300 likes | 579 Views
AToM 3 : A T ool f o r M ulti-Formalism and M eta- M odelling. Juan de Lara (1,2) Hans Vangheluwe (2). (2) School of Computer Science McGill University Montreal, Canada. (1) ETS Informática Universidad Autónoma de Madrid Madrid, Spain. Problems.
E N D
AToM3: ATool for Multi-Formalism and Meta-Modelling Juan de Lara(1,2) Hans Vangheluwe(2) (2) School of Computer Science McGill University Montreal, Canada (1) ETS Informática Universidad Autónoma de Madrid Madrid, Spain
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 Modelling Formalism 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) • Introduce higher modelling layers to model the formalisms themselves. Order Description Example Meta-Meta Model Models of (meta-) formalisms, which can be used to describe other formalisms • Models of: • Entity-Relationship Diagrams • UML class Diagrams • ... Meta- Model Models of formalisms. • Models of: • Deterministic Finite Automata • DFD, Structure Charts • Ordinary Differential Equations • ... Model The description of an object in a certain formalism. • f´(x) = -sin(x), f(0) = 0 (in the • ODEs formalism). • ...
Meta-Modelling (iii) • Example: 0..N 1..1 1 State Name: String Type: (I, R, F) StateTransition.forAll(t1, t2|t1.Condition<>t2.Condition) 1 S0 S1 Transition Condition: String 0..N 1 1..1 0 0 S2 S3 • Constraints • distinctStateNames: 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) 0 Model: Even binary numbers (DFA) Meta-Model: DFA formalism (“UML” class diagram + OCL)
Meta-Modelling (iv) E-R E-R (meta-meta-model) E-R DFA (meta-model) Meta-Modelling Tool (AToM3 Kernel) • User Input: • Create entities • Delete entities • Verify conditions • (local, global) DFA Even Binary Numbers Meta-Modelling Tool (AToM3 Kernel) • User Input: • Create entities • Delete entities • Verify conditions • (local, global) (model)
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) Graphical Icons User Interface Model ASG Nodes Structure ASG Structure (meta-meta-model) E-R E-R Graph Rewriting Processor Graphical Model Abstract Syntax Graph (meta-model) Meta-Modelling Tool (AToM3 Kernel) User Interface E-R DFA Constraint Manager Code Generator • User Input: • Create entities • Delete entities • Verify conditions • (local, global) DFA Even Binary Numbers Meta-Modelling Tool (AToM3 Kernel) (model) • User Input: • Create entities • Delete entities • Verify conditions • (local, global)
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 Cardinalities Edit Properties
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.
Transforming NFAs into DFAs (ii) Rule 3: Eliminates non determinism between two different states RHS LHS 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) Example (i) Rule 3 Rule 1
Transforming NFAs into DFAs (ii) Example (ii) Rule 1 Rule 1 Rule 3
Transforming NFAs into DFAs (ii) Example (iii) Rule 1 Rule 1 Rule 3
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/