Synchronizations with Mobility for Graph Transformations joint work with Ugo Montanari Dipartimento...

Preview:

Citation preview

Synchronizations with Mobility for Graph Transformations

joint work withUgo MontanariDipartimento di Informatica Università di Pisa

Ivan LaneseDipartimento di Informatica Università di Pisa

Dagstuhl seminar, Germany, 7-11 June 2004

Synchronizations with Mobility for Graph

Transformations

Roadmap Aims of the work Background: Synchronized Hyperedge

Replacement Parametric inference rules Abstract semantics Expressiveness Conclusions and future work

Synchronizations with Mobility for Graph

Transformations

Roadmap Aims of the work Background: Synchronized Hyperedge

Replacement Parametric inference rules Abstract semantics Expressiveness Conclusions and future work

Synchronizations with Mobility for Graph

Transformations

Aims of the work (1) To develop an expressive framework for

graph transformation We base on Synchronized Hyperedge Replacement

Rules with local effects Composition via synchronization with mobility

Different synchronizations mechanisms for different applications

Different applicative scenarios Modeling network reconfigurations Modeling software architectures Giving a graphical semantics to calculi for mobility

Synchronizations with Mobility for Graph

Transformations

Aims of the work (2) To define an abstract semantics

For reasoning on behavioural properties The abstract semantics must be

compositional

Synchronizations with Mobility for Graph

Transformations

Roadmap Aims of the work Background: Synchronized Hyperedge

Replacement Parametric inference rules Abstract semantics Expressiveness Conclusions and future work

Synchronizations with Mobility for Graph

Transformations

Why graphs? Are a natural model for distributed

systems Represent the spatial structure Are a concurrent model

Give a more suggestive representation for process calculi Easy to understand Semantically sound

Synchronizations with Mobility for Graph

Transformations

Which graphs? We use hypergraphs with labeled

(hyper)edges Subset of nodes (free nodes) as interface

Important for the abstract semantics Computational interpretation:

Edges are processes or systems Nodes are links or ports Synchronization is performed via shared nodes

Synchronizations with Mobility for Graph

Transformations

Judgements 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(x1,…,xn) | G|G | νx G s is an edge label, x and x1,…,xn are nodes ν is a binder for x

We require that Γ contains at least names in fn(G)

Synchronizations with Mobility for Graph

Transformations

x,y z, w. C(x,w) | C(w,y) | C (y,z) | C(z,x)

Example: ring

w z

In this case arrows identify the second attachment node

Synchronizations with Mobility for Graph

Transformations

SHR: a 3 step approach Productions to describe the behaviour of

single hyperedges: Local effects (easier to implement) 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

Finally transitions are applied

Synchronizations with Mobility for Graph

Transformations

Edge Replacement Systems

R

1

2 3 4

L

12 3 4 H

A production describes how the hyperedge L is transformed into the graph R

Synchronizations 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’

1

2 3 4

1

2

3

L

L’

12 3 4

1

2

3

H

Synchronizations 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, ...)

Synchronizations with Mobility for Graph

Transformations

An example: Milner synchronization

Pairs of edges can synchronize by doing complementary actions

aa a

3 3

B1 A1

B2 A2

Synchronizations with Mobility for Graph

Transformations

SHR 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

a<x> a<y>

(x) (y)

B1 A1

a<x> ~ a<y>

B2 A2

a<x> a<y>

x= y

Synchronizations with Mobility for Graph

Transformations

Example

b)

x CBrother

C

C

C

C

C

C

CC CBrother Brother

(4)(3)(2)(1)

Star Rec.S

S

SS

(5)

x

Initial Graph

C

Brother:

C

C

C

C S

Star Reconfiguration:

(w)

r(w)

r(w)

Synchronizations 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)

G1 G2

,

Synchronizations 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

x1,…,xn L(x1,…,xn) G

,

Synchronizations with Mobility for Graph

Transformations

Roadmap Aims of the work Background: Synchronized Hyperedge

Replacement Parametric inference rules Abstract semantics Expressiveness Conclusions and future work

Synchronizations with Mobility for Graph

Transformations

Synchronization Algebra with Mobility

A quintuple <Act,•,Init,Fin,ε> 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

Synchronizations with Mobility for Graph

Transformations

Synchronization Algebra with Mobility (2)

Init, Fin: subsets of Act Init contains trivial actions that can be

produced on isolated nodes Fin contains actions that correspond to

completed synchronizations (only actions in Fin are allowed on hidden nodes)

ε: element of Act ε corresponds to “no synchronization”

Synchronizations with Mobility for Graph

Transformations

Example: Milner synchronization

Synchronizations with Mobility for Graph

Transformations

The rule for synchronization

yx

GUGx

GGyx

/

'|'|,

'||,,','

,

'

,

)ar(

n\n

|'

,\)dom())(n),((act

)|)(n,(

)dom(

)|mgu(

),()(),,()(

U

yxzzz

xba

mlmlwv

wbyvax

x

c

if (z)'

(x)'

possiblewhenever in tivesrepresenta choose we where

Synchronizations with Mobility for Graph

Transformations

Roadmap Aims of the work Background: Synchronized Hyperedge

Replacement Parametric inference rules Abstract semantics Expressiveness Conclusions and future work

Synchronizations with Mobility for Graph

Transformations

Abstract semantics We use the standard concept of

bisimulation

symmetric and

||

||||

iff ||

'2

'2

'1

'

'2

'2

,22

'1

',11

2211

1

1

GG

GGGG

GG

Synchronizations with Mobility for Graph

Transformations

Properties of abstract semantics

Two bisimilar graphs have the same interface We can add isolated nodes to the interface

to compare graphs with different interfaces The abstract semantics is compositional

We build a suitable algebra for judgements We prove that bisimilarity is a congruence

w.r.t. the operators of the algebra

Synchronizations with Mobility for Graph

Transformations

Algebra We use an algebra in the style of

Bauderon & Courcelle Algebra generated by the operators

(modulo axioms) We consider graphs typed by their

interfaces We have classes of typed operators

Synchronizations with Mobility for Graph

Transformations

Algebra for judgements Nil : empty graph sx1,x2,...,xn : edge s with n attachment nodes - || - : union of graphs with disjoint

interfaces x,y - : merge of x and y (x representative) !x - : creation of isolated node x ?x - : hiding of node x

Synchronizations with Mobility for Graph

Transformations

The idea of the proof Inference rules can be written in De

Simone format using the algebraic operators

All the axioms bisimulate Bisimulation is a congruence thanks to

standard results on bialgebras Turi-Plotkin and Buscemi-Montanari

Synchronizations with Mobility for Graph

Transformations

Roadmap Aims of the work Background: Synchronized Hyperedge

Replacement Parametric inference rules Abstract semantics Expressiveness Conclusions and future work

Synchronizations with Mobility for Graph

Transformations

Example: routing We want to use graphs to model

dynamically evolving routers We use two kinds of edges R (router) and

L (link) of arity 3 and 2 Edges can execute complementary actions

on two of their attachment nodes and create links among nodes whose names are matched

Synchronizations with Mobility for Graph

Transformations

A sample production

),(|),(|),,(|,,,,,,

),,(|,, ,),,,(),,,,(,,,

smLrlLyzxRsrmlzyx

yzxRzyx idsraymlazx

Synchronizations with Mobility for Graph

Transformations

Bisimilar routers A router is characterized by its interface S

and its connection relation Conn is the set of pairs of nodes that are

connected by disjoint paths Bisimilarity captures exactly this notion of

equivalence

)( SSConn

Synchronizations with Mobility for Graph

Transformations

Changing the synchronization model

We can use for routers the broadcast synchronization model

Synchronizations with Mobility for Graph

Transformations

Routers with broadcast synchronization

Multicast is now allowed Different equivalence on graphs

The left one can send messages from any node to any other

The right one broadcasts messages from any node to the other two

If names are transmitted new broadcast groups are created

Synchronizations with Mobility for Graph

Transformations

Mapping Fusion Calculus into SHR

SHR is expressive enough to model Fusion Calculus processes Fusion Calculus can be mapped into Milner

SHR We will not present the mapping in

detail The induced semantics is concurrent

Many actions at the same time on different channels

Synchronizations with Mobility for Graph

Transformations

Fusion Calculus vs Milner SHRFusion Milner SHR

Processes Graphs

Sequential processes Hyperedges

Names Nodes

Parallel comp. Parallel comp.

Scope Restriction

Sets of conc. transit. Transitions

Synchronizations with Mobility for Graph

Transformations

Example).|.|.)(( RzyQyxPuxxy

)||)((

).|.|)(().|.|.)(( )(

RQPy

RzyQyxPyRzyQyxPuxxyzx

uxx

We can also execute both the steps at the same time

Synchronizations with Mobility for Graph

Transformations

An apparent mismatch Bisimulation is a congruence in SHR but

not in Fusion Calculus The reason: SHR semantics is concurrent In Fusion ux.vy+vy.ux≈ux|vy but the

bisimulation relation is not preserved by a context that merges u and v

In SHR the two terms are not bisimilar since the second one can execute both the prefixes at the same time

Synchronizations with Mobility for Graph

Transformations

Roadmap Aims of the work Background: Synchronized Hyperedge

Replacement Parametric inference rules Abstract semantics Expressiveness Conclusions and future work

Synchronizations 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 defined a suitable abstract semantics through bisimilarity

We have proven that bisimilarity is a congruence

We have presented some possible applications

Synchronizations with Mobility for Graph

Transformations

Future work Study the properties of our bisimilarity

Which equivalence is induced on Fusion processes?

Allow different kinds of mobility (until now essentially Fusion style moblity)

Consider nodes with different synchronization models in the same graph

Apply synchronization algebras with mobility to other formalisms

Synchronizations 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 abstract semantics for SHR B. König and U. Montanari. Observational equivalence for

synchronized graph rewriting. Proc. of TACS’01, LNCS 2215, 2001

Synchronizations with Mobility for Graph

Transformations

Bibliography (2) For synchronization algebras

G. Winskel. Event structures. LNCS 255, 1986 For algebras for graphs

M. Bauderon and B. Courcelle. Graph expressions and graph rewriting. Math. Systems Theory 20, 1987

For results on bialgebras D. Turi and G. Plotkin. Towards a mathematical

operational semantics. Proc. of LICS’97, 1997 M. Buscemi and U. Montanari. A first order coalgebraic

model of pi-calculus early observational equivalence. Proc. of CONCUR’02, LNCS 2421, 2002

For Fusion Calculus vs SHR I. Lanese and U. Montanari. A graphical Fusion Calculus.

Proc. of CoMeta final workshop, ENTCS, to appear

Synchronizations with Mobility for Graph

Transformations

Synchronizations with Mobility for Graph

Transformations

Conditions on synchronization algebras

(a'))(a),((a'')a''a'Act aa,a',a''

bbaInitiActa

aiaaiActInit,ai

Init,Finε

εa'aεa'Act.aa,a'

ararmaxar

that such

undefined is or either

iff

ecommutativ and eassociativ isoperator The

Recommended