html5-img
1 / 20

Bidirectionalization of ATL with GRoundTram : Transformation algorithms (ongoing work)

Bidirectionalization of ATL with GRoundTram : Transformation algorithms (ongoing work). Joint work with AtlanMod and BiG group. Isao Sasano Shibaura Institute of Technology. AtlanMod -BiG Joint workshop 15-16 September 2012. O bjective of this work.

Download Presentation

Bidirectionalization of ATL with GRoundTram : Transformation algorithms (ongoing work)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Bidirectionalization of ATL with GRoundTram: Transformation algorithms(ongoing work) Joint work with AtlanModand BiGgroup Isao Sasano Shibaura Institute of Technology AtlanMod-BiG Joint workshop 15-16 September 2012

  2. Objectiveof this work Model driven development in ATL system Bidirectional graph transformation in GRoundTram system (Currently uni-direction, Rule based) (function from graph to graph) We aim to show correspondence between ATL system and GRoundTram system, providing a way to bidirectionalize ATL.

  3. Toward Bidirectionalization of ATL The full set of ATL A core subset of ATL UnQL encode

  4. Ongoing work • Connect ATL system and GRoundTram system • Encoding and decoding between models in ATL system in xmi format and graphs in GRoundTram system • Encoding ATL rules in ATL system into unql queries in GRoundTram system • Basic algorithms are presented in ICMT 2011

  5. Bidirectionalizing a subset of ATL by GRoundTram update update ATL model M1 model M2 encode decode encode decode encode UnQL graph g2 GRoundTram graph g1

  6. A simple model (by Massimo)

  7. Encoding models into graphs • We have to be able to transform the graph representation back into a representation in the original form • We embed some ID’s in the graphs as edge labels to keep correspondence with models(this might not be necessary by Massimo’s ID embedding)

  8. (Example) Encoding a model into a graph 1 2 Class Attribute attr name=“Person” name=“name” owner attr Attribute Class 1 name 2 name owner “Person” “name”

  9. Encoding algorithm (1) Assign numbers 1, . . . , n to all the model elements and let them be s1, . . . , sn . (2) Visit the elements s1, . . . , sn . For each si , let (ni , {f1, . . . , fk}) = si , gi = &mi:={ni : (trans (f1) ∪ …∪trans (fk))}} g0 = &src:= {: &m1, … ,: &mt} Return &src@ cycle(g0 g1 …gn) . trans (l = atom) = {l : {atom}} trans (reference l --> sj) = {l : &mj}

  10. A subset of ATL (by Massimo) module = moduleid;createid : id; fromid : id; rule+ rule = ruleidfrominPattooutPat+ inPat = id :oclType| id : oclType(oclExp) outPat = id :oclType (binding, …) binding = id ← oclExp oclExp = id |oclExp.id |oclExp.id(oclExp, …) | string | … Imperative features and many of OCL expressions are excluded.

  11. An example of ATL rules (by Massimo) rule Class2Table { from s : ClassDiagram!Class to t : Relational!Table ( name <- s.name, col <- s.attr ) } rule Attribute2Column { from s : ClassDiagram!Attribute ( not s.multiValued ) to t : Relational!Column ( name <- s.name, type <- s.type ) }

  12. An example of ATL rules (cont.) rule Datatype2Type { from s : ClassDiagram!DataType to t : Relational!Type ( __xmiID__ <- 'IN'.concat(s.__xmiID__.concat('.Datatype2Type.t')), name <- s.name ) }

  13. Algorithm for encoding ATL in UnQL We transform a rule into mutually recursive UnQL functions, with reflecting the encoding of models.

  14. Encoding result (Class2Relational) (expected) sfun Class2Table({Class:$s}) = {Table:Class2TableAux($s)} | Class2Table({$l:$s}) = {$l:Class2Table($s)} and sfun Class2TableAux({attr:$s}) = (select {col:$a1} where $a1 in Class2Table($s)) | Class2TableAux({name:$s}) = (select {name:$a1} where $a1 in Class2Table($s)) | Class2TableAux({__xmiID__:$s}) = (select {__xmiID__:$a5} where …. | Class2TableAux({$l:$s}) = {} and sfun Attribute2Column ({Attribute:$s}) = {Column:Attribute2ColumnAux($s)} | …..

  15. Whole encoding result(expected) select letrec sfun Class2Table … = … and sfun Class2TableAux … = … andsfun Attribute2Column … = … and sfun Attribute2ColumnAux … = … andsfun DataType2Type … = … and sfun DataType2TypeAux … = … in Datatype2Type (Attribute2Column (Class2Table ($db)))

  16. Current restriction • Currently we only cope with the ATL rules that have only one output pattern. • Now we are considering how to allow multiple output patterns.

  17. Summary • We have presented an approach to bidirectionalize ATL by: • encoding a subset of ATL into UnQL • encoding models in xmi format into graphs (in dot format)

  18. Work in near future • Implememt the transformation algorithms • Xmi (in Massimo’s format) to graph --- now implementing (almost finished) • A subset of atl (by Massimo) to unql --- now ready to implement (with some restrictions) • Graph to xmi --- start implemeting after the above two finished • Apply to examples including • Simplified version of Class2Relational example.

  19. Things to discuss • Xmi format adapted • how to transform back to xmi from graphs • Graphs (after the forward transformatio) may lose sharing information. • Should we reflect the original xmi structure? • (Inside the BiG: how to treat atl rules with multiple output patterns. The problem is to refer to the function in the outer level. This might be coped with by introducing accumulating paraeter (Kato-san’s idea).)

  20. Thank you

More Related