30 March 2005, IPA lentedagen, BredaGraph-Based State Spaces1 Graph Transformation for Model...
-
date post
20-Dec-2015 -
Category
Documents
-
view
219 -
download
0
Transcript of 30 March 2005, IPA lentedagen, BredaGraph-Based State Spaces1 Graph Transformation for Model...
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 1
Graph Transformation for Model Transformation
Arend RensinkUniversity of Twente
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 2
Overview
• Scenario
• Outline of the presentation– Requirements– Principles– Example– Practice– Next step– Final words
A-Model A-B Trafo B-Model
Language A A-B Trafo Def
Trafo Def Language
Language B
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 3
Requirements: What do we need?• Reasoning about models– Instances of different meta-models– Need common representation
• Idea: graphs as common representation– Powerful yet simple– Natural for many models – Theory of graph transformation available
• Some aspects not covered well– Cardinality and inheritance in meta-models– Ordered associations– Attributes
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 4
Example: ASG to FG
• Abstract Syntax Graph model
Statementnext
1
0..1
AssignIfWhile
body
else
then 0..11
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 5
Example: ASG instance
• Programready = false;while (! ready) {
if (x < max) {x = x*x;ready =
true;} else {
ready = false;
}}
• Graph Assign
While
If
Assign
Assign
Assign
next
body
then
next
else
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 6
Target model: Flow Graphs
Element
flow
1 2
Procedure Stop
flow
Predicate
nondeterministic choice
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 7
Example: FG instance
• ASG Assign
While
If
Assign
Assign
Assign
next
body
then
next
else
• FG Proc
Pred
Pred
Proc
Proc
Proc
flow
flow
flow
flow
flow
Stop
flow flow
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 8
Trafo Def: set of rulesstart
assign
if-else
stop
if-no-else while
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 9
Graph formalism
• Graphs in this presentation:– flat (i.e., not hierarchical), untyped– directed, edge-labelled, no parallel edges– self-edges depicted as node labels
• Formally: G = (L,N,E) with– L set of labels– N finite set of nodes– E N L N finite set of labelled edges
• Partial morphisms– structure-preserving node mappings
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 10
forbidden
Graph ProductionsProduction rule
source graph
matching
Concrete transformation
src(t) tgt(t)morph(t) target
graph
pushout
NACNACNACs
(SPO = Single Pushout Approach)
LHS RHSrule morphism
(partial)
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 11
Example production ruleAlternative single-graph representation
blue = eraser:LHS, not RHS;
to be matched and deleted
green = creator:
RHS, not LHS;to be added
black = reader:LHS and RHS;
to be matched and preserved
red = embargo:
NAC, not LHS;forbidden
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 12
B-Model
Lang B
Application scenario
• Overhead: Transformation to and from graphs– Price for common representation
• Graph transformations inefficient– Graph matching inherently complex (NP-complete)– Domain-specific transformations superior– Graph Trafo can serve as specification
A-B Trafo
A-B Prod Syst
Graph Production Systems
A-Graph
A-Type
A-Model
Lang A
B-Graph
B-Type
should be reversible
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 13
Graphs everywhere
• Other modelling domains (meta-models)– XSD/XML– ERD schemas/databases– Class/object diagrams
• Certain patterns emerge– Commonalities among modelling
domains– Should be formulated on MOF level
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 14
Practice: What is available?
• BOTL (München) – Bidirectional O-o Transformation Language– Transforms object models to object models
• FuJaBA (Paderborn, Kassel)– From UML to Java and Back Again– Generates Java code from enriched activity
diagrams
• ATOM3 (Madrid)– A Tool for Multi-Formalism Meta-Modelling– Transforms any model at any meta-level
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 15
Next step: Dynamic Semantics• Current research mostly on static semantics– Models: Class diagrams, ERD schemes, XML
schemas– Instances: Objects, ER databases, XML documents
• Dynamic semantics: how do systems behave?– Can be expressed as changes on instance level– These can also be seen as transformations– Graph transformations for operational semantics– Aim: Semantics-preserving model transformations
• NWO project: GRASLAND– Graphs for Software Language Definition– Aim: Generic semantic definition language
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 16
TAAL Experiment[Kleppe, Rensink,
Kastenberg]
• Example O-Olanguage
• Transformations
dynamic semantics
ASG to FGmeta-levelshift
GROOVE
30 March 2005, IPA lentedagen, Breda
Graph-Based State Spaces 17
Final words• MDA: Cool idea– Good intuitions– Poor mathematical backing
• Graph transformation: Promising approach– Good mathematical backing– Useful for formalizing principles– Questionable for practical transformations
• State of the art– A lot of work at the stage of (small) case studies– We need engineering discipline
(Who’s going to write the XSD meta-model in MOF?)