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

on global types and multi party sessions
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

logoP7

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

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 1 / 31

slide-2
SLIDE 2

logoP7 1 Relating global descriptions distributed systems with sets of

descriptions of their components is the subject of an important and long-standing research.

2 Recently, the community of behavioral types for web services has

joined this effort.

3 The aim of this talk is to give an overview of the research done by

these newcomers, addressing its goals and specificities.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 2 / 31

slide-3
SLIDE 3

logoP7 1 Relating global descriptions distributed systems with sets of

descriptions of their components is the subject of an important and long-standing research.

2 Recently, the community of behavioral types for web services has

joined this effort.

3 The aim of this talk is to give an overview of the research done by

these newcomers, addressing its goals and specificities. For survey and pointers refer to the long version available online. The version in the proceedings focuses on technical content.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 2 / 31

slide-4
SLIDE 4

logoP7

Context

send "hello" 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 } receive ok from Alice; receive ok from Charlie They do it by exchanging some messages Alice, Bob, and Charlie want to collaborate on the net

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-5
SLIDE 5

logoP7

Context

send "hello" 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 } receive ok from Alice; receive ok from Charlie They do it by exchanging some messages Alice, Bob, and Charlie want to collaborate on the net

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-6
SLIDE 6

logoP7

Context

send "hello" 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 } receive ok from Alice; receive ok from Charlie They do it by exchanging some messages Alice, Bob, and Charlie want to collaborate on the net

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-7
SLIDE 7

logoP7

Context

send "hello" 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 } receive ok from Alice; receive ok from Charlie Several potential problems

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-8
SLIDE 8

logoP7

Context

send "hello" 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 } receive ok from Alice; receive ok from Charlie Several potential problems Communication errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-9
SLIDE 9

logoP7

Context

send "hello" 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 } receive ok from Alice; receive ok from Charlie A string is sent but a Boolean is expected Several potential problems Communication errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-10
SLIDE 10

logoP7

Context

send "hello" 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 } receive ok from Alice; receive ok from Charlie A string is sent but a Boolean is expected Several potential problems Communication errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-11
SLIDE 11

logoP7

Context

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 } receive ok from Alice; receive ok from Charlie Several potential problems Communication errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-12
SLIDE 12

logoP7

Context

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 } receive ok from Alice; receive ok from Charlie Several potential problems Communication errors Protocol errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-13
SLIDE 13

logoP7

Context

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 } receive ok from Alice; receive ok from Charlie A message is sent but there is no corresponding reception Several potential problems Communication errors Protocol errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-14
SLIDE 14

logoP7

Context

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 } receive ok from Alice; receive ok from Charlie A message is sent but there is no corresponding reception Several potential problems Communication errors Protocol errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-15
SLIDE 15

logoP7

Context

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 } receive ok from Alice; receive ok from Charlie Several potential problems Communication errors Protocol errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-16
SLIDE 16

logoP7

Context

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 } receive ok from Alice; receive ok from Charlie There may be deadlocks Several potential problems Communication errors Protocol errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-17
SLIDE 17

logoP7

Context

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 } receive ok from Alice; receive ok from Charlie There may be deadlocks Several potential problems Communication errors Protocol errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-18
SLIDE 18

logoP7

Context

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 } receive ok from Charlie; receive ok from Alice Several potential problems Communication errors Protocol errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-19
SLIDE 19

logoP7

Context

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 } receive ok from Charlie; receive ok from Alice There may be starvation Here Bob starves Several potential problems Communication errors Protocol errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-20
SLIDE 20

logoP7

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 There may be starvation Here Bob starves Several potential problems Communication errors Protocol errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-21
SLIDE 21

logoP7

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 These problems may be due to: Several potential problems Communication errors Protocol errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-22
SLIDE 22

logoP7

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 These problems may be due to: Programming errors Several potential problems Communication errors Protocol errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-23
SLIDE 23

logoP7

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 These problems may be due to: Programming errors Software evolution Several potential problems Communication errors Protocol errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-24
SLIDE 24

logoP7

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 These problems may be due to: Programming errors Software evolution Rogue participants Several potential problems Communication errors Protocol errors

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 3 / 31

slide-25
SLIDE 25

logoP7

Global vs. Local specifications

Global specification

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 4 / 31

slide-26
SLIDE 26

logoP7

Global vs. Local specifications

Global specification

Do not describe (just) the behavior of each single participant

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 4 / 31

slide-27
SLIDE 27

logoP7

Global vs. Local specifications

Global specification

Do not describe (just) the behavior of each single participant Describe the abstract global behavior of the protocol

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 4 / 31

slide-28
SLIDE 28

logoP7

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.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 4 / 31

slide-29
SLIDE 29

logoP7

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;

  • r 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

slide-30
SLIDE 30

logoP7

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;

  • r 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

slide-31
SLIDE 31

logoP7

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;

  • r 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

slide-32
SLIDE 32

logoP7

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;

  • r 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

slide-33
SLIDE 33

logoP7

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;

  • r 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

slide-34
SLIDE 34

logoP7

Interest of global descriptions

Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice;

  • r Charlie sends ok to Alice; Charlie sends ok to Bob;
  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 5 / 31

slide-35
SLIDE 35

logoP7

Interest of global descriptions

Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice;

  • r 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;

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 5 / 31

slide-36
SLIDE 36

logoP7

Interest of global descriptions

Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice;

  • r 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;

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 5 / 31

slide-37
SLIDE 37

logoP7

Interest of global descriptions

Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice;

  • r 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;

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 5 / 31

slide-38
SLIDE 38

logoP7

Interest of global descriptions

Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice;

  • r 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

  • n global specifications.
  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 5 / 31

slide-39
SLIDE 39

logoP7

Interest of global descriptions

Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice;

  • r 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

  • n global specifications.

We must ensure that all and only the expected synchronizations happen.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 5 / 31

slide-40
SLIDE 40

logoP7

Interest of global descriptions

Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice;

  • r 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

  • n global specifications.

We must ensure that all and only the expected synchronizations happen.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 5 / 31

slide-41
SLIDE 41

logoP7

Interest of global descriptions

Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice;

  • r 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

  • n global specifications.

We must ensure that all and only the expected synchronizations happen.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 5 / 31

slide-42
SLIDE 42

logoP7

Interest of global descriptions

Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice;

  • r 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

  • n global specifications.

We must ensure that all and only the expected synchronizations happen.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 5 / 31

slide-43
SLIDE 43

logoP7

Interest of global descriptions

Alice sends a Boolean to Charlie; either Charlie sends ok to Bob; Charlie sends ok to Alice;

  • r 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

  • n 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, Proving their properties.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 5 / 31

slide-44
SLIDE 44

logoP7

A long-standing quest

Several communities formalize and study the relation between a global description and a set of components implementing it.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 6 / 31

slide-45
SLIDE 45

logoP7

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?

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 6 / 31

slide-46
SLIDE 46

logoP7

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 algebras; soundness and progress.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 6 / 31

slide-47
SLIDE 47

logoP7

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.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 7 / 31

slide-48
SLIDE 48

logoP7

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. However their frontiers are blurred

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 7 / 31

slide-49
SLIDE 49

logoP7

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. However their frontiers are blurred 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; 4 Draw few conclusions.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 7 / 31

slide-50
SLIDE 50

logoP7

A study in the “services” approach.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 8 / 31

slide-51
SLIDE 51

logoP7

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.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 9 / 31

slide-52
SLIDE 52

logoP7

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 − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 9 / 31

slide-53
SLIDE 53

logoP7

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 − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Atomic actions: “seller sends buyer a price” gets seller

price

− → buyer

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 9 / 31

slide-54
SLIDE 54

logoP7

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 − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Atomic actions: “seller sends buyer a price” gets seller

price

− → buyer Connectives: “and”, “then”, “or” become “∧ ∧ ∧”, “; ; ;”, “∨ ∨ ∨”

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 9 / 31

slide-55
SLIDE 55

logoP7

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 − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Atomic actions: “seller sends buyer a price” gets seller

price

− → buyer Connectives: “and”, “then”, “or” become “∧ ∧ ∧”, “; ; ;”, “∨ ∨ ∨” Control loops: “may repeatedly” becomes “(...)* * *”

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 9 / 31

slide-56
SLIDE 56

logoP7

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 − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Atomic actions: “seller sends buyer a price” gets seller

price

− → buyer Connectives: “and”, “then”, “or” become “∧ ∧ ∧”, “; ; ;”, “∨ ∨ ∨” Control loops: “may repeatedly” becomes “(...)* * *”

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 9 / 31

slide-57
SLIDE 57

logoP7

Syntax of Global Types

Global Types G ::= skip (skip) | p

a

− → p (interaction) | G ; G (sequence) | G ∧ G (both) | G ∨ G (either) | G ∗

∗ ∗

(star)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 10 / 31

slide-58
SLIDE 58

logoP7

Syntax of Global Types

Global Types G ::= skip (skip) | p

a

− → p (interaction) | G ; G (sequence) | G ∧ G (both) | G ∨ G (either) | G ∗

∗ ∗

(star) Two observations:

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 10 / 31

slide-59
SLIDE 59

logoP7

Syntax of Global Types

Global Types G ::= skip (skip) | p p p

a

− → p (interaction) | G ; G (sequence) | G ∧ G (both) | G ∨ G (either) | G ∗

∗ ∗

(star) Two observations:

1 Actually instead of just one sender

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 10 / 31

slide-60
SLIDE 60

logoP7

Syntax of Global Types

Global Types G ::= skip (skip) | {p1, ..., pn}

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

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 10 / 31

slide-61
SLIDE 61

logoP7

Syntax of Global Types

Global Types G ::= skip (skip) | π π π

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 π)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 10 / 31

slide-62
SLIDE 62

logoP7

Syntax of Global Types

Global Types G ::= skip (skip) | π π π

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 π) (seller

price

− → buyer1 ∧ bank

mortgage

− → buyer2); ({buyer1,buyer2}

accept

− → seller ∧ {buyer1,buyer2}

accept

− → bank)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 10 / 31

slide-63
SLIDE 63

logoP7

Syntax of Global Types

Global Types G ::= skip (skip) | π π π

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 π) (seller

price

− → buyer1 ∧ bank

mortgage

− → buyer2); ({buyer1,buyer2}

accept

− → seller ∧ {buyer1,buyer2}

accept

− → bank)

2 Kleene star yields termination under fairness for free.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 10 / 31

slide-64
SLIDE 64

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-65
SLIDE 65

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-66
SLIDE 66

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-67
SLIDE 67

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Every action corresponds to a pair

  • f communications.

Every communication comes from an action. A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-68
SLIDE 68

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Every action corresponds to a pair

  • f communications.

Every communication comes from an action. A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-69
SLIDE 69

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Every action corresponds to a pair

  • f communications.

Every communication comes from an action. A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-70
SLIDE 70

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Every action corresponds to a pair

  • f communications.

Every communication comes from an action. A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-71
SLIDE 71

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Global choices correspond to internal/external choice pairs A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-72
SLIDE 72

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Global choices correspond to internal/external choice pairs A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-73
SLIDE 73

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Global choices correspond to internal/external choice pairs A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-74
SLIDE 74

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Global choices correspond to internal/external choice pairs A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-75
SLIDE 75

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Kleene stars correspond to recursion A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-76
SLIDE 76

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) The order of sequential compositions is respected A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-77
SLIDE 77

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Actions composed by “∧” appear in some order. A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-78
SLIDE 78

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Actions composed by “∧” appear in some order. But other orders are admitted A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !descr. buyer! ! !price. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?descr. seller? ? ?price. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-79
SLIDE 79

logoP7

From Global to Local

Back to our example: (seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Actions composed by “∧” appear in some order. But other orders are admitted A possible implementation:

seller

✬ ✫ ✩ ✪

buyer! ! !price. buyer! ! !descr. rec X . ( buyer? ? ?offer. . .buyer! ! !price.X + + +buyer? ? ?accept.end + + +buyer? ? ?quit.end )

buyer

✬ ✫ ✩ ✪

seller? ? ?price. seller? ? ?descr. rec X . ( seller! ! !offer. . .seller? ? ?price.X ⊕ ⊕ ⊕seller! ! !accept.end ⊕ ⊕ ⊕seller! ! !quit.end )

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 11 / 31

slide-80
SLIDE 80

logoP7

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)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 12 / 31

slide-81
SLIDE 81

logoP7

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:

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 12 / 31

slide-82
SLIDE 82

logoP7

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)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 12 / 31

slide-83
SLIDE 83

logoP7

Soundness and completeness [first technical slide]

1 Define the traces of a global types in the obvious way:

tr(skip) = {ε} tr(π

a

− → p) = {π

a

− → p} tr(G ∗) = (tr(G ))⋆ tr(G1; G2) = tr(G1)tr(G2) tr(G1 ∨ G2) = tr(G1) ∪ tr(G2) tr(G1 ∧ G2) = tr(G1) ∃ tr(G2) (shuffle)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 13 / 31

slide-84
SLIDE 84

logoP7

Soundness and completeness [first technical slide]

1 Define the traces of a global types in the obvious way:

tr(skip) = {ε} tr(π

a

− → p) = {π

a

− → p} tr(G ∗) = (tr(G ))⋆ tr(G1; G2) = tr(G1)tr(G2) tr(G1 ∨ G2) = tr(G1) ∪ tr(G2) tr(G1 ∧ G2) = tr(G1) ∃ tr(G2) (shuffle)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 13 / 31

slide-85
SLIDE 85

logoP7

Soundness and completeness [first technical slide]

1 Define the traces of a global types in the obvious way:

tr(skip) = {ε} tr(π

a

− → p) = {π

a

− → p} tr(G ∗) = (tr(G ))⋆ tr(G1; G2) = tr(G1)tr(G2) tr(G1 ∨ G2) = tr(G1) ∪ tr(G2) tr(G1 ∧ G2) = tr(G1) ∃ tr(G2) (shuffle)

2 Define the traces of sets of components as traces of an LTS:

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 13 / 31

slide-86
SLIDE 86

logoP7

Soundness and completeness [first technical slide]

1 Define the traces of a global types in the obvious way:

tr(skip) = {ε} tr(π

a

− → p) = {π

a

− → p} tr(G ∗) = (tr(G ))⋆ tr(G1; G2) = tr(G1)tr(G2) tr(G1 ∨ G2) = tr(G1) ∪ tr(G2) tr(G1 ∧ G2) = tr(G1) ∃ tr(G2) (shuffle)

2 Define the traces of sets of components as traces of an LTS:

  • B

{..., p :

i∈I pi!

! !ai.Ti, ...}

− − − →

  • (p

ak

− → pk)::B {..., p : Tk, ...}

  • (k∈I)
  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 13 / 31

slide-87
SLIDE 87

logoP7

Soundness and completeness [first technical slide]

1 Define the traces of a global types in the obvious way:

tr(skip) = {ε} tr(π

a

− → p) = {π

a

− → p} tr(G ∗) = (tr(G ))⋆ tr(G1; G2) = tr(G1)tr(G2) tr(G1 ∨ G2) = tr(G1) ∪ tr(G2) tr(G1 ∧ G2) = tr(G1) ∃ tr(G2) (shuffle)

2 Define the traces of sets of components as traces of an LTS:

  • B

{..., p :

i∈I pi!

! !ai.Ti, ...}

− − − →

  • (p

ak

− → pk)::B {..., p : Tk, ...}

  • (k∈I)
  • B::(pi

a

− →p)i∈I {..., p:

j∈J πj?

? ?aj.Tj, ...}

  • πk

a

− →p

− − − − →

  • B

{..., p : Tk, ...}

  • (πk={pi}i∈I )
  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 13 / 31

slide-88
SLIDE 88

logoP7

Soundness and completeness [first technical slide]

1 Define the traces of a global types in the obvious way:

tr(skip) = {ε} tr(π

a

− → p) = {π

a

− → p} tr(G ∗) = (tr(G ))⋆ tr(G1; G2) = tr(G1)tr(G2) tr(G1 ∨ G2) = tr(G1) ∪ tr(G2) tr(G1 ∧ G2) = tr(G1) ∃ tr(G2) (shuffle)

2 Define the traces of sets of components as traces of an LTS:

  • B

{..., p :

i∈I pi!

! !ai.Ti, ...}

− − − →

  • (p

ak

− → pk)::B {..., p : Tk, ...}

  • (k∈I)
  • B::(pi

a

− →p)i∈I {..., p:

j∈J πj?

? ?aj.Tj, ...}

  • πk

a

− →p

− − − − →

  • B

{..., p : Tk, ...}

  • (πk={pi}i∈I )

3 Soundness: tr({pi:Ti}i∈I) ⊆ tr(G )

every trace of {pi:Ti}i∈I is a trace of G

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 13 / 31

slide-89
SLIDE 89

logoP7

Soundness and completeness [first technical slide]

1 Define the traces of a global types in the obvious way:

tr(skip) = {ε} tr(π

a

− → p) = {π

a

− → p} tr(G ∗) = (tr(G ))⋆ tr(G1; G2) = tr(G1)tr(G2) tr(G1 ∨ G2) = tr(G1) ∪ tr(G2) tr(G1 ∧ G2) = tr(G1) ∃ tr(G2) (shuffle)

2 Define the traces of sets of components as traces of an LTS:

  • B

{..., p :

i∈I pi!

! !ai.Ti, ...}

− − − →

  • (p

ak

− → pk)::B {..., p : Tk, ...}

  • (k∈I)
  • B::(pi

a

− →p)i∈I {..., p:

j∈J πj?

? ?aj.Tj, ...}

  • πk

a

− →p

− − − − →

  • B

{..., p : Tk, ...}

  • (πk={pi}i∈I )

3 Soundness: tr({pi:Ti}i∈I) ⊆ tr(G )

every trace of {pi:Ti}i∈I is a trace of G

4 Completeness: tr(G ) ⊆ tr({pi:Ti}i∈I)◦:

every trace of G is the permutation of a trace of {pi:Ti}i∈I.

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

slide-90
SLIDE 90

logoP7

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:

(p

a

− → q; r

b

− → s)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 14 / 31

slide-91
SLIDE 91

logoP7

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:

(p

a

− → q; r

b

− → s)

2 No decision maker: Branching must be decided by someone

p

a

− → q ∨ q

b

− → p

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 14 / 31

slide-92
SLIDE 92

logoP7

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:

(p

a

− → q; r

b

− → s)

2 No decision maker: Branching must be decided by someone

p

a

− → q ∨ q

b

− → p

3 No knowledge: Other participants are not aware of the choice made.

(p

a

− → q; q

a

− → r; r

a

− → p) ∨ (p

b

− → q; q

a

− → r; r

b

− → p)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 14 / 31

slide-93
SLIDE 93

logoP7

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:

(p

a

− → q; r

b

− → s)

2 No decision maker: Branching must be decided by someone

p

a

− → q ∨ q

b

− → p

3 No knowledge: Other participants are not aware of the choice made.

(p

a

− → q; q

a

− → r; r

a

− → p) ∨ (p

b

− → q; q

a

− → r; r

b

− → p) 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

slide-94
SLIDE 94

logoP7

Examples

This still leaves a lot of flexibility (cf. state of the art): same message different receivers in a choice ( seller

price

− → buyer1; buyer1

price

− → buyer2 ∨ seller

price

− → buyer2; buyer2

price

− → buyer1)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 15 / 31

slide-95
SLIDE 95

logoP7

Examples

This still leaves a lot of flexibility (cf. state of the art): same message different receivers in a choice ( seller

price

− → buyer1; buyer1

price

− → buyer2 ∨ seller

price

− → buyer2; buyer2

price

− → buyer1) different receivers to break a loop seller

agency

− → broker; (broker offer − → buyer; buyer counteroffer − → broker)∗ ∗ ∗; (broker result − → seller ∧ broker result − → buyer)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 15 / 31

slide-96
SLIDE 96

logoP7

Projection [last technical slide]

Global types not inherently flawed are associated to sound and complete sets of components compositionally by a deduction system

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 16 / 31

slide-97
SLIDE 97

logoP7

Projection [last technical slide]

Global types not inherently flawed are associated to sound and complete sets of components compositionally by a deduction system

(SP-Skip)

∆ ⊢ skip ⊲ ∆

(SP-Action)

{p : S, q : T, ...} ⊢ p

a

− → q ⊲ {p : q! ! !a.S, q : p? ? ?a.T, ...}

(SP-Sequence)

∆ ⊢ G2 ⊲ ∆′ ∆′ ⊢ G1 ⊲ ∆′′ ∆ ⊢ G1; G2 ⊲ ∆′′

(SP-Iteration)

{p : T1 ⊕ T2, ...} ⊢ G ⊲ {p : T1, ...} {p : T2, ...} ⊢ G ∗ ⊲ {p : T1 ⊕ T2, ...}

(SP-Alternative)

∆ ⊢ G1 ⊲ {p : T1, ...} ∆ ⊢ G2 ⊲ {p : T2, ...} ∆ ⊢ G1 ∨ ∨ ∨ G2 ⊲ {p : T1 ⊕ T2, ...}

(SP-Subsumption)

∆ ⊢ G ′ ⊲ ∆′ G ′ G ∆′′ ∆′ ∆ ⊢ G ⊲ ∆′′

(XY

def

= tr(L)⊆tr(M)⊆tr(L)◦)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 16 / 31

slide-98
SLIDE 98

logoP7

Projection [last technical slide]

Global types not inherently flawed are associated to sound and complete sets of components compositionally by a deduction system

(SP-Skip)

∆ ⊢ skip ⊲ ∆

(SP-Action)

{p : S, q : T, ...} ⊢ p

a

− → q ⊲ {p : q! ! !a.S, q : p? ? ?a.T, ...}

(SP-Sequence)

∆ ⊢ G2 ⊲ ∆′ ∆′ ⊢ G1 ⊲ ∆′′ ∆ ⊢ G1; G2 ⊲ ∆′′

(SP-Iteration)

{p : T1 ⊕ T2, ...} ⊢ G ⊲ {p : T1, ...} {p : T2, ...} ⊢ G ∗ ⊲ {p : T1 ⊕ T2, ...}

(SP-Alternative)

∆ ⊢ G1 ⊲ {p : T1, ...} ∆ ⊢ G2 ⊲ {p : T2, ...} ∆ ⊢ G1 ∨ ∨ ∨ G2 ⊲ {p : T1 ⊕ T2, ...}

(SP-Subsumption)

∆ ⊢ G ′ ⊲ ∆′ G ′ G ∆′′ ∆′ ∆ ⊢ G ⊲ ∆′′

(XY

def

= tr(L)⊆tr(M)⊆tr(L)◦)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 16 / 31

slide-99
SLIDE 99

logoP7

Projection [last technical slide]

Global types not inherently flawed are associated to sound and complete sets of components compositionally by a deduction system

(SP-Skip)

∆ ⊢ skip ⊲ ∆

(SP-Action)

{p : S, q : T, ...} ⊢ p

a

− → q ⊲ {p : q! ! !a.S, q : p? ? ?a.T, ...}

(SP-Sequence)

∆ ⊢ G2 ⊲ ∆′ ∆′ ⊢ G1 ⊲ ∆′′ ∆ ⊢ G1; G2 ⊲ ∆′′

(SP-Iteration)

{p : T1 ⊕ T2, ...} ⊢ G ⊲ {p : T1, ...} {p : T2, ...} ⊢ G ∗ ⊲ {p : T1 ⊕ T2, ...}

(SP-Alternative)

∆ ⊢ G1 ⊲ {p : T1, ...} ∆ ⊢ G2 ⊲ {p : T2, ...} ∆ ⊢ G1 ∨ ∨ ∨ G2 ⊲ {p : T1 ⊕ T2, ...}

(SP-Subsumption)

∆ ⊢ G ′ ⊲ ∆′ G ′ G ∆′′ ∆′ ∆ ⊢ G ⊲ ∆′′

(XY

def

= tr(L)⊆tr(M)⊆tr(L)◦)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 16 / 31

slide-100
SLIDE 100

logoP7

Projection [last technical slide]

Global types not inherently flawed are associated to sound and complete sets of components compositionally by a deduction system

(SP-Skip)

∆ ⊢ skip ⊲ ∆

(SP-Action)

{p : S, q : T, ...} ⊢ p

a

− → q ⊲ {p : q! ! !a.S, q : p? ? ?a.T, ...}

(SP-Sequence)

∆ ⊢ G2 ⊲ ∆′ ∆′ ⊢ G1 ⊲ ∆′′ ∆ ⊢ G1; G2 ⊲ ∆′′

(SP-Iteration)

{p : T1 ⊕ T2, ...} ⊢ G ⊲ {p : T1, ...} {p : T2, ...} ⊢ G ∗ ⊲ {p : T1 ⊕ T2, ...}

(SP-Alternative)

∆ ⊢ G1 ⊲ {p : T1, ...} ∆ ⊢ G2 ⊲ {p : T2, ...} ∆ ⊢ G1 ∨ ∨ ∨ G2 ⊲ {p : T1 ⊕ T2, ...}

(SP-Subsumption)

∆ ⊢ G ′ ⊲ ∆′ G ′ G ∆′′ ∆′ ∆ ⊢ G ⊲ ∆′′

(XY

def

= tr(L)⊆tr(M)⊆tr(L)◦)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 16 / 31

slide-101
SLIDE 101

logoP7

Projection [last technical slide]

Global types not inherently flawed are associated to sound and complete sets of components compositionally by a deduction system

(SP-Skip)

∆ ⊢ skip ⊲ ∆

(SP-Action)

{p : S, q : T, ...} ⊢ p

a

− → q ⊲ {p : q! ! !a.S, q : p? ? ?a.T, ...}

(SP-Sequence)

∆ ⊢ G2 ⊲ ∆′ ∆′ ⊢ G1 ⊲ ∆′′ ∆ ⊢ G1; G2 ⊲ ∆′′

(SP-Iteration)

{p : T1 ⊕ T2, ...} ⊢ G ⊲ {p : T1, ...} {p : T2, ...} ⊢ G ∗ ⊲ {p : T1 ⊕ T2, ...}

(SP-Alternative)

∆ ⊢ G1 ⊲ {p : T1, ...} ∆ ⊢ G2 ⊲ {p : T2, ...} ∆ ⊢ G1 ∨ ∨ ∨ G2 ⊲ {p : T1 ⊕ T2, ...}

(SP-Subsumption)

∆ ⊢ G ′ ⊲ ∆′ G ′ G ∆′′ ∆′ ∆ ⊢ G ⊲ ∆′′ Makes projection algorithm very hard (see proceedings)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 16 / 31

slide-102
SLIDE 102

logoP7

A three-layered structure

G Global Type G = alice

nat

− → bob; bob

nat

− → charlie Talice Tbob Tcharlie Local Types Tbob= alice? ? ?nat. charlie! ! !nat. end Palice Pbob Pcharlie Processes Pbob= receive x from alice; send x+42 to charlie; end Projection Type checking

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 17 / 31

slide-103
SLIDE 103

logoP7

A three-layered structure

G Global Type G = alice

nat

− → bob; bob

nat

− → charlie Talice Tbob Tcharlie Local Types Tbob= alice? ? ?nat. charlie! ! !nat. end Palice Pbob Pcharlie Processes Pbob= receive x from alice; send x+42 to charlie; end Projection Type checking

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 17 / 31

slide-104
SLIDE 104

logoP7

A three-layered structure

G Global Type G = alice

nat

− → bob; bob

nat

− → charlie Talice Tbob Tcharlie Local Types Tbob= alice? ? ?nat. charlie! ! !nat. end Palice Pbob Pcharlie Processes Pbob= receive x from alice; send x+42 to charlie; end Projection Type checking

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 17 / 31

slide-105
SLIDE 105

logoP7

A three-layered structure

G Global Type G = alice

nat

− → bob; bob

nat

− → charlie Talice Tbob Tcharlie Local Types Tbob= alice? ? ?nat. charlie! ! !nat. end Palice Pbob Pcharlie Processes Pbob= receive x from alice; send x+42 to charlie; end Projection Type checking

Sought properties (second-third layers):

1 Subject reduction: No communication errors; 2 Progress: No stuck processes (safety); 3 Fairness: No starving processes (liveness).

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 17 / 31

subject reduction progress, fairness soundness completeness

slide-106
SLIDE 106

logoP7

A three-layered structure

G Global Type G = alice

nat

− → bob; bob

nat

− → charlie Talice Tbob Tcharlie Local Types Tbob= alice? ? ?nat. charlie! ! !nat. end Palice Pbob Pcharlie Processes Pbob= receive x from alice; send x+42 to charlie; end Projection Type checking

Sought properties (second-third layers):

1 Subject reduction: No communication errors; 2 Progress: No stuck processes (safety); 3 Fairness: No starving processes (liveness).

Checked on Local Types

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 17 / 31

subject reduction progress, fairness soundness completeness

slide-107
SLIDE 107

logoP7

Other approaches

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 18 / 31

slide-108
SLIDE 108

logoP7

Automata approach: global specifications

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.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 19 / 31

slide-109
SLIDE 109

logoP7

Automata approach: global specifications

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. Message Sequence Graphs: seller buyer descr price seller buyer

  • ffer

price seller buyer accept seller buyer quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 19 / 31

slide-110
SLIDE 110

logoP7

Automata approach: global specifications

(seller descr − → buyer ∧ ∧ ∧ seller

price

− → buyer); ; ; (buyer offer − → seller; ; ; seller

price

− → buyer)∗ ∗ ∗; ; ; (buyer

accept

− → seller ∨ ∨ ∨ buyer

quit

− → seller) Message Sequence Graphs: seller buyer descr price seller buyer

  • ffer

price seller buyer accept seller buyer quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 19 / 31

slide-111
SLIDE 111

logoP7

Automata approach: local specifications

Seller buffers Buyer q0 start q1 q2 q4 q3

buyer! ! !descr buyer! ! !price buyer? ? ?offer buyer? ? ?accept buyer? ? ?quit

CFSM

Communicating Finite State Machines

q0 start q1 q2 q4 q3

seller? ? ?descr seller? ? ?price seller! ! !offer seller! ! !accept seller! ! !quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 20 / 31

slide-112
SLIDE 112

logoP7

Automata approach: local specifications

Seller buffers Buyer q0 start q1 q2 q4 q3

buyer! ! !descr buyer! ! !price buyer? ? ?offer buyer? ? ?accept buyer? ? ?quit

CFSM

Communicating Finite State Machines

q0 start q1 q2 q4 q3

seller? ? ?descr seller? ? ?price seller! ! !offer seller! ! !accept seller! ! !quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 20 / 31

slide-113
SLIDE 113

logoP7

Automata approach: local specifications

Seller buffers Buyer q0 start q1 q2 q4 q3

buyer! ! !descr buyer! ! !price buyer? ? ?offer buyer? ? ?accept buyer? ? ?quit

descr

CFSM

Communicating Finite State Machines

q0 start q1 q2 q4 q3

seller? ? ?descr seller? ? ?price seller! ! !offer seller! ! !accept seller! ! !quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 20 / 31

slide-114
SLIDE 114

logoP7

Automata approach: local specifications

Seller buffers Buyer q0 start q1 q2 q4 q3

buyer! ! !descr buyer! ! !price buyer? ? ?offer buyer? ? ?accept buyer? ? ?quit

descr

CFSM

Communicating Finite State Machines

q0 start q1 q2 q4 q3

seller? ? ?descr seller? ? ?price seller! ! !offer seller! ! !accept seller! ! !quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 20 / 31

slide-115
SLIDE 115

logoP7

Automata approach: local specifications

Seller buffers Buyer q0 start q1 q2 q4 q3

buyer! ! !descr buyer! ! !price buyer? ? ?offer buyer? ? ?accept buyer? ? ?quit

descr price

CFSM

Communicating Finite State Machines

q0 start q1 q2 q4 q3

seller? ? ?descr seller? ? ?price seller! ! !offer seller! ! !accept seller! ! !quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 20 / 31

slide-116
SLIDE 116

logoP7

Automata approach: local specifications

Seller buffers Buyer q0 start q1 q2 q4 q3

buyer! ! !descr buyer! ! !price buyer? ? ?offer buyer? ? ?accept buyer? ? ?quit

descr price

CFSM

Communicating Finite State Machines

q0 start q1 q2 q4 q3

seller? ? ?descr seller? ? ?price seller! ! !offer seller! ! !accept seller! ! !quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 20 / 31

slide-117
SLIDE 117

logoP7

Automata approach: local specifications

Seller buffers Buyer q0 start q1 q2 q2 q4 q3

buyer! ! !descr buyer! ! !price buyer? ? ?offer buyer? ? ?accept buyer? ? ?quit

price

CFSM

Communicating Finite State Machines

q0 start q1 q2 q4 q3

seller? ? ?descr seller? ? ?price seller! ! !offer seller! ! !accept seller! ! !quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 20 / 31

slide-118
SLIDE 118

logoP7

Automata approach: local specifications

Seller buffers Buyer q0 start q1 q2 q2 q4 q3

buyer! ! !descr buyer! ! !price buyer? ? ?offer buyer? ? ?accept buyer? ? ?quit

price

CFSM

Communicating Finite State Machines

q0 start q1 q2 q4 q3

seller? ? ?descr seller? ? ?price seller! ! !offer seller! ! !accept seller! ! !quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 20 / 31

slide-119
SLIDE 119

logoP7

Automata approach: local specifications

Seller buffers Buyer q0 start q1 q2 q2 q4 q3

buyer! ! !descr buyer! ! !price buyer? ? ?offer buyer? ? ?accept buyer? ? ?quit

CFSM

Communicating Finite State Machines

q0 start q1 q2 q4 q3

seller? ? ?descr seller? ? ?price seller! ! !offer seller! ! !accept seller! ! !quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 20 / 31

slide-120
SLIDE 120

logoP7

Automata approach: local specifications

Seller buffers Buyer q0 start q1 q2 q2 q4 q3

buyer! ! !descr buyer! ! !price buyer? ? ?offer buyer? ? ?accept buyer? ? ?quit

CFSM

Communicating Finite State Machines

q0 start q1 q2 q4 q3

seller? ? ?descr seller? ? ?price seller! ! !offer seller! ! !accept seller! ! !quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 20 / 31

slide-121
SLIDE 121

logoP7

Automata approach: local specifications

Seller buffers Buyer q0 start q1 q2 q2 q4 q3

buyer! ! !descr buyer! ! !price buyer? ? ?offer buyer? ? ?accept buyer? ? ?quit

quit

CFSM

Communicating Finite State Machines

q0 start q1 q2 q4 q3

seller? ? ?descr seller? ? ?price seller! ! !offer seller! ! !accept seller! ! !quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 20 / 31

slide-122
SLIDE 122

logoP7

Automata approach: local specifications

Seller buffers Buyer q0 start q1 q2 q2 q4 q3

buyer! ! !descr buyer! ! !price buyer? ? ?offer buyer? ? ?accept buyer? ? ?quit

quit

CFSM

Communicating Finite State Machines

q0 start q1 q2 q4 q3

seller? ? ?descr seller? ? ?price seller! ! !offer seller! ! !accept seller! ! !quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 20 / 31

slide-123
SLIDE 123

logoP7

Automata approach: local specifications

Seller buffers Buyer q0 start q1 q2 q4 q3

buyer! ! !descr buyer! ! !price buyer? ? ?offer buyer? ? ?accept buyer? ? ?quit

CFSM

Communicating Finite State Machines

q0 start q1 q2 q4 q3

seller? ? ?descr seller? ? ?price seller! ! !offer seller! ! !accept seller! ! !quit

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 20 / 31

slide-124
SLIDE 124

logoP7

Automata approach: problems and results

Research focused on decidability, expressivity, and complexity.

1 CFSM are Turing complete.

Typical problems: termination, reachability, deadlock freedom, boundedness (in general undecidable). Study of restrictions to make them decidable (eg, lossy channels, half-duplex, bounded buffers,...).

2 MSG are finitely generated.

Typical problems: model checking, implementability. Study of variants: to have good closure properties, to make projection (into CFSM) effectively and efficiently implementable,

3 Implementability (generally meaning the same traces).

Study of different notions of implementability (eg, unsound implementations, implementations with a controlled use of covert channels, implementation admitting deadlocks) to obtain decidability and/or polynomial complexity.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 21 / 31

slide-125
SLIDE 125

logoP7

The protocol approach: global specifications

MSC (as for automata, but much more detailed):

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 22 / 31 RFC 2945 (SRP Authentication and Key Exchange System)

slide-126
SLIDE 126

logoP7

The protocol approach: global specifications

MSC (as for automata, but much more detailed):

U = <username> a = random() A = g a%N p = < raw password > x = SHA(s|SHA(U|′′ :′′ |p)) S = (B − g x)(a+u∗x)%N K = SHA Interleave(S)

client host U s A B

s = <salt from passwd file> v = <stored passwd verif> b = random() B = (v + g b)%N S = (A ∗ v u)b%N K = SHA Interleave(S)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 22 / 31 RFC 2945 (SRP Authentication and Key Exchange System)

slide-127
SLIDE 127

logoP7

The protocol approach: global specifications

MSC (as for automata, but much more detailed):

U = <username> a = random() A = g a%N p = < raw password > x = SHA(s|SHA(U|′′ :′′ |p)) S = (B − g x)(a+u∗x)%N K = SHA Interleave(S)

client host U s A B

s = <salt from passwd file> v = <stored passwd verif> b = random() B = (v + g b)%N S = (A ∗ v u)b%N K = SHA Interleave(S)

Says how messages are generated

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 22 / 31 RFC 2945 (SRP Authentication and Key Exchange System)

slide-128
SLIDE 128

logoP7

The protocol approach: global specifications

MSC (as for automata, but much more detailed):

U = <username> a = random() A = g a%N p = < raw password > x = SHA(s|SHA(U|′′ :′′ |p)) S = (B − g x)(a+u∗x)%N K = SHA Interleave(S)

client host U s A B

s = <salt from passwd file> v = <stored passwd verif> b = random() B = (v + g b)%N S = (A ∗ v u)b%N K = SHA Interleave(S)

Says how messages are generated Says how messages are used

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 22 / 31 RFC 2945 (SRP Authentication and Key Exchange System)

slide-129
SLIDE 129

logoP7

Differences with automata and service approaches

Simpler and lower-level paradigms: Interaction patterns are simpler (protocols are finite: MSCs instead of MSGs) Content of interactions is richer and more detailed (in automata a finite set of message is often used). The details of internal execution are exposed both in global and local specifications (a small overlook may yield dramatic flaws)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 23 / 31

slide-130
SLIDE 130

logoP7

Differences with automata and service approaches

Simpler and lower-level paradigms: Interaction patterns are simpler (protocols are finite: MSCs instead of MSGs) Content of interactions is richer and more detailed (in automata a finite set of message is often used). The details of internal execution are exposed both in global and local specifications (a small overlook may yield dramatic flaws) A larger variety of specification languages (induced by the points above): Global: Carlsen, Casper, CAPSL, CASRUL, ... Local: modal logic, CSP, CCS, rewriting systems, spi-calculus.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 23 / 31

slide-131
SLIDE 131

logoP7

Differences with automata and service approaches

Simpler and lower-level paradigms: Interaction patterns are simpler (protocols are finite: MSCs instead of MSGs) Content of interactions is richer and more detailed (in automata a finite set of message is often used). The details of internal execution are exposed both in global and local specifications (a small overlook may yield dramatic flaws) A larger variety of specification languages (induced by the points above): Global: Carlsen, Casper, CAPSL, CASRUL, ... Local: modal logic, CSP, CCS, rewriting systems, spi-calculus. Dynamicity (accounted for both by projection and by analysis) Protocols are specified for roles, implemented by several participants. Systems may include intruders and non specified participants that may alter the topology of interactions Different executions of the protocol may not be independent (cf. store and replay attacks)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 23 / 31

slide-132
SLIDE 132

logoP7

Related work in the “services” approach.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 24 / 31

slide-133
SLIDE 133

logoP7

Related work in the “services” approach

The “services” approach explores different variants of global specifications, ... as the “automata” approach does. The focus is on how to model some use-cases rather than how to satisfy some properties. Two examples:

1 How to model a dynamically changing topology: channels. 2 How to model a dynamically changing set of participants: roles.

See the long version of the article for an extensive review of related work

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 25 / 31

slide-134
SLIDE 134

logoP7

Higher-order sessions

[Honda, Yoshida, Carbone 2008]

Specify channels and pass them around

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 26 / 31

slide-135
SLIDE 135

logoP7

Higher-order sessions

[Honda, Yoshida, Carbone 2008]

Specify channels and pass them around Two channels: b shared by Alice and Bob, and c by Alice and Charlie. Alice

cInt

− − − → Charlie; send an integer on channel c Alice

bc:!Int

− − − − − → Bob; delegate the sending of an int on c Bob

cInt

− − − → Charlie; send an integer on channel c Alice

cInt

− − − → Charlie; send an integer on channel c

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 26 / 31

slide-136
SLIDE 136

logoP7

Higher-order sessions

[Honda, Yoshida, Carbone 2008]

Specify channels and pass them around Two channels: b shared by Alice and Bob, and c by Alice and Charlie. Alice

cInt

− − − → Charlie; send an integer on channel c Alice

bc:!Int

− − − − − → Bob; delegate the sending of an int on c Bob

cInt

− − − → Charlie; send an integer on channel c Alice

cInt

− − − → Charlie; send an integer on channel c

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 26 / 31

slide-137
SLIDE 137

logoP7

Higher-order sessions

[Honda, Yoshida, Carbone 2008]

Specify channels and pass them around Two channels: b shared by Alice and Bob, and c by Alice and Charlie. Alice

cInt

− − − → Charlie; send an integer on channel c Alice

bc:!Int

− − − − − → Bob; delegate the sending of an int on c Bob

cInt

− − − → Charlie; send an integer on channel c Alice

cInt

− − − → Charlie; send an integer on channel c

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 26 / 31

slide-138
SLIDE 138

logoP7

Higher-order sessions

[Honda, Yoshida, Carbone 2008]

Specify channels and pass them around Two channels: b shared by Alice and Bob, and c by Alice and Charlie. Alice

cInt

− − − → Charlie; send an integer on channel c Alice

bc:!Int

− − − − − → Bob; delegate the sending of an int on c Bob

cInt

− − − → Charlie; send an integer on channel c Alice

cInt

− − − → Charlie; send an integer on channel c

Alice

✬ ✫ ✩ ✪

send 1 on c in send c on b in send 3 on c in ()

Bob

✬ ✫ ✩ ✪

receive $k on b in send 2 on $k in ()

Charlie

✬ ✫ ✩ ✪

receive $x on c in receive $y on c in receive $z on c in $x+$y+$z

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 26 / 31

slide-139
SLIDE 139

logoP7

Higher-order sessions

[Honda, Yoshida, Carbone 2008]

Specify channels and pass them around Two channels: b shared by Alice and Bob, and c by Alice and Charlie. Alice

cInt

− − − → Charlie; send an integer on channel c Alice

bc:!Int

− − − − − → Bob; delegate the sending of an int on c Bob

cInt

− − − → Charlie; send an integer on channel c Alice

cInt

− − − → Charlie; send an integer on channel c

Alice

✬ ✫ ✩ ✪

send 1 on c in send c on b in send 3 on c in ()

Bob

✬ ✫ ✩ ✪

receive $k on b in send 2 on $k in ()

Charlie

✬ ✫ ✩ ✪

receive $x on c in receive $y on c in receive $z on c in $x+$y+$z

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 26 / 31

slide-140
SLIDE 140

logoP7

Dynamic multirole sessions

[Deni´ elou & Yoshida 2011]

A seller that deal with just one or two buyers is unrealistic: ∀x : buyer. (seller descr − → x ∧ seller

price

− → x); (x

accept

− → seller ∨ x

quit

− → seller) buyer is a role: can be played by different participants (ranged over by x)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 27 / 31

slide-141
SLIDE 141

logoP7

Dynamic multirole sessions

[Deni´ elou & Yoshida 2011]

A seller that deal with just one or two buyers is unrealistic: ∀x : buyer. (seller descr − → x ∧ seller

price

− → x); (x

accept

− → seller ∨ x

quit

− → seller) buyer is a role: can be played by different participants (ranged over by x)

seller

✗ ✖ ✔ ✕

∀x : buyer. x! ! !descr. x! ! !price. (x? ? ?accept + x? ? ?quit)

buyer

✗ ✖ ✔ ✕

seller? ? ?descr. seller? ? ?price. (seller! ! !accept ⊕ seller! ! !quit)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 27 / 31

slide-142
SLIDE 142

logoP7

Dynamic multirole sessions

[Deni´ elou & Yoshida 2011]

A seller that deal with just one or two buyers is unrealistic: ∀x : buyer. (seller descr − → x ∧ seller

price

− → x); (x

accept

− → seller ∨ x

quit

− → seller) buyer is a role: can be played by different participants (ranged over by x)

seller

✗ ✖ ✔ ✕

∀x : buyer. x! ! !descr. x! ! !price. (x? ? ?accept + x? ? ?quit)

buyer

✗ ✖ ✔ ✕

seller? ? ?descr. seller? ? ?price. (seller! ! !accept ⊕ seller! ! !quit) Main property: Communication safety and progress of projections are ensured also in the presence of dynamically joining and leaving participants

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 27 / 31

slide-143
SLIDE 143

logoP7

Dynamic multirole sessions

[Deni´ elou & Yoshida 2011]

A seller that deal with just one or two buyers is unrealistic: ∀x : buyer. (seller descr − → x ∧ seller

price

− → x); (x

accept

− → seller ∨ x

quit

− → seller) buyer is a role: can be played by different participants (ranged over by x)

seller

✗ ✖ ✔ ✕

∀x : buyer. x! ! !descr. x! ! !price. (x? ? ?accept + x? ? ?quit)

buyer

✗ ✖ ✔ ✕

seller? ? ?descr. seller? ? ?price. (seller! ! !accept ⊕ seller! ! !quit) Main property: Communication safety and progress of projections are ensured also in the presence of dynamically joining and leaving participants In this and the previous work roles and dynamicity are respectively inter- nalized (in the “protocols” approach they usually are at the meta-level)

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 27 / 31

slide-144
SLIDE 144

logoP7

Conclusion

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 28 / 31

slide-145
SLIDE 145

logoP7

Conclusion

Automata and Services: The automata approach has a wealth of results in decidability and complexity that the services approach can use in studying its own framework and as guidelines for the definition of new ones. The automata community can find in the service framework new applications for their results and a new playground. Protocol and Services: Protocols and Services approaches have a lot of common and they can mutually influence much more. Typing techniques are used to prove security properties while security protocols research spurs new research in type theory. Mutual influence is already happening:

WPPL [McCarthy & Krishnamurthi 2008] is a work in the verification

  • f protocols directly inspired to multiparty section types

Dynamic multirole session types [Deni´ elou & Yoshida 2011] endow sessions with roles that protocols have been studying for many years.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 29 / 31

slide-146
SLIDE 146

logoP7

A conclusion that Jacques II de Chabannes, seigneur de Lapalisse would have been proud of: There are huge potential benefits for these communities to put their research efforts together.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 30 / 31

slide-147
SLIDE 147

logoP7

Acknowledgments

The following persons helped us in preparing the survey in the full paper: Mart´ ın Abadi, Roberto Amadio, Ahmed Bouajjani, Mario Bravetti, Roberto Bruni, Olivier Carton, Ivan Lanese, Anca Muscholl, Mihaela Sighireanu, Nobuko Yoshida, Gianluigi Zavattaro, Wies law Zielonka.

  • G. Castagna (CNRS)

On Global Types and Multi-Party Sessions DisCoTec 2011 - Reykjav´ ık 31 / 31