executability analysis of graph transformation rules (vl/hcc 2011)

18
htweight Executability Ana Graph Transformation Rules 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

Upload: elena-planas

Post on 16-Apr-2017

667 views

Category:

Technology


3 download

TRANSCRIPT

Lightweight Executability Analysisof Graph Transformation Rules

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

DSVL: Domain Specific Visual Language

Lightweight Executability Analysis of Graph transformation Rules

Domain Specific LanguageLanguage specifically designed for a particular problem domain

Visual LanguageLanguage where images are used to comunicate concepts

Defined by…… its Syntax … its SemanticDSL + VL = DSVL

Basic ConceptsGoal

MethodConclusions

Domain Specific Visual LanguageDSVL Syntax (meta-model)DSVL Semantics (GT Rules)

1/13

Part

capacity: int

0..1 0..1

0..1

0..1cin

cout0..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

Nex

t

Input

OutputConveyor Machine

DSVL Syntax: Meta-model (I)

Lightweight Executability Analysis of Graph transformation Rules

Meta-modeling is a technique to describe the structure of a language.

Basic ConceptsGoal

MethodConclusions

Domain Specific Visual LanguageDSVL Syntax (meta-model)DSVL Semantics (GT Rules)

2/13

Integrity Constraints

DSVL Syntax: Meta-model (II)

Lightweight Executability Analysis of Graph transformation Rules

Basic ConceptsGoal

MethodConclusions

Domain Specific Visual LanguageDSVL Syntax (meta-model)DSVL Semantics (GT Rules)

3/13

concept image

Piece

Machine

Conveyor

m

p

Equivalent Concrete Syntax

mcapacity = 3

p

busy = true

m: Machinebusy = true

c: Conveyorcapacity = 3

p: Part

Abstract Syntax

Example: Instantiation of the meta-model

DSVL Semantics: Graph Transformation Rules

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 RHSRule newMachine

Compacted (operational) notation

Basic ConceptsGoal

MethodConclusions

Domain Specific Visual LanguageDSVL Syntax (meta-model)DSVL Semantics (GT Rules)

4/13

equivalentc1

c2

m1 c1

c2

m1

m2

{del}

{new}

Rule newMachine

c1

c2

m1

m2

Lightweight Executability Analysis of Graph transformation Rules

Goal

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 ConceptsGoal

MethodConclusions

5/13

Lightweight Executability Analysis of Graph transformation Rules

What is Weak Executability of a rule?

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).

6/13

Basic ConceptsGoal

MethodConclusions

Lightweight Executability Analysis of Graph transformation Rules

Weak Executability: Example

newMachine

capacity: int 0..11..*

1..* 0..1

busy: boolean

in out

out in

Input

OutputConveyor Machine

The DSVL specifies…newMachine

m1

{del}

{new}

c1

c2m2

newMachine is not weakly executable

Target Model

m1c1

c2

c0

m2

Source Model

m1c1

c2

c0Inconsistencies:

has not any output conveyorbusy attribute of has not been initialized

m2

m2

7/13

Basic ConceptsGoal

MethodConclusions

Lightweight Executability Analysis of Graph transformation Rules

Step 1: Derive Actions

DestroyLink(Input,conveyor,c2,machine,m1)m2 := CreateObject(Machine)CreateLink(Input,conveyor,c2,machine,m2)

Action-based representation

Declarative GTR

m1

{del}

{new}

c1

c2m2

Ligh

twei

ght m

etho

dIn

put

Out

put

Declarative GTR

FEEDBACK

Derive actions

Verify Weak Executability

Translate

Rule {action}

FEEDBACK

Example: Rule newMachine

Basic ConceptsGoal

MethodConclusions

Step 1: Derive ActionsStep 2: Verify Weak Executability Step 3: Translate Feedback

8/13

Lightweight Executability Analysis of Graph transformation Rules

Step 2: Verify Weak Executability

Ligh

twei

ght m

etho

dIn

put

Out

put

Declarative GTR

FEEDBACK

Derive actions

Verify Weak Executability

Translate

Rule {action}

FEEDBACK

Basic ConceptsGoal

MethodConclusions

Step 1: Derive ActionsStep 2: Verify Weak Executability Step 3: Translate Feedback

DependencySome 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.

9/13

Lightweight Executability Analysis of Graph transformation Rules

Step 2: Verify Weak Executability

Ligh

twei

ght m

etho

dIn

put

Out

put

Declarative GTR

FEEDBACK

Derive actions

Verify Weak Executability

Translate

Rule {action}

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

Example: Rule newMachine

dep1.1: CreateLink(Input,conveyor,X,machine,m2)dep1.2: CreateLink(Output,machine,m2,conveyor,Y)dep1.3: UpdateAttribute(m2,busy,Z)

Dependencies

Basic ConceptsGoal

MethodConclusions

10/13

{new}

dep1.2dep1.1 dep1.3

AND AND{new}m2

X

Ym2{new}

m2ATTRIB. COMP.: m2.busy = Z

action 2 dep1.2

Step 1: Derive ActionsStep 2: Verify Weak Executability Step 3: Translate Feedback

Lightweight Executability Analysis of Graph transformation Rules

Step 2: Verify Weak Executability

Ligh

twei

ght m

etho

dIn

put

Out

put

Declarative GTR

FEEDBACK

Derive actions

Verify Weak Executability

Translate

Rule {action}

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

Example: Rule newMachine

dep1.1: CreateLink(Input,conveyor,X,machine,m2)dep1.2: CreateLink(Output,machine,m2,conveyor,Y)dep1.3: UpdateAttribute(m2,busy,Z)

Dependencies

Basic ConceptsGoal

MethodConclusions

Step 1: Derive ActionsStep 2: Verify Weak Executability Step 3: Translate Feedback

{new}

dep1.2dep1.1 dep1.3

AND AND{new}m2

X

Ym2{new}

m2ATTRIB. COMP.: m2.busy = Z

action 2 dep1.2

10/13

Lightweight Executability Analysis of Graph transformation Rules

Step 2: Verify Weak Executability

Ligh

twei

ght m

etho

dIn

put

Out

put

Declarative GTR

FEEDBACK

Derive actions

Verify Weak Executability

Translate

Rule {action}

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

Example: Rule newMachine

dep1.1: CreateLink(Input,conveyor,X,machine,m2)dep1.2: CreateLink(Output,machine,m2,conveyor,Y)dep1.3: UpdateAttribute(m2,busy,Z)

Dependencies

Basic ConceptsGoal

MethodConclusions

Step 1: Derive ActionsStep 2: Verify Weak Executability Step 3: Translate Feedback

{new}

dep1.2dep1.1 dep1.3

AND AND{new}m2

X

Ym2{new}

m2ATTRIB. COMP.: m2.busy = Z

action 2 dep1.2

10/13

Lightweight Executability Analysis of Graph transformation Rules

Step 2: Verify Weak Executability

Ligh

twei

ght m

etho

dIn

put

Out

put

Declarative GTR

FEEDBACK

Derive actions

Verify Weak Executability

Translate

Rule {action}

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

Example: Rule newMachine

dep1.1: CreateLink(Input,conveyor,X,machine,m2)dep1.2: CreateLink(Output,machine,m2,conveyor,Y)dep1.3: UpdateAttribute(m2,busy,Z)

Dependencies

Basic ConceptsGoal

MethodConclusions

Step 1: Derive ActionsStep 2: Verify Weak Executability Step 3: Translate Feedback

{new}

dep1.2dep1.1 dep1.3

AND AND{new}m2

X

Ym2{new}

m2ATTRIB. COMP.: m2.busy = Z

action 2 dep1.2

10/13

FEED

BACK

Lightweight Executability Analysis of Graph transformation Rules

Step 2: Verify Weak Executability

Ligh

twei

ght m

etho

dIn

put

Out

put

Declarative GTR

FEEDBACK

Derive actions

Verify Weak Executability

Translate

Rule {action}

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

Example: Rule newMachine

dep1.1: CreateLink(Input,conveyor,X,machine,m2)dep1.2: CreateLink(Output,machine,m2,conveyor,Y)dep1.3: UpdateAttribute(m2,busy,Z)

Dependencies

Basic ConceptsGoal

MethodConclusions

Step 1: Derive ActionsStep 2: Verify Weak Executability Step 3: Translate Feedback

{new}

dep1.2dep1.1 dep1.3

AND AND{new}m2

X

Ym2{new}

m2ATTRIB. COMP.: m2.busy = Z

action 2 dep1.2

10/13

Lightweight Executability Analysis of Graph transformation Rules

Step 3: Translate feedback

Ligh

twei

ght m

etho

dIn

put

Out

put

Declarative GTR

FEEDBACK

Derive actions

Verify Weak Executability

Translate

Rule {action}

FEEDBACK

Example: Rule newMachine

FEED

BACK

dep1.2: CreateLink(Output,machine,m2,conveyor,Y)dep1.3: UpdateAttribute(m2,busy,Z)

Weak Executable GTR

m1

{del}

{new}

c1

c2m2 Y

ATTRIB. COMPUTATION: m2.busy = Z

Basic ConceptsGoal

MethodConclusions

Step 1: Derive ActionsStep 2: Verify Weak Executability Step 3: Translate Feedback

11/13

Conclusions

• Lightweight method for verifying the weak executability of GT Rules considering the meta-model integrity constraints.

• Feedback allows:

• Semi-automatic correction of the rules.

• Visually highlighting the problems detected.

• The method can be complemented with more powerful techniques as model checking.

Lightweight Executability Analysis of Graph transformation Rules

Basic ConceptsGoal

MethodConclusions

12/13

Thanks for your attention!Elena Planas [email protected]

Lightweight Executability Analysis of Graph transformation Rules 13/13