Transcript Dia 1

Evolution of Modelling Languages
Bart Meyers
Hans Vangheluwe
1
Outline
• language evolution
• de/re-constructing language evolution
• caveat
• conclusion
2
Evolution of languages
Current situation
(industry):
pragmatic approach
metamodelling
language
Current situation
Why?
(academic):
• Development
cycle
model co-evolution
• Evolution
of domain
DSL
ΔL
DSL’
DSm
Δm
DSm’
executable
system
Δe?
executable
system
=
3
But there’s more to it
4
Train DSL meta-model
Concrete
syntax
Petri Net
meta-model
<track
id=“t%%n”
train=“train%%t”
next=“%%next”/>
<train
id=“train%%t”/>
Concrete
mapping
<track
<railroad>
id=“t%%n”
next=“%%next”/>
<track id=“t0”
train=“train0”
next=“sw1”/>
Train2PT
<train id=“train0”/>
<switch id=“sw1”
nextL=“t5”
nextR=“t2”/>
conforms
to
Train2XML
<track id=“t2”
next=“t3”/>
<track id=“t3” next=“t4”/>
<track id=“t4” next=“s6”/>
<track <station
id=“t5” next=“s6”/>
<stationid=“s%%n”
id=“s6” next=“t0”/>
next=“%%next”/>
</railroad>
conforms to
<track
id=“t%%n”
train=“train%%t”
next=“%%next”/>
<train
id=“train%%t”/>
<track
id=“t%%n”
next=“%%next”/>
XML
representation
<station
id=“s%%n”
next=“%%next”/>
Abstract
<switch
id=“sw%%n”
syntax
nextL=“%%left”
<switch
id=“sw%%n”
nextL=“%%left”
nextR=“%%right”/>
nextR=“%%right”/>
Marked
Petri Net
5
Train DSL
meta-model
Petri Net
meta-model
Train2PT
conforms to
Abstract syntax
conforms to
Marked Petri Net
6
De-constructing evolution
7
De-construction evolution
• image evolution
8
Image evolution: PN to CCPN
add maximum capacity to PNPlace
9
Delta model
- maxCapacity :: Integer
NewAttribute(
PNPlace,
“maxCapacity”,
Integer, 1, 1, 1);
M. Herrmannsdoerfer, S. Benz, and E.
Juergens. Cope - automating coupled
evolution of metamodels and models. In
Proceedings of the 23rd European Conference on Object-Oriented Programming
(ECOOP), pages 52–76, 2009.
10
Migration transformation EI
1
1
1
1
1
1
1
1
11
Train DSL
meta-model
CCPN
meta-model
Train2PT
conforms to
conforms to
1
1
1
1
1
1
1
Marked CCPN
Abstract syntax
12
Image evolution
• co-evolving T
T’ = E ○ T
13
Train DSL
meta-model
CCPN
meta-model
Train2PT
conforms to
conforms to
EI
1
1
1
1
1
1
1
1
Marked CCPN
Abstract syntax
14
De-construction evolution
• domain evolution
15
Train DSL
meta-model
Petri Net
meta-model
Train2PT
conforms to
Abstract syntax
conforms to
Marked Petri Net
16
Domain evolution: Tv1 to Tv2
add length to Rail
Rails are not linked to rails
17
Delta model
- length :: Integer
NewAttribute(
Rails,
“length”,
Integer, 1, 1, 1);
Rails are not linked to rails
18
Migration transformation ED
19
Train DSL v2
meta-model
Petri Net
meta-model
Train2PT
conforms to
conforms to
Abstract syntax
Marked Petri Net
20
Domain evolution
• co-evolving T
T’ = T ○ E-1
21
Train DSL v2
meta-model
Petri Net
meta-model
Train2PT
conforms to
conforms to
ED-1
Abstract syntax
Marked Petri Net
22
De-construction evolution
• transformation evolution
23
Re-constructing evolution
24
Train DSL v2
meta-model
CCPN
meta-model
Train2PT
conforms to
conforms to
ED-1
EI
Optimize?
1
1
1
Abstract syntax
1
1
1
1
1
Marked CCPN
25
Train DSL v2 meta-model
CCPN
meta-model
Concrete
syntax
Concrete
mapping
ED-1
conforms to
Train2PT
Train2XML
XML
representation
<railroad>
<track id=“t0” train=“train0” next=“sw1”/>
<train id=“train0”/>
<switch id=“sw1” nextL=“t5” nextR=“t2”/>
<track id=“t2” next=“t3”/>
<track id=“t3” next=“t4”/>
<track id=“t4” next=“s6”/>
<track id=“t5” next=“s6”/>
<station id=“s6” next=“t0”/>
</railroad>
<track
id=“t%%n”
train=“train%%t”
next=“%%next”/>
<train
id=“train%%t”/>
<track
id=“t%%n”
next=“%%next”/>
ED-1
ED-1
Abstract
syntax
conforms to
EI
1
1
1
1
1
1
1
1
Marked CCPN
<station
id=“s%%n”
next=“%%next”/>
<switch
id=“sw%%n”
nextL=“%%left”
nextR=“%%right”/>
26
Train DSL v2 meta-model
CCPN
meta-model
Concrete
syntax
Concrete
mapping
conforms to
Train2PT
Train2XML
XML
representation
<railroad>
<track id=“t0” train=“train0” next=“sw1”/>
<train id=“train0”/>
<switch id=“sw1” nextL=“t5” nextR=“t2”/>
<track id=“t2” next=“t3”/>
<track id=“t3” next=“t4”/>
<track id=“t4” next=“s6”/>
<track id=“t5” next=“s6”/>
<station id=“s6” next=“t0”/>
</railroad>
<track
id=“t%%n”
train=“train%%t”
next=“%%next”/>
<train
id=“train%%t”/>
<track
id=“t%%n”
next=“%%next”/>
ED-1
ED-1
Abstract
syntax
conforms to
EI
1
1
1
1
1
1
1
1
Marked CCPN
<station
id=“s%%n”
next=“%%next”/>
<switch
id=“sw%%n”
nextL=“%%left”
nextR=“%%right”/>
27
But... it’s not just a walk in the park
28
Domain evolution: add capacity
N
- capacity :: Integer
NewAttribute(
Rails,
“length”,
Integer, 1, 1, 1);
GeneralizeAttribute(
Train,
TrainPosition,
0, N);
ED2
capacity ≥ number of trains on location
29
Train DSL v3
meta-model
CCPN
meta-model
TrainV2 to CCPN
Train2PT
conforms to
ED2
1
ED-1
conforms to
EI
1
1
1
1
1
1
1
1
Marked CCPN
Abstract syntax
30
Train DSL v3
meta-model
CCPN
meta-model
TrainV2 to CCPN
Train2PT
conforms to
ED2
1
ED-1
conforms to
EI
1
1
1
1
1
1
1
1
Marked CCPN
Abstract syntax
31
Domain mapping problem
32
Conclusions
• evolution always happens
• today: lack of support for language evolution
• divide and conquer
• automation is the goal, but full automation impossible
33
Questions and Discussion
34
Pre-requisites for language evolution
1 higher order transformation
• automation
• example: (partially) generate migration transformation
35
Pre-requisites for language evolution
1 higher order transformation
• automation
• example: (partially) generate migration transformation
Δ MMI
HOT
E
36
Pre-requisites for language evolution
2 model differencing
• detect differences between two versions of (meta)models
• on ASG’s
• unique identifiers
• heuristics
• representation of difference
• operational: sequence of edit (CRUD) operations
• structural: colouring, delta model
37
Pre-requisites for language evolution
3 transformation inversing
• for automatic co-evolution of transformations
• calculate inverse
• use relations
• e.g. as bi-directional transformation rules (TGG)
38
Evolution of models
metamodelling
language
DSL
DSm
Δm
DSm’
executable
system
Δe?
executable
system
=
39