On the traceability in a graph roundtrip On the traceability in a - - PowerPoint PPT Presentation

on the traceability in a graph roundtrip on the
SMART_READER_LITE
LIVE PREVIEW

On the traceability in a graph roundtrip On the traceability in a - - PowerPoint PPT Presentation

On the traceability in a graph roundtrip On the traceability in a graph roundtrip transformation system GRoundTram transformation system GRoundTram Soichiro Hidaka National Institute of Informatics Workshop on Bidirectional


slide-1
SLIDE 1

On the traceability in a graph roundtrip transformation system GRoundTram† On the traceability in a graph roundtrip transformation system GRoundTram†

Soichiro Hidaka National Institute of Informatics Workshop on Bidirectional Transformation (BT2010)

  • Mar. 15th, 2010

†Joint work with Zhenjiang Hu, Kazuhiro Inaba, Hiroyuki Kato (National Institute of Informatics) Kazutaka Matsuda (University of Tokyo) Keisuke Nakano (University of Electro-Communications) Isao Sasano (Shibaura Institute of Technology)

slide-2
SLIDE 2
  • S. Hidaka Traceability in GRoundTram

2

Since BT-ABC-3 (Nov. 2009)

  • In the BT-ABC-3

– support bidir. interpretation of much-more user-friendly surface syntax – lots of examples added – supports (limited form of) insertion – graph editor is provided – released complete source code in OCaml – 17000 lines of codes including comments

  • At the time of BT-ABC-4

– More clear formulation of trace information – Deletion support (not implemented yet) – Enhanced handling of insertions – Graph contraction support

slide-3
SLIDE 3
  • S. Hidaka Traceability in GRoundTram

3

GRoundTram

  • Graph Roundtrip Transformation for Models

– to support systematic development of bidirectional model transformation

  • ground tram

– bidirectional ground transportation system (tram usually runs in both directions)

  • "Ground" ... we would like to provide "basis"

– user-level model representation is internally represented by more general graph – base graph manipulation system (graph algebra) to be

  • powerful enough to express typical model transformation
  • rigid enough to reason about properties such as well-

behavedness

slide-4
SLIDE 4
  • S. Hidaka Traceability in GRoundTram

4

Model Driven Software Development

M1 M2

model for analysis model for design implementation

refine refine

……. ….. ….

transform

transform

transform

transform

  • We want to reflect modification at the downstream

to the upstream

slide-5
SLIDE 5
  • S. Hidaka Traceability in GRoundTram

5

Bidirectional Model Transformation Example: Class2RDB

Association

name = "address" Class name = "Person" is_persistent = true src_of src Class name = "Address" is_persistent = false dest

Association

name = "phone" src_of src Class name = "Phone" is_persistent = true dest Attribute name = "name" is_primary = true attrs Attribute name = "addr" is_primary = true attrs Attribute name = "number" is_primary = true attrs PrimitiveDataType name = "String" type type PrimitiveDataType name = "Integer" type

Table name = "Person" Column name = "name" type = "String" pkey cols Column name = "addr" type = "String" cols Column name = "number" type = "Integer" cols Fkey fkeys Table name = "Phone" Column name = "number" type = "Integer" pkey cols refs cols

slide-6
SLIDE 6
  • S. Hidaka Traceability in GRoundTram

6

Our Target Bidirectional Transformation

backward Trans. modify

t’

forward Trans.

t s’ s

slide-7
SLIDE 7
  • S. Hidaka Traceability in GRoundTram

7

Why UnQL/UnCAL?

  • Functional (Compositional)
  • Has clear formal semantics
  • Has nice user-level syntax
slide-8
SLIDE 8
  • S. Hidaka Traceability in GRoundTram

8

Basic idea of compositional approach in BT

complecation: variable reference

t s t’ t t1 s T1 T2

Id

s T1 T2 s1

  • s2

T t1

  • t2

t2

slide-9
SLIDE 9
  • S. Hidaka Traceability in GRoundTram

9

Encoding in Graphs

  • Edge label: primitive data and tag
  • Set of outgoing edges: collections
  • edges directed to other node: references to other

components

1 1003 3 2 "16/12/2008" 5 4 1002 7 6 "16/10/2008" 9 8 1001 11 10 "16/07/2008" 13 12 "IPL of Tokyo" 15 14 "100-888" 17 16 contractual 19 18 "BiG office of Tokyo" 21 20 "200-777" 23 22 shipping 24 no date 39

  • rder_of order

25 add 27 email 29 name 32 add info code type 26 "kato@biglab" 28 "Kato" 30 no date 40

  • rder_of
  • rder

31

  • rder

add 34 email 36 email 38 name no date

  • rder_of

info code type 33 "tanaka@gmail" 35 "tanaka@biglab" 37 "Tanaka" 41 customer customer

Issue: coping with bisimulation

slide-10
SLIDE 10
  • S. Hidaka Traceability in GRoundTram

10

A compositional Framework for Bidirectional Model Transformation

Model Transformation in UnQL+[1] (Compositional and Functional) Model Transformation in UnQL+[1] (Compositional and Functional)

UnCAL graph algebra

(Graph Construction and Structural Recursion)

UnCAL graph algebra

(Graph Construction and Structural Recursion) desugaring (incl. editing primitives) to core language desugaring (incl. editing primitives) to core language

Bidirectional Interpreter

  • Bidirectionalization
  • Fusion Optimization

Bidirectional Interpreter

  • Bidirectionalization
  • Fusion Optimization

source model source model target model target model

Validation Validation [1] SAC2009 [Overview] ICSE2009 NIER Tr. MQL Two methods for typechecking

slide-11
SLIDE 11
  • S. Hidaka Traceability in GRoundTram

11

Project site

  • www.biglab.org

Top Demo

slide-12
SLIDE 12
  • S. Hidaka Traceability in GRoundTram

12

Agenda

  • Traceability

– Enriched forward transformation – Tracing source node from target node – Tracing source edges from target edges

  • Tracing in deletion handling
  • Tracing in insertion handling
  • Internal representation and view

edited by end-users

  • Conclusion and future work
slide-13
SLIDE 13
  • S. Hidaka Traceability in GRoundTram

13

UnCAL graph model

1 3 5 b a a a 2 4 c 6 c d &

  • Cyclic
  • Edge-labeled

– All informations are stored in edge labels – Node ids have no particular meanings

  • Directed
  • Unordered (branches)
  • Multi-rooted (has entry points as

input nodes)

– Indicated by input markers

  • Has (optional) output nodes

– Indicated by output markers

  • Unranked

– node has arbitrary number of edges

  • Has ε edges

7 8 d

Property: Every UnCAL graph can be normalized up to isomorphism.

slide-14
SLIDE 14
  • S. Hidaka Traceability in GRoundTram

14

Source graph example: Customer- centric order information

1 1003 3 2 "16/12/2008" 5 4 1002 7 6 "16/10/2008" 9 8 1001 11 10 "16/07/2008" 13 12 "IPL of Tokyo" 15 14 "100-888" 17 16 contractual 19 18 "BiG office of Tokyo" 21 20 "200-777" 23 22 shipping 24 no date 39

  • rder_of order

25 add 27 email 29 name 32 add info code type 26 "kato@biglab" 28 "Kato" 30 no date 40

  • rder_of
  • rder

31

  • rder

add 34 email 36 email 38 name no date

  • rder_of

info code type 33 "tanaka@gmail" 35 "tanaka@biglab" 37 "Tanaka" 41 customer customer

  • Customer2Order (Pastor et al. 2007)
slide-15
SLIDE 15
  • S. Hidaka Traceability in GRoundTram

15

1 1003 3 2 "16/12/2008" 5 4 1002 7 6 "16/10/2008" 9 8 1001 11 10 "16/07/2008" 13 12 "IPL of Tokyo" 15 14 "100-888" 17 16 contractual 19 18 "BiG office of Tokyo" 21 20 "200-777" 23 22 shipping 24 no date 39

  • rder_of order

25 add 27 email 29 name 32 add info code type 26 "kato@biglab" 28 "Kato" 30 no date 40

  • rder_of
  • rder

31

  • rder

add 34 email 36 email 38 name no date

  • rder_of

info code type 33 "tanaka@gmail" 35 "tanaka@biglab" 37 "Tanaka" 41 customer customer

Transformation in UnQL

select {order: {date: $date, no: $no, customer_name: $name, addr: $a}} where {customer.order: $o} in $db, {order_of:$c, date:$date, no:$no} in $o, {add:$a, name:$name} in $c, {code:$code, info:$info, type:shipping} in $a

slide-16
SLIDE 16
  • S. Hidaka Traceability in GRoundTram

16

select {order: {date: $date, no: $no, customer_name: $name, addr: $a}} where {customer.order: $o} in $db, {order_of:$c, date:$date, no:$no} in $o, {add:$a, name:$name} in $c, {code:$code, info:$info, type:shipping} in $a

Target graph example:Order- centric graph

1 1003 3 2 "16/12/2008" 5 4 1002 7 6 "16/10/2008" 9 8 1001 11 10 "16/07/2008" 13 12 "BiG office of Tokyo" 15 14 "200-777" 17 16 shipping 19 18 "Kato" 20 info code type 22 21 "Tanaka" 23 24

  • rder

25

  • rder

26

  • rder

no dat e customer_name addr no dat e addr customer_name no dat e addr customer_name

slide-17
SLIDE 17
  • S. Hidaka Traceability in GRoundTram

17

From UnQL to UnCAL via structural recursion

  • Extract every subgraph under edges labeled b

select $G where {_*.b:$G} in $db sfun f({b:$G}) = $G | f({$l:$G}) = f($G) in f($db) rec(λ({$l,$G}). if $l = b then $G else {ε:&})($db) UnQL UnQL Structural Structural Recursion Recursion UnCAL UnCAL

Property: Every UnQL query can be translated into UnCAL query

slide-18
SLIDE 18
  • S. Hidaka Traceability in GRoundTram

18

UnCAL Syntax (Subset)

T ::= {} (* one-node graph *) | {L : T} (* graph with a single edge from root *) | T ∪ T (* union of two graphs *) | &x := T (* label the root node with input marker x *) | &y (* one-node graph with output marker y *) | () (* empty graph *) | T ⊕ T (* disjoint union *) | T @ T (* append of two graphs *) | cycle(T) (* graph with cycles *) | $G (* variable reference *) | if L = L then T else T (* conditional *) | rec(λ(l,G).T)(T) (* application of structural recursion *) L ::= a (* edge label *) | $l (* label variabe reference *)

Buneman et al., VLDBJ2000

slide-19
SLIDE 19
  • S. Hidaka Traceability in GRoundTram

19

Bulk Semantics of UnCAL Structural recursion (example)

&z1 &z1

L L

ε

&z1 &z1 &z1

d

&z1

a c

ε

&z1 &z1 &z1

d

&z1 &z1

d

&z1

ε

&z1 &z1 &z1

d

&z1

sfun a2d_xc({$l:$g}) = if $l = a then {d : (a2d_xc($g))} else if $l = c then a2d_xc($g) else {$l : (a2d_xc($g))} in a2d_xc($db) 1 3 5 b a a a 2 4 c 6 c d & $db &z1@rec(λ({$l,$g}). if $l = a then &z1:= {d : &z1} else if $l = c then &z1:= {ε :&z1} else &z1:= {$l :&z1})($db) Transformation to core algebra(desugaring)

slide-20
SLIDE 20
  • S. Hidaka Traceability in GRoundTram

20

&z1 &z1

d

&z1 &z1

b b L

&z1 &z1

d d

ε

&z1 &z1

Bulk Semantics of UnCAL Structural recursion (example)

&z1

d

&z1 &z1 &z1

L a c

ε

&z1 &z1

1 3 5 b a a a 2 4 c 6 c d &

a d b a c a c

&z1

d

&z1 &z1

d

&z1

ε

&z1 &z1 &z1

d

&z1 &z1 &z1

b

1 3 5 b d d d 2 6 d &

slide-21
SLIDE 21
  • S. Hidaka Traceability in GRoundTram

21

Union(∪)

The Role of ε-edges

  • Remember

(store) the separation points

t1 t2

How do we decide?

t t’ t’1 t’2

Instead

t1 t2 ε ε ∪ ∪

slide-22
SLIDE 22
  • S. Hidaka Traceability in GRoundTram

22

The Role of ε-edges (cont.)

  • Given modified tree t’

– Even in the presence

  • f overlap
  • Compute

reachable(g,v) to grab reachable parts of the graph g from node v

  • And apply backward

transformation recursively

t’ t’1 t’2

modify

t1 t2 ε ε t’1' t’2 ε ε ε ε ε ε ∪

slide-23
SLIDE 23
  • S. Hidaka Traceability in GRoundTram

23

Union(∪) Multiple Input Nodes

  • Take reachable

parts from the

  • riginal input

nodes

  • Had we removed

ε edges, decomposition would not have been possible

modify

g1 g2 g g’ g’2 g’1 ε ε ε ε ε ε ε ε

&x1 &x2 &x1 &x2 &x1&x2 &x1 &x2 &x1 &x2 &x1&x2

∪ ∪

slide-24
SLIDE 24
  • S. Hidaka Traceability in GRoundTram

24

Enriched node ID

TraceID ::= DatabaseID | C Pos Marker | RN Pos TraceID Marker | RE Pos TraceID Edge tr(v) = v (v ∈ DatabaseID) tr(RN _ v _) = tr(v) tr(RE _ v _) = tr(v) corr ((v,l,u)) = (v,l,u) (v,u∈ DatabaseID) corr ((RE p _ e’,l,RE p _ e’)) = corr(e’)

slide-25
SLIDE 25
  • S. Hidaka Traceability in GRoundTram

25

Bulk semantics and bidirectionalization

  • f structural recursion

rec(λ({$l,$G}). if $l = b then $G else {ε:&})($db)

UnCAL UnCAL 1 3 5 b a a a 2 4 6 c d & Source Source

graphs produced by the body of rec for each input edge

  • utput nodes

input nodes

T r a n s f

  • r

m

c

Target Target Also a unit of insertions

3 5 a 6 d & &

a d RE 6 5 (1,b,3) RE 6 6 (1,b,3) RE 6 (C 1) (5,d,6) RE 6 (C 2) (5,d,6) ε RN 6 4 RN 6 3 RN 6 6 RN 6 2 RN 6 1 RN 6 5 RE 6 (C 1) (1,a,2) RE 6 (C 2) (1,a,2) ε RE 6 (C 1) (2,a,5) RE 6 (C 2) (2,a,5) ε RE 6 3 (1,b,3) RE 6 (C 1) (1,c,4) RE 6 (C 2) (1,c,4) ε RE 6 (C 1) (4,c,4) RE 6 (C 2) (4,c,4) ε RE 6 (C 1) (3,a,5) RE 6 (C 2) (3,a,5) ε

Internal Internal representation representation retaining trace retaining trace information information

slide-26
SLIDE 26
  • S. Hidaka Traceability in GRoundTram

26

Epsilon edge removal: problematic case

  • When removing ε

edges, the source and the target of the edge can’t always be glued together.

a 1 3 5 ε ε c 4 2 6 b a 1 3 5 c 2 b

  • Node 1 should not

reach node 5!

&z1 &z2 &z1 &z2

slide-27
SLIDE 27
  • S. Hidaka Traceability in GRoundTram

27

General condition in which the gluing fails

  • If the target of the ε edge has another

incoming edge, and the source of the ε edge has another outgoing edge, then the gluing fails.

a 1 3 5 ε ε c 4 2 6 b ε ε &z1 &z2

slide-28
SLIDE 28
  • S. Hidaka Traceability in GRoundTram

28

Epsilon edge removal: correct method in UnQL paper

  • Roughly, outgoing

edges of the target

  • f the ε edges are

copied.

a 1 3 5 ε ε c 4 2 6 b

  • If the target has no
  • utgoing edges,

then nothing should be done.

a 1 3 5 c 4 2 6 b b

  • Node 4 and edge b is no

longer reachable and can be removed as well. &z1 &z2 &z1 &z2

slide-29
SLIDE 29
  • S. Hidaka Traceability in GRoundTram

29

ε edge removal and transitive closure

  • Example

a 1 3 5 ε ε c 4 2 6 b &z1 &z2 a 1 3 5 c 4 2 6 b b &z1 &z2

  • General form

ε closure v ε closure v

slide-30
SLIDE 30
  • S. Hidaka Traceability in GRoundTram

30

Can these problematic cases be generated from UnQL(+)?

  • Yes, but only from

limited regular path pattern, and I think it is rare.

  • For ordinary

combination of constructors (cycle, append and union), no problem.

select $G where {((b.(a|a.x))|(c.(a|a.y)):$G} in $db s1 s2 s4 a a a a (&x1 := … U $G, &x2 := … U $G, ….)

slide-31
SLIDE 31
  • S. Hidaka Traceability in GRoundTram

31

Simple and concrete example of problematic case

let $G = {c} in (&x1 := {a} U $G, &x2 := {b} U $G) Correct solution Naïve gluing of ε (* UnCAL Source *) Before ε removal

input node &x2 should not reach edge “a”!

slide-32
SLIDE 32
  • S. Hidaka Traceability in GRoundTram

32

Current implementation

  • Formal solution generally introduces

unreachable parts

– It will hinder current clear separation of ε removal and unreachable part removal

  • Process split in two phases

– 1st stage tries gluing for only safe cases – 2nd stage does the rest

  • If ambiguity found during the process

– Entire epsilon removal is given up

slide-33
SLIDE 33
  • S. Hidaka Traceability in GRoundTram

33

Conclusion

  • Enhancement of forward semantics for

traceability

  • Deletion handling using edge tracing
  • Insertion handling using node tracing
  • Correspondence between internal

representation and view presented by end users

  • Future work

– More user-friendly editing support – More clear understanding of relationship between (constant) complement approach