Title: Synchronization Algebras with Mobility for Graph Transformations
1Synchronization Algebras with Mobility for Graph
Transformations
FGUC 2004, London, 3-4 September 2004
Ivan Lanese Dipartimento di Informatica
Università di Pisa
joint work with Ugo Montanari Dipartimento di
Informatica Università di Pisa
2Roadmap
- Introduction
- Background Synchronized Hyperedge Replacement
- Synchronization algebras with mobility
- Parametric inference rules
- Examples
- An application to Fusion Calculus
- Conclusion and future work
3Roadmap
- Introduction
- Background Synchronized Hyperedge Replacement
- Synchronization algebras with mobility
- Parametric inference rules
- Examples
- An application to Fusion Calculus
- Conclusion and future work
4How to model systems (I)
- Systems are not built directly over the assembler
language and the hardware functionalities - infrastructure makes some primitives available
- TCP/IP, RPC, Bluetooth
- systems are built on top of these primitives
- To model systems we need
- to model the primitives of the infrastructure
- to model systems using these primitives
5How to model systems (II)
- To model infrastructure
- synchronization algebras
- extended with mobility and local resources
- To model systems
- graph transformations
- we use the Synchronized Hyperedge Replacement
(SHR) approach
6Why graphs?
- Are a natural model for distributed systems
- Represent the spatial structure
- Suggestive visual representation
- Sound mathematical foundations
- Are a concurrent model
- Graph transformations model system computation
and reconfiguration
7Which graphs?
- We use hypergraphs with labeled (hyper)edges
- Subset of nodes (free nodes) as interface
- important for compositionality
- Computational interpretation
- edges are processes or systems
- nodes are links or ports
- synchronization is performed via shared nodes
8Roadmap
- Introduction
- Background Synchronized Hyperedge Replacement
- Synchronization algebras with mobility
- Parametric inference rules
- Examples
- An application to Fusion Calculus
- Conclusion and future work
9The Synchronized Hyperedge Replacement approach
- An approach to graph transformation aimed at
modeling distributed systems - productions with local effects
- composition via synchronization with mobility
- Implementable in a distributed setting since
- applying a production is a local operation
- synchronization can be performed using a
distributed algorithm
10SHR a 2 step approach
- Productions to describe the behaviour of single
hyperedges - Hyperedges rewritten into generic graphs
- Constraints on surrounding nodes
- Global constraint-solving algorithm to derive
transitions - To select which productions can be applied
- Allows to define complex transformations
11Edge Replacement Systems
- A production describes how the hyperedge L is
transformed into the graph R
12Edge Replacement Systems
- A production describes how the hyperedge L is
transformed into the graph R
Many productions can be applied concurrently
13Synchronized Hyperedge Replacement
- We associate actions to nodes attached to edges
to be rewritten - A transition is allowed iff the synchronization
constraints associated to nodes are satisfied - Many synchronization models are possible (Milner,
Hoare, ...)
14An example Hoare synchronization
- All the edges attached to a node must do the same
action
a
?
A2
A2
15SHR with mobility
- We introduce name mobility
- Actions carry tuples of references to nodes (new
or already existent) - References associated to synchronized actions are
matched and corresponding nodes are merged
altx1gtaltx2gt
altxgt
A1
A1
?
x
x1x2
A2
A2
16The replicating net
- Requires the same action on all external nodes
- Creates a copy of itself for each parameter of
the action
17The replicating net in action
R
R
R
18The replicating net in action
R
R
R
R
R
R
19An algebraic presentation
- We use judgements to represent graphs
- To simplify the definition of the semantics
- G G where G is a finite set of nodes and G is a
term generated by - G nil s(x1,,xn) GG ?x G
- s is an edge label, x and x1,,xn are nodes
- ? is a binder for x
- We require that G contains at least names in fn(G)
?
20Example ring
21Transitions as syntactic judgements
- ? ? ? (Act x N)
- Associates to each external node its action and
its tuple of references to nodes - ? ??? is an idempotent substitution (forces
merges on nodes)
22Deriving transitions
- Productions
- Transitions are generated from productions by
applying a suitable set of inference rules - Inference rules are parametric w.r.t. the
synchronization model, which is expressed by an
algebra
?,?
x1,,xn L(x1,,xn) ?? ? G
?
?
23Roadmap
- Introduction
- Background Synchronized Hyperedge Replacement
- Synchronization algebras with mobility
- Parametric inference rules
- Examples
- An application to Fusion Calculus
- Conclusion and future work
24Synchronization Algebra with Mobility
- A tuple ltAct,,e,Init,Fin,Mobgt
- Act ranked set of actions
- partial function Act x Act-gtAct
- e element of Act
- Init subset of Act
- Fin subset of Act
- Mob set of mobility patterns
25Synchronization Algebra with Mobility
- A tuple ltAct,,e,Init,Fin,Mobgt
- Act ranked set of actions
- partial function Act x Act-gtAct
- Defines action composition
- Undefined if the actions can not synchronize
- Returns the composed action otherwise
- e element of Act
- Init subset of Act
- Fin subset of Act
- Mob set of mobility patterns
26Synchronization Algebra with Mobility
- A tuple ltAct,,e,Init,Fin,Mobgt
- Act ranked set of actions
- partial function Act x Act-gtAct
- e element of Act
- corresponds to no synchronization
- Init subset of Act
- Fin subset of Act
- Mob set of mobility patterns
27Synchronization Algebra with Mobility
- A tuple ltAct,,e,Init,Fin,Mobgt
- Act ranked set of actions
- partial function Act x Act-gtAct
- e element of Act
- Init subset of Act
- contains trivial actions that can be produced on
isolated nodes - Fin subset of Act
- Mob set of mobility patterns
28Synchronization Algebra with Mobility
- A tuple ltAct,,e,Init,Fin,Mobgt
- Act ranked set of actions
- partial function Act x Act-gtAct
- e element of Act
- Init subset of Act
- Fin subset of Act
- contains actions that correspond to completed
synchronizations (only actions in Fin are allowed
on hidden nodes) - Mob set of mobility patterns
29What is a mobility pattern
c
a
b
30Example Hoare synchronization
31Roadmap
- Introduction
- Background Synchronized Hyperedge Replacement
- Synchronization algebras with mobility
- Parametric inference rules
- Examples
- An application to Fusion Calculus
- Conclusion and future work
32Parametric inference rules
- Set of rules for composing productions
- Rules that allow to derive transitions for each
graph starting from productions - disjoint union
- merging of nodes ? synchronization
- adding a new node
- hiding a node
33The rule for synchronization
34What we have obtained?
- Make the dimensions of infrastructure modelling
and system modelling orthogonal - Unify different existing models from SHR
literature - Hoare and Milner synchronizations
- Allow to model more complex primitives as
required in global computing systems
35Roadmap
- Introduction
- Background Synchronized Hyperedge Replacement
- Synchronization algebras with mobility
- Parametric inference rules
- Examples
- An application to Fusion Calculus
- Conclusion and future work
36Priority communication
37Priority communication mobility
- Synchronizing input and output
- merge of parameters
- Synchronizing two outputs
- the one with lowest priority is discarded
n lt m
38The Game of Life
- A cellular automata a grid of interconnected
cells that can be alive or not (empty) - A living cell stays alive if it has 2 or 3 alive
neighbours, dies otherwise - A dead cell becomes alive if it has 3 alive
neighbours
39Modelling the Game of Life
- Edges with labels A (alive) and E (empty)
- Edges share an hidden node with each neighbour
- At each step a node must communicate its state
and get the state of the neighbours - Action (a,e) Im alive, I argue you are empty
- Sinchronizations such as (a,e)(e,a)ok
- ok is the only non trivial final action
- No mobility
40Life productions
?
- A production for each guess on the states of
neighbours
41Life
(w,w)
(b,w)
(b,w)
(w,b)
(w,b)
(w,w)
(w,b)
(w,w)
(b,w)
(w,w)
(w,b)
(w,b)
(w,w)
(w,w)
(b,w)
(b,w)
42Life
(b,w)
(b,w)
(b,b)
(b,b)
(b,b)
(b,b)
(b,b)
(b,b)
(b,b)
(b,b)
(b,b)
(b,b)
(b,b)
ok
(b,b)
ok
ok
(b,b)
(b,b)
ok
ok
ok
ok
ok
ok
ok
ok
(b,b)
ok
(b,b)
ok
(b,w)
(b,b)
ok
ok
ok
(b,b)
(b,b)
ok
ok
ok
ok
ok
ok
ok
(b,b)
ok
ok
ok
(b,b)
(b,b)
(b,b)
ok
ok
ok
(b,w)
(b,w)
(b,b)
(b,b)
(b,b)
(b,b)
(b,b)
(b,b)
(b,b)
(b,b)
(b,b)
(b,b)
43Life
44Roadmap
- Introduction
- Background Synchronized Hyperedge Replacement
- Synchronization algebras with mobility
- Parametric inference rules
- Examples
- An application to Fusion Calculus
- Conclusion and future work
45Mapping Fusion Calculus into SHR
- SHR is expressive enough to model Fusion Calculus
processes - Fusion Calculus can be (easily) mapped into SHR
with Milner synchronization - We will not present the mapping in detail
- The induced semantics is
- correct transitions are preserved
- concurrent SHR transitions correspond to sets of
indipendent Fusion transitions
46Fusion Calculus vs Milner SHR
- Fusion Milner SHR
- Processes Graphs
- Sequential processes Hyperedges
- Names Nodes
- Parallel comp. Parallel comp.
- Scope Restriction
- Sets of indip. transit. Transitions
47Milner synchronization model
48Example
49Changing the synchronization model
- Lets choose the broadcast synchronization model
? create a broadcast Fusion calculus
50Example
51Roadmap
- Introduction
- Background Synchronized Hyperedge Replacement
- Synchronization algebras with mobility
- Parametric inference rules
- Examples
- An application to Fusion Calculus
- Conclusion and future work
52Conclusions
- We have extended a known approach to graph
transformations by making it parametric w.r.t.
the synchronization model - We have presented some possible applications
- We have mapped Fusion Calculus into SHR
- We have derived for free a broadcast Fusion
calculus
53Future work
- Define and study an abstract semantics
- Which equivalence is induced on Fusion processes?
- Consider nodes with different synchronization
models in the same graph - Apply synchronization algebras with mobility to
other formalisms - Apply SHR to bigraphs?
- Implementation
54Questions?
55Bibliography (1)
- For Synchronized Hyperedge Replacement
- P. Degano and U. Montanari. A model for
distributed systems based on graph rewriting.
Journal of ACM 34(2), 1987 - D. Hirsch and U. Montanari. Synchronized
hyperedge replacement with name mobility. Proc.
of CONCUR 2001, LNCS, 2001 - G. Ferrari, U. Montanari and E. Tuosto. A lts
semantics of ambients via graph synchronization
with mobility. Proc. of ICTCS01, LNCS 2202, 2001 - For synchronization algebras
- G. Winskel. Event structures. LNCS 255, 1986
- For Fusion Calculus vs SHR
- I. Lanese and U. Montanari. A graphical Fusion
Calculus. Proc. of CoMeta final workshop, ENTCS,
to appear