1 CoMeta, final workshop, 15-16-17/12/2003 Ivan Lanese Dipartimento di Informatica Università di...

31
1 CoMeta, final workshop, 15-16-17/12/2003 Ivan Lanese Dipartimento di Informatica Università di Pisa Ugo Montanari A graphical Fusion Calculus Joint work with:
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    214
  • download

    0

Transcript of 1 CoMeta, final workshop, 15-16-17/12/2003 Ivan Lanese Dipartimento di Informatica Università di...

1CoMeta, final workshop, 15-16-17/12/2003

Ivan LaneseDipartimento di Informatica

Università di Pisa

Ugo Montanari

A graphical Fusion Calculus

Joint work with:

2CoMeta, final workshop, 15-16-17/12/2003

Roadmap

Aims

Fusion Calculus

Synchronized Hyperedge Replacement

Mapping Fusion Calculus into SHR

Beyond SHR: logic programming

Conclusion

3CoMeta, final workshop, 15-16-17/12/2003

Aims of the work

Give a more intuitive presentation for Fusion Calculus

Applying process calculi to distributed systems is not intuitive because of:

– Interleaving semantics– The same operators describes topology and

allowed behaviours Comparing two apparently quite different

formalisms: Fusion Calculus and Synchronized Hyperedge Replacement

– Extending a similar work on π-calculus (Hirsch)

4CoMeta, final workshop, 15-16-17/12/2003

Fusion Calculus vs SHR: an overview

Fusion Calculus SHR

Process calculus Graph transformation

Algebraic model Graphical representation (but also algebraic notation...)

Interleaving Concurrent

Milner synchronization Different allowed synchronization models

5CoMeta, final workshop, 15-16-17/12/2003

Fusion Calculus

It is an evolution of -calculus Simpler and more symmetric but also more

expressive Introduce fusion of names

6CoMeta, final workshop, 15-16-17/12/2003

Syntax for Fusion Calculus

Agents:

S::=i i.Pi

P::=0 | S | P1|P2 | (x)P | rec X. P | X

nameson relation eequivalenc:

||::

:actions Free

xuxu

7CoMeta, final workshop, 15-16-17/12/2003

Structural congruence

Process: agent up-to the following laws:– | and + are associative, commutative and with 0 as

unit -conversion– (x)0 = 0, (x)(y)P=(y)(x) P– P|(x)Q=(x)(P|Q) if x not free in P– rec X.P=P[rec X.P/X]

8CoMeta, final workshop, 15-16-17/12/2003

SOS semantics

''',,'

')(,,\,'

')()()n(,'

/')(,,'

'|'|

,','

|'|

'

'

'

.

)(

)(

\

QQQPQPPP

PPzzzuyxzPP

PzPzzPP

zxPPzxzxzPP

QPQP

yxQQPP

QPQP

PP

PQP

PP

PP

xuyz

xuy

z

yx

yuxu

PREF

PAR

COM

SUM

PASS

SCOPE

STRUCT

OPEN

9CoMeta, final workshop, 15-16-17/12/2003

Graph transformation

Graphs naturally represent the topology of the system

Synchronized Hyperedge Replacement for modeling computation, synchronization, reconfiguration

Powerful metamodel:

– Different process calculi: Ambient, π, ...

– Software architecture

– ...

10CoMeta, final workshop, 15-16-17/12/2003

SHR: a 2 step approach

Productions to describe the behaviour of single hyperedges:

– Local effects (easyer to implement)– Hyperedges rewritten into generic graphs– Constraints on surrounding nodes

Global constraint-solving algorithm:– Allows to define complex transformations

11CoMeta, final workshop, 15-16-17/12/2003

Edge Replacement Systems

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

R

1

2 3 4

L

1

2 3 4 H

12CoMeta, final workshop, 15-16-17/12/2003

Edge Replacement Systems

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

R

R’

1

2 3 4

1

2

3

Many concurrent rewritings are allowed

L

L’

1

2 3 4

1

2

3

H

13CoMeta, final workshop, 15-16-17/12/2003

Synchronized Hyperedge Replacement

Synchronized rewritings: we associate actions

to surrounding nodes. A rewriting is allowed iff the

synchronization constraints associated to nodes

are satisfied

Many synchronization models are possible

(Hoare, Milner, ...)

14CoMeta, final workshop, 15-16-17/12/2003

Synchronized Hyperedge Replacement

Milner synchronization: pair of edges can synchronize by doing complementary actions

aa a

3 3

B1 A1

B2 A2

15CoMeta, final workshop, 15-16-17/12/2003

SHR with mobility

a<x> a<y>

(x) (y)

B1 A1

a<x> ~ a<y>

B2 A2

a<x> a<y>

x= y

– Actions carry tuple of references to nodes (new or already

existant)

– References associated to synchronized actions are matched and

corresponding nodes are merged

We introduce name mobility

16CoMeta, final workshop, 15-16-17/12/2003

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)

17CoMeta, final workshop, 15-16-17/12/2003

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

Algebraic notation for graphs

Example: ring

w z

18CoMeta, final workshop, 15-16-17/12/2003

: (A x N* ) (x, a , y) if (x) = (a , y)

Associate to each external node its action and its tuple of names: is an idempotent substitution (forces some merges on nodes)

Rewritings as syntactic judgements

Rewriting:

G1 G2

,

19CoMeta, final workshop, 15-16-17/12/2003

Rewritings as syntactic judgements

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

Productions

,

Rewritings generated from productions by applying a suitable set of inference rules (determined by the synchronization model)

Derivations

0 G0 1 G1 … n Gn

1,1 2,2 n,n

20CoMeta, final workshop, 15-16-17/12/2003

Fusion Calculus vs SHR

Fusion SHR

Processes Graphs

Sequential processes Hyperedges

Names Nodes

Parallel comp. Parallel comp.

Scope Restriction

Transitions Rewritings

21CoMeta, final workshop, 15-16-17/12/2003

Translation

PxPx

PPPP

SLSS

)(

||

))(fnarray(

nil0

2121

ˆ

with agreeing on substituti

xoutuxu

xinuxu

n

n

names) canonical(with for form standard : ˆ SS

Using structural congruence we can avoid recursion at top-level

22CoMeta, final workshop, 15-16-17/12/2003

Productions

One for each possible action of a standard process

'ˆ PP '|ˆ| PP

'ˆ PP )'(|)(ˆ| PP

23CoMeta, final workshop, 15-16-17/12/2003

Correspondence theorem

We use special rules to force an interleaving behaviour in SHR

Bijective correspondence between transitions and rewritings

'PP '|,| PP E

'PP )'(|)(| PP

24CoMeta, final workshop, 15-16-17/12/2003

Example

).|.|.)(( RzyQyxPuxxy

)||)((

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

RQPy

RzyQyxPyRzyQyxPuxxyzx

uxx

With normal SHR we can execute both the steps at the same time

25CoMeta, final workshop, 15-16-17/12/2003

Beyond SHR: logic programming

Logic programming is a well developed programming paradigm– Useful for implementation purposes

Which logic programming?– Not only refutations but general partial computation

– Limit logic programming to have a correspondence between it and SHR systems: Synchronized Logic Programming» Can be meta-interpreted into standard logic programming

26CoMeta, final workshop, 15-16-17/12/2003

The correspondence

Correspondence between SHR with Hoare synchronization and Synchronized Logic Programming– Do you remember last year presentation?

SHR SLP

Graphs Goals

Nodes Variables

Productions Clauses

Transitions Big-steps

Synchronization Unification

27CoMeta, final workshop, 15-16-17/12/2003

Synchronized Logic Programming

Graphs are goals without functional symbols and constants

Big-steps: sequence of SLD steps between “graphs”

Functional symbols for modeling actions (unification for synchronization)

Logic programming has no restriction operator: we can introduce it

28CoMeta, final workshop, 15-16-17/12/2003

From fusion to logic programming

One further step is needed:– Implementing Milner synchronization using Hoare

synchronization– Not so easy in a mobile environment– Auxiliary structures for implementing Milner nodes

29CoMeta, final workshop, 15-16-17/12/2003

Conclusion

Fusion Calculus a “subcalculus” of interleaving Milner SHR

– Essentially two kinds of actions– One action at the time

Graphical representation for Fusion Calculus– Separation between topology of the system and behaviour

Cross-fertilization between the two models:– Concurrent semantics for Fusion Calculus– Extension of hyperequivalence to general SHR rewritings– Changing the synchronization model of Fusion Calculus

30CoMeta, final workshop, 15-16-17/12/2003

Example

PPuxy uxy.

QPQzwuPuxy wyzx |.|. ,

xzQPQzwuPuxyx wy /)|().|.)((

31CoMeta, final workshop, 15-16-17/12/2003

Recursion example

).)(.().)(.( )( XuxxXrecXuxxXrec uyy

),,(|,

),,(|

).)(.(.

),,().)(.(.

321

1

321

uzuLzyu

uyuLyu

XxxxXrecxx

yinuXxxxXrecxx

),,()(|,,

),,(|,,

33).)(.(.321

),,(321).)(.(.321

321

211

321

xxxLxxxx

xxxLxxx

XxxxXrecxx

xinxXxxxXrecxx

Production:

Corresponding rewriting: