atom 3 : a tool for multi- formalism and meta-modelling juan de lara (1,2) hans vangheluwe (2) (1)...

30
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

Upload: barry-payne

Post on 29-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

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

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.

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.

Index Problems Goals

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

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

Multi-Formalism ModellingFormalism Transformation Graph

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.

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

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)

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

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.

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

Index Problems Goals Background.

AToM3.– Meta-Modelling the DFA Formalism.

Transforming NFAs into DFAs. Conclusions and Future work.

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)

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

AToM3(iii) DFA Meta-Model

Semantic information

Edit Properties

Edit Cardinalities

AToM3(iii) DFA Meta-Model

Semantic information

Constraints

AToM3(iv) DFA Meta-Model

Graphical information

Edit Appearance

AToM3(v) DFA Meta-Model

Global Semantic Information and Constraints.

Edit Model Attributes

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

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

Index Problems Goals Background. AToM3.

Transforming NFAs into DFAs.–Example

Conclusions and Future work.

Transforming NFAs into DFAs (i)

Eliminates unreachable states

Joins equivalent states

Eliminates non determinism between two different states

Eliminates non determinism with self-loops.

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

Transforming NFAs into DFAs (ii)

Example (i)

Rule 1Rule 1Rule 3Rule 3

Transforming NFAs into DFAs (ii)

Example (ii)

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

Transforming NFAs into DFAs (ii)

Example (iii)

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

Transforming NFAs into DFAs (ii)

Example (iv)

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

Conclusions and Future work.

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

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/