Bridging the Gap Between Binary and Multiparty Communications Jorge - - PowerPoint PPT Presentation

bridging the gap between binary and multiparty
SMART_READER_LITE
LIVE PREVIEW

Bridging the Gap Between Binary and Multiparty Communications Jorge - - PowerPoint PPT Presentation

Bridging the Gap Between Binary and Multiparty Communications Jorge A. P erez University of Groningen (NL) Joint work with Lu s Caires - Universidade NOVA de Lisboa (PT) Open Problems in Concurrency Theory (OPCT) Bertinoro, June 2014


slide-1
SLIDE 1

Bridging the Gap Between Binary and Multiparty Communications

Jorge A. P´ erez University of Groningen (NL)

Joint work with Lu´ ıs Caires - Universidade NOVA de Lisboa (PT)

Open Problems in Concurrency Theory (OPCT) Bertinoro, June 2014

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-2
SLIDE 2

Outline

An Open Problem This Talk Some Technical Details Preliminaries Medium Processes Main Results Concluding Remarks

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-3
SLIDE 3

Large-Scale Software Infrastructures

  • Massive collections of heterogeneous, communicating services
  • Correctness is a combination of several issues, including:

⋆ Resource usage policies ⋆ Security and trustworthiness requirements ⋆ Conformance to predefined protocols

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-4
SLIDE 4

Large-Scale Software Infrastructures: Protocols

  • Rely on advanced forms of mobility, concurrency, and distribution
  • Conveniently described as chroreographies

⋆ A global description of the overall interactive scenario ⋆ Descriptions of the local behavior for each participant ⋆ Ways of ensuring that implementations “respect” global and local descriptions.

  • Several analysis techniques proposed, including:

⋆ Models/standards for (semi)formal description/analysis (e.g., BPMN) ⋆ Automata-based approaches (e.g., MSCs/MSGs, CFSMs) ⋆ Type-based approaches, such as session types

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-5
SLIDE 5

Session Types: A Class of Behavioral Types

Seminal approach to the analysis structured communications

[Honda (1993); Honda, Vasconcelos, Kubo (1998)]

  • Communication protocols structured into sessions
  • Concurrent processes communicating through session channels
  • Disciplined interactive behavior, abstracted as session types

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-6
SLIDE 6

Session Types: A Class of Behavioral Types

Seminal approach to the analysis structured communications

[Honda (1993); Honda, Vasconcelos, Kubo (1998)]

  • Communication protocols structured into sessions
  • Concurrent processes communicating through session channels
  • Disciplined interactive behavior, abstracted as session types

Correctness guarantees for specifications:

  • Adhere to their ascribed session protocols - Fidelity
  • Do not feature runtime errors – Safety
  • Do not get stuck – Progress / Lock-Freedom
  • Do not have infinite reduction sequences – Termination

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-7
SLIDE 7

STs for Multiparty Communications

  • Multiparty Session Types (MPSTs) [Honda, Yoshida, Carbone (2008)]

⋆ Protocols may involve more than two partners ⋆ Global and local types, related by a projection function ⋆ Underlying theory is subtle; analysis techniques hard to obtain

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-8
SLIDE 8

STs for Multiparty Communications

  • Multiparty Session Types (MPSTs) [Honda, Yoshida, Carbone (2008)]

⋆ Protocols may involve more than two partners ⋆ Global and local types, related by a projection function ⋆ Underlying theory is subtle; analysis techniques hard to obtain

Foundational significance: Sound and complete characterization though communicating

  • automata. [Deni´

elou and Yoshida (2013)]

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-9
SLIDE 9

STs for Multiparty and Binary Communications

  • Multiparty Session Types (MPSTs) [Honda, Yoshida, Carbone (2008)]

⋆ Protocols may involve more than two partners ⋆ Global and local types, related by a projection function ⋆ Underlying theory is subtle; analysis techniques hard to obtain

Foundational significance: Sound and complete characterization though communicating

  • automata. [Deni´

elou and Yoshida (2013)]

  • Binary Session Types (BSTs) [Honda, Vasconcelos, Kubo (1998)]

⋆ Protocols involve exactly two partners ⋆ Correctness depends on action compatibility, realized via type duality ⋆ Well-understood theory and analysis techniques

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-10
SLIDE 10

STs for Multiparty and Binary Communications

  • Multiparty Session Types (MPSTs) [Honda, Yoshida, Carbone (2008)]

⋆ Protocols may involve more than two partners ⋆ Global and local types, related by a projection function ⋆ Underlying theory is subtle; analysis techniques hard to obtain

Foundational significance: Sound and complete characterization though communicating

  • automata. [Deni´

elou and Yoshida (2013)]

  • Binary Session Types (BSTs) [Honda, Vasconcelos, Kubo (1998)]

⋆ Protocols involve exactly two partners ⋆ Correctness depends on action compatibility, realized via type duality ⋆ Well-understood theory and analysis techniques

Foundational significance: Linear logic propositions as session types, in the style of Curry-Howard [Caires and Pfenning (2010); Wadler (2012)]

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-11
SLIDE 11

Can MPSTs Be Reduced Into BSTs?

  • A reduction would be

⋆ theoretically insightful ⋆ practically useful

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-12
SLIDE 12

Can MPSTs Be Reduced Into BSTs?

  • A reduction would be

⋆ theoretically insightful ⋆ practically useful

  • Could we decompose global specifications into binary fragments,

preserving sequencing information in interactions?

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-13
SLIDE 13

Can MPSTs Be Reduced Into BSTs?

  • A reduction would be

⋆ theoretically insightful ⋆ practically useful

  • Could we decompose global specifications into binary fragments,

preserving sequencing information in interactions? – Non trivial!

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-14
SLIDE 14

Can MPSTs Be Reduced Into BSTs?

  • A reduction would be

⋆ theoretically insightful ⋆ practically useful

  • Could we decompose global specifications into binary fragments,

preserving sequencing information in interactions? – Non trivial!

  • Practice suggests that MPSTs are more expressive than BSTs

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-15
SLIDE 15

Can MPSTs Be Reduced Into BSTs?

  • A reduction would be

⋆ theoretically insightful ⋆ practically useful

  • Could we decompose global specifications into binary fragments,

preserving sequencing information in interactions? – Non trivial!

  • Practice suggests that MPSTs are more expressive than BSTs
  • Open problem: We don’t know of any formal results

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-16
SLIDE 16

Outline

An Open Problem This Talk Some Technical Details Preliminaries Medium Processes Main Results Concluding Remarks

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-17
SLIDE 17

This Talk: A Positive Result

We present a formal, two-way correspondence between

  • MPSTs with labeled communication and parallel composition,

following [Honda, Yoshida, Carbone (2008), Deni´

elou and Yoshida (2013)]

  • BSTs based on linear logic, following [Caires and Pfenning (2010)]:

fidelity, safety, termination, and (dead)lock-freedom by typing.

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-18
SLIDE 18

Our Approach

  • We decouple a multiparty communication from p to q:

⋆ A send action from p to some intermediate entity ⋆ A forwarding action from the entity to q

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-19
SLIDE 19

Our Approach: Medium Processes

  • We decouple a multiparty communication from p to q:

⋆ A send action from p to some intermediate entity ⋆ A forwarding action from the entity to q

  • Given a global type G, extract its medium process MG

⋆ Intermediate party in all multiparty exchanges ⋆ Captures sequencing information in G by decoupling interactions ⋆ Local implementations need not know about the medium

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-20
SLIDE 20

MPSTs and BSTs: A Two-Way Correspondence

  • 1. Let G be a well-formed global type.

MG is well-typed under an environment in which participants are assigned types corresponding to the projections of G.

  • 2. Let MG be a well-typed medium process under an environment

in which participants are assigned some binary types. Such binary types correspond, in a precise sense, to the projections of G.

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-21
SLIDE 21

A Possible Methodology

Revising the one proposed in [Honda, Yoshida, Carbone (2008)] (i) A developer describes an intended interaction scenario as a global type G. (ii) She extracts MG and the set of (local) binary session types representing the projection of G onto all participants. (iii) Using logic-based BSTs she checks that MG is well-typed with respect to the set of (local) binary types just extracted. This ensures deadlock-freedom. (iv) She develops code, one for each participant, validating its conformance to the corresponding (local) session type.

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-22
SLIDE 22

Two Different Worlds, Connected via Mediums

  • Multiparty interactions now explained from two different angles
  • Half-way between two essentially distinct, foundational theories
  • Clean justifications, based on linear logic, for MPSTs concepts:

⋆ semantics of global types ⋆ definitions of projection/well-formedness

  • Naturally handles name passing, delegation, parallel composition
  • Direct connection from choreographies to process implementations
  • Techniques for binary processes applicable on global specifications:

⋆ Deadlock freedom ⋆ Typed behavioral equivalences

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-23
SLIDE 23

Outline

An Open Problem This Talk Some Technical Details Preliminaries Medium Processes Main Results Concluding Remarks

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-24
SLIDE 24

Outline

An Open Problem This Talk Some Technical Details Preliminaries Medium Processes Main Results Concluding Remarks

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-25
SLIDE 25

A Standard Session π-calculus

  • Given names (x, y, z, . . .), processes (P, Q, R) are defined by

P ::=

|

P | Q

|

(νy)P

|

x y.P

|

x(y).P

|

!x(y).P

|

x ⊳li; P

|

x ⊲{li : Pi}i∈I

|

[x↔y]

  • We write x(y) to stand for the bound output (νy)x y.
  • An associated LTS with expected labels:

λ ::= τ | x(y) | x ⊳l | x y | x(y) | x ⊳l

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-26
SLIDE 26

MPSTs: Syntax

  • The language of global types subsumes those given in

[Honda, Yoshida, Carbone (2008), Deni´ elou and Yoshida (2013)]

  • Define global and local types as

G ::= end | p։q:{liUi.Gi}i∈I | G1 | G2 T ::= end | p?{liUi.Ti}i∈I | p!{liUi.Ti}i∈I U ::= bool | nat | str | . . . | T

  • G↾pi is the (merge-based) projection of G onto participant pi
  • Well-formedness of G is defined as correct projectability on all pi

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-27
SLIDE 27

Choreographies as MPSTs: A Commit Protocol

Structured interaction among three participants pA, pB, and pC: G = pA ։pB:

  • actint.

pB ։pC:

  • sigstr.

pA ։pC:{comm1.end}

  • ,

quitint. pB ։pC:

  • save1.

pA ։pC:{fin1.end} The projections of G onto pA and pC: G↾pA = pA!

  • actint.pA!{comm1.end},

quitint.pB!{sigstr.end}

  • G↾pC =

pB?

  • sigstr.pA?{comm1.end},

save1.pA?{fin1.end}

  • Relating Binary and Multiparty Communications
  • J. A. P´

erez (Groningen)

slide-28
SLIDE 28

Outline

An Open Problem This Talk Some Technical Details Preliminaries Medium Processes Main Results Concluding Remarks

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-29
SLIDE 29

Medium Process of a Global Type

The medium of global type G, noted MG, is defined inductively as:

  • Mend = 0
  • M p։q:{liUi.Gi}i∈I =

cp ⊲

  • li : cp(u).cq ⊳li; cq(v).([u↔v] | MGi)
  • i∈I
  • MG1 | G2 = MG1 | MG2

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-30
SLIDE 30

Correspondence Between G and MG (Informal)

Let G = p։q:{liUi.Gi}i∈I. Then, we have: MG = cp ⊲

  • li : cp(u).cq ⊳li; cq(v).([u↔v] | MGi)
  • i∈I

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-31
SLIDE 31

Correspondence Between G and MG (Informal)

Let G = p։q:{liUi.Gi}i∈I. Then, we have: MG = cp ⊲

  • li : cp(u).cq ⊳li; cq(v).([u↔v] | MGi)
  • i∈I

cp⊳ lj

− − − → cp(u).cq ⊳lj; cq(v).([u↔v] | MGj) (j ∈ I)

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-32
SLIDE 32

Correspondence Between G and MG (Informal)

Let G = p։q:{liUi.Gi}i∈I. Then, we have: MG = cp ⊲

  • li : cp(u).cq ⊳li; cq(v).([u↔v] | MGi)
  • i∈I

cp⊳ lj

− − − → cp(u).cq ⊳lj; cq(v).([u↔v] | MGj) (j ∈ I)

cp(y)

− − → cq ⊳lj; cq(v).([y↔v] | MGj)

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-33
SLIDE 33

Correspondence Between G and MG (Informal)

Let G = p։q:{liUi.Gi}i∈I. Then, we have: MG = cp ⊲

  • li : cp(u).cq ⊳li; cq(v).([u↔v] | MGi)
  • i∈I

cp⊳ lj

− − − → cp(u).cq ⊳lj; cq(v).([u↔v] | MGj) (j ∈ I)

cp(y)

− − → cq ⊳lj; cq(v).([y↔v] | MGj)

cq⊳ lj

− − − → cq(v).([y↔v] | MGj)

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-34
SLIDE 34

Correspondence Between G and MG (Informal)

Let G = p։q:{liUi.Gi}i∈I. Then, we have: MG = cp ⊲

  • li : cp(u).cq ⊳li; cq(v).([u↔v] | MGi)
  • i∈I

cp⊳ lj

− − − → cp(u).cq ⊳lj; cq(v).([u↔v] | MGj) (j ∈ I)

cp(y)

− − → cq ⊳lj; cq(v).([y↔v] | MGj)

cq⊳ lj

− − − → cq(v).([y↔v] | MGj)

cq(v)

− − → (νv)([y↔v] | MGj)

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-35
SLIDE 35

Correspondence Between G and MG (Informal)

Let G = p։q:{liUi.Gi}i∈I. Then, we have: MG = cp ⊲

  • li : cp(u).cq ⊳li; cq(v).([u↔v] | MGi)
  • i∈I

cp⊳ lj

− − − → cp(u).cq ⊳lj; cq(v).([u↔v] | MGj) (j ∈ I)

cp(y)

− − → cq ⊳lj; cq(v).([y↔v] | MGj)

cq⊳ lj

− − − → cq(v).([y↔v] | MGj)

cq(v)

− − → (νv)([y↔v] | MGj)

τ

− − → MGj

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-36
SLIDE 36

An Example: The Commit Protocol

G = pA ։pB:

  • actint.pB ։pC:
  • sigstr.pA ։pC:{comm1.end}
  • ,

quitint.pB ։pC:{save1.pA ։pC:{fin1.end}

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-37
SLIDE 37

An Example: The Commit Protocol

G = pA ։pB:

  • actint.pB ։pC:
  • sigstr.pA ։pC:{comm1.end}
  • ,

quitint.pB ։pC:{save1.pA ։pC:{fin1.end}

  • The medium process MG:

a ⊲

  • act : a(v).b ⊳act; b(w).([w↔v] |

b ⊲{sig : b(n).c ⊳sig; c(m).([n↔m] | a ⊲{comm : a(u).c ⊳comm; c(y).([u↔y] | 0)} )}) , quit : a(v).b ⊳quit; b(w).([w↔v] | b ⊲{save : b(n).c ⊳save; c(m).([n↔m] | a ⊲{fin : a(u).c ⊳fin; c(y).([u↔y] | 0)} )} )

  • Relating Binary and Multiparty Communications
  • J. A. P´

erez (Groningen)

slide-38
SLIDE 38

An Example: The Commit Protocol

  • The projections of G – the interface of local implementations:

G↾pA = pA!{actint.pA!{comm1.end}, quitint.pB!{sigstr.end}} G↾pB = pA?{actint.pB!{sigstr.end}, quitint.pB!{save1.end}} G↾pC = pB?{sigstr.pA?{comm1.end}, save1.pA?{fin1.end}}

  • The medium process MG:

a ⊲

  • act : a(v).b ⊳act; b(w).([w↔v] |

b ⊲{sig : b(n).c ⊳sig; c(m).([n↔m] | a ⊲{comm : a(u).c ⊳comm; c(y).([u↔y] | 0)} )}) , quit : a(v).b ⊳quit; b(w).([w↔v] | b ⊲{save : b(n).c ⊳save; c(m).([n↔m] | a ⊲{fin : a(u).c ⊳fin; c(y).([u↔y] | 0)} )} )

  • Relating Binary and Multiparty Communications
  • J. A. P´

erez (Groningen)

slide-39
SLIDE 39

Outline

An Open Problem This Talk Some Technical Details Preliminaries Medium Processes Main Results Concluding Remarks

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-40
SLIDE 40

Correspondence between MPSTs and BSTs

  • Conditions under which a medium MG is well-typed in the

logically motivated BSTs of [Caires & Pfenning (2010)]

  • A bidirectional correspondence that relates

(a) binary session types associated to MG (b) the local types for G

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-41
SLIDE 41

MPSTs and BSTs: Two-Way Correspondence (1)

  • The type judgment Γ; ∆ ⊢ P :: z:C (from [Caires & Pfenning (2010)]):

P provides behavior C at channel z, building on “services” in Γ; ∆

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-42
SLIDE 42

MPSTs and BSTs: Two-Way Correspondence (1)

  • The type judgment Γ; ∆ ⊢ P :: z:C (from [Caires & Pfenning (2010)]):

P provides behavior C at channel z, building on “services” in Γ; ∆

  • A compositional typing gives a binary type for all participants.
  • Mapping

· from local types T to binary session types A

Theorem (From Well-Formedness To Typed Mediums)

Let G be a global type, with part(G) = {p1, . . . , pn}. If G is well-formed then Γ; c1: G↾p1 , . . . , cn: G↾pn ⊢ MG :: −:1 is a compositional typing for MG, for some Γ.

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-43
SLIDE 43

MPSTs and BSTs: Two-Way Correspondence (2)

  • The type judgment Γ; ∆ ⊢ P :: z:C (from [Caires & Pfenning (2010)]):

P provides behavior C at channel z, building on “services” in Γ; ∆

  • A compositional typing gives a binary type for all participants.
  • Mapping

· from local types T to binary session types A

  • Ordering ⊔ relates local branching types (akin to subtyping)

Theorem (From Well-Typedness To WF Global Types)

Let G be a global type. If Γ; c1:A1, . . . , cn:An ⊢ MG :: −:1 is a compositional typing for MG then there exist local types T1, . . . , Tn s.t. G↾rj ⊔ Tj and Tj = Aj, for all rj ∈ G.

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-44
SLIDE 44

A Behavioral Characterization of Swapping

  • The swap relation, written ≃sw, enables safe transformations over

global types [Carbone and Montesi (2013)]. For instance: {p1, q1}#{p2, q2} p1 ։q1:

  • liUi.p2 ։q2:{l′

jU ′ j.Gij}j∈J

  • i∈I

≃sw p2 ։q2:

  • l′

jU ′ j.p1 ։q1:{liUi.Gij}i∈I

  • j∈J

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-45
SLIDE 45

A Behavioral Characterization of Swapping

  • The swap relation, written ≃sw, enables safe transformations over

global types [Carbone and Montesi (2013)]. For instance: {p1, q1}#{p2, q2} p1 ։q1:

  • liUi.p2 ։q2:{l′

jU ′ j.Gij}j∈J

  • i∈I

≃sw p2 ։q2:

  • l′

jU ′ j.p1 ։q1:{liUi.Gij}i∈I

  • j∈J
  • On logic-based BSTs, we have prefix commutations on processes.

To justify such transformations, we use context bisimilarity. Two typed processes P and Q, are context bisimilar, denoted Γ; ∆ ⊢ P ≈ Q :: x:A if, once composed with requirements Γ and ∆, they perform the same actions on x (as described by A).

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-46
SLIDE 46

A Behavioral Characterization of Swapping

Theorem

If G1 ≃sw G2 then Γ; ∆ ⊢ MG1 ≈ MG2 :: −:1.

  • A semantic justification of key structural identities on global types
  • Useful to relax sequential constraints induced by process structure
  • The converse does not hold in general. Example:

G = p։q:

  • liUi.r։p:{l′

jU ′ j.Gij}j∈J

  • i∈I

It cannot be swapped and yet prefixes for q and r in MG could be commuted.

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-47
SLIDE 47

Operational Correspondence

  • A formal connection between MPSTs and mediums.

Intuition: the medium faithfully mirrors the choreography.

  • The annotated medium of a global type G, denoted MGk,

uses a session on fresh name k to mimic each action of G.

  • The correspondence can then be recasted as follows:

If G is well-formed then we have the type judgment, for some Γ: Γ; c1: G↾p1 , . . . , cn: G↾pn ⊢ MGk :: k:( |G| ) ( |G| ) denotes a binary type that captures the sequentiality in G.

  • Let S = (ν

c)(P1 | · · · | Pn | MGk) be a system realizing G.

  • Every move of G can be mimicked by an action of S on k.

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-48
SLIDE 48

Outline

An Open Problem This Talk Some Technical Details Preliminaries Medium Processes Main Results Concluding Remarks

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-49
SLIDE 49

Concluding Remarks (1)

  • Medium processes define a simple characterization of the

multiparty interactions that underlie actual choreographic protocols

  • They offer a formal connection between typed frameworks for

multiparty and binary communications

  • Not merely a pleasant reduction: our approach establishes a

natural bridge between session types and well-established theories

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-50
SLIDE 50

Concluding Remarks (2)

  • Logically motivated BSTs reveal strong and tight correspondences

between typed mediums and the local projections of a global type.

  • These correspondences are useful! Key guarantees

⋆ preservation ⋆ progress / lock-freedom ⋆ termination ⋆ behavioral equivalences

can be transferred from BSTs to MPSTs.

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-51
SLIDE 51

Concluding Remarks (2)

  • Logically motivated BSTs reveal strong and tight correspondences

between typed mediums and the local projections of a global type.

  • These correspondences are useful! Key guarantees

⋆ preservation ⋆ progress / lock-freedom ⋆ termination ⋆ behavioral equivalences

can be transferred from BSTs to MPSTs.

  • Moreover, logically motivated theories of BSTs with

⋆ recursion [Toninho et al., 2014] ⋆ asynchrony [DeYoung et al., 2012] ⋆ dependent types [Toninho et al., 2011] ⋆ parametric polymorphism [Caires et al., 2013] ⋆ ...

can be lifted to MPSTs!

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-52
SLIDE 52

Bridging the Gap Between Binary and Multiparty Communications

Jorge A. P´ erez University of Groningen (NL)

Joint work with Lu´ ıs Caires - Universidade NOVA de Lisboa (PT)

Open Problems in Concurrency Theory (OPCT) Bertinoro, June 2014

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-53
SLIDE 53

Session types as linear logic propositions

The type syntax coincides with dual intuitionistic linear logic: A, B ::= 1 | A ⊗ B | A ⊸ B | !A

| {li : Ai}i∈I | ⊕{li : Ai}i∈I

[No atomic formulas, ⊤, 0]

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-54
SLIDE 54

Session types as linear logic propositions

The type syntax coincides with dual intuitionistic linear logic: A, B ::= 1 | A ⊗ B | A ⊸ B | !A

| {li : Ai}i∈I | ⊕{li : Ai}i∈I

[No atomic formulas, ⊤, 0]

Types are assigned to names and describe their session behavior: x : A ⊗ B Output an A along x and behave as B on x x : A ⊸ B Input an A along x and behave as B on x x : !A Persistently offer A along x x : {li : Ai}i∈I Offer a choice between an Ai along x x : ⊕ {li : Ai}i∈I Select one of the Ai along x x : 1 Terminated interaction on x

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-55
SLIDE 55

Local Types and Logic-Based Types

Definition

The mapping · from local types T into binary session types A is inductively defined as:

  • end
  • =

1

  • p!{liUi.Ti}i∈I
  • =

⊕ {li : Ui ⊗ Ti }i∈I

  • p?{liUi.Ti}i∈I
  • =
  • {li : Ui ⊸

Ti }i∈I

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-56
SLIDE 56

Annotated Mediums

Definition

Let G be a global type. Also, let k be a fresh name. The annotated medium of G with respect to and k, denoted MGk, is defined inductively as follows:

  • Mendk = 0
  • Mp։q:{liUi.Gi}i∈Ik =

cp ⊲

  • li : k ⊳li; cp(u).k(p).
  • 0p |

cq ⊳li; k ⊲{li : cq(v).([u↔v] | k(q).MGik)}{i}

  • i∈I

where p and q are names assumed distinct from any other name cpi.

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-57
SLIDE 57

Global Types and Logic-Based Types

Definition

Let σ(·) denote a mapping from participants to logic-based types. The mapping ( | · | ) from global types G into binary session types A is inductively defined as: ( |end| ) = 1 ( |p։q:{liUi.Gi}i∈I| ) = ⊕ {li : σ(p) ⊗ {li : σ(q) ⊸ ( |Gi| )}{i}}i∈I

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)

slide-58
SLIDE 58

Medium of a Global Type with Recursion

Definition

Let G be a global type with recursion µX.G. Also, let l be a label. The medium of G with respect to l, noted MGl, is defined inductively as follows:

  • Mendl = k ⊳l; 0
  • Mp։q:{liUi.Gi}i∈Il′ =

cp ⊲

  • li : cp(u).cq ⊳li; cq(v).([u↔v] | MGili)
  • i∈I
  • MµX.Gl = (corec X(k).MGl) k
  • MXl = k ⊳l; X(k)

where name k is assumed to be distinct from any other name cpi.

Relating Binary and Multiparty Communications

  • J. A. P´

erez (Groningen)