on global types and multi party sessions

On Global Types and Multi-Party Sessions Giuseppe Castagna CNRS - PowerPoint PPT Presentation

On Global Types and Multi-Party Sessions Giuseppe Castagna CNRS Universit e Paris Diderot (joint work with Mariangiola Dezani and Luca Padovani) FMOODS & FORTE invited talk DisCoTec 2011 - Reykjav k logoP7 G. Castagna (CNRS) On


  1. Context repeat send false to Charlie; receive $x from Charlie; until $x; send ok to Bob repeat receive $x from Alice ; send $x to Alice; until $x; send ok to Bob receive ok from Charlie; receive ok from Alice Several potential problems These problems may be due to: Programming errors Communication errors Protocol errors logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 3 / 31

  2. Context repeat send false to Charlie; receive $x from Charlie; until $x; send ok to Bob repeat receive $x from Alice ; send $x to Alice; until $x; send ok to Bob receive ok from Charlie; receive ok from Alice Several potential problems These problems may be due to: Programming errors Communication errors Software evolution Protocol errors logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 3 / 31

  3. Context repeat send false to Charlie; receive $x from Charlie; until $x; send ok to Bob repeat receive $x from Alice ; send $x to Alice; until $x; send ok to Bob receive ok from Charlie; receive ok from Alice Several potential problems These problems may be due to: Programming errors Communication errors Software evolution Protocol errors logoP7 Rogue participants G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 3 / 31

  4. Global vs. Local specifications Global specification logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 4 / 31

  5. Global vs. Local specifications Global specification Do not describe (just) the behavior of each single participant logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 4 / 31

  6. Global vs. Local specifications Global specification Do not describe (just) the behavior of each single participant Describe the abstract global behavior of the protocol logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 4 / 31

  7. Global vs. Local specifications Global specification Do not describe (just) the behavior of each single participant Describe the abstract global behavior of the protocol Match against/Extract the behaviors of the participants. logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 4 / 31

  8. Global vs. Local specifications Global specification Do not describe (just) the behavior of each single participant Describe the abstract global behavior of the protocol Match against/Extract the behaviors of the participants. Example of global description Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; logoP7 or Charlie sends ok to Alice; Charlie sends ok to Bob; G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 4 / 31

  9. Global vs. Local specifications The global specification is compact and synthetic Example of global description Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; logoP7 or Charlie sends ok to Alice; Charlie sends ok to Bob; G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 4 / 31

  10. Global vs. Local specifications send true to Charlie; receive ok from Charlie; send ok to Bob receive $x from Alice; if $x then { send ok to Bob; send ok to Alice } else { send ok to Alice; send ok to Bob } switch | receive ok from Alice -> receive ok from Charlie | receive ok from Charlie -> receive ok from Alice Example of global description Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; logoP7 or Charlie sends ok to Alice; Charlie sends ok to Bob; G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 4 / 31

  11. Global vs. Local specifications send true to Charlie; receive ok from Charlie; send ok to Bob receive $x from Alice; if $x then { send ok to Bob; send ok to Alice } else { send ok to Alice; send ok to Bob } switch | receive ok from Alice -> receive ok from Charlie | receive ok from Charlie -> receive ok from Alice Example of global description Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; logoP7 or Charlie sends ok to Alice; Charlie sends ok to Bob; G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 4 / 31

  12. Global vs. Local specifications send true to Charlie; receive ok from Charlie; send ok to Bob receive $x from Alice; if $x then { send ok to Bob; send ok to Alice } else { send ok to Alice; send ok to Bob } switch | receive ok from Alice -> receive ok from Charlie | receive ok from Charlie -> receive ok from Alice Example of global description Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; logoP7 or Charlie sends ok to Alice; Charlie sends ok to Bob; G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 4 / 31

  13. Interest of global descriptions Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; or Charlie sends ok to Alice; Charlie sends ok to Bob; logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 5 / 31

  14. Interest of global descriptions Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; or Charlie sends ok to Alice; Charlie sends ok to Bob; Given a distributed implementation that β€œsatisfies” this global specification: 1 Every send of a given type is matched by a reception of the same type; logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 5 / 31

  15. Interest of global descriptions Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; or Charlie sends ok to Alice; Charlie sends ok to Bob; Given a distributed implementation that β€œsatisfies” this global specification: 1 Every send of a given type is matched by a reception of the same type; logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 5 / 31

  16. Interest of global descriptions Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; or Charlie sends ok to Alice; Charlie sends ok to Bob; Given a distributed implementation that β€œsatisfies” this global specification: 1 Every send of a given type is matched by a reception of the same type; logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 5 / 31

  17. Interest of global descriptions Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; or Charlie sends ok to Alice; Charlie sends ok to Bob; Given a distributed implementation that β€œsatisfies” this global specification: 1 Every send of a given type is matched by a reception of the same type; 2 It should be easier to check the absence of deadlocks and starvation on global specifications. logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 5 / 31

  18. Interest of global descriptions Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; or Charlie sends ok to Alice; Charlie sends ok to Bob; Given a distributed implementation that β€œsatisfies” this global specification: 1 Every send of a given type is matched by a reception of the same type; 2 It should be easier to check the absence of deadlocks and starvation on global specifications. We must ensure that all and only the expected synchronizations happen. logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 5 / 31

  19. Interest of global descriptions Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; or Charlie sends ok to Alice; Charlie sends ok to Bob; Given a distributed implementation that β€œsatisfies” this global specification: 1 Every send of a given type is matched by a reception of the same type; 2 It should be easier to check the absence of deadlocks and starvation on global specifications. We must ensure that all and only the expected synchronizations happen. logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 5 / 31

  20. Interest of global descriptions Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; or Charlie sends ok to Alice; Charlie sends ok to Bob; Given a distributed implementation that β€œsatisfies” this global specification: 1 Every send of a given type is matched by a reception of the same type; 2 It should be easier to check the absence of deadlocks and starvation on global specifications. We must ensure that all and only the expected synchronizations happen. logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 5 / 31

  21. Interest of global descriptions Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; or Charlie sends ok to Alice; Charlie sends ok to Bob; Given a distributed implementation that β€œsatisfies” this global specification: 1 Every send of a given type is matched by a reception of the same type; 2 It should be easier to check the absence of deadlocks and starvation on global specifications. We must ensure that all and only the expected synchronizations happen. logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 5 / 31

  22. Interest of global descriptions Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice; or Charlie sends ok to Alice; Charlie sends ok to Bob; Given a distributed implementation that β€œsatisfies” this global specification: 1 Every send of a given type is matched by a reception of the same type; 2 It should be easier to check the absence of deadlocks and starvation on global specifications. We must ensure that all and only the expected synchronizations happen. We need a theoretical framework for: Defining global specifications, Defining local specifications, Relating them, logoP7 Proving their properties. G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 5 / 31

  23. A long-standing quest Several communities formalize and study the relation between a global description and a set of components implementing it. logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 6 / 31

  24. A long-standing quest Several communities formalize and study the relation between a global description and a set of components implementing it. Typical issues: Verification: does a given set of components implement a global specification? Implementability: does a set of components that implement the specification exist and can it be automatically produced? Analysis: which properties of the specification can be checked and transposed to every implementation that satisfies it? logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 6 / 31

  25. A long-standing quest Several communities formalize and study the relation between a global description and a set of components implementing it. Typical issues: Verification: does a given set of components implement a global specification? Implementability: does a set of components that implement the specification exist and can it be automatically produced? Analysis: which properties of the specification can be checked and transposed to every implementation that satisfies it? Typical approaches: Automata: software engineering for telecommunications; MSG and SDL-core ( ie , CFSM); decidability and complexity; Protocols: cryptographic protocols; MSC, rewriting systems, process algebras; confidentiality, availability; Services: web services interactions; behavioral types and process logoP7 algebras; soundness and progress. G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 6 / 31

  26. A long-standing quest Automata: MSG and CFSM; decidability and complexity. Protocols: MSC, rewriting, concurrency; confidentiality, availability; Services: types and process algebras; soundness and progress. These approaches differ by: the tackled problems, the levels of abstraction, the paradigms, the techniques. logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 7 / 31

  27. A long-standing quest Automata: MSG and CFSM; decidability and complexity. Protocols: MSC, rewriting, concurrency; confidentiality, availability; Services: types and process algebras; soundness and progress. These approaches differ by: the tackled problems, However their the levels of abstraction, frontiers are the paradigms, blurred the techniques. logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 7 / 31

  28. A long-standing quest Automata: MSG and CFSM; decidability and complexity. Protocols: MSC, rewriting, concurrency; confidentiality, availability; Services: types and process algebras; soundness and progress. These approaches differ by: the tackled problems, However their the levels of abstraction, frontiers are the paradigms, blurred the techniques. In the rest of this talk: 1 Present a study typical of the Services approach; 2 Use it to briefly survey the related Services-oriented research; 3 Hint at and compare it with the Automata and Protocols approaches; logoP7 4 Draw few conclusions. G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 7 / 31

  29. A study in the β€œservices” approach. logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 8 / 31

  30. From informal descriptions to global types Seller sends buyer a price and a description of the product; then buyer may repeatedly send seller an offer then wait for a new price; then buyer sends seller acceptance or quits the conversation. logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 9 / 31

  31. From informal descriptions to global types Seller sends buyer a price and a description of the product; then buyer may repeatedly send seller an offer then wait for a new price; then buyer sends seller acceptance or quits the conversation. ( seller descr price βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; price ( buyer offer βˆ’ β†’ seller ; ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; βˆ— ; ; accept quit ∨ ( buyer βˆ’ β†’ seller ∨ ∨ buyer βˆ’ β†’ seller ) logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 9 / 31

  32. From informal descriptions to global types Seller sends buyer a price and a description of the product; then buyer may repeatedly send seller an offer then wait for a new price; then buyer sends seller acceptance or quits the conversation. ( seller descr price βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; price ( buyer offer βˆ’ β†’ seller ; ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— βˆ— ; ; ; accept quit ∨ ( buyer βˆ’ β†’ seller ∨ ∨ buyer βˆ’ β†’ seller ) price Atomic actions: β€œ seller sends buyer a price ” gets seller βˆ’ β†’ buyer logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 9 / 31

  33. From informal descriptions to global types Seller sends buyer a price and a description of the product; then buyer may repeatedly send seller an offer then wait for a new price; then buyer sends seller acceptance or quits the conversation. ( seller descr price βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; price ( buyer offer βˆ’ β†’ seller ; ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; βˆ— ; ; accept quit ∨ ( buyer βˆ’ β†’ seller ∨ ∨ buyer βˆ’ β†’ seller ) price Atomic actions: β€œ seller sends buyer a price ” gets seller βˆ’ β†’ buyer Connectives: β€œand”, β€œthen”, β€œor” become β€œ ∧ ∧ ∧ ”, β€œ; ; ;”, β€œ ∨ ∨ ” ∨ logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 9 / 31

  34. From informal descriptions to global types Seller sends buyer a price and a description of the product; then buyer may repeatedly send seller an offer then wait for a new price; then buyer sends seller acceptance or quits the conversation. ( seller descr price βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; price ( buyer offer βˆ’ β†’ seller ; ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; βˆ— ; ; accept quit ∨ ( buyer βˆ’ β†’ seller ∨ ∨ buyer βˆ’ β†’ seller ) price Atomic actions: β€œ seller sends buyer a price ” gets seller βˆ’ β†’ buyer Connectives: β€œand”, β€œthen”, β€œor” become β€œ ∧ ∧ ∧ ”, β€œ; ; ;”, β€œ ∨ ∨ ∨ ” Control loops: β€œ may repeatedly ” becomes β€œ (...)* * * ” logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 9 / 31

  35. From informal descriptions to global types Seller sends buyer a price and a description of the product; then buyer may repeatedly send seller an offer then wait for a new price; then buyer sends seller acceptance or quits the conversation. ( seller descr price βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; price ( buyer offer βˆ’ β†’ seller ; ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; βˆ— ; ; accept quit ∨ ( buyer βˆ’ β†’ seller ∨ ∨ buyer βˆ’ β†’ seller ) price Atomic actions: β€œ seller sends buyer a price ” gets seller βˆ’ β†’ buyer Connectives: β€œand”, β€œthen”, β€œor” become β€œ ∧ ∧ ∧ ”, β€œ; ; ;”, β€œ ∨ ∨ ∨ ” Control loops: β€œ may repeatedly ” becomes β€œ (...)* * * ” logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 9 / 31

  36. Syntax of Global Types Global Types ::= skip (skip) G a | βˆ’ β†’ p (interaction) p | G ; G (sequence) | G ∧ G (both) | G ∨ G (either) G βˆ— βˆ— βˆ— | (star) logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 10 / 31

  37. Syntax of Global Types Global Types ::= skip (skip) G a | βˆ’ β†’ p (interaction) p | G ; G (sequence) | G ∧ G (both) | G ∨ G (either) G βˆ— βˆ— βˆ— | (star) Two observations: logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 10 / 31

  38. Syntax of Global Types Global Types ::= skip (skip) G a | βˆ’ β†’ p (interaction) p p p | G ; G (sequence) | G ∧ G (both) | G ∨ G (either) G βˆ— βˆ— βˆ— | (star) Two observations: 1 Actually instead of just one sender logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 10 / 31

  39. Syntax of Global Types Global Types ::= skip (skip) G a | { p 1 , ..., p n } βˆ’ β†’ p (interaction) | G ; G (sequence) | G ∧ G (both) | G ∨ G (either) G βˆ— βˆ— βˆ— | (star) Two observations: 1 Actually instead of just one sender we may specify multiple senders logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 10 / 31

  40. Syntax of Global Types Global Types ::= skip (skip) G a | βˆ’ β†’ p (interaction) Ο€ Ο€ Ο€ | G ; G (sequence) | G ∧ G (both) | G ∨ G (either) G βˆ— βˆ— βˆ— | (star) Two observations: 1 Actually instead of just one sender we may specify multiple senders (ranged over by Ο€ ) logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 10 / 31

  41. Syntax of Global Types Global Types ::= skip (skip) G a | βˆ’ β†’ p (interaction) Ο€ Ο€ Ο€ | G ; G (sequence) | G ∧ G (both) | G ∨ G (either) G βˆ— βˆ— βˆ— | (star) Two observations: 1 Actually instead of just one sender we may specify multiple senders (ranged over by Ο€ ) price mortgage ( seller βˆ’ β†’ buyer1 ∧ bank βˆ’ β†’ buyer2 ); accept accept ( { buyer1,buyer2 } βˆ’ β†’ seller ∧ { buyer1,buyer2 } βˆ’ β†’ bank ) logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 10 / 31

  42. Syntax of Global Types Global Types ::= skip (skip) G a | βˆ’ β†’ p (interaction) Ο€ Ο€ Ο€ | G ; G (sequence) | G ∧ G (both) | G ∨ G (either) G βˆ— βˆ— βˆ— | (star) Two observations: 1 Actually instead of just one sender we may specify multiple senders (ranged over by Ο€ ) price mortgage ( seller βˆ’ β†’ buyer1 ∧ bank βˆ’ β†’ buyer2 ); accept accept ( { buyer1,buyer2 } βˆ’ β†’ seller ∧ { buyer1,buyer2 } βˆ’ β†’ bank ) 2 Kleene star yields termination under fairness for free. logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 10 / 31

  43. From Global to Local Back to our example: price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; price ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; accept quit ( buyer βˆ’ β†’ seller ∨ ∨ ∨ buyer βˆ’ β†’ seller ) logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  44. From Global to Local Back to our example: price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; price ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; accept quit ( buyer βˆ’ β†’ seller ∨ ∨ ∨ buyer βˆ’ β†’ seller ) A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? descr . ? ! price . ! buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . buyer! . ! ! price . X buyer? ! offer . . seller? . ? price . X seller! ! ? + + + buyer? ? ? accept .end βŠ• βŠ• βŠ• seller! ! accept .end ! + + buyer? + ? quit .end ) ? βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  45. From Global to Local Back to our example: price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; price ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; accept quit ( buyer βˆ’ β†’ seller ∨ ∨ ∨ buyer βˆ’ β†’ seller ) A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? descr . ? ! price . ! buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . buyer! . ! ! price . X buyer? ! offer . . seller? . ? price . X seller! ! ? + + + buyer? ? ? accept .end βŠ• βŠ• βŠ• seller! ! accept .end ! + + buyer? + ? quit .end ) ? βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  46. From Global to Local Back to our example: Every action price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; corresponds to a pair price of communications. ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; Every communication accept quit ( buyer βˆ’ β†’ seller ∨ ∨ buyer ∨ βˆ’ β†’ seller ) comes from an action. A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? descr . ? ! ! price . buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . . buyer! ! ! price . X buyer? ! offer . . . seller? ? price . X seller! ! ? + + + buyer? ? ? accept .end βŠ• βŠ• βŠ• seller! ! ! accept .end + + buyer? + ? ? quit .end ) βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  47. From Global to Local Back to our example: Every action price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; corresponds to a pair price of communications. ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; Every communication accept quit ( buyer βˆ’ β†’ seller ∨ ∨ buyer ∨ βˆ’ β†’ seller ) comes from an action. A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? descr . ? ! ! price . buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . . buyer! ! ! price . X buyer? ! offer . . . seller? ? price . X seller! ! ? + + + buyer? ? ? accept .end βŠ• βŠ• βŠ• seller! ! ! accept .end + + buyer? + ? ? quit .end ) βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  48. From Global to Local Back to our example: Every action price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; corresponds to a pair price of communications. ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; Every communication accept quit ( buyer βˆ’ β†’ seller ∨ ∨ buyer ∨ βˆ’ β†’ seller ) comes from an action. A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? descr . ? ! ! price . buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . . buyer! ! ! price . X buyer? ! offer . . . seller? ? price . X seller! ! ? + + + buyer? ? ? accept .end βŠ• βŠ• βŠ• seller! ! ! accept .end + + buyer? + ? ? quit .end ) βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  49. From Global to Local Back to our example: Every action price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; corresponds to a pair price of communications. ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; Every communication accept quit ( buyer βˆ’ β†’ seller ∨ ∨ buyer ∨ βˆ’ β†’ seller ) comes from an action. A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? descr . ? ! ! price . buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . . buyer! ! ! price . X buyer? ! offer . . . seller? ? price . X seller! ! ? + + + buyer? ? ? accept .end βŠ• βŠ• βŠ• seller! ! ! accept .end + + buyer? + ? ? quit .end ) βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  50. From Global to Local Back to our example: Global choices price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; correspond to price ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; internal/external accept quit choice pairs ( buyer βˆ’ β†’ seller ∨ ∨ ∨ buyer βˆ’ β†’ seller ) A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? ? descr . ! ! price . buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . buyer! . ! ! price . X buyer? ! offer . . seller? . ? price . X seller! ! ? + + + buyer? ? accept .end ? βŠ• βŠ• βŠ• seller! ! ! accept .end + + + buyer? ? ? quit .end ) βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  51. From Global to Local Back to our example: Global choices price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; correspond to price ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; internal/external accept quit choice pairs ( buyer βˆ’ β†’ seller ∨ ∨ ∨ buyer βˆ’ β†’ seller ) A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? ? descr . ! ! price . buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . buyer! . ! ! price . X buyer? ! offer . . seller? . ? price . X seller! ! ? + + + buyer? ? accept .end ? βŠ• βŠ• βŠ• seller! ! ! accept .end + + + buyer? ? ? quit .end ) βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  52. From Global to Local Back to our example: Global choices price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; correspond to price ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; internal/external accept quit choice pairs ( buyer βˆ’ β†’ seller ∨ ∨ ∨ buyer βˆ’ β†’ seller ) A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? ? descr . ! ! price . buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . buyer! . ! ! price . X buyer? ! offer . . seller? . ? price . X seller! ! ? + + + buyer? ? accept .end ? βŠ• βŠ• βŠ• seller! ! ! accept .end + + + buyer? ? ? quit .end ) βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  53. From Global to Local Back to our example: Global choices price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; correspond to price ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; internal/external accept quit choice pairs ( buyer βˆ’ β†’ seller ∨ ∨ ∨ buyer βˆ’ β†’ seller ) A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? ? descr . ! ! price . buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . buyer! . ! ! price . X buyer? ! offer . . seller? . ? price . X seller! ! ? + + + buyer? ? accept .end ? βŠ• βŠ• βŠ• seller! ! ! accept .end + + + buyer? ? ? quit .end ) βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  54. From Global to Local Back to our example: Kleene stars price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; correspond to price ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; recursion accept quit ( buyer βˆ’ β†’ seller ∨ ∨ ∨ buyer βˆ’ β†’ seller ) A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? ? descr . ! ! price . buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . buyer! . ! ! price . X buyer? ! offer . . seller? . ? price . X seller! ! ? + + + buyer? ? accept .end ? βŠ• βŠ• βŠ• seller! ! ! accept .end + + + buyer? ? ? quit .end ) βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  55. From Global to Local Back to our example: The order of price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; sequential price ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; compositions is accept quit respected ( buyer βˆ’ β†’ seller ∨ ∨ ∨ buyer βˆ’ β†’ seller ) A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? ? descr . ! ! price . buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . buyer! . ! ! price . X buyer? ! offer . . seller? . ? price . X seller! ! ? + + + buyer? ? accept .end ? βŠ• βŠ• βŠ• seller! ! ! accept .end + + + buyer? ? ? quit .end ) βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  56. From Global to Local Back to our example: Actions composed price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; by β€œ ∧ ” appear price ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; in some order. accept quit ( buyer βˆ’ β†’ seller ∨ ∨ ∨ buyer βˆ’ β†’ seller ) A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? ? descr . ! ! price . buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . buyer! . ! ! price . X buyer? ! offer . . seller? . ? price . X seller! ! ? + + + buyer? ? accept .end ? βŠ• βŠ• βŠ• seller! ! ! accept .end + + + buyer? ? ? quit .end ) βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  57. From Global to Local Back to our example: Actions composed price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; by β€œ ∧ ” appear price ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; in some order. accept quit ( buyer βˆ’ β†’ seller ∨ ∨ buyer ∨ βˆ’ β†’ seller ) But other orders are admitted A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! descr . seller? ? descr . ? ! ! price . buyer! ? price . ? seller? rec X . ( rec X . ( ? ? offer . . . buyer! ! ! price . X buyer? ! offer . . . seller? ? price . X seller! ! ? + + + buyer? ? ? accept .end βŠ• βŠ• βŠ• seller! ! ! accept .end + + buyer? + ? ? quit .end ) βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  58. From Global to Local Back to our example: Actions composed price ( seller descr βˆ’ β†’ buyer ∧ ∧ ∧ seller βˆ’ β†’ buyer ); ; ; by β€œ ∧ ” appear price ( buyer offer ; βˆ— ; βˆ’ β†’ seller ; ; seller βˆ’ β†’ buyer ) βˆ— βˆ— ; ; in some order. accept quit ( buyer βˆ’ β†’ seller ∨ ∨ buyer ∨ βˆ’ β†’ seller ) But other orders are admitted A possible implementation: ✬ ✩ ✬ ✩ buyer seller buyer! ! ! price . seller? ? price . ? ! ! descr . buyer! ? descr . ? seller? rec X . ( rec X . ( ? ? offer . . . buyer! ! ! price . X buyer? ! offer . . . seller? ? price . X seller! ! ? + + + buyer? ? ? accept .end βŠ• βŠ• βŠ• seller! ! ! accept .end + + buyer? + ? ? quit .end ) βŠ• βŠ• βŠ• seller! ! quit .end ) ! ✫ βœͺ logoP7 ✫ βœͺ G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 11 / 31

  59. Local Types and Projection Implementations are specified by: T ::= end (termination) | X (variable) | p! ! ! a . T (output) | Ο€ ? ? ? a . T (input) Ο€ Ο€ | T βŠ• T (internal choice) | T + T (external choice) | rec X . T (recursion) logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 12 / 31

  60. Local Types and Projection Implementations are specified by: T ::= end (termination) | X (variable) | p! ! ! a . T (output) | Ο€ ? ? ? a . T (input) Ο€ Ο€ | T βŠ• T (internal choice) | T + T (external choice) | rec X . T (recursion) Given a global type we want to automatically produce a mapping from participants to local types that is sound and complete , that is: logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 12 / 31

  61. Local Types and Projection Implementations are specified by: T ::= end (termination) | X (variable) | p! ! ! a . T (output) | Ο€ ? ? a . T ? (input) Ο€ Ο€ | T βŠ• T (internal choice) | T + T (external choice) | rec X . T (recursion) Given a global type we want to automatically produce a mapping from participants to local types that is sound and complete , that is : 1 There is a 1-1 correspondence between actions and communications; 2 Communications of actions in β€œ; ; ;” respect the order ( sequentiality ); 3 Communications of actions in β€œ ∧ ∧ ∧ ” occur in any order ( shuffling ); 4 Communications of actions in β€œ ∨ ∨ ” are mutually exclusive ( alternative ) ∨ logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 12 / 31

  62. Soundness and completeness [first technical slide] 1 Define the traces of a global types in the obvious way: tr (skip) = { Ξ΅ } tr ( G 1 ; G 2 ) = tr ( G 1 ) tr ( G 2 ) a a tr ( Ο€ βˆ’ β†’ p ) = { Ο€ βˆ’ β†’ p } tr ( G 1 ∨ G 2 ) = tr ( G 1 ) βˆͺ tr ( G 2 ) tr ( G βˆ— ) = ( tr ( G )) ⋆ tr ( G 1 ∧ G 2 ) = tr ( G 1 ) tr ( G 2 ) ( shuffle ) βˆƒ logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 13 / 31

  63. Soundness and completeness [first technical slide] 1 Define the traces of a global types in the obvious way: tr (skip) = { Ξ΅ } tr ( G 1 ; G 2 ) = tr ( G 1 ) tr ( G 2 ) a a tr ( Ο€ βˆ’ β†’ p ) = { Ο€ βˆ’ β†’ p } tr ( G 1 ∨ G 2 ) = tr ( G 1 ) βˆͺ tr ( G 2 ) tr ( G βˆ— ) = ( tr ( G )) ⋆ tr ( G 1 ∧ G 2 ) = tr ( G 1 ) tr ( G 2 ) ( shuffle ) βˆƒ logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 13 / 31

  64. Soundness and completeness [first technical slide] 1 Define the traces of a global types in the obvious way: tr (skip) = { Ξ΅ } tr ( G 1 ; G 2 ) = tr ( G 1 ) tr ( G 2 ) a a tr ( Ο€ βˆ’ β†’ p ) = { Ο€ βˆ’ β†’ p } tr ( G 1 ∨ G 2 ) = tr ( G 1 ) βˆͺ tr ( G 2 ) tr ( G βˆ— ) = ( tr ( G )) ⋆ tr ( G 1 ∧ G 2 ) = tr ( G 1 ) tr ( G 2 ) ( shuffle ) βˆƒ 2 Define the traces of sets of components as traces of an LTS: logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 13 / 31

  65. Soundness and completeness [first technical slide] 1 Define the traces of a global types in the obvious way: tr (skip) = { Ξ΅ } tr ( G 1 ; G 2 ) = tr ( G 1 ) tr ( G 2 ) a a tr ( Ο€ βˆ’ β†’ p ) = { Ο€ βˆ’ β†’ p } tr ( G 1 ∨ G 2 ) = tr ( G 1 ) βˆͺ tr ( G 2 ) tr ( G βˆ— ) = ( tr ( G )) ⋆ tr ( G 1 ∧ G 2 ) = tr ( G 1 ) tr ( G 2 ) ( shuffle ) βˆƒ 2 Define the traces of sets of components as traces of an LTS: a k οΏ½ οΏ½ οΏ½ οΏ½ B ( p βˆ’ β†’ p k ):: B βˆ’ βˆ’ βˆ’ βˆ’ β†’ ( k ∈ I ) { ..., p : οΏ½ i ∈ I p i ! ! ! a i . T i , ... } { ..., p : T k , ... } logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 13 / 31

  66. Soundness and completeness [first technical slide] 1 Define the traces of a global types in the obvious way: tr (skip) = { Ξ΅ } tr ( G 1 ; G 2 ) = tr ( G 1 ) tr ( G 2 ) a a tr ( Ο€ βˆ’ β†’ p ) = { Ο€ βˆ’ β†’ p } tr ( G 1 ∨ G 2 ) = tr ( G 1 ) βˆͺ tr ( G 2 ) tr ( G βˆ— ) = ( tr ( G )) ⋆ tr ( G 1 ∧ G 2 ) = tr ( G 1 ) tr ( G 2 ) ( shuffle ) βˆƒ 2 Define the traces of sets of components as traces of an LTS: a k οΏ½ οΏ½ οΏ½ οΏ½ B ( p βˆ’ β†’ p k ):: B βˆ’ βˆ’ βˆ’ βˆ’ β†’ ( k ∈ I ) { ..., p : οΏ½ i ∈ I p i ! ! ! a i . T i , ... } { ..., p : T k , ... } οΏ½ οΏ½ a a οΏ½ οΏ½ B ::( p i βˆ’ β†’ p ) i ∈ I B βˆ’ β†’ p Ο€ k βˆ’ βˆ’ βˆ’ βˆ’ β†’ ( Ο€ k = { p i } i ∈ I ) { ..., p : οΏ½ ? a j . T j , ... } ? { ..., p : T k , ... } j ∈ J Ο€ j ? logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 13 / 31

  67. Soundness and completeness [first technical slide] 1 Define the traces of a global types in the obvious way: tr (skip) = { Ξ΅ } tr ( G 1 ; G 2 ) = tr ( G 1 ) tr ( G 2 ) a a tr ( Ο€ βˆ’ β†’ p ) = { Ο€ βˆ’ β†’ p } tr ( G 1 ∨ G 2 ) = tr ( G 1 ) βˆͺ tr ( G 2 ) tr ( G βˆ— ) = ( tr ( G )) ⋆ tr ( G 1 ∧ G 2 ) = tr ( G 1 ) tr ( G 2 ) ( shuffle ) βˆƒ 2 Define the traces of sets of components as traces of an LTS: a k οΏ½ οΏ½ οΏ½ οΏ½ B ( p βˆ’ β†’ p k ):: B βˆ’ βˆ’ βˆ’ βˆ’ β†’ ( k ∈ I ) { ..., p : οΏ½ i ∈ I p i ! ! a i . T i , ... } ! { ..., p : T k , ... } οΏ½ οΏ½ a a οΏ½ οΏ½ B ::( p i βˆ’ β†’ p ) i ∈ I B βˆ’ β†’ p Ο€ k βˆ’ βˆ’ βˆ’ βˆ’ β†’ ( Ο€ k = { p i } i ∈ I ) { ..., p : οΏ½ ? a j . T j , ... } ? { ..., p : T k , ... } j ∈ J Ο€ j ? 3 Soundness: tr ( { p i : T i } i ∈ I ) βŠ† tr ( G ) every trace of { p i : T i } i ∈ I is a trace of G logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 13 / 31

  68. Soundness and completeness [first technical slide] 1 Define the traces of a global types in the obvious way: tr (skip) = { Ξ΅ } tr ( G 1 ; G 2 ) = tr ( G 1 ) tr ( G 2 ) a a tr ( Ο€ βˆ’ β†’ p ) = { Ο€ βˆ’ β†’ p } tr ( G 1 ∨ G 2 ) = tr ( G 1 ) βˆͺ tr ( G 2 ) tr ( G βˆ— ) = ( tr ( G )) ⋆ tr ( G 1 ∧ G 2 ) = tr ( G 1 ) tr ( G 2 ) ( shuffle ) βˆƒ 2 Define the traces of sets of components as traces of an LTS: a k οΏ½ οΏ½ οΏ½ οΏ½ B ( p βˆ’ β†’ p k ):: B βˆ’ βˆ’ βˆ’ βˆ’ β†’ ( k ∈ I ) { ..., p : οΏ½ i ∈ I p i ! ! ! a i . T i , ... } { ..., p : T k , ... } οΏ½ οΏ½ a a οΏ½ οΏ½ B ::( p i βˆ’ β†’ p ) i ∈ I B βˆ’ β†’ p Ο€ k βˆ’ βˆ’ βˆ’ βˆ’ β†’ ( Ο€ k = { p i } i ∈ I ) { ..., p : οΏ½ ? a j . T j , ... } ? { ..., p : T k , ... } j ∈ J Ο€ j ? 3 Soundness: tr ( { p i : T i } i ∈ I ) βŠ† tr ( G ) every trace of { p i : T i } i ∈ I is a trace of G 4 Completeness: tr ( G ) βŠ† tr ( { p i : T i } i ∈ I ) β—¦ : every trace of G is the permutation of a trace of { p i : T i } i ∈ I . logoP7 L β—¦ def = { Ξ± 1 Β· Β· Β· Ξ± n | βˆƒ a permutation Οƒ s.t. Ξ± Οƒ (1) Β· Β· Β· Ξ± Οƒ ( n ) ∈ L } G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 13 / 31

  69. Flawed global types Some global types cannot be implemented by a sound and complete set of components 1 No sequentiality: Actions cannot synch without covert channels: a b ( p βˆ’ β†’ q ; r βˆ’ β†’ s ) logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 14 / 31

  70. Flawed global types Some global types cannot be implemented by a sound and complete set of components 1 No sequentiality: Actions cannot synch without covert channels: a b ( p βˆ’ β†’ q ; r βˆ’ β†’ s ) 2 No decision maker: Branching must be decided by someone a b βˆ’ β†’ q ∨ q βˆ’ β†’ p p logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 14 / 31

  71. Flawed global types Some global types cannot be implemented by a sound and complete set of components 1 No sequentiality: Actions cannot synch without covert channels: a b ( p βˆ’ β†’ q ; r βˆ’ β†’ s ) 2 No decision maker: Branching must be decided by someone a b βˆ’ β†’ q ∨ q βˆ’ β†’ p p 3 No knowledge: Other participants are not aware of the choice made. a a a ( p βˆ’ β†’ q ; q βˆ’ β†’ r ; r βˆ’ β†’ p ) ∨ b a b ( p βˆ’ β†’ q ; q βˆ’ β†’ r ; r βˆ’ β†’ p ) logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 14 / 31

  72. Flawed global types Some global types cannot be implemented by a sound and complete set of components 1 No sequentiality: Actions cannot synch without covert channels: a b ( p βˆ’ β†’ q ; r βˆ’ β†’ s ) 2 No decision maker: Branching must be decided by someone a b βˆ’ β†’ q ∨ q βˆ’ β†’ p p 3 No knowledge: Other participants are not aware of the choice made. a a a ( p βˆ’ β†’ q ; q βˆ’ β†’ r ; r βˆ’ β†’ p ) ∨ b a b ( p βˆ’ β†’ q ; q βˆ’ β†’ r ; r βˆ’ β†’ p ) logoP7 See proceedings for a formal characterization of the various kinds of flaw G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 14 / 31

  73. Examples This still leaves a lot of flexibility ( cf. state of the art): same message different receivers in a choice price price ( seller βˆ’ β†’ buyer1 ; buyer1 βˆ’ β†’ buyer2 price price ∨ seller βˆ’ β†’ buyer2 ; buyer2 βˆ’ β†’ buyer1 ) logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 15 / 31

  74. Examples This still leaves a lot of flexibility ( cf. state of the art): same message different receivers in a choice price price ( seller βˆ’ β†’ buyer1 ; buyer1 βˆ’ β†’ buyer2 price price ∨ seller βˆ’ β†’ buyer2 ; buyer2 βˆ’ β†’ buyer1 ) different receivers to break a loop agency seller βˆ’ β†’ broker ; ( broker offer β†’ buyer ; buyer counteroffer βˆ— βˆ’ βˆ’ β†’ broker ) βˆ— βˆ— ; ( broker result β†’ seller ∧ broker result βˆ’ βˆ’ β†’ buyer ) logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 15 / 31

  75. Projection [last technical slide] Global types not inherently flawed are associated to sound and complete sets of components compositionally by a deduction system logoP7 G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 16 / 31

  76. Projection [last technical slide] Global types not inherently flawed are associated to sound and complete sets of components compositionally by a deduction system (SP-Action) (SP-Skip) a βˆ† ⊒ skip ⊲ βˆ† { p : S , q : T , ... } ⊒ p βˆ’ β†’ q ⊲ { p : q! ! ! a . S , q : p? ? a . T , ... } ? (SP-Sequence) (SP-Iteration) βˆ† β€² ⊒ G 1 ⊲ βˆ† β€²β€² βˆ† ⊒ G 2 ⊲ βˆ† β€² { p : T 1 βŠ• T 2 , ... } ⊒ G ⊲ { p : T 1 , ... } βˆ† ⊒ G 1 ; G 2 ⊲ βˆ† β€²β€² { p : T 2 , ... } ⊒ G βˆ— ⊲ { p : T 1 βŠ• T 2 , ... } (SP-Alternative) βˆ† ⊒ G 1 ⊲ { p : T 1 , ... } βˆ† ⊒ G 2 ⊲ { p : T 2 , ... } βˆ† ⊒ G 1 ∨ ∨ ∨ G 2 ⊲ { p : T 1 βŠ• T 2 , ... } (SP-Subsumption) G β€² οΏ½ G βˆ† β€²β€² οΏ½ βˆ† β€² βˆ† ⊒ G β€² ⊲ βˆ† β€² logoP7 def = tr ( L ) βŠ† tr ( M ) βŠ† tr ( L ) β—¦ ) ( X οΏ½ Y βˆ† ⊒ G ⊲ βˆ† β€²β€² G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 16 / 31

  77. Projection [last technical slide] Global types not inherently flawed are associated to sound and complete sets of components compositionally by a deduction system (SP-Action) (SP-Skip) a βˆ† ⊒ skip ⊲ βˆ† { p : S , q : T , ... } ⊒ p βˆ’ β†’ q ⊲ { p : q! ! ! a . S , q : p? ? a . T , ... } ? (SP-Sequence) (SP-Iteration) βˆ† β€² ⊒ G 1 ⊲ βˆ† β€²β€² βˆ† ⊒ G 2 ⊲ βˆ† β€² { p : T 1 βŠ• T 2 , ... } ⊒ G ⊲ { p : T 1 , ... } βˆ† ⊒ G 1 ; G 2 ⊲ βˆ† β€²β€² { p : T 2 , ... } ⊒ G βˆ— ⊲ { p : T 1 βŠ• T 2 , ... } (SP-Alternative) βˆ† ⊒ G 1 ⊲ { p : T 1 , ... } βˆ† ⊒ G 2 ⊲ { p : T 2 , ... } βˆ† ⊒ G 1 ∨ ∨ ∨ G 2 ⊲ { p : T 1 βŠ• T 2 , ... } (SP-Subsumption) G β€² οΏ½ G βˆ† β€²β€² οΏ½ βˆ† β€² βˆ† ⊒ G β€² ⊲ βˆ† β€² logoP7 def = tr ( L ) βŠ† tr ( M ) βŠ† tr ( L ) β—¦ ) ( X οΏ½ Y βˆ† ⊒ G ⊲ βˆ† β€²β€² G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 16 / 31

  78. Projection [last technical slide] Global types not inherently flawed are associated to sound and complete sets of components compositionally by a deduction system (SP-Action) (SP-Skip) a βˆ† ⊒ skip ⊲ βˆ† { p : S , q : T , ... } ⊒ p βˆ’ β†’ q ⊲ { p : q! ! ! a . S , q : p? ? a . T , ... } ? (SP-Sequence) (SP-Iteration) βˆ† β€² ⊒ G 1 ⊲ βˆ† β€²β€² βˆ† ⊒ G 2 ⊲ βˆ† β€² { p : T 1 βŠ• T 2 , ... } ⊒ G ⊲ { p : T 1 , ... } βˆ† ⊒ G 1 ; G 2 ⊲ βˆ† β€²β€² { p : T 2 , ... } ⊒ G βˆ— ⊲ { p : T 1 βŠ• T 2 , ... } (SP-Alternative) βˆ† ⊒ G 1 ⊲ { p : T 1 , ... } βˆ† ⊒ G 2 ⊲ { p : T 2 , ... } βˆ† ⊒ G 1 ∨ ∨ ∨ G 2 ⊲ { p : T 1 βŠ• T 2 , ... } (SP-Subsumption) G β€² οΏ½ G βˆ† β€²β€² οΏ½ βˆ† β€² βˆ† ⊒ G β€² ⊲ βˆ† β€² logoP7 def = tr ( L ) βŠ† tr ( M ) βŠ† tr ( L ) β—¦ ) ( X οΏ½ Y βˆ† ⊒ G ⊲ βˆ† β€²β€² G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 16 / 31

  79. Projection [last technical slide] Global types not inherently flawed are associated to sound and complete sets of components compositionally by a deduction system (SP-Action) (SP-Skip) a βˆ† ⊒ skip ⊲ βˆ† { p : S , q : T , ... } ⊒ p βˆ’ β†’ q ⊲ { p : q! ! ! a . S , q : p? ? a . T , ... } ? (SP-Sequence) (SP-Iteration) βˆ† β€² ⊒ G 1 ⊲ βˆ† β€²β€² βˆ† ⊒ G 2 ⊲ βˆ† β€² { p : T 1 βŠ• T 2 , ... } ⊒ G ⊲ { p : T 1 , ... } βˆ† ⊒ G 1 ; G 2 ⊲ βˆ† β€²β€² { p : T 2 , ... } ⊒ G βˆ— ⊲ { p : T 1 βŠ• T 2 , ... } (SP-Alternative) βˆ† ⊒ G 1 ⊲ { p : T 1 , ... } βˆ† ⊒ G 2 ⊲ { p : T 2 , ... } βˆ† ⊒ G 1 ∨ ∨ ∨ G 2 ⊲ { p : T 1 βŠ• T 2 , ... } (SP-Subsumption) G β€² οΏ½ G βˆ† β€²β€² οΏ½ βˆ† β€² βˆ† ⊒ G β€² ⊲ βˆ† β€² logoP7 def = tr ( L ) βŠ† tr ( M ) βŠ† tr ( L ) β—¦ ) ( X οΏ½ Y βˆ† ⊒ G ⊲ βˆ† β€²β€² G. Castagna (CNRS) On Global Types and Multi-Party Sessions DisCoTec 2011 - ReykjavΒ΄ Δ±k 16 / 31

Recommend


More recommend


Explore More Topics

Stay informed with curated content and fresh updates.