1 / 17

Graph Transformation for Model Transformation

Graph Transformation for Model Transformation. Arend Rensink University of Twente. Trafo Def Language. Language A. A-B Trafo Def. Language B. Overview. Scenario Outline of the presentation Requirements Principles Example Practice Next step Final words. A-Model. A-B Trafo.

snowy
Télécharger la présentation

Graph Transformation for Model Transformation

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. Graph Transformation for Model Transformation Arend Rensink University of Twente Graph-Based State Spaces

  2. Trafo Def Language Language A A-B Trafo Def Language B Overview • Scenario • Outline of the presentation • Requirements • Principles • Example • Practice • Next step • Final words A-Model A-B Trafo B-Model Graph-Based State Spaces

  3. Requirements: What do we need? • Reasoning about models • Instances of different meta-models • Need common representation • Idea: graphs as common representation • Powerful yet simple • Natural for many models • Theory of graph transformation available • Some aspects not covered well • Cardinality and inheritance in meta-models • Ordered associations • Attributes Graph-Based State Spaces

  4. Example: ASG to FG • Abstract Syntax Graph model 0..1 next Statement then else body 1 0..1 1 While If Assign Graph-Based State Spaces

  5. Assign next While body If then else Assign Assign next Assign Example: ASG instance • Program ready = false;while (! ready) {if (x < max) { x = x*x; ready = true; } else { ready = false; }} • Graph Graph-Based State Spaces

  6. Target model: Flow Graphs nondeterministic choice 1 2 Element flow flow Procedure Stop Predicate Graph-Based State Spaces

  7. Assign Proc next flow While Pred flow flow body flow If Pred then else flow flow Assign Assign Proc Proc next flow Assign Proc Stop Example: FG instance • ASG • FG Graph-Based State Spaces

  8. while assign start if-else if-no-else stop Trafo Def: set of rules Graph-Based State Spaces

  9. Graph formalism • Graphs in this presentation: • flat (i.e., not hierarchical), untyped • directed, edge-labelled, no parallel edges • self-edges depicted as node labels • Formally: G = (L,N,E) with • L set of labels • N finite set of nodes • E  N  L  N finite set of labelled edges • Partial morphisms • structure-preserving node mappings Graph-Based State Spaces

  10. Production rule rule morphism LHS RHS NAC NAC (partial) NACs forbidden matching source graph morph(t) target graph src(t) tgt(t) Concrete transformation pushout Graph Productions (SPO = Single Pushout Approach) Graph-Based State Spaces

  11. Example production rule Alternative single-graph representation green = creator: RHS, not LHS;to be added blue = eraser: LHS, not RHS;to be matched and deleted black = reader:LHS and RHS;to be matched and preserved red = embargo: NAC, not LHS;forbidden Graph-Based State Spaces

  12. Lang A A-Type B-Type Lang B A-Model A-Graph B-Graph B-Model should be reversible Application scenario Graph Production Systems • Overhead: Transformation to and from graphs • Price for common representation • Graph transformations inefficient • Graph matching inherently complex (NP-complete) • Domain-specific transformations superior • Graph Trafo can serve as specification A-B Prod Syst A-B Trafo Graph-Based State Spaces

  13. Graphs everywhere • Other modelling domains (meta-models) • XSD/XML • ERD schemas/databases • Class/object diagrams • Certain patterns emerge • Commonalities among modelling domains • Should be formulated on MOF level Graph-Based State Spaces

  14. Practice: What is available? • BOTL (München) • Bidirectional O-o Transformation Language • Transforms object models to object models • FuJaBA (Paderborn, Kassel) • From UML to Java and Back Again • Generates Java code from enriched activity diagrams • ATOM3 (Madrid) • A Tool for Multi-Formalism Meta-Modelling • Transforms any model at any meta-level Graph-Based State Spaces

  15. Next step: Dynamic Semantics • Current research mostly on static semantics • Models: Class diagrams, ERD schemes, XML schemas • Instances: Objects, ER databases, XML documents • Dynamic semantics: how do systems behave? • Can be expressed as changes on instance level • These can also be seen as transformations • Graph transformations for operational semantics • Aim: Semantics-preserving model transformations • NWO project: GRASLAND • Graphs for Software Language Definition • Aim: Generic semantic definition language Graph-Based State Spaces

  16. meta-levelshift TAAL Experiment [Kleppe, Rensink, Kastenberg] • Example O-Olanguage • Transformations GROOVE ASG to FG dynamic semantics Graph-Based State Spaces

  17. Final words • MDA: Cool idea • Good intuitions • Poor mathematical backing • Graph transformation: Promising approach • Good mathematical backing • Useful for formalizing principles • Questionable for practical transformations • State of the art • A lot of work at the stage of (small) case studies • We need engineering discipline(Who’s going to write the XSD meta-model in MOF?) Graph-Based State Spaces

More Related