Download presentation
Presentation is loading. Please wait.
1
1 Ivan Lanese Dipartimento di Informatica Università di Pisa Ugo Montanari From Graph Rewriting to Logic Programming joint work with
2
2 Outline Graph rewriting as a metamodel Graphical presentation of systems Synchronized hyperedge replacement (SHR) SHR with name mobility Translation into logic programming Ambients in SHR Modelling local names Conclusions
3
3 Motivation We propose to use: Graphs as a natural way to model systems Synchronized hyperedge replacement to model synchronization, reconfiguration and computation
4
4 A very general framework Synchronized hyperedge replacement can be used to model: Network structures and reconfigurations Software architectures Process-calculi ( -calculus, Ambient calculus, …)
5
5 A Strategy in Two Steps Local graph transformations: –Modular description of the system –Easy to implement in a distributed environment Global constraint solving: –Allows complex synchronizations and rewritings
6
6 Edge Replacement Systems Productions: A context free production rewrites a single edge labeled by L into an arbitrary graph R. (Notation: L R) L 1 2 3 4 R 1 2 3 4 H
7
7 Edge Replacement Systems Productions: A context free production rewrites a single edge labeled by L into an arbitrary graph R. (Notation: L R) R R’ 1 2 3 4 1 2 3 Rewritings of different edges can be executed concurrently L L’ 1 2 3 4 1 2 3 H
8
8 Synchronized Hyperedge Replacement Synchronized rewriting: Actions are associated to nodes in productions. A rewriting is allowed if its actions satisfy the synchronization requirements associated to nodes How many edges synchronize depends on the synchronization policy Synchronized rewriting propagates synchronization all over the graph
9
9 Synchronized Hyperedge Replacement Hoare Synchronization: All adjacent edges must produce the same action on the shared node Milner Synchronization: Only two of the adjacent edges synchronize by matching their complementary actions a a a 3 3 B1A1 B2A2 Hoare synchronization
10
10 Adding Mobility Synchronized rewriting with name mobility – Allow declaration of new nodes in productions – Add to an action in a node a tuple of names that it wants to communicate – The names of synchronized actions are pairwise matched and the corresponding nodes merged a (x) (y) B1A1 a = a B2A2 a a x= y
11
11 Example b) x C Brother C C C C C C CCC (4)(3)(2)(1) Star Rec. S S SS (5) x Initial Graph C Brother: C C C CS Star Reconfiguration: (w) r(w)
12
12 Logic Programming
13
13 Synchronized Logic Programs Goals have no functional symbols: goal-graphs Synchronized clauses –bodies are goal-graphs –heads are A(t 1,…,t n ) where t i is either a variable or a single function symbol applied to variables Syncronized execution
14
14 The Ring-Star Example, I y C x y C z C x x, yC(x,y) {(x, y x, y z.C(x,z) | C(z,y) y C x y S x r (w) x, yC(x,y) {(x,r, ), (y,r, )} x, y S(w,y)
15
15 The Ring-Star Example, II x C C C C C C C CCC S S SS
16
16 A challenging example: Ambient calculus SHR as a semantic framework for Ambient calculus Ambients naturally form trees Connectors to simulate Milner synchronization Computations formed by activity steps and reconfiguration steps
17
17 The In transition a)n[in m.P | Q] | m[ R ] b)m[n[P | Q] | R]
18
18 Productions for the In transition
19
19 The In transition
20
20 The reconfiguration
21
21 Ambients in logic programming The starting goal: nil(v), c 3 (x,y,v), n(w,x), c 3 (w,a,b), nil(b), c 3 (p,q,a), in_m.P(p), Q(q), m(c,y), c 3 (c,r,d), nil(d), R(r) The final result: nil(v 2 ), m(k 2,v 2 ), c 3 (k 2,c 2,d 2 ), nil(d 2 ), c 3 (h 2,r 2,c 2 ), R(r 2 ), n(w 1,h 2 ), c 3 (w 1,a 1,b 1 ), nil(b 1 ), c 3 (p 1,q 1,a 1 ), P(p 1 ), Q(q 1 ) Easy to execute with a meta-interpreter.
22
22 Adding restriction Graphs can be extended with a restriction operator Transitions on hidden nodes are not seen from the outside The transmission of an hidden name can provoke an extrusion The SHR rules can be extended to deal with the restriction operator
23
23 Back to logic programming Logic programming with restriction: An extension of logic programming with the restriction operator Allows a uniform treatment of restriction to goal variables and of anonymous variables Introduce a step-by-step semantics of name visibility The synchronized version is in correpondence with SHR
24
24 Conclusions and Future Work Graph rewriting as a general model An useful semantic framework for process-calculi Useful connections between SHR and logic programming: –Implementations of SHR systems –Logic programming with restriction General synchronizations for graph rewriting
25
25 x,y z, w. C(x,w) | C(w,y) | C (y,z) | C(z,x) A Notation For Graphs Ring Example w z
26
26 : (A x N* ) (x, a, y) if (x) = (a, y) Transitions as Judgements Formalization of synchronized rewriting as judgements Transitions G 1 , G 2 is the set of new names that are used in synchronization = {z | x. (x) = (a, y), z , z set(y)} o
27
27 Transitions as Judgements Formalization of synchronized rewriting as judgements Derivations 0 G 0 1 G 1 … n G n 11 22 nn x 1,…,x n L(x 1,…,x n ) x 1,…,x n, G Productions Free names can: i) be added to productions; and ii) merged Identity productions are always available Transitions are generated from the productions by applying the transition rules of the chosen synchronization mechanism
28
28 From Synchronized Graph Rewriting to LP PROLOG metainterpreter for synchronous execution
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.