Synchronization Algebras with Mobility for Graph Transformations joint work with Ugo Montanari Dipartimento di Informatica Università di Pisa Ivan Lanese Dipartimento di Informatica Università di Pisa FGUC 2004, London, 3-4 September 2004
Synchronization Algebras with Mobility for Graph Transformations Roadmap 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 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) 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
Synchronization Algebras with Mobility for Graph Transformations How 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
Synchronization Algebras with Mobility for Graph Transformations Why 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
Synchronization Algebras with Mobility for Graph Transformations Which 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
Synchronization Algebras with Mobility for Graph Transformations Roadmap 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 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
Synchronization Algebras with Mobility for Graph Transformations SHR: 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
Synchronization Algebras with Mobility for Graph Transformations Edge Replacement Systems R L H A production describes how the hyperedge L is transformed into the graph R
Synchronization Algebras with Mobility for Graph Transformations Edge Replacement Systems A production describes how the hyperedge L is transformed into the graph R Many productions can be applied concurrently R R’ L L’ H
Synchronization Algebras with Mobility for Graph Transformations Synchronized 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,...)
Synchronization Algebras with Mobility for Graph Transformations An example: Hoare synchronization All the edges attached to a node must do the same action A1A1 A2A2 a A1A1 A1A1 a=a A2A2 A2A2
Synchronization Algebras with Mobility for Graph Transformations SHR with mobility A1A1 A2A2 a A1A1 A1A1 a =a A2A2 A2A2 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 x x 1 =x 2
Synchronization Algebras with Mobility for Graph Transformations The replicating net Requires the same action on all external nodes Creates a copy of itself for each parameter of the action R a RR x y z Just the case of one action a of arity 1
Synchronization Algebras with Mobility for Graph Transformations The replicating net in action R R R a R R R x1x1 x2x2
Synchronization Algebras with Mobility for Graph Transformations The replicating net in action R R R R R R a R R R R R R
Synchronization Algebras with Mobility for Graph Transformations An algebraic presentation We use judgements to represent graphs To simplify the definition of the semantics Γ G where Γ is a finite set of nodes and G is a term generated by G ::= nil | s(x 1,…,x n ) | G|G | ν x G s is an edge label, x and x 1,…,x n 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 C C C C x y wz
Synchronization Algebras with Mobility for Graph Transformations Transitions as syntactic judgements Transitions: : (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) G 1 G 2 ,,
Synchronization Algebras with Mobility for Graph Transformations Deriving 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 x 1,…,x n L(x 1,…,x n ) G ,,
Synchronization Algebras with Mobility for Graph Transformations Roadmap 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 A tuple 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 A tuple Act: ranked set of actions : partial function Act x Act->Act 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 A tuple Act: ranked set of actions : partial function Act x Act->Act ε: element of Act 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 A tuple Act: ranked set of actions : partial function Act x Act->Act ε: 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
Synchronization Algebras with Mobility for Graph Transformations Synchronization Algebra with Mobility A tuple Act: ranked set of actions : partial function Act x Act->Act ε: 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
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 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 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
Synchronization Algebras with Mobility for Graph Transformations The rule for synchronization
Synchronization Algebras with Mobility for Graph Transformations What 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
Synchronization Algebras with Mobility for Graph Transformations Roadmap 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 Synchronizing input and output: merge of parameters Synchronizing two outputs: the one with lowest priority is discarded n < m
Synchronization Algebras with Mobility for Graph Transformations The 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
Synchronization Algebras with Mobility for Graph Transformations Modelling 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): “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) (w,w) (w,b) A production for each guess on the states of neighbours
Synchronization Algebras with Mobility for Graph Transformations Life (w,b) (w,w) (w,b) (w,w) (b,w)
Synchronization Algebras with Mobility for Graph Transformations Life ok (b,w) (b,b) ok
Synchronization Algebras with Mobility for Graph Transformations Life
Synchronization Algebras with Mobility for Graph Transformations Roadmap 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 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
Synchronization Algebras with Mobility for Graph Transformations Fusion Calculus vs Milner SHR FusionMilner SHR ProcessesGraphs Sequential processesHyperedges NamesNodesParallel comp. ScopeRestriction Sets of indip. transit.Transitions
Synchronization Algebras with Mobility for Graph Transformations Milner synchronization model
Synchronization Algebras with Mobility for Graph Transformations Example z x 1 x 2.R y 1 x 1 x 2.Q x x 1 x 2.P w 1 2 in 1 w out 1 z R y x 1 x 2.Q x 1 2 P w=z
Synchronization Algebras with Mobility for Graph Transformations Changing the synchronization model Let’s choose the broadcast synchronization model create a broadcast Fusion calculus
Synchronization Algebras with Mobility for Graph Transformations Example z x 1 x 2.R y 1 x 1 x 2.Q x x 1 x 2.P w 1 2 R y QP w=z=x in 1 w out 1 z in 1 x
Synchronization Algebras with Mobility for Graph Transformations Roadmap 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 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
Synchronization Algebras with Mobility for Graph Transformations Future 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
Synchronization Algebras with Mobility for Graph Transformations
Bibliography (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 ICTCS’01, 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