Executability Analysis of Graph Transformation Rules (VL/HCC 2011)
1. Lightweight Executability Analysis of G raph T ransformation R ules Universitat Oberta de Catalunya, Spain École des Mines de Nantes, France Universitat Politècnica de Catalunya, Spain Universidad Autónoma de Madrid, Spain Universidad Autónoma de Madrid, Spain VL/HCC – Madrid, September 23, 2010 Elena Planas Jordi Cabot Cristina Gómez Esther Guerra Juan de Lara
2. DSVL : D omain S pecific V isual L anguage Lightweight Executability Analysis of Graph transformation Rules DSL + VL = DSVL Basic Concepts Goal Method Conclusions Domain Specific Visual Language DSVL Syntax (meta-model) DSVL Semantics (GT Rules) 1/13 Domain Specific Language Language specifically designed for a particular problem domain Visual Language Language where images are used to comunicate concepts Defined by… … its Syntax … its Semantic
3. Part capacity: int 0..1 0..1 0..1 0..1 cin cout 0..1 * * 1..* 1..* 0..1 context Conveyor inv : self .capacity > 0 and self .part-> size ()<= self .capacity context Machine inv : if ( self .busy=false) then self .part-> size ()=0 else self .part-> size ()>0 endif {xor} busy: boolean in out out in inConv inMachine Next Input Output Conveyor Machine DSVL Syntax : M eta-model (I) Lightweight Executability Analysis of Graph transformation Rules Meta-modeling is a technique to describe the structure of a language. Basic Concepts Goal Method Conclusions Domain Specific Visual Language DSVL Syntax (meta-model) DSVL Semantics (GT Rules) 2/13 Integrity Constraints
4. DSVL Syntax : M eta-model (II) Lightweight Executability Analysis of Graph transformation Rules Basic Concepts Goal Method Conclusions Domain Specific Visual Language DSVL Syntax (meta-model) DSVL Semantics (GT Rules) 3/13 m p Equivalent Concrete Syntax m capacity = 3 p busy = true p: Part Abstract Syntax Example : Instantiation of the meta-model concept image Piece Machine Conveyor m: Machine busy = true c: Conveyor capacity = 3
5. DSVL Semantics : G raph T ransformation R ules Lightweight Executability Analysis of Graph transformation Rules Graph Transformation is a formal, declarative and rule-based technique for expressing model manipulations. Extended (declarative) notation LHS RHS Rule newMachine Compacted (operational) notation Basic Concepts Goal Method Conclusions Domain Specific Visual Language DSVL Syntax (meta-model) DSVL Semantics (GT Rules) 4/13 c1 c2 m1 c1 c2 m1 m2 equivalent {del} {new} Rule newMachine c1 c2 m1 m2
6. Lightweight Executability Analysis of Graph transformation Rules G oal Graph Transformation Rules are increasingly used in Model Driven Engineering to express model transformations There is a lack of methods able to analyse rule correctness Propose a lightweight, efficient and static method to check the weak executability of rules Contextualization The Problem Our solution Basic Concepts Goal Method Conclusions 5/13
7. Lightweight Executability Analysis of Graph transformation Rules What is Weak Executability of a rule? 6/13 Basic Concepts Goal Method Conclusions A rule is weakly executable if it has a chance of being successfully executed (the rule’s execution generates a graph consistent with the system’s integrity constraints).
8. Lightweight Executability Analysis of Graph transformation Rules Weak Executability: Example new Machine 7/13 Basic Concepts Goal Method Conclusions capacity: int 0..1 1..* 1..* 0..1 busy: boolean in out out in Input Output Conveyor Machine The DSVL specifies… newMachine m1 {del} {new} c1 c2 m2 newMachine is not weakly executable Target Model m1 c1 c2 c0 m2 Source Model m1 c1 c2 c0 Inconsistencies: has not any output conveyor busy attribute of has not been initialized m2 m2
10. Lightweight Executability Analysis of Graph transformation Rules Step 2: Verify Weak Executability Lightweight method Input Output Declarative GTR FEEDBACK Derive actions Verify Weak Executability Translate Rule {action} FEEDBACK Basic Concepts Goal Method Conclusions Step 1: Derive Actions Step 2: Verify Weak Executability Step 3: Translate Feedback 9/13 Dependency Some actions require the presence of other actions in order to be executable. In order to be Weak Executable, a rule must satisfy all its dependencies.
11. Lightweight Executability Analysis of Graph transformation Rules Step 2: Verify Weak Executability Lightweight method Input Output Declarative GTR FEEDBACK Derive actions Verify Weak Executability Translate Rule {action} FEEDBACK E xample: Rule newMachine Basic Concepts Goal Method Conclusions 10/13 Step 1: Derive Actions Step 2: Verify Weak Executability Step 3: Translate Feedback action 1: DestroyLink(Input,conveyor,c2,machine,m1) action 2: m2 := CreateObject(Machine) action 3: CreateLink(Input,conveyor,c2,machine,m2) Action-based representation dep1.1: CreateLink(Input,conveyor,X,machine,m2) dep1.2: CreateLink(Output,machine,m2,conveyor,Y) dep1.3: UpdateAttribute(m2,busy,Z) Dependencies {new} dep 1.2 dep 1.1 dep 1.3 AND AND {new} m2 X Y m2 {new} m2 ATTRIB. COMP.: m2.busy = Z action 2 dep 1.2
12. Lightweight Executability Analysis of Graph transformation Rules Step 2: Verify Weak Executability Lightweight method Input Output Declarative GTR FEEDBACK Derive actions Verify Weak Executability Translate Rule {action} FEEDBACK E xample: Rule newMachine Basic Concepts Goal Method Conclusions Step 1: Derive Actions Step 2: Verify Weak Executability Step 3: Translate Feedback 10/13 action 1: DestroyLink(Input,conveyor,c2,machine,m1) action 2: m2 := CreateObject(Machine) action 3: CreateLink(Input,conveyor,c2,machine,m2) Action-based representation dep1.1: CreateLink(Input,conveyor,X,machine,m2) dep1.2: CreateLink(Output,machine,m2,conveyor,Y) dep1.3: UpdateAttribute(m2,busy,Z) Dependencies {new} dep 1.2 dep 1.1 dep 1.3 AND AND {new} m2 X Y m2 {new} m2 ATTRIB. COMP.: m2.busy = Z action 2 dep 1.2
13. Lightweight Executability Analysis of Graph transformation Rules Step 2: Verify Weak Executability Lightweight method Input Output Declarative GTR FEEDBACK Derive actions Verify Weak Executability Translate Rule {action} FEEDBACK E xample: Rule newMachine Basic Concepts Goal Method Conclusions Step 1: Derive Actions Step 2: Verify Weak Executability Step 3: Translate Feedback 10/13 action 1: DestroyLink(Input,conveyor,c2,machine,m1) action 2: m2 := CreateObject(Machine) action 3: CreateLink(Input,conveyor,c2,machine,m2) Action-based representation dep1.1: CreateLink(Input,conveyor,X,machine,m2) dep1.2: CreateLink(Output,machine,m2,conveyor,Y) dep1.3: UpdateAttribute(m2,busy,Z) Dependencies {new} dep 1.2 dep 1.1 dep 1.3 AND AND {new} m2 X Y m2 {new} m2 ATTRIB. COMP.: m2.busy = Z action 2 dep 1.2
14. Lightweight Executability Analysis of Graph transformation Rules Step 2: Verify Weak Executability Lightweight method Input Output Declarative GTR FEEDBACK Derive actions Verify Weak Executability Translate Rule {action} FEEDBACK E xample: Rule newMachine Basic Concepts Goal Method Conclusions Step 1: Derive Actions Step 2: Verify Weak Executability Step 3: Translate Feedback 10/13 action 1: DestroyLink(Input,conveyor,c2,machine,m1) action 2: m2 := CreateObject(Machine) action 3: CreateLink(Input,conveyor,c2,machine,m2) Action-based representation dep1.1: CreateLink(Input,conveyor,X,machine,m2) dep1.2: CreateLink(Output,machine,m2,conveyor,Y) dep1.3: UpdateAttribute(m2,busy,Z) Dependencies {new} dep 1.2 dep 1.1 dep 1.3 AND AND {new} m2 X Y m2 {new} m2 ATTRIB. COMP.: m2.busy = Z action 2 dep 1.2
15. Lightweight Executability Analysis of Graph transformation Rules Step 2: Verify Weak Executability Lightweight method Input Output Declarative GTR FEEDBACK Derive actions Verify Weak Executability Translate Rule {action} FEEDBACK E xample: Rule newMachine Basic Concepts Goal Method Conclusions Step 1: Derive Actions Step 2: Verify Weak Executability Step 3: Translate Feedback 10/13 FEEDBACK action 1: DestroyLink(Input,conveyor,c2,machine,m1) action 2: m2 := CreateObject(Machine) action 3: CreateLink(Input,conveyor,c2,machine,m2) Action-based representation dep1.1: CreateLink(Input,conveyor,X,machine,m2) dep1.2: CreateLink(Output,machine,m2,conveyor,Y) dep1.3: UpdateAttribute(m2,busy,Z) Dependencies {new} dep 1.2 dep 1.1 dep 1.3 AND AND {new} m2 X Y m2 {new} m2 ATTRIB. COMP.: m2.busy = Z action 2 dep 1.2