Top Banner
AToM 3 : A T ool fo r M ulti- Formalism and M eta- M odelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid, Spain (2) School of Computer Scien McGill University Montreal, Canada
30

AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Dec 29, 2015

Download

Documents

Barry Payne
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

AToM3: A Tool for Multi-Formalism and Meta-

Modelling

Juan de Lara(1,2)

Hans Vangheluwe(2)

(1) ETS InformáticaUniversidad Autónoma de MadridMadrid, Spain

(2) School of Computer ScienceMcGill UniversityMontreal, Canada

Page 2: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Problems

To model and simulate complex systems:– Many components– Each one is better described in a particular

formalism.

To transform models between formalisms preserving behaviour.

Page 3: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Goals

We propose Meta-Modelling + Graph-Rewriting to solve these problems.

To be able to automatically generate tools for the processing of models.

Common framework for all these tools.

Page 4: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Index Problems Goals

Background.– Multi-Formalism Modelling– Meta-Modelling.– Graph Grammars.

AToM3. Transforming NFA into DFA. Conclusions and Future work.

Page 5: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Multi-Formalism ModellingFormalism Transformation Graph

Page 6: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Meta-Modelling (i)

Need of multiple, heterogeneous tools for multi-formalism modelling?

We solve it with Meta-Modelling:

– Modelling the formalism...

– And generating automatically a tool for processing models in the described formalism.

Page 7: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Meta-Modelling (ii)

• f´(x) = -sin(x), f(0) = 0 (in theODEs formalism).• ...

The description of anobject in a certain

formalism.

Models of:• Deterministic Finite Automata• DFD, Structure Charts• Ordinary Differential Equations•...

Models of formalisms.

Introduce higher modelling layers to model the formalisms themselves.

Model

Meta

-M

odel

Meta

-Meta

Model

Models of (meta-)formalisms, which can be

used to describe other formalisms

Models of: • Entity-Relationship Diagrams• UML class Diagrams• ...

Order Description Example

Page 8: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Meta-Modelling (iii)

Example:

S0 S11

S2

0

1

0

S3

0

1

Model: Even binary numbers (DFA)

State

Name: StringType: (I, R, F)

StateTransition.forAll(t1, t2|t1.Condition<>t2.Condition)

Transition

Condition: String1..1

0..N

1..1 0..N

ConstraintsdistinctStateNames: State.forAll(p, q|p.Name<>q.Name)uniqueInitial: State.exists(n|n.Type==I and

State.forAll(m|n<>m and m.Type<>I)existsFinal: State.exists(n|n.Type==F)

Meta-Model: DFA formalism (“UML” class diagram + OCL)

Page 9: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Meta-Modelling (iv)

E-RE-R

Meta-ModellingTool

(AToM3 Kernel)User Input:• Create entities• Delete entities• Verify conditions(local, global)

DFADFA

Meta-ModellingTool

(AToM3 Kernel)User Input:• Create entities• Delete entities• Verify conditions(local, global)

EvenBinary

Numbers

EvenBinary

Numbers

(meta-meta-model)

(meta-model)

(model)

E-RE-R

E-RE-R

DFADFA

Page 10: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Graph Grammars (i) A (meta-)* model is a graph.

Just like string grammars, but rules have graphs in LHSs and RHSs.

If a matching is found between a LHS and a zone in the graph, this subgraph is substituted by the RHS.

A Graph Rewriting System tries each rule in sequence until none of them is applicable.

Page 11: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Graph Grammars (ii) We use graph grammars to:

– Express operational semantics (simulator specification)

– Transform models into behaviourally equivalent models expressed in another formalism.

– Optimize models.

– Generate code for a particular tool ( denotational semantics).

Page 12: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Index Problems Goals Background.

AToM3.– Meta-Modelling the DFA Formalism.

Transforming NFAs into DFAs. Conclusions and Future work.

Page 13: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

AToM3(i)

E-RE-R

Meta-ModellingTool

(AToM3 Kernel)User Input:• Create entities• Delete entities• Verify conditions(local, global)

DFADFA

Meta-ModellingTool

(AToM3 Kernel)

User Input:• Create entities• Delete entities• Verify conditions(local, global)

EvenBinary

Numbers

EvenBinary

Numbers

(meta-meta-model)

(model)

Use

r In

terf

ace

Use

r In

terf

ace

Model

ConstraintManager

CodeGenerator

GraphRewritingProcessor

ASG

Str

uct

ure

ASG

Nodes

Str

uct

ure

GraphicalModel

GraphicalIcons

AbstractSyntaxGraph

E-RE-R

E-RE-R

DFADFA

(meta-model)

Page 14: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

AToM3(ii) Types is another formalism.

Atomic (integer, boolean, ...) or composite.

A composite type is a model in the “types” formalism.

Regular or Generative:– ATOM3Attribute– ATOM3Constraint– ATOM3Link– ATOM3Appearance

Page 15: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

AToM3(iii) DFA Meta-Model

Semantic information

Edit Properties

Edit Cardinalities

Page 16: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

AToM3(iii) DFA Meta-Model

Semantic information

Constraints

Page 17: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

AToM3(iv) DFA Meta-Model

Graphical information

Edit Appearance

Page 18: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

AToM3(v) DFA Meta-Model

Global Semantic Information and Constraints.

Edit Model Attributes

Page 19: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

AToM3(vi) Configuring the DFA User Interface (In the Buttons formalism).

Automatically generated by a Graph-Grammar:

– Transforms a Model in the Eentity Relationship formalism into a Model in the Buttons Formalism.

Edit Entity

Config. Action

Page 20: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

AToM3(vii) The Tool to Process DFA Models.

Create, Edit, Verify...

Other manipulations can be defined by means of graph grammars:

– Simulate.– Optimize.– Transform.– Generate Code.– ...

Page 21: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Index Problems Goals Background. AToM3.

Transforming NFAs into DFAs.–Example

Conclusions and Future work.

Page 22: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Transforming NFAs into DFAs (i)

Eliminates unreachable states

Joins equivalent states

Eliminates non determinism between two different states

Eliminates non determinism with self-loops.

Page 23: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Condition: node(2).condition == node(3).condition

Action: Copy inputs and outpus from node(4) and node(5) into node(7)

Condition: node(2).condition == node(3).condition

Action: Copy inputs and outpus from node(4) and node(5) into node(7)

Transforming NFAs into DFAs (ii)

Rule 3: Eliminates non determinism between two different states

LHS RHS

Page 24: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Transforming NFAs into DFAs (ii)

Example (i)

Rule 1Rule 1Rule 3Rule 3

Page 25: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Transforming NFAs into DFAs (ii)

Example (ii)

Rule 1Rule 1 Rule 3Rule 3Rule 1Rule 1

Page 26: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Transforming NFAs into DFAs (ii)

Example (iii)

Rule 3Rule 3Rule 1Rule 1 Rule 1Rule 1

Page 27: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Transforming NFAs into DFAs (ii)

Example (iv)

Page 28: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Index Problems Goals Background. AToM3. Transforming NFAs into DFAs.

Conclusions and Future work.

Page 29: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Conclusions Meta-Modelling + Graph Transformation is a powerful

combination for Multi-Paradigm Modelling.

AToM3 implements such a combination:

– Meta-Modelling facilitates the generation of modelling tools.

– Graph Transformation facilitates the processing of models (transformation, simulation, optimization, code generation).

Page 30: AToM 3 : A Tool for Multi- Formalism and Meta-Modelling Juan de Lara (1,2) Hans Vangheluwe (2) (1) ETS Informática Universidad Autónoma de Madrid Madrid,

Future Work Extend AToM3:

– Hierarchy. Hierarchical Graph Grammars.

– Meta-Model Inheritance. Formalism inheritance.

– Collaborative Modelling. XML representation.

– Meta-Model UML Class Diagrams.

Implement all the Formalisms and Transformations in the Formalism Transformation Graph.

AToM3 is available at:http://moncs.cs.mcgill.ca/MSDL/research/projects/AToM3/