on global types and multi party sessions
play

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