Runtime Interoperability of Transformation Engines 1150 1150 - - PowerPoint PPT Presentation

runtime interoperability of transformation engines
SMART_READER_LITE
LIVE PREVIEW

Runtime Interoperability of Transformation Engines 1150 1150 - - PowerPoint PPT Presentation

Runtime Interoperability of Transformation Engines 1150 1150 Massimo Tisi AtlanMod Nantes, France Massimo.Tisi@inria.fr Runtime Interoperability of Transformation Engines 1150 1150 Massimo Tisi AtlanMod Nantes, France


slide-1
SLIDE 1

Runtime Interoperability of Transformation Engines

Massimo Tisi

AtlanMod

Nantes, France Massimo.Tisi@inria.fr

1150 1150

slide-2
SLIDE 2

Runtime Interoperability of Transformation Engines

Massimo Tisi

AtlanMod

Nantes, France Massimo.Tisi@inria.fr

1150 1150

slide-3
SLIDE 3

An Identity Crisis

Massimo Tisi

AtlanMod

Nantes, France Massimo.Tisi@inria.fr

1150 1150

slide-4
SLIDE 4

ATL GRoundTram

slide-5
SLIDE 5

ATL UnQL EMF Model Graph EMF Model Graph

slide-6
SLIDE 6

ATL UnQL EMF Model Graph EMF Model Graph ATL2UnQL EMF2Graph

slide-7
SLIDE 7

ATL UnQL EMF Model Graph EMF Model Graph ATL2UnQL EMF2Graph update update propagation

slide-8
SLIDE 8

ATL ? EMF Model ? EMF Model ? ATL2? EMF2?

 CSP  ASM  Maude  ...

slide-9
SLIDE 9

? UnQL ? Graph ? Graph ?2UnQL ?2Graph

 TGG  QVT  XSLT  … 

slide-10
SLIDE 10

L1 L2 SM1 SM2 TM1 TM2 l m m' f1 f2

slide-11
SLIDE 11

L1 L2 SM1 SM2 TM1 TM2 m f1 f2 m

In an ideal world...

slide-12
SLIDE 12

L1 L2 SM1 SM2 TM1 TM2 m f1 f2 m

In an ideal world... ...but we are not in an ideal world :(

slide-13
SLIDE 13

Realistic Hypothesis 1

 m is injective

 from abstract to concrete  no information loss

 all information from SM1 is encoded in SM2

 good bidirectionality properties with m'

 at least get-put?

slide-14
SLIDE 14

Realistic Hypothesis 2

 l is not injective

 Not all the language features are translated  Why?

  • 1. not possible -> very different semantics of L1 and L2
  • 2. possible but we don't want to:

 e.g., we just want to translate the bidirectionalizable part

  • 3. possible but we just don't have time

 Result: f1 is “semantically different” from f2

 TM2 != m(TM1)

slide-15
SLIDE 15

Partial translation

 If we allow any translation l, we could end up

with a TM2 completely unrelated with TM1

 We are interested in “approximations by defect”

  • f a perfect translation

 We say that l is a partial translation of a model

transformation when it is always guaranteed that:

 TM2 is part-of m(TM1)  (or for graphs: TM2 is a subgraph of m(TM1))

slide-16
SLIDE 16

L1 L2 SM1 SM2 TM1 TM2 l m m' f1 f2 ? ?

The problem

 To say more we need to go down to the model-element level

slide-17
SLIDE 17

Family: Class name: Attribute attrs members: Attribute multivalued = true Person: Class String: Datatype firstName: Attribute attrs type type type family : Attribute attrs type Family: Table name: Column cols Person: Table String: Type firstName: Column cols type type family : Column cols type

Class models and Relational models

slide-18
SLIDE 18

Family: Class name: Attribute attrs members: Attribute multivalued = true Person: Class String: Datatype firstName: Attribute attrs type type type family : Attribute attrs type Family: Table name: Column cols Person: Table String: Type firstName: Column cols type type family : Column cols type

Class2Relational.atl

rule Class2Table { from s : ClassDiagram!Class to t : Relational!Table ( name <- s.name, col <- s.attr ) }

Trace Link

slide-19
SLIDE 19

Family: Class name: Attribute attrs members: Attribute multivalued = true Person: Class String: Datatype firstName: Attribute attrs type type type family : Attribute attrs type Family: Table name: Column cols Person: Table String: Type firstName: Column cols type type family : Column cols type

Class2Relational.atl

rule Class2Table { from s : ClassDiagram!Class to t : Relational!Table ( name <- s.name, col <- s.attr ) }

Trace Link

rule Attribute2Column { from s : ClassDiagram!Attribute ( not s.multiValued ) to t : Relational!Column ( name <- s.name, type <- s.type ) }

guard bindings Guards and bindings are OCL expressions over the source model

slide-20
SLIDE 20

Class2Relational.atl

module Class2Relational; create OUT : Relational from IN : ClassDiagram; rule Datatype2Type { from s : ClassDiagram!DataType to t : Relational!Type ( name <- s.name ) } rule Attribute2Column { from s : ClassDiagram!Attribute ( not s.multiValued ) to t : Relational!Column ( name <- s.name, type <- s.type ) } rule Class2Table { from s : ClassDiagram!Class to t : Relational!Table ( name <- s.name, col <- s.attr ) }

 But there is much more:

 Matching multiple elements

per rule

 Generating multiple

elements per rule

 OCL functions (helpers)  Explicit inter-rule activation

(lazy rules)

 Imperative blocks

slide-21
SLIDE 21

Trace links

A H I J G E C B K rule1 rule2 rule3 Source Model Destination Model t u v t t

slide-22
SLIDE 22

Trace links

A H I J G E C B K rule1 rule2 rule3 Source Model Destination Model t u v t t

slide-23
SLIDE 23

Trace links

A H I J G E C B K rule1 rule2 rule3 Source Model Destination Model t u v t t

J?

slide-24
SLIDE 24

J: who am I?

J

slide-25
SLIDE 25
  • 1. Identity by trace links

A H I J G E C B K rule1 rule2 rule3 t u v t t

J!

slide-26
SLIDE 26

ATL UnQL EMF Model Graph EMF Model Graph ATL2UnQL EMF2Graph UnCAL

 But:

 Not a clear 1-to-1 relationship in ATL2UnQL  Even if we modify ATL2UnQL we don't want to modify UnQL to UnCAL

slide-27
SLIDE 27
  • 2. Identity by identifiers

 Modeling frameworks have a notion of

model-element identity

 E.g., in EMF:

 Users can set an explicit ID for each model element

 It is serialized as an XML ID when the model is serialized to

XMI/XML

 Otherwise the system uses an implicit ID

 the Java object ID while it is in memory  an XMI ID when the model is serialized to XMI

 quite similar to XPath  e.g., “/0/@elements.3/@inPattern/@elements.0”

 Users are encouraged to abstract from IDs

slide-28
SLIDE 28
  • 2a. Emulating identifiers

A H I J G E C B K rule1 rule2 rule3 t u v t t IDJ=“/0/@elements.1” /0/@elements.1

J!

slide-29
SLIDE 29

 But:

 Implicit identifiers depend on several factors that

cannot be easily emulated

 Non-determinism in the serialization format

 Changes among EMF versions

 Structure of the file

 e.g., element ordering in non-ordered references  Non-determinism in the serializer  Non-determinism in the transformation language  Changes among ATL versions or ATL implementations  Because of the partial translation!

slide-30
SLIDE 30

ATL UnQL EMF Model Graph EMF Model explicit IDs Graph ATL2UnQL EMF2Graph

  • 2b. “Lifting” Identity

ATL EMF Model IDFIER

slide-31
SLIDE 31

The IDFIER HOT

rule Class2Table { from s : ClassDiagram!Class to t : Relational!Table ( name <- s.name, col <- s.attr ) } rule Class2Table { from s : ClassDiagram!Class to t : Relational!Table ( __xmiID__ <- 'IN'.concat(s.__xmiID__.concat('.Class2Table.t')), name <- s.name, col <- s.attr ) }

slide-32
SLIDE 32

A H I J G E C B K rule1 rule2 rule3 t u v t t IDJ=“IN.A.rule1.v” IN.A.rule1.v

J!

slide-33
SLIDE 33

“Lifting” identity

 The logic for identification is “lifted”

 from an implicit semantics in the modeling

framework

 to an explicit transformation rule  that is composed with the given ATL transformation

slide-34
SLIDE 34

Benefits

 We keep element identity in TM1 and TM2

 With no changes to the two transformation engines  With no changes to the translator l

 that is totally agnostic w.r.t the ID format  and goes on working if we change it

 Transparently for a tool that uses SM1/L1/TM1

 But not for a tool that uses SM2/L2/TM2

 Supporting partial translations

slide-35
SLIDE 35

Future work

 A good formalization

 Some category theory?

 Complete analysis of identification methods

 e.g., adding structural comparison

 Application to runtime ATL-GRoundTram

interaction

slide-36
SLIDE 36

Massimo Tisi - 36/36

Thanks