From Graph Rewriting to Logic Programming - PowerPoint PPT Presentation

About This Presentation
Title:

From Graph Rewriting to Logic Programming

Description:

Synchronized hyperedge replacement to model synchronization, reconfiguration and ... The transmission of an hidden name can provoke an extrusion ... – PowerPoint PPT presentation

Number of Views:74
Avg rating:3.0/5.0
Slides: 29
Provided by: danhi1
Category:

less

Transcript and Presenter's Notes

Title: From Graph Rewriting to Logic Programming


1
From Graph Rewriting to Logic Programming
Ivan Lanese Dipartimento di Informatica Università
di Pisa
joint work with
Ugo Montanari
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
Motivation
  • We propose to use
  • Graphs as a natural way to model systems
  • Synchronized hyperedge replacement to model
    synchronization, reconfiguration and computation

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
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
Edge Replacement Systems
  • Productions A context free production rewrites a
    single edge labeled by L into an arbitrary graph
    R. (Notation L ? R)

L
R
H
3
3
4
4
2
2
1
1
7
Edge Replacement Systems
  • Productions A context free production rewrites a
    single edge labeled by L into an arbitrary graph
    R. (Notation L ? R)

Rewritings of different edges can be executed
concurrently
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
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

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

11
Example
12
Logic Programming
13
Synchronized Logic Programs
  • Goals have no functional symbols goal-graphs
  • Synchronized clauses
  • bodies are goal-graphs
  • heads are A(t1,,tn) where ti is either a
    variable or a single function symbol applied to
    variables
  • Syncronized execution

14
The Ring-Star Example, I
15
The Ring-Star Example, II
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
The In transition
  • nin m.P Q m R
  • mnP Q R

18
Productions for the In transition
19
The In transition
20
The reconfiguration
21
Ambients in logic programming
The starting goal nil(v), c3(x,y,v), n(w,x),
c3(w,a,b), nil(b), c3(p,q,a), in_m.P(p),
Q(q), m(c,y), c3(c,r,d), nil(d), R(r) The final
result nil(v2), m(k2,v2), c3(k2,c2,d2),
nil(d2), c3(h2,r2,c2), R(r2), n(w1,h2),
c3(w1,a1,b1), nil(b1), c3(p1,q1,a1), P(p1),
Q(q1) Easy to execute with a meta-interpreter.
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
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
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
A Notation For Graphs
  • Ring Example

26
Transitions as Judgements
Formalization of synchronized rewriting as
judgements
  • Transitions

?
? G1 ?? ?, D G2
?
?
? ? ? (A x N ) (x, a , y) ? ? if ?(x)
(a , y)
o
D is the set of new names that are used in
synchronization D z ? x. ?(x) (a , y), z
? ?, z ?set(y)
27
Transitions as Judgements
Formalization of synchronized rewriting as
judgements
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
From Synchronized Graph Rewriting to LP
PROLOG metainterpreter for synchronous execution
Write a Comment
User Comments (0)
About PowerShow.com