A DSML for reversible transformations Micka el Kerboeuf, - - PowerPoint PPT Presentation

a dsml for reversible transformations
SMART_READER_LITE
LIVE PREVIEW

A DSML for reversible transformations Micka el Kerboeuf, - - PowerPoint PPT Presentation

11th Workshop on Domain-Specific Modeling A DSML for reversible transformations Micka el Kerboeuf, Jean-Philippe Babau LISyC University of Western Brittany, France { kerboeuf,babau } @univ-brest.fr Motivation Modif Reuse of rewriting


slide-1
SLIDE 1

11th Workshop on Domain-Specific Modeling

A DSML for reversible transformations

Micka¨ el Kerboeuf, Jean-Philippe Babau

LISyC – University of Western Brittany, France {kerboeuf,babau}@univ-brest.fr

slide-2
SLIDE 2

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Motivation

Tools for DSML environments Reuse of legacy tools (transformations)

in legacy tool

  • ut

input metamodel

  • utput

metamodel

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

2/17

slide-3
SLIDE 3

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Motivation

Tools for DSML environments Reuse of legacy tools (transformations)

data in legacy tool

  • ut

specific tool specific context input metamodel

  • utput

metamodel

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

2/17

slide-4
SLIDE 4

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Motivation

Tools for DSML environments Reuse of legacy tools (transformations)

data injection in legacy tool

  • ut

specific tool (by transitivity) specific context input metamodel

  • utput

metamodel

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

2/17

slide-5
SLIDE 5

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Motivation

Tools for DSML environments Reuse of legacy tools (transformations)

data injection in legacy tool

  • ut

specific tool (by transitivity) specific context input metamodel

  • utput

metamodel

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

2/17

slide-6
SLIDE 6

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Motivation

Tools for DSML environments Reuse of legacy tools (transformations)

data injection in legacy tool

  • ut

specific tool (by transitivity) specific context input metamodel

  • utput

metamodel modif

Modif: a DSL for transformations between structurally and semantically close subsets of metamodels

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

2/17

slide-7
SLIDE 7

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Motivation

Rewriting tools (endogenous transformations) The tool’s outcome has to be put back into the original context

specific tool legacy tool

injection

  • ut

specific context input / output metamodel modif in

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

3/17

slide-8
SLIDE 8

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Outline

1

Motivation

2

Modif Transformations targeted by Modif Example: a simulator for Finite State Machines (FSM)

3

Reuse of rewriting tools Addressed problem Similar problems in other domains Storage and recovery of deleted data Join algorithm Limitations Example: a flattener for Finite State Machines (FSM)

4

Current and future works

5

Conclusion

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

4/17

slide-9
SLIDE 9

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Transformations targeted by Modif

Metamodel refactoring delete, rename, change, hide and flatten inheritance Process and tool support

1 generation of a by

default specification

2 Modif update 3 generation of the

target metamodel

4 verification of

matching

5 generation of

injection

data injection in input specific context legacy tool

  • ut
  • utput

specific tool (by transitivity) modif spec. Modif tool's input full matching

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

5/17

slide-10
SLIDE 10

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Transformations targeted by Modif

Metamodel refactoring delete, rename, change, hide and flatten inheritance Process and tool support

1 generation of a by

default specification

2 Modif update 3 generation of the

target metamodel

4 verification of

matching

5 generation of

injection

data injection in input specific context legacy tool

  • ut
  • utput

specific tool (by transitivity) modif spec. Modif tool's input full matching

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

5/17

slide-11
SLIDE 11

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Transformations targeted by Modif

Metamodel refactoring delete, rename, change, hide and flatten inheritance Process and tool support

1 generation of a by

default specification

2 Modif update 3 generation of the

target metamodel

4 verification of

matching

5 generation of

injection

data injection in input specific context legacy tool

  • ut
  • utput

specific tool (by transitivity) modif spec. Modif tool's input full matching

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

5/17

slide-12
SLIDE 12

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Transformations targeted by Modif

Metamodel refactoring delete, rename, change, hide and flatten inheritance Process and tool support

1 generation of a by

default specification

2 Modif update 3 generation of the

target metamodel

4 verification of

matching

5 generation of

injection

data injection in input specific context legacy tool

  • ut
  • utput

specific tool (by transitivity) modif spec. Modif tool's input full matching

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

5/17

slide-13
SLIDE 13

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Transformations targeted by Modif

Metamodel refactoring delete, rename, change, hide and flatten inheritance Process and tool support

1 generation of a by

default specification

2 Modif update 3 generation of the

target metamodel

4 verification of

matching

5 generation of

injection

data injection in input specific context legacy tool

  • ut
  • utput

specific tool (by transitivity) modif spec. Modif tool's input full matching

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

5/17

slide-14
SLIDE 14

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Transformations targeted by Modif

Metamodel refactoring delete, rename, change, hide and flatten inheritance Process and tool support

1 generation of a by

default specification

2 Modif update 3 generation of the

target metamodel

4 verification of

matching

5 generation of

injection

data injection in input specific context legacy tool

  • ut
  • utput

specific tool (by transitivity) modif spec. Modif tool's input full matching

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

5/17

slide-15
SLIDE 15

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Example: a simulator for Finite State Machines (FSM)

State name : EString ini : EBoolean Event name Transition context 0..1 input 0..*

  • utput

0..* t 0..1 target 1 source 1 trigger 1 inside 0..*

begin idle running nominal degraded

go go go nok

  • k

Legacy tool

1 takes a FSM complying

with the simple FSM metamodel

2 takes a set of incoming

events

3 produces a sequence of

reached states as an execution trace

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

6/17

slide-16
SLIDE 16

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Example: a simulator for Finite State Machines (FSM)

UML statecharts much larger metamodel! come with tool support (e.g. editors) Reuse of FSM simulator with UML thanks to Modif

1 default Modif specification for UML: deletes everything 2 update: meaningful concepts for FSM are kept and renamed 3 target metamodel generation 4 target metamodel fully matches the simple FSM metamodel 5 generation of injection

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

7/17

slide-17
SLIDE 17

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Example: a simulator for Finite State Machines (FSM)

UML statecharts much larger metamodel! come with tool support (e.g. editors) Reuse of FSM simulator with UML thanks to Modif

1 default Modif specification for UML: deletes everything 2 update: meaningful concepts for FSM are kept and renamed 3 target metamodel generation 4 target metamodel fully matches the simple FSM metamodel 5 generation of injection

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

7/17

slide-18
SLIDE 18

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Example: a simulator for Finite State Machines (FSM)

UML statecharts much larger metamodel! come with tool support (e.g. editors) Reuse of FSM simulator with UML thanks to Modif

1 default Modif specification for UML: deletes everything 2 update: meaningful concepts for FSM are kept and renamed 3 target metamodel generation 4 target metamodel fully matches the simple FSM metamodel 5 generation of injection

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

7/17

slide-19
SLIDE 19

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Example: a simulator for Finite State Machines (FSM)

UML statecharts much larger metamodel! come with tool support (e.g. editors) Reuse of FSM simulator with UML thanks to Modif

1 default Modif specification for UML: deletes everything 2 update: meaningful concepts for FSM are kept and renamed 3 target metamodel generation 4 target metamodel fully matches the simple FSM metamodel 5 generation of injection

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

7/17

slide-20
SLIDE 20

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Example: a simulator for Finite State Machines (FSM)

UML statecharts much larger metamodel! come with tool support (e.g. editors) Reuse of FSM simulator with UML thanks to Modif

1 default Modif specification for UML: deletes everything 2 update: meaningful concepts for FSM are kept and renamed 3 target metamodel generation 4 target metamodel fully matches the simple FSM metamodel 5 generation of injection

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

7/17

slide-21
SLIDE 21

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Example: a simulator for Finite State Machines (FSM)

UML statecharts much larger metamodel! come with tool support (e.g. editors) Reuse of FSM simulator with UML thanks to Modif

1 default Modif specification for UML: deletes everything 2 update: meaningful concepts for FSM are kept and renamed 3 target metamodel generation 4 target metamodel fully matches the simple FSM metamodel 5 generation of injection

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

7/17

slide-22
SLIDE 22

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Reusability of tool’s outcome

Contextualization A Modif specification can be inverted to produce a transformation from the tool’s definition domain back into the specific context.

data injection in abstract data legacy tool

  • ut

by transitivity modif spec. Modif tool's input full matching data'

contextualization

concrete data modif spec. Modif initial context full matching

Without deletion, the composition of injection and contextualization produces identity Deleted data are lost

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

8/17

slide-23
SLIDE 23

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Similar problems in other domains

The view-update problem in the context

  • f databases

Under which conditions updates on views can be translated into updates on the underlying database? initial context: the underlying database tool’s definition domain: view rewriting tool: set of updates applied to the view

data in VIEW updates

  • ut

translated updates data' DATA BASE

Modif is not restricted to functions to build views

  • nly the effects of the legacy tool can be analysed
  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

9/17

slide-24
SLIDE 24

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Similar problems in other domains

Bidirectional transformations (lenses) Propagation of updates between connected structures (e.g. relevant for model versioning)

data1 data1' MM v2 data2' data2 MM v1 DIFF

injection and contextualization actually aim at implementing an asymmetrical lense... but Modif is not intended to maintain the consistency of two metamodels

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

10/17

slide-25
SLIDE 25

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Storage and recovery of deleted data

Data recovery data are backed up... and referenced by keys

data in abstract data legacy tool

  • ut

by transitivity modif spec. Modif tool's input data' concrete data modif spec. Modif initial context data + keys annotated concrete data injection

contextualization

full matching full matching

two target metamodels are generated the generated injection produces two sets of instances a specialized version of contextualization performs a joint

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

11/17

slide-26
SLIDE 26

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Join algorithm

data in legacy tool

  • ut

data' data + keys injection

contextualization 1 For each instance of out with key

k, the corresponding instance of data+key with key k is used to recover deleted attributes

2 Each instance of data+key whose

class had been deleted is recovered

3 Each reference of each instance of

  • ut which itself or its source or its

target had been deleted is recovered

4 Keys are removed and then the

inverted Modif is applied

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

12/17

slide-27
SLIDE 27

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Join algorithm

data in legacy tool

  • ut

data' data + keys injection

contextualization 1 For each instance of out with key

k, the corresponding instance of data+key with key k is used to recover deleted attributes

2 Each instance of data+key whose

class had been deleted is recovered

3 Each reference of each instance of

  • ut which itself or its source or its

target had been deleted is recovered

4 Keys are removed and then the

inverted Modif is applied

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

12/17

slide-28
SLIDE 28

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Join algorithm

data in legacy tool

  • ut

data' data + keys injection

contextualization 1 For each instance of out with key

k, the corresponding instance of data+key with key k is used to recover deleted attributes

2 Each instance of data+key whose

class had been deleted is recovered

3 Each reference of each instance of

  • ut which itself or its source or its

target had been deleted is recovered

4 Keys are removed and then the

inverted Modif is applied

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

12/17

slide-29
SLIDE 29

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Join algorithm

data in legacy tool

  • ut

data' data + keys injection

contextualization 1 For each instance of out with key

k, the corresponding instance of data+key with key k is used to recover deleted attributes

2 Each instance of data+key whose

class had been deleted is recovered

3 Each reference of each instance of

  • ut which itself or its source or its

target had been deleted is recovered

4 Keys are removed and then the

inverted Modif is applied

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

12/17

slide-30
SLIDE 30

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Join algorithm

data in legacy tool

  • ut

data' data + keys injection

contextualization 1 For each instance of out with key

k, the corresponding instance of data+key with key k is used to recover deleted attributes

2 Each instance of data+key whose

class had been deleted is recovered

3 Each reference of each instance of

  • ut which itself or its source or its

target had been deleted is recovered

4 Keys are removed and then the

inverted Modif is applied

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

12/17

slide-31
SLIDE 31

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Limitations

The legacy tool is a black box For now, only the effects of rewriting tools can be observed no traceability between new instances and the existing instances that have been used to compute them the way the legacy tool is designed impacts its reusability:

it is higher for rewriting tools that give priority to update instead of recreation

the generated tools are helpers

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

13/17

slide-32
SLIDE 32

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Example: a flattener for Finite State Machines (FSM)

Legacy rewriting tool: a flattener for simple FSM

State name : EString ini : EBoolean Event name Transition context 0..1 input 0..*

  • utput

0..* t 0..1 target 1 source 1 trigger 1 inside 0..*

Specific context: UML statecharts including things that should be deleted (e.g. actions)...

State name : EString ini : EBoolean Action name : EString Event name Transition context 0..1 entry 0..1 exit 0..1 input 0..*

  • utput

0..* sin 0..1 sout 0..1 t 0..1 t 0..1 target 1 source 1 trigger 1 action 0..1 inside 0..*

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

14/17

slide-33
SLIDE 33

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Example: a flattener for Finite State Machines (FSM)

Recovered and lost data

begin idle running

entry / start exit / stop

nominal

entry / run1

degraded

go / init go / raz go nok / runD

  • k
  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

15/17

slide-34
SLIDE 34

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Example: a flattener for Finite State Machines (FSM)

Recovered and lost data

begin idle running nominal degraded

go go go nok

  • k

begin idle running

entry / start exit / stop

nominal

entry / run1

degraded

go / init go / raz go nok / runD

  • k

injection

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

15/17

slide-35
SLIDE 35

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Example: a flattener for Finite State Machines (FSM)

Recovered and lost data

begin idle running nominal degraded

go go go nok

  • k

begin idle running

entry / start exit / stop

nominal

entry / run1

degraded

go / init go / raz go nok / runD

  • k

begin idle running nominal running degraded

go nok

  • k

go go go

injection flattener

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

15/17

slide-36
SLIDE 36

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Example: a flattener for Finite State Machines (FSM)

Recovered and lost data

begin idle running nominal degraded

go go go nok

  • k

begin idle running

entry / start exit / stop

nominal

entry / run1

degraded

go / init go / raz go nok / runD

  • k

begin idle running nominal running degraded

go nok

  • k

go go go go / raz go / raz

begin idle running nominal running degraded

go nok / runD

  • k

go / init entry / run1

injection flattener flattener contextualization

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

15/17

slide-37
SLIDE 37

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Current and future works

Graph semantics Denotational semantics of Modif to formally:

prove the soundness of the join algorithm identify a minimal set of core refactoring operations

Ability to add data customizable rules to create default new instances Levenshtein distance between two metamodels to generate a modif specification between two given metamodels the smallest distance between two semantically close metamodels is expected to be relevant

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

16/17

slide-38
SLIDE 38

Motivation Modif Reuse of rewriting tools Current and future works Conclusion

Conclusion

Modif a tranformation language dedicated to semantically close metamodels aims at promoting the reusability of legacy transformations A relational mechanism upon Modif to enable the reuse of endogenous transformations... especially when they update instances J.-P. Babau and M. Kerboeuf. Domain Specific Language Modeling Facilities. In proceedings of the 5th MoDELS workshop on Models and Evolution, 2011.

  • M. Kerboeuf & J.-P. Babau – A DSML for reversible transformations

17/17