FGUC 2004 London 3 4 September 2004 Synchronization
FGUC 2004, London, 3 -4 September 2004 Synchronization Algebras with Mobility for Graph Transformations Ivan Lanese Dipartimento di Informatica Università di Pisa joint work with Ugo Montanari Dipartimento di Informatica Università di Pisa
Roadmap n n n n Introduction Background: Synchronized Hyperedge Replacement Synchronization algebras with mobility Parametric inference rules Examples An application to Fusion Calculus Conclusion and future work Synchronization Algebras with Mobility for Graph Transformations
Roadmap n n n n Introduction Background: Synchronized Hyperedge Replacement Synchronization algebras with mobility Parametric inference rules Examples An application to Fusion Calculus Conclusion and future work Synchronization Algebras with Mobility for Graph Transformations
How to model systems (I) n Systems are not built directly over the assembler language and the hardware functionalities n infrastructure makes some primitives available n n n TCP/IP, RPC, Bluetooth… systems are built on top of these primitives To model systems we need n n to model the primitives of the infrastructure to model systems using these primitives Synchronization Algebras with Mobility for Graph Transformations
How to model systems (II) n To model infrastructure n n n synchronization algebras extended with mobility and local resources To model systems n n graph transformations we use the Synchronized Hyperedge Replacement (SHR) approach Synchronization Algebras with Mobility for Graph Transformations
Why graphs? n Are a natural model for distributed systems n n n Represent the spatial structure Suggestive visual representation Sound mathematical foundations Are a concurrent model Graph transformations model system computation and reconfiguration Synchronization Algebras with Mobility for Graph Transformations
Which graphs? We use hypergraphs with labeled (hyper)edges Subset of nodes (free nodes) as interface n n n important for compositionality Computational interpretation: n n edges are processes or systems nodes are links or ports synchronization is performed via shared nodes Synchronization Algebras with Mobility for Graph Transformations
Roadmap n n n n Introduction Background: Synchronized Hyperedge Replacement Synchronization algebras with mobility Parametric inference rules Examples An application to Fusion Calculus Conclusion and future work Synchronization Algebras with Mobility for Graph Transformations
The Synchronized Hyperedge Replacement approach n An approach to graph transformation aimed at modeling distributed systems n n n productions with local effects composition via synchronization with mobility Implementable in a distributed setting since n n applying a production is a local operation synchronization can be performed using a distributed algorithm Synchronization Algebras with Mobility for Graph Transformations
SHR: a 2 step approach Productions to describe the behaviour of single hyperedges n n n Hyperedges rewritten into generic graphs Constraints on surrounding nodes Global constraint-solving algorithm to derive transitions n n n To select which productions can be applied Allows to define complex transformations Synchronization Algebras with Mobility for Graph Transformations
Edge Replacement Systems n A production describes how the hyperedge L is transformed into the graph R L R 2 3 1 4 H 2 3 4 1 Synchronization Algebras with Mobility for Graph Transformations
Edge Replacement Systems n A production describes how the hyperedge L is transformed into the graph R L R 2 3 4 H 2 3 1 1 2 2 3 L’ 4 R’ 3 Many productions can be applied concurrently Synchronization Algebras with Mobility for Graph Transformations
Synchronized Hyperedge Replacement n n n 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, . . . ) Synchronization Algebras with Mobility for Graph Transformations
An example: Hoare synchronization n All the edges attached to a node must do the same action a=a a A 1 A 1 A 2 A 2 Synchronization Algebras with Mobility for Graph Transformations
SHR with mobility n We introduce name mobility n n Actions carry tuples of references to nodes (new or already existent) References associated to synchronized actions are matched and corresponding nodes are merged a<x 1>=a<x 2> a<x> A 2 x A 1 A 1 x 1=x 2 A 2 Synchronization Algebras with Mobility for Graph Transformations A 2
The replicating net n n n Requires the same action on all external nodes Creates a copy of itself for each parameter of the action Just the case of one action a of arity 1 a<x> a<y> x R a<z> R y R z Synchronization Algebras with Mobility for Graph Transformations
The replicating net in action a<x 1> a<x 2> x 1 x 2 R R R Synchronization Algebras with Mobility for Graph Transformations
The replicating net in action a<y 1> a<y 2> a<y 3> a<y 4> R R R Synchronization Algebras with Mobility for Graph Transformations
An algebraic presentation We use judgements to represent graphs n n Γ G where Γ is a finite set of nodes and G is a term generated by n n n To simplify the definition of the semantics G : : = nil | s(x 1, …, xn) | G|G | νx G s is an edge label, x and x 1, …, xn are nodes ν is a binder for x We require that Γ contains at least names in fn(G) Synchronization Algebras with Mobility for Graph Transformations
Example: ring x C C w z C C y Synchronization Algebras with Mobility for Graph Transformations
Transitions as syntactic judgements n Transitions: n n n G 1 , G 2 : (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) Synchronization Algebras with Mobility for Graph Transformations
Deriving transitions n Productions n G n L(x 1, …, xn) , x 1, …, xn 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 Synchronization Algebras with Mobility for Graph Transformations
Roadmap n n n n Introduction Background: Synchronized Hyperedge Replacement Synchronization algebras with mobility Parametric inference rules Examples An application to Fusion Calculus Conclusion and future work Synchronization Algebras with Mobility for Graph Transformations
Synchronization Algebra with Mobility n n n n A tuple <Act, • , ε, Init, Fin, Mob> Act: ranked set of actions • : partial function Act x Act->Act ε: element of Act Init: subset of Act Fin: subset of Act Mob: set of mobility patterns Synchronization Algebras with Mobility for Graph Transformations
Synchronization Algebra with Mobility n n n A tuple <Act, • , ε, Init, Fin, Mob> Act: ranked set of actions • : partial function Act x Act->Act n n n n Defines action composition Undefined if the actions can not synchronize Returns the composed action otherwise ε: element of Act Init: subset of Act Fin: subset of Act Mob: set of mobility patterns Synchronization Algebras with Mobility for Graph Transformations
Synchronization Algebra with Mobility n n A tuple <Act, • , ε, Init, Fin, Mob> Act: ranked set of actions • : partial function Act x Act->Act ε: element of Act n n corresponds to “no synchronization” Init: subset of Act Fin: subset of Act Mob: set of mobility patterns Synchronization Algebras with Mobility for Graph Transformations
Synchronization Algebra with Mobility n n n A tuple <Act, • , ε, Init, Fin, Mob> Act: ranked set of actions • : partial function Act x Act->Act ε: element of Act Init: subset of Act n n n contains trivial actions that can be produced on isolated nodes Fin: subset of Act Mob: set of mobility patterns Synchronization Algebras with Mobility for Graph Transformations
Synchronization Algebra with Mobility n n n A tuple <Act, • , ε, Init, Fin, Mob> Act: ranked set of actions • : partial function Act x Act->Act ε: element of Act Init: subset of Act Fin: subset of Act n n contains actions that correspond to completed synchronizations (only actions in Fin are allowed on hidden nodes) Mob: set of mobility patterns Synchronization Algebras with Mobility for Graph Transformations
What is a mobility pattern a • b = c Synchronization Algebras with Mobility for Graph Transformations
Example: Hoare synchronization Synchronization Algebras with Mobility for Graph Transformations
Roadmap n n n n Introduction Background: Synchronized Hyperedge Replacement Synchronization algebras with mobility Parametric inference rules Examples An application to Fusion Calculus Conclusion and future work Synchronization Algebras with Mobility for Graph Transformations
Parametric inference rules n n Set of rules for composing productions Rules that allow to derive transitions for each graph starting from productions n n disjoint union merging of nodes synchronization adding a new node hiding a node Synchronization Algebras with Mobility for Graph Transformations
The rule for synchronization Synchronization Algebras with Mobility for Graph Transformations
What we have obtained? n n Make the dimensions of infrastructure modelling and system modelling orthogonal Unify different existing models from SHR literature n n Hoare and Milner synchronizations Allow to model more complex primitives as required in global computing systems Synchronization Algebras with Mobility for Graph Transformations
Roadmap n n n n Introduction Background: Synchronized Hyperedge Replacement Synchronization algebras with mobility Parametric inference rules Examples An application to Fusion Calculus Conclusion and future work Synchronization Algebras with Mobility for Graph Transformations
Priority communication Synchronization Algebras with Mobility for Graph Transformations
Priority communication: mobility n Synchronizing input and output: n n merge of parameters Synchronizing two outputs: n the one with lowest priority is discarded n < m Synchronization Algebras with Mobility for Graph Transformations
The Game of Life n n n 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 Synchronization Algebras with Mobility for Graph Transformations
Modelling the Game of Life n n n n 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): “I’m alive, I argue you are empty” Sinchronizations such as (a, e) • (e, a)=ok ok is the only non trivial final action No mobility Synchronization Algebras with Mobility for Graph Transformations
Life productions (w, b) n (w, b) (w, w) (w, b) A production for each guess on the states of neighbours Synchronization Algebras with Mobility for Graph Transformations
Life (b, w) (w, b) (w, w)(w, w) (w, b) (w, w) (b, w) Synchronization Algebras with Mobility for Graph Transformations
Life (b, b) (b, w) (b, b) (b, b) (b, b) (b, w) (b, b) (b, b) ok ok ok ok ok (b, b) ok ok (b, w) ok ok (b, w) (b, b) (b, b) (b, b) Synchronization Algebras with Mobility for Graph Transformations (b, b) (b, b) (b, w)
Life Synchronization Algebras with Mobility for Graph Transformations
Roadmap n n n n Introduction Background: Synchronized Hyperedge Replacement Synchronization algebras with mobility Parametric inference rules Examples An application to Fusion Calculus Conclusion and future work Synchronization Algebras with Mobility for Graph Transformations
Mapping Fusion Calculus into SHR n SHR is expressive enough to model Fusion Calculus processes n n n Fusion Calculus can be (easily) mapped into SHR with Milner synchronization We will not present the mapping in detail The induced semantics is n n correct: transitions are preserved concurrent: SHR transitions correspond to sets of indipendent Fusion transitions Synchronization Algebras with Mobility for Graph Transformations
Fusion Calculus vs Milner SHR Fusion Processes Sequential processes Names Parallel comp. Scope Sets of indip. transit. Milner SHR Graphs Hyperedges Nodes Parallel comp. Restriction Transitions Synchronization Algebras with Mobility for Graph Transformations
Milner synchronization model Synchronization Algebras with Mobility for Graph Transformations
Example x 1 x 2. P 2 w 1 in 1 w y out 1 z 1 x 1 x 2. R 1 x 1 x 2. Q 2 P y 1 x 1 x 2. Q 2 x x w=z 2 z Synchronization Algebras with Mobility for Graph Transformations R
Changing the synchronization model n Let’s choose the broadcast synchronization model create a broadcast Fusion calculus Synchronization Algebras with Mobility for Graph Transformations
Example x 1 x 2. P 2 w 1 in 1 w y in 1 x out 1 z 1 x 1 x 2. R 1 x 1 x 2. Q 2 x P y w=z=x 2 z Synchronization Algebras with Mobility for Graph Transformations R Q
Roadmap n n n n Introduction Background: Synchronized Hyperedge Replacement Synchronization algebras with mobility Parametric inference rules Examples An application to Fusion Calculus Conclusion and future work Synchronization Algebras with Mobility for Graph Transformations
Conclusions n n n 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 n We have derived for free a broadcast Fusion calculus Synchronization Algebras with Mobility for Graph Transformations
Future work n Define and study an abstract semantics n n n 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 Synchronization Algebras with Mobility for Graph Transformations
Synchronization Algebras with Mobility for Graph Transformations
Bibliography (1) n For Synchronized Hyperedge Replacement n n For synchronization algebras n n 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 ICTCS’ 01, LNCS 2202, 2001 G. Winskel. Event structures. LNCS 255, 1986 For Fusion Calculus vs SHR n I. Lanese and U. Montanari. A graphical Fusion Calculus. Proc. of Co. Meta final workshop, ENTCS, to appear Synchronization Algebras with Mobility for Graph Transformations
- Slides: 55