Download presentation
Presentation is loading. Please wait.
1
1 Formal Models for Distributed Negotiations Concurrent Languages Translation 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 Process Description Languages In concurrency there have been two mainstream paradigms Petri-net like Process Description Languages (PDL) Simplified concurrent programming languages Primitives resembles conceptual activities Focus on certain aspects of interaction Not mere mathematical abstraction Inspiration of real programming languages Role analogous to that of -calculus for sequential languages
3
Formal Models for Distributed Negotiations3 PDL Examples CCS [Milner] / CSP [Hoare] Calculus of Comm. Systems / Comm. Sequential Processes pi-calculus [Milner, Parrow, Walker] name passing ambient calculus [Cardelli, Gordon] mobile environments spi-calculus [Abadi, Gordon] / Security Process Algebra [Focardi, Gorrieri] cryptography / security join-calculus [Fournet, Gonthier] unique receptor Linda [Gelernter] / KLAIM [De Nicola, Ferrari, Pugliese] shared and distributed dataspaces
4
Formal Models for Distributed Negotiations4 PDL Ingredients Processes / Agents encode both states and programs Mostly based on message passing Syntax Processes are terms over a signature e.g. parallel composition, input prefix, restriction, nondeterministic choice possibly modulo some structural axioms E e.g. associativity of parallel composition, commutativity of choice Operational semantics Labeled Transition System (LTS) over suitable observable actions Defined by SOS inference rules taking advantage of the signature The transitions of a complex agent are defined in terms of the transitions of its constituent agents Reduction semantics Often exploit structural axioms to give unconditional reduction
5
Formal Models for Distributed Negotiations5 Abstract Semantics Studying behavioral equivalences is fundamental More efficient agents can replace obsolete agents Trace equivalence Set of possible executions Bisimilarity Takes into account the branching structure of the LTS May / Must testing Test agents only under suitable scenarios Barbed bisimilarity Unlabeled bisimilarity + state predicates (barbs) Better be congruences! SOS formats can guarantee that
6
Formal Models for Distributed Negotiations6 Traces vs Bisimulation Bisimilarity is the largest binary relation on agents such that if P Q then: if P P’ then there exists Q’ such that Q Q’ and P’ Q’ vice versa a.b+a.ca.(b+c) bc 00 b+c 00 aa bc a bc
7
Formal Models for Distributed Negotiations7 Simple Process Algebra (SPA) Syntax P ::= 0 | a?P | a!P | P\a | P|P Operational semantics Actions {a?,a!} { } a?P P a? input prefix a!P P a! output prefix P\a Q\a P Q a!,a? channel restriction P|R Q|R P Q R|P R|Q P Q parallel composition P|Q P’|Q’ P P’ a? Q Q’ a! internal action
8
Formal Models for Distributed Negotiations8 Truly Concurrent Semantics The abstract semantics we have seen are called interleaving Actions are performed sequentially Petri nets can provide truly concurrent semantics in a natural way Encoding PDL in finite nets is not always possible (expressiveness gap) requires complex constructions (combinatorial explosion of states / transitions) e.g. parallel composition must synchronize all pairs of complementary actions
9
Formal Models for Distributed Negotiations9 Why Zero-Safe Nets To exploit Zero-Safe nets to compose the models of smaller systems according to the PDL signature The encoding must preserve “the semantics” NPNP … NQNQ … |= N P|Q a?a!a?a! …
10
Formal Models for Distributed Negotiations10 Channels are encoded as zero places a? and a! Input, output and synchronization as transactions in a, out a, syn a Z({a 1,…,a n }) = Z a 1 … Z a n The Idea in a out a syn a a?a! ZaZa
11
Formal Models for Distributed Negotiations11 A-interfaced net: I=(B,A,f) B is a Zero-Safe net A={a 1,…,a n } f:Z(A) B is an injective map The agent P is modeled by a chan(P)-interfaced net [P], where chan(P) denote the non restricted channels of P We let u [P] denote the initial marking of [P] {a 1,…,a n }-Interfaced Nets [P] … f(Z a n )f(Z a 1 ) u [P]
12
Formal Models for Distributed Negotiations12 Inactive agent 0 [0] = (B 0, , ) Input prefix a?P If a chan(P) We add a NEW place a?P A NEW transition t a?P :a?P u [P] a? u [a?P] = a?P otherwise We add the channel a to the interface We add a copy of Z a We extend the injective mapping in the obvious way We proceed as before The Encoding I B0B0
13
Formal Models for Distributed Negotiations13 Inactive agent 0 [0] = (B 0, , ) Input prefix a?P If a chan(P) We add a NEW place a?P A NEW transition t a?P :a?P u [P] a? u [a?P] = a?P otherwise We add the channel a to the interface We add a copy of Z a We extend the injective mapping in the obvious way We proceed as before The Encoding I B0B0 [P] … f(Z a ) u [P]
14
Formal Models for Distributed Negotiations14 Inactive agent 0 [0] = (B 0, , ) Input prefix a?P If a chan(P) We add a NEW place a?P A NEW transition t a?P :a?P u [P] a? u [a?P] = a?P otherwise We add the channel a to the interface We add a copy of Z a We extend the injective mapping in the obvious way We proceed as before The Encoding I B0B0 [P] … f(Z a ) u [P] B [a?P] a?P
15
Formal Models for Distributed Negotiations15 Inactive agent 0 [0] = (B 0, , ) Input prefix a?P If a chan(P) We add a NEW place a?P A NEW transition t a?P :a?P u [P] a? u [a?P] = a?P otherwise We add the channel a to the interface We add a copy of Z a We extend the injective mapping in the obvious way We proceed as before The Encoding I B0B0 [P] … f(Z a ) u [P] B [a?P] t a?P
16
Formal Models for Distributed Negotiations16 Inactive agent 0 [0] = (B 0, , ) Input prefix a?P If a chan(P) We add a NEW place a?P A NEW transition t a?P :a?P u [P] a? u [a?P] = a?P otherwise We add the channel a to the interface We add a copy of Z a We extend the injective mapping in the obvious way We proceed as before The Encoding I B0B0 [P] … f(Z a ) u [P] B [a?P] t a?P
17
Formal Models for Distributed Negotiations17 Output prefix a!P Analogous to input Restriction P\a Let [P]=(B,A,f) [P\a]=(B’,A’,f’) B’ is obtained from B by removing transitions f(in a ) and f(out a ), if present A’ = A-{a} f’ = f| Z(A’) u [P\a] = u [P] The Encoding II [P] … f(Z a ) u [P] B [P\a]
18
Formal Models for Distributed Negotiations18 [P 2 ] Parallel composition P 1 |P 2 Let [P 1 ]=(B 1,A 1,f 1 ) and [P 2 ]=(B 2,A 2,f 2 ) Let Z = Z(A 1 ) Z(A 2 ) [P 1 |P 2 ]=(B,A,f) A = A 1 A 2 B is the union of B 1 and B 2 where f 1 (Z) and f 2 (Z) are collapsed f = f 1 f 2 u [P 1 |P 2 ] = u [P 1 ] u [P 2 ] The Encoding III [P 1 ] … u [P 1 ] B [P 1 |P 2 ] f 1 (Z) f 2 (Z) … u [P 2 ]
19
Formal Models for Distributed Negotiations19 Example: [a?0] t a?0 syn a 0 a?0 in a out a
20
Formal Models for Distributed Negotiations20 Example: [b?a?0] t a?0 syn a 0 a?0 t b?a?0 in a out a syn b in b out b
21
Formal Models for Distributed Negotiations21 Example: [a!0] syn a in a out a t a!0 0
22
Formal Models for Distributed Negotiations22 Example: [b?a?0|a!0] t a?0 syn a 0 a?0 t b?a?0 in a out a syn b in b out b t a!0 0
23
Formal Models for Distributed Negotiations23 Example: [(b?a?0|a!0)\a] t a?0 0 t b?a?0 syn b in b out b t a!0 0
24
Formal Models for Distributed Negotiations24 Abstract net t a?0 0 t b?a?0 syn b in b out b t a!0 0 a?0 b? b?a?0a!0 00 Proposition: The abstract net of [P] under the CTPh and ITPh coincide
25
Formal Models for Distributed Negotiations25 Semantic Correspondence Proposition Each transaction of [P]=(B,A,f) contains at most one occurrence of transitions in f(A) We can associate unambiguous labels to transactions: ( ) = a? if a chan(P) and f(in a ) is fired in transaction ( ) = a! if a chan(P) and f(out a ) is fired in transaction ( ) = otherwise Theorem P is “bisimilar” to A ([P]) (in the interleaving sense) matching labels in the LTS via the labeling of transactions
26
Formal Models for Distributed Negotiations26 About Restriction The restriction operator P\a hides channel a from external observers Then a has just local scope No interaction on a is possible with the environment It is natural to consider equivalent two processes that differ just for the renaming of restricted names For such P and Q, we write P res Q Two A-interfaced nets (B,A,f) and (B’,A,f’) are isomorphic if there exists a ZS net homomorphism :B B’ that respects interfaces i.e. (f(x)) = f’(x) Proposition: If P res Q then [P] is isomorphic to [Q]
27
Formal Models for Distributed Negotiations27 About Choice P+R Q P Q R+P Q P Q NPNP … NQNQ … += N P+Q … … … ……
28
Formal Models for Distributed Negotiations28 Recap We have seen Short introduction to PDL Operational and abstract semantics Encoding of SPA in ZSN Truly concurrent semantics Correspondence theorem
29
Formal Models for Distributed Negotiations29 References Zero-safe nets: comparing the collective and individual token approaches (Information and Computation 156(1-2):46-89, Academic Press 2000) R. Bruni, U. Montanari
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.