Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Formal Models for Distributed Negotiations From Petri Nets to Join Calculus Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela.

Similar presentations


Presentation on theme: "1 Formal Models for Distributed Negotiations From Petri Nets to Join Calculus Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela."— Presentation transcript:

1 1 Formal Models for Distributed Negotiations From Petri Nets to Join Calculus Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias Informaticas (ECI 2003), Buenos Aires, July 21-26 2003

2 Formal Models for Distributed Negotiations2 Petri Net Flavors We have already seen that the basic net model can be extended in many ways To model interesting features e.g. read arcs To increase expressiveness e.g. inhibitor arcs Many other variations have been proposed in the literature (stochastic, priorities, time, …) We survey some of them, as incremental extensions (bottom-up), showing that they can also be recovered in the other way round (top-down) starting from a process calculus

3 Formal Models for Distributed Negotiations3 Basic Model: P/T Petri Nets ba cd 2 3 2

4 Formal Models for Distributed Negotiations4 Basic Model: P/T Petri Nets ba cd 2 3 2

5 Formal Models for Distributed Negotiations5 Colured Nets (also High-Level Nets) ba cd y y::y x  |y| x+3 5 1 “s” x 6 structured data as tokens

6 Formal Models for Distributed Negotiations6 Coloured Nets (also High-Level Nets) ba cd y y::y x  |y| x+3 5 4 x 6 structured data as tokens x=1 y=“s” “ss”

7 Formal Models for Distributed Negotiations7 Reconfigurable Nets ba xy y y x c d a x post-sets places depend on fetched values c network reconfigurability vs static connectivity

8 Formal Models for Distributed Negotiations8 Reconfigurable Nets ba xy y y x d a x post-sets places depend on fetched values network reconfigurability vs static connectivity x=c y=c c c c

9 Formal Models for Distributed Negotiations9 Dynamic Nets ba y c d a x firings can generate new net fragments c dynamic control N(x,y)

10 Formal Models for Distributed Negotiations10 From Petri Nets to Dynamic Nets and Back via JOIN The join-calculus is the natural higher order extension of Petri nets More and more restrictive type systems recover all kinds of nets we have seen [Buscemi, Sassone 2001] Dynamic nets (no restriction) Reconfigurable nets (no definitions inside definitions) High level nets (no channel names as messages) Place/Transition nets (no values in messages)

11 Formal Models for Distributed Negotiations11 JOIN-Calculus Well-known asynchronous calculus continuation passing style Distributed implementations JoCaml (http://join.inria.fr) Polyphonic C# Analogous to dynamic coloured Petri nets Running implementation of Zero-Safe Nets CHAM semantics soup of molecules processes definitions

12 Formal Models for Distributed Negotiations12 Chemical Abstract Machine States are called solutions s Multisets of molecules m 1,…,m n data and rules (reflexive CHAM) Hierarchical structure via membranes Group solutions into molecules e.g. {[ s 1, {[ s 2 ]}, {[ s 3, {[ s 4 ]} ]} ]} Evolution (chemical rules) Heating / cooling  (reversible) Structural equivalence Reactions  Transitions Concurrency multiset union

13 Formal Models for Distributed Negotiations13 Background: the Join Calculus Syntax P,Q::=0 | x  ŷ  | def D in P | P|Q D,E::=J  P | D  E J,K::= x  ŷ  | J|K Operational semantics (CHAM Style) 0  P|Q  P,Q D  E  D,E def D in P  D  dn(D), P  dn(D) ( range  dn(D) “globally fresh”) J  P, J   J  P, P  heating and cooling reaction processes definitions patterns

14 Formal Models for Distributed Negotiations14 JOIN: An Example A process P P  z  x,z  | def x  y   z  y,x  in x  v  P as a solution {[ z  x,z , w  y   z  y,w , w  v  ]} A reaction {[ z  x,z , w  y   z  y,w , w  v  ]}  {[ z  x,z , w  y   z  y,w , z  v,w  ]} bound name extrusion defined name received name free name membrane

15 Formal Models for Distributed Negotiations15 Continuation Passing Style I The form of definitions resembles very much let f(x)=E in E’ (typical of functional programming) e.g. same scoping discipline Asynchrony forces us to create and send continuations in join e.g. encoding untyped -calculus [M] v sends the value of M on v a value is a process serving requests a request must supply two names x (channel for requests for the value of the argument) w (to eventually return a value)

16 Formal Models for Distributed Negotiations16 Continuation Passing Style II Call-by-name [x] v = v  x  [ x.M] v = def k  x,w   [M] w in v  k  [MN] v = def y  p   [N] p in def q  c   c  y,v  in [M] q Parallel call-by-value [MN] v = def q  c  |p  y   c  y,v  in [M] q |[N] p

17 Formal Models for Distributed Negotiations17 Example: Cell Abstraction def create  n,c   def get  k  | s  v   k  v  | s  v   set  m,k  | s  v   k  | s  m  in s  n  | c  get,set  A message to create triggers the outermost definition, which in turn defines three fresh names (get,set,s) with local rules and state: get / set are sent back on channel c for later access / update of cell contents; s cannot be extruded and remains local, it models the cell and its contents; the initial value stored in s is the parameter n in the message create; the rules guarantee the invariant of the cell: in every configuration there is exactly one message on s, (with its current value)

18 Formal Models for Distributed Negotiations18 Nets as Join Terms Roughly Places are channels Transitions are definitions Tokens are message values Nets are join processes Different classes of nets corresponds to different classes of terms Note that in general a definition can contain another definition A reduction will release fresh places and transitions Fresh transitions can release tokens in previously existing places, but they cannot fetch tokens from them

19 Formal Models for Distributed Negotiations19 Aim: To identify terms that correspond to P/T Petri nets Three kinds of judgements |- P :  P is ok and contains no def_in_ |- P :  P is ok |- D :  D is ok Type System  0 I

20 Formal Models for Distributed Negotiations20 Type System  0 II |- 0 :  |- x  :  |- P|Q :  |- P :  |- Q :  |- P :  |- P :  |- def D in P :  |- D :  |- P :  |- J  P :  |- P :  rn(J) = {  } |- D  D’ :  |- D :  |- D’ : 

21 Formal Models for Distributed Negotiations21 Type System  1 Aim: To identify terms that correspond to coloured Petri nets Three kinds of judgements (as before) Type environments needed Channels must be kept distinct from messages  set of channel names  set of messages  and  must be disjoint in  ;  |- P : 

22 Formal Models for Distributed Negotiations22 Type System  1 II  ;  |- 0 :   ;  |- P|Q :   ;  |- P :  ;  |- Q :   ;  |- P :   ;  |- P :   ;  |- def D in P :  ,dn(D);  |- D : ,dn(D);  |- P :   ;  |- J  P :   ; ,rn(J) |- P :   ;  |- D  D’ :   ;  |- D :  ;  |- D’ :   ;  |- x  y  :  y  x 

23 Formal Models for Distributed Negotiations23 Results  0 characterizes terms that correspond to P/T Petri nets  1 characterizes terms that correspond to Coloured nets A third type system  2 characterizes terms that correspond to reconfigurable nets A trivial type system  3 characterizes terms that correspond to dynamic nets All type systems Enjoy subject reduction Allow the definition of a behaviour preserving isomorphism between typeable terms and (the corresponding kind of) nets

24 Formal Models for Distributed Negotiations24 Recap We have seen Join calculus Different flavors of Petri nets Corresponding flavors of Join calculus

25 Formal Models for Distributed Negotiations25 References The reflexive chemical abstract machine and the Join calculus (Proc. POPL’96, ACM, pp. 372-385) C. Fournet, G. Gonthier High-level Petri nets as type theories in the Join-calculus (Proc. FoSSaCS’01, LNCS 2030, pp. 104-120) M. Buscemi, V. Sassone


Download ppt "1 Formal Models for Distributed Negotiations From Petri Nets to Join Calculus Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela."

Similar presentations


Ads by Google