Graph Transformation and Software Technology Chapter 1
Proc (A4) ; if [product available] then Proc(A5) else Proc(A8) ⦠receive order ; ... using two simple rules: delete isolated nodes remove successive.
Graph Transformation and Software Technology Chapter 1: Motivation Reiko Heckel Software Technology Group
Outline Why it is fun Where it comes from What it is good for
Concept of the course
Why it is fun: Programming By Example StageCast (www.stagecast.com): a visual programming environment for kids (from 8 years on), based on behavioral rules associated to graphical objects visual pattern matching simple internal control structures (priority, sequence, nondeterminism, ...) external keyboard control
Î
Rule-based behavior modeling is a natural and intuitive paradigm!
Example: A simple PacMan game; concrete (StageCast) vs. abstract (graph-based) presentation.
States of the PacMan Game: Graph-Based Presentation :Ghost :Field
:Field
:Field
:Field
:Field
:PacMan marbles=3 :Marble
:Field
instance graph (represents a single state; abstracts from spatial layout)
typing
Ghost *
cardinalities (specify additional constraints on well-typed instance graphs)
1
Field 1 * Marble
1 *
PacMan marbles:int
type graph (specifies legal instance graphs Æ state space)
Rules of the PacMan Game: Graph-Based Presentation, PacMan pm:PacMan marbles=m
:Marble
f1:Field
f2:Field
pm:PacMan f1:Field
pm:PacMan marbles=m+1
collect f1:Field
pm:PacMan
movePM f2:Field
f2:Field
f1:Field
f2:Field
PacMan’s rules: collect has priority over movePM
Rules of the PacMan Game: Graph-Based Presentation, Ghost g:Ghost
:PacMan
f1:Field
f2:Field
g:Ghost f1:Field
g:Ghost
kill f1:Field
g:Ghost
moveGhost f2:Field
f2:Field
f1:Field
f2:Field
Ghost’s rules: kill has priority over moveGhost
Graph Transformation :Field
:Ghost
:Field
:Field
:Field
:Field
:PacMan marbles=3 marbles=4 :Marble
:Field
typing
Ghost *
1
Field 1 * Marble
1 *
PacMan marbles:int
collect ; kill
Where it all comes from … Chomsky Grammars
Term Rewriting
Petri Nets
Graph Transformation and Graph Grammars
Chomsky Grammars: Transforming Strings Production A Æ aAb as graph grammar production (represents path expression anbn) 2:
A
3:
1:
a
2:
A
3:
b
4:
Graph grammars: formal language theory for graphical structures Language
hierarchies (e.g. what are context free graph grammars, and how useful can they be) Decidability and complexity results Parsing algorithms
Petri Nets: Transforming (Multi-) Sets A PT net transition as graph transformation rule A
2 C
B
a1:A a2:A
b1:B
b2:B
c:C
Graph transformation: modeling and analysis of concurrent systems Relation
with Petri nets (use of analysis tools, transfer of concepts) Independence, causality, and conflicts of rules Semantics of concurrency
Term Rewriting: Transforming Trees or DAGs Term rewrite rules (directed equations):
x*0Æ0 x * s(y) Æ (x * y) + x
Transformation of trees or directed acyclic graphs (DAGs)? or
Graph rewriting: efficient implementation of equational
deduction (in functional programming, code optimization in compiler and DBMS)
Relation with term rewriting Termination and confluence
.. and what it is good for Chomsky Grammars
Term Rewriting
Petri Nets
Graph Transformation and Graph Grammars
Diagram Languages
Graph-based Computation
Model and Program Transformation
9
Behaviour Modelling and Visual Programming
Graph-based Language Definition Example: activity diagrams compiled to imperative program, in two phases 1. 2.
if [product available] then Proc(A5) else Proc(A8) … receive order ; check availability ; if [product available] then calculate prize; send receipt else notify client
check availability
4
2
[product available]
[product not available]
calculate prize notify client
1
3
6
8 send receipt
7
5
.. and what it is good for Chomsky Grammars
Term Rewriting
Petri Nets
Graph Transformation and Graph Grammars
9 Diagram
Languages
Graph-based Computation
Model and Program Transformation
9 Behaviour
Modelling and Visual Programming
Model (and Program) Transformation
Explain statechart in terms of equivalent finite automaton
new auction offer something auction running
make bid
make bid no bid
some bid timeout
Flattening Rule: Incoming Transition
s1
a
s2 b s3
s1
a
s2 b s3
Transition from state s1 to the boundary of a complex state represents a transition from s1 to the initial state of the complex state
Flattening Rule: Outgoing Transitions
s1
s2 a
b s3
a
s2 b
s1 a
s3
Transition from boundary of complex state to state s1 represents corresponding transitions from all substates to s1
.. and what it is good for Chomsky Grammars
Term Rewriting
Petri Nets
Graph Transformation and Graph Grammars
9 Diagram Languages
9 Graph-based Computation
Model and Program Transformation
9 Behaviour Modelling and Visual Programming
Bridges of Königsberg (Euler 1736)
walk across each of the bridges exactly once, returning to the starting place
Euler Graph
contains only nodes with even numbers of links
can be reduced to a loop
using two simple rules:
remove successive pair of links
delete isolated nodes
Chinese Postman (Kwan 1962)
travel across each link to deliver mail, but minimize the amount of additional walking
Eulerization
add links between pairs of nodes with an odd number of links each x
x+1
if x and y are odd, add link in between y
y+1
Graph is Eulerian as soon as rule is no longer applicable
Application in Software Engineering: Model-Based Testing
Test a web site by following each link at least once, but minimize additional navigation
.. and what it is good for Chomsky Grammars
Tree Transformations
Petri Nets
Graph Transformation and Graph Grammars
9
9
Graph-based Language Definition
Graph-based Computation
9 Model and Program Transformation
9 Behaviour Modelling and Visual Programming
The Message
Graphs are everywhere: they provide representations for many real-world and computer science problems Program
states Diagrams City maps …
Graph transformation rules are the most natural way to model the manipulation of graphs
Concept of the Course Application-oriented mix Foundations Theory Applications Tools
For example Ægraph
grammars Æcontext-freeness Ædiagram languages ÆDiaGen
Next lectures: Graph
Transformation in a Nutshell: Introduction to basic oncepts Mathematical Background: How to build a formalism
cutting-edge technology based solutions. - Our R&D ... training. TECHNOLOGICAL. - Trend to blend technology and medicine ;. >> RFID .... Core Competencies.
... to that of the spacing of the main reinforcement, only staggered (not to exceed ... In general, the truss members in these bents have very large slenderness ...
as Jean-Pierre Serre, a lover of small and charming special cases, observed, .... de la noter noir sur blanc, de peur d'avoir l'air de bombiner, au lieu de taper sur un .... some mathematical assertion or other, and David Ruelle recalls that once, ..
Jun 2, 2010 - erenceâ in PDF format, which contains, among other things, the information that was ...... Version (or portions of such combination), to make, use, sell, offer for sale, have .... granted shall survive any termination of this License.
Jun 2, 2010 - A future version of VirtualBox will also support packages that ...... are most likely identical across VMs and therefore achieves most of the pos-.
will look something like this: 2. In the Available Module (left) pane, left-click on the .... China. Tel: 86-10-85282100 Fax: 86-10-85282104. China - Chengdu.
Oct 24, 2009 - method and a distance between attributed graphs are defined. ..... ing graphs require the use of a fast but yet effective graph distance.
compression ignition engine and few people remember its inventor or the ... This statement made in 1878 so impressed Diesel that from then on, the idea of a ...
In the past it was common practice to teach structural analysis and stress analysis, or theory of structures and strength of materials as they were frequently known ...
chapter briefly reviews DVLO theory, and then reviews some notable ..... different values of shear stress could be increased (drag reduction) or decreased.
... point was the. 1920s. With increased household incomes in North America and Europe ... In the postâWorld War II (WWII) era we saw a second boom in the manufacturing ... level of production automation, whose competitiveness will heavily depend .
structure, we examined fragmented bones from various museum collections and we collected Computed .... Tokio: National Science. Museum Monographs. p ...
The classical methods and tools used in signal processing are often ...... A: the matrix on which the search occurs. %. %. % ... tool for viewing the different planes.
more visually due to the appearance of false contours (loss on the face and the shoulder). â« For the image on the right: quantization is carried out with a 2 bits per ...
Determine the events A,. B,C,Au B,BuC,An B,AnC,BnC,andAn B. = (k: k is even) = (2, 4, 6, . .... P(@)=l-P(S)=l-1=0. 1.20. Verify Eq. (1.27). Let A c B. Then from the ...
A thesis outline (presented as a flow chart) relating aspects of the development ..... Summary. The hydrological environment of Eucalyptus gomphocephala, while well ...... (1996) A global analysis of root distributions for terrestrial biomes.
phrase structure grammar; and it outlines its strengths and limits .! lOther recent formal ... for the most part we don't know what algorithm or computing machinery the brain uses ...... In a nutshell , FLR problems ignore grammars , parsing , and ..
not use the X register for indexed addressing may use X as a temporary storage cell, or accumulator. The following ...... PC= PC + 1 = $04A8. TEMP =(PC)= $17.
Always road test your car after servicing. ... Check and adjust the contact breaker points (Section 13). . Check the alternator and ..... part-load running. The filter ...
problems while the engine and accessories are cool. ...... pinion rubber gaiter, and gripping the track rod. ...... multi-plug and the air bypass hose from the valve.
finite element discretization methods have been the most successful, but to use them it is necessary to discretize the field .... iterative adjustment of the control functions in elliptic systems. ..... allow the boundary points to move over a surfac