Describing Behaviour Models through Reusable, Multilevel, Coupled Model Transformations Adrian Rutle Fernando Mac´ ıas Francisco Dur´ an Roberto Rodr´ ıguez-Echeverr´ ıa Uwe Wolter November 2, 2016 Fernando Mac´ ıas et al. Multilevel Coupled MTs
PLS example with two-level approach Fernando Mac´ ıas et al. Multilevel Coupled MTs
PLS example with multilevel approach (a) generic_plant EClass 1-1 EClass 1-1 EClass 1-1 EReference contains@1-2 out@1-2 Machine Container Part EReference EReference in@1-2 creates@1-1 EReference (b) hammer_plant (c) stool_plant Machine 1-1 Machine 1-1 Machine 1-1 Machine 1-1 Machine 1-1 Container 1-1 GenLeg GenSeat Gluer GenHandle GenHead Conveyor creates creates@1-1 creates cout@1-1 creates creates@1-1 creates@1-1 creates EReference@2 creates@1-1 1-1 1-1 1-1 Part Part Container Leg Seat Box Part 1-1 Part 1-1 Container 1-1 Handle Head Tray has@1-1 EReference@2 has@1-1 EReference@2 has@1-1 EReference@2 has@1-1 EReference@2 Part 1-1 Machine 1-1 Part 1-1 1..1 1..1 3..3 1..1 Hammer Assembler Stool (d) hammer_config_1 (e) stool_config_1 Tray 1-1 GenHead 1-1 Conveyor 1-1 cout@1-1 Tray 1-1 out@1-1 t2 GenLeg 1-1 Box 1-1 Gluer 1-1 ghead c1 cout t1 in@1-1 out@2 out@1-1 gleg b1 in@2 gluer out@2 cout@1-1 cout in@1-1 in@2 cout@1-1 cout out@1-1 out@2 in@1-1 in@2 GenHandle 1-1 Conveyor 1-1 Assembler 1-1 Conveyor 1-1 1-1 GenSeat Box 1-1 Box 1-1 out@2 out@1-1 out@1-1 ghandle c2 assembler c3 gseat b2 b3 out@2 out@1-1 out@2 Fernando Mac´ ıas et al. Multilevel Coupled MTs
PLS example with multilevel approach Tray 1-1 1-1 1-1 1-1 GenHead Conveyor cout@1-1 Tray out@1-1 t2 ghead c1 cout t1 out@2 cout in@1-1 in@2 cout@1-1 cout cout@1-1 1-1 1-1 1-1 1-1 GenHandle Conveyor Assembler Conveyor out@2 out@1-1 ghandle c2 assembler c3 out@2 out@1-1 Fernando Mac´ ıas et al. Multilevel Coupled MTs
Defining semantics for behavioural models We use model transformations: Inherently multilevel Commonality can be exploited for reusability Across languages (horizontally) Inside the same stack of languages (vertically) Generic if defined on higher levels Trade-off between genericity may lead to imprecision Fernando Mac´ ıas et al. Multilevel Coupled MTs
Defining semantics for behavioural models We use model transformations: Inherently multilevel Commonality can be exploited for reusability Across languages (horizontally) Inside the same stack of languages (vertically) Generic if defined on higher levels Trade-off between genericity may lead to imprecision Our proposal : Multilevel transformations coupled with a meta-level: precise and reusable Fernando Mac´ ıas et al. Multilevel Coupled MTs
Option 1: Two-level rule Machine 1-1 Machine 1-1 Container 1-1 GenHandle GenHead Conveyor creates creates@1-1 creates cout@1-1 EReference@2 creates@1-1 1-1 1-1 1-1 Part Part Container Handle Head Tray has@1-1 EReference@2 has@1-1 EReference@2 Part 1-1 Machine 1-1 Hammer Assembler Create an instance of ——————————————– Handle for each instance 1-1 of GenHandle GenHead 1-1 Conveyor 1-1 cout@1-1 Tray 1-1 Tray out@1-1 t2 ghead c1 cout t1 out@2 cout@1-1 cout in@1-1 in@2 cout@1-1 cout GenHandle 1-1 Conveyor 1-1 Assembler 1-1 Conveyor 1-1 out@2 out@1-1 ghandle c2 assembler c3 out@2 out@1-1 FROM TO cr:creates GenHandle Handle GenHandle gha h gha Fernando Mac´ ıas et al. Multilevel Coupled MTs
Option 1: Two-level rule Machine 1-1 Machine 1-1 Container 1-1 GenHandle GenHead Conveyor creates creates@1-1 creates cout@1-1 EReference@2 creates@1-1 1-1 1-1 1-1 Part Part Container Handle Head Tray has@1-1 EReference@2 has@1-1 EReference@2 Part 1-1 Machine 1-1 Hammer Assembler Create an instance of ——————————————– Handle for each instance 1-1 of GenHandle GenHead 1-1 Conveyor 1-1 cout@1-1 Tray 1-1 Tray out@1-1 t2 ghead c1 cout t1 out@2 cout@1-1 cout in@1-1 in@2 cout@1-1 cout Create an instance of GenHandle 1-1 Conveyor 1-1 Assembler 1-1 Conveyor 1-1 out@2 out@1-1 ghandle c2 assembler c3 out@2 out@1-1 Head for each instance of GenHead FROM TO cr:creates GenHead Head GenHead ghe h ghe Fernando Mac´ ıas et al. Multilevel Coupled MTs
Option 1: Two-level rule Machine 1-1 Machine 1-1 Container 1-1 GenHandle GenHead Conveyor creates creates@1-1 creates cout@1-1 EReference@2 creates@1-1 1-1 1-1 1-1 Part Part Container Handle Head Tray has@1-1 EReference@2 has@1-1 EReference@2 Part 1-1 Machine 1-1 Hammer Assembler ——————————————– 1-1 GenHead 1-1 Conveyor 1-1 cout@1-1 Tray 1-1 Tray out@1-1 t2 ghead c1 cout t1 out@2 cout@1-1 cout in@1-1 in@2 cout@1-1 cout GenHandle 1-1 Conveyor 1-1 Assembler 1-1 Conveyor 1-1 out@2 out@1-1 ghandle c2 assembler c3 out@2 out@1-1 FROM TO cr:creates GenHead Head GenHead ghe h ghe Fernando Mac´ ıas et al. Multilevel Coupled MTs
Option 1: Two-level rule Machine 1-1 Machine 1-1 Container 1-1 GenHandle GenHead Conveyor creates creates@1-1 creates cout@1-1 EReference@2 creates@1-1 1-1 1-1 1-1 Part Part Container Problems Handle Head Tray has@1-1 EReference@2 has@1-1 EReference@2 × Too specific Part 1-1 Machine 1-1 Hammer Assembler × Difficult to reuse ——————————————– × Each machine needs 1-1 GenHead 1-1 Conveyor 1-1 cout@1-1 Tray 1-1 Tray out@1-1 t2 ghead c1 cout t1 a new rule out@2 cout@1-1 cout in@1-1 in@2 cout@1-1 cout GenHandle 1-1 Conveyor 1-1 Assembler 1-1 Conveyor 1-1 × Each language or out@2 out@1-1 ghandle c2 assembler c3 out@2 out@1-1 hierarchy needs its set of similar rules × Leads to proliferation FROM TO cr:creates GenHead Head GenHead ghe h ghe Fernando Mac´ ıas et al. Multilevel Coupled MTs
Option 2: Multilevel rule 1-1 1-1 1-1 EClass EReference EClass EClass contains@1-2 Machine out@1-2 Container Part EReference EReference in@1-2 creates@1-1 EReference ——————————————– Machine 1-1 Machine 1-1 Container 1-1 GenHandle GenHead Conveyor creates creates@1-1 creates cout@1-1 EReference@2 creates@1-1 Part 1-1 Part 1-1 Container 1-1 Handle Head Tray Create an instance of has@1-1 EReference@2 has@1-1 EReference@2 Part 1-1 Machine 1-1 Hammer Assembler Part for each instance of ——————————————– Machine 1-1 1-1 1-1 Tray 1-1 GenHead Conveyor cout@1-1 Tray out@1-1 t2 ghead c1 cout t1 out@2 cout@1-1 cout in@1-1 in@2 cout@1-1 cout 1-1 1-1 1-1 1-1 GenHandle Conveyor Assembler Conveyor out@1-1 out@2 ghandle c2 assembler c3 out@2 out@1-1 FROM TO cr:creates Machine Part Machine p m m Fernando Mac´ ıas et al. Multilevel Coupled MTs
Option 2: Multilevel rule 1-1 1-1 1-1 EClass EReference EClass EClass contains@1-2 Machine out@1-2 Container Part EReference EReference in@1-2 creates@1-1 EReference ——————————————– Machine 1-1 Machine 1-1 Container 1-1 GenHandle GenHead Conveyor creates creates@1-1 creates cout@1-1 EReference@2 creates@1-1 Part 1-1 Part 1-1 Container 1-1 Handle Head Tray has@1-1 EReference@2 has@1-1 EReference@2 Part 1-1 Machine 1-1 Hammer Assembler ——————————————– 1-1 1-1 1-1 Tray 1-1 GenHead Conveyor cout@1-1 Tray out@1-1 t2 ghead c1 cout t1 out@2 cout@1-1 cout in@1-1 in@2 cout@1-1 cout 1-1 1-1 1-1 1-1 GenHandle Conveyor Assembler Conveyor out@1-1 out@2 ghandle c2 assembler c3 out@2 out@1-1 FROM TO cr:creates Machine Part Machine p m m Fernando Mac´ ıas et al. Multilevel Coupled MTs
Option 2: Multilevel rule 1-1 1-1 1-1 EClass EReference EClass EClass contains@1-2 Machine out@1-2 Container Part EReference EReference in@1-2 creates@1-1 EReference ——————————————– Problems Machine 1-1 Machine 1-1 Container 1-1 × Too generic GenHandle GenHead Conveyor creates creates@1-1 creates cout@1-1 EReference@2 creates@1-1 × Not precise Part 1-1 Part 1-1 Container 1-1 Handle Head Tray has@1-1 EReference@2 has@1-1 EReference@2 × All machines will Part 1-1 Machine 1-1 Hammer Assembler create parts ——————————————– × All parts can be 1-1 1-1 1-1 Tray 1-1 GenHead Conveyor cout@1-1 Tray out@1-1 t2 ghead c1 cout t1 out@2 created directly cout@1-1 cout in@1-1 in@2 cout@1-1 cout 1-1 1-1 1-1 1-1 GenHandle Conveyor Assembler Conveyor out@1-1 out@2 ghandle c2 assembler c3 × Any machine can out@2 out@1-1 create any part FROM TO cr:creates Machine Part Machine p m m Fernando Mac´ ıas et al. Multilevel Coupled MTs
Recommend
More recommend