From Communicating Machines to Graphical Choreographies Julien - - PowerPoint PPT Presentation

from communicating machines to graphical choreographies
SMART_READER_LITE
LIVE PREVIEW

From Communicating Machines to Graphical Choreographies Julien - - PowerPoint PPT Presentation

From Communicating Machines to Graphical Choreographies Julien Lange based on joint works with L. Bocchi, E. Tuosto, and N. Yoshida May 2015 L. Bocchi, J. Lange, E. Tuosto, N. Yoshida From Communicating Machines to Graphical Choreographies


slide-1
SLIDE 1

From Communicating Machines to Graphical Choreographies

Julien Lange based on joint works with L. Bocchi, E. Tuosto, and N. Yoshida

May 2015

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-2
SLIDE 2

separation alignment cohesion

Single bird » local behaviour » CFSM Flock » global behaviour » choreography

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-3
SLIDE 3

separation alignment cohesion

Single bird » local behaviour » CFSM Flock » global behaviour » choreography

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-4
SLIDE 4

Introduction

§ Parts of distributed systems change/evolve, not always in a

coordinated way,

§ these changes are often not documented. § Service oriented systems are sometimes composed dynamically, § it is often unclear how complex the overall system has become. § Cognizant’s Zero Deviation Lifecyle Business Unit.

A global point of view of a distributed system is essential for top-level management.

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-5
SLIDE 5

Choreography Local Typei Local Type1 Local Typen Processi Process1 Processn Validate Validate Validate Project Project Project

§ Choreography-driven development, cf. Multiparty Session Types

top-down approach (POPL ’08 & ESOP’12)

§ Not applicable without a priori knowledge of a choreography

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-6
SLIDE 6

Choreography Local Typei Local Type1 Local Typen Processi Process1 Processn Validate Validate Validate

§ Choreography-driven development, cf. Multiparty Session Types

top-down approach (POPL ’08 & ESOP’12)

§ Not applicable without a priori knowledge of a choreography § Our goal: from Communicating Finite-State Machines to Global

Graphs

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-7
SLIDE 7

Background: CFSMs

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink

... ...

İ

... ...

  • B0

B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink BA!orange

A B

“On Communicating Finite-State Machines”, Brand & Zafiropulo (’83)

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-8
SLIDE 8

Background: CFSMs

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink

... ...

İ

... ...

  • B0

B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink BA!orange

A B

apple

“On Communicating Finite-State Machines”, Brand & Zafiropulo (’83)

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-9
SLIDE 9

Background: CFSMs

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink

... ...

İ

... ...

  • B0

B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink BA!orange

A B

  • range

apple

“On Communicating Finite-State Machines”, Brand & Zafiropulo (’83)

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-10
SLIDE 10

Background: CFSMs

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink

... ...

İ

... ...

  • B0

B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink BA!orange

A B

  • range

apple

“On Communicating Finite-State Machines”, Brand & Zafiropulo (’83)

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-11
SLIDE 11

Background: CFSMs

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink

... ...

İ

... ...

  • B0

B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink BA!orange

A B

  • range

“On Communicating Finite-State Machines”, Brand & Zafiropulo (’83)

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-12
SLIDE 12

Background: CFSMs

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink

... ...

İ

... ...

  • B0

B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink BA!orange

A B

  • range

“On Communicating Finite-State Machines”, Brand & Zafiropulo (’83)

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-13
SLIDE 13

Background: CFSMs

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink

... ...

İ

... ...

  • B0

B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink BA!orange

A B

  • range orange

“On Communicating Finite-State Machines”, Brand & Zafiropulo (’83)

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-14
SLIDE 14

Background: CFSMs

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink

... ...

İ

... ...

  • B0

B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink BA!orange

A B

  • range orange orange

“On Communicating Finite-State Machines”, Brand & Zafiropulo (’83)

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-15
SLIDE 15

Background: CFSMs

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink

... ...

İ

... ...

  • B0

B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink BA!orange

A B

  • range orange orange orange

“On Communicating Finite-State Machines”, Brand & Zafiropulo (’83)

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-16
SLIDE 16

Background: CFSMs

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink

... ...

İ

... ...

  • B0

B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink BA!orange

A B

  • range orange orange orange orange

“On Communicating Finite-State Machines”, Brand & Zafiropulo (’83)

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-17
SLIDE 17

Background: CFSMs

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink

... ...

İ

... ...

  • B0

B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink BA!orange

A B

  • range orange orange orange orange orange

“On Communicating Finite-State Machines”, Brand & Zafiropulo (’83)

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-18
SLIDE 18

Global Graphs

A0 A1 A2 A3 A4

Alice

AB!bwin AC!cwin BA?sig CA?msg CA?msg BA?sig AD!free B0 B1 B2

Bob

AB?bwin CB?blose BC!close BA!sig C0 C1 C2 C3 C4 C5

Carol

BC?close CD!busy AC?cwin CD!busy CA!msg BC?close AC?cwin CD!busy CB!blose CB!blose D0 D1

Dave

AD?free CD?busy

AÑC:cwin CÑB:blose AÑB:bwin BÑC:close CÑD:busy BÑA:sig CÑA:msg AÑD:free

Four Player Game

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-19
SLIDE 19

Global Graphs

A0 A1 A2 A3 A4

Alice

AB!bwin AC!cwin BA?sig CA?msg CA?msg BA?sig AD!free B0 B1 B2

Bob

AB?bwin CB?blose BC!close BA!sig C0 C1 C2 C3 C4 C5

Carol

BC?close CD!busy AC?cwin CD!busy CA!msg BC?close AC?cwin CD!busy CB!blose CB!blose D0 D1

Dave

AD?free CD?busy

AÑC:cwin CÑB:blose AÑB:bwin BÑC:close CÑD:busy BÑA:sig CÑA:msg AÑD:free

Four Player Game

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-20
SLIDE 20

A0 A1 A2 A3 A4

Alice

AB!bwin AC!cwin BA?sig CA?msg CA?msg BA?sig AD!free B0 B1 B2

Bob

AB?bwin CB?blose BC!close BA!sig C0 C1 C2 C3 C4 C5

Carol

BC?close CD!busy AC?cwin CD!busy CA!msg BC?close AC?cwin CD!busy CB!blose CB!blose D0 D1

Dave

AD?free CD?busy

CFSMs

AÑC:cwin CÑB:blose AÑB:bwin BÑC:close CÑD:busy BÑA:sig CÑA:msg AÑD:free

Deni´ elou & Yoshida – ESOP’12

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-21
SLIDE 21

A0 A1 A2 A3 A4

Alice

AB!bwin AC!cwin BA?sig CA?msg CA?msg BA?sig AD!free B0 B1 B2

Bob

AB?bwin CB?blose BC!close BA!sig C0 C1 C2 C3 C4 C5

Carol

BC?close CD!busy AC?cwin CD!busy CA!msg BC?close AC?cwin CD!busy CB!blose CB!blose D0 D1

Dave

AD?free CD?busy

CFSMs

AÑC:cwin CÑB:blose AÑB:bwin BÑC:close CÑD:busy BÑA:sig CÑA:msg AÑD:free

Deni´ elou & Yoshida – ESOP’12 This work

This work

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-22
SLIDE 22

Objectives

Two main objectives:

§ Sound Condition for Safety: generalised multiparty compatibility

If S “ pM1,...,Mkq is compatible then S is “safe”, i.e., every sent message is eventually received and no deadlock.

§ Construction of a Global Graph:

If G is the global graph constructed from S, then S “ pM1,...,Mkq ” pGç1,...,Gçkq

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-23
SLIDE 23

The Plan

  • 1. Build TSpSq, the transition system of all synchronous executions
  • 2. Check for safety on TSpSq to

§ ensure equivalence between original system and the projections

  • f the choreography,

§ guarantee safety (no deadlock, no orphan message)

  • 3. Build a choreography (global graph) from TSpSq, relying on

§ the theory of regions, and § safe Petri nets.

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-24
SLIDE 24
  • 1. Synchronous Transition System of CFSMs
  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-25
SLIDE 25

CFSMs

$ ’ ’ ’ ’ ’ & ’ ’ ’ ’ ’ %

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink B0 B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink

A B

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-26
SLIDE 26

CFSMs

$ ’ ’ ’ ’ ’ & ’ ’ ’ ’ ’ %

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink B0 B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink

A B

pA0,B0q

(A1,B1q

pA2,B2q pA3,B3q pA0,B0,AÑB:appleq pA0,B0,AÑB:orangeq pA1,B1,AÑB:appleq pA1,B1,AÑB:orangeq pA2,B2,AÑB:drinkq

TSpSq

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-27
SLIDE 27

CFSMs

$ ’ ’ ’ ’ ’ & ’ ’ ’ ’ ’ %

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink B0 B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink

A B

pA0,B0q

(A1,B1q

pA2,B2q pA3,B3q pA0,B0,AÑB:appleq pA0,B0,AÑB:orangeq pA1,B1,AÑB:appleq pA1,B1,AÑB:orangeq pA2,B2,AÑB:drinkq

TSpSq

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-28
SLIDE 28

CFSMs

$ ’ ’ ’ ’ ’ & ’ ’ ’ ’ ’ %

A0 A1 A2 A3 AB!apple AB!orange AB!apple AB!orange AB!drink B0 B1 B2 B3 AB?apple AB?orange AB?apple AB?orange AB?drink

A B

pA0,B0q

(A1,B1q

pA2,B2q pA3,B3q pA0,B0,AÑB:appleq pA0,B0,AÑB:orangeq pA1,B1,AÑB:appleq pA1,B1,AÑB:orangeq pA2,B2,AÑB:drinkq

TSpSq

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-29
SLIDE 29

Synchronous Transition System (TSpSq)

A0 A1 A2 A3 A4

Alice

AB!bwin AC!cwin BA?sig CA?msg CA?msg BA?sig AD!free B0 B1 B2

Bob

AB?bwin CB?blose BC!close BA!sig C0 C1 C2 C3 C4 C5

Carol

BC?close CD!busy AC?cwin CD!busy CA!msg BC?close AC?cwin CD!busy CB!blose CB!blose D0 D1

Dave

AD?free CD?busy

Four Player Game (CFSMs)

pA0,B0,C0,D0q pA0,B0,C2,D1q pA1,B0,C1,D0q pA1,B0,C4,D1q pA1,B1,C0,D0q pA1,B1,C2,D1q pA1,B2,C3,D0q pA1,B2,C5,D1q pA2,B0,C3,D0q pA3,B2,C0,D1q pA2,B0,C5,D1q pA4,B0,C0,D1q CÑD:busy AÑC:cwin AÑB:bwin AÑC:cwin AÑB:bwin CÑD:busy CÑB:blose CÑB:blose CÑD:busy BÑC:close BÑC:close CÑD:busy BÑA:sig BÑA:sig CÑA:msg CÑD:busy CÑA:msg BÑA:sig AÑD:free

Synchronous Transition System (TSpSq)

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-30
SLIDE 30
  • 2. Check for Safety: Generalised Multiparty Compatibility (GMC)
  • 1. Representability
  • 2. Branching Property
  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-31
SLIDE 31

Checking Compatibility (i) – Representability

Representability

§ The projected TSpSq ” original machine § Each branching in each machine must be represented in TS

B0 B1 B2

Bob

AB?bwin CB?blose BC!close BA!sig

pA0,B0,C0,D0q pA0,B0,C2,D1q pA1,B0,C1,D0q pA1,B0,C4,D1q pA1,B1,C0,D0q pA1,B1,C2,D1q pA1,B2,C3,D0q pA1,B2,C5,D1q pA2,B0,C3,D0q pA3,B2,C0,D1q pA2,B0,C5,D1q pA4,B0,C0,D1q CÑD:busy AÑC:cwin AÑB:bwin AÑC:cwin AÑB:bwin CÑD:busy CÑB:blose CÑB:blose CÑD:busy BÑC:close BÑC:close CÑD:busy BÑA:sig BÑA:sig CÑA:msg CÑD:busy CÑA:msg BÑA:sig AÑD:free

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-32
SLIDE 32

Checking Compatibility (i) – Representability

Representability

§ The projected TSpSq ” original machine § Each branching in each machine must be represented in TS

B0 B1 B2

Bob

AB?bwin CB?blose BC!close BA!sig

pA0,B0,C0,D0q pA0,B0,C2,D1q pA1,B0,C1,D0q pA1,B0,C4,D1q pA1,B1,C0,D0q pA1,B1,C2,D1q pA1,B2,C3,D0q pA1,B2,C5,D1q pA2,B0,C3,D0q pA3,B2,C0,D1q pA2,B0,C5,D1q pA4,B0,C0,D1q CÑD:busy AÑC:cwin AÑB:bwin AÑC:cwin AÑB:bwin CÑD:busy CÑB:blose CÑB:blose CÑD:busy BÑC:close BÑC:close CÑD:busy BÑA:sig BÑA:sig CÑA:msg CÑD:busy CÑA:msg BÑA:sig AÑD:free

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-33
SLIDE 33

Checking Compatibility (i) – Representability

Representability

§ The projected TSpSq ” original machine § Each branching in each machine must be represented in TS

B0 B1 B2

Bob

AB?bwin CB?blose BC!close BA!sig

pA0,B0,C0,D0q pA0,B0,C2,D1q pA1,B0,C1,D0q pA1,B0,C4,D1q pA1,B1,C0,D0q pA1,B1,C2,D1q pA1,B2,C3,D0q pA1,B2,C5,D1q pA2,B0,C3,D0q pA3,B2,C0,D1q pA2,B0,C5,D1q pA4,B0,C0,D1q CÑD:busy AÑC:cwin AÑB:bwin AÑC:cwin AÑB:bwin CÑD:busy CÑB:blose CÑB:blose CÑD:busy BÑC:close BÑC:close CÑD:busy BÑA:sig BÑA:sig CÑA:msg CÑD:busy CÑA:msg BÑA:sig AÑD:free

pAÑB:bwinqçB “AB?bwin pBÑA:sigqçB “BA!sig pCÑD:busyqçB “ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-34
SLIDE 34

Checking Compatibility (i) – Representability

Representability

§ The projected TSpSq ” original machine § Each branching in each machine must be represented in TS

B0 B1 B2

Bob

AB?bwin CB?blose BC!close BA!sig

pA0,B0,C0,D0q pA0,B0,C2,D1q pA1,B0,C1,D0q pA1,B0,C4,D1q pA1,B1,C0,D0q pA1,B1,C2,D1q pA1,B2,C3,D0q pA1,B2,C5,D1q pA2,B0,C3,D0q pA3,B2,C0,D1q pA2,B0,C5,D1q pA4,B0,C0,D1q CÑD:busy AÑC:cwin AÑB:bwin AÑC:cwin AÑB:bwin CÑD:busy CÑB:blose CÑB:blose CÑD:busy BÑC:close BÑC:close CÑD:busy BÑA:sig BÑA:sig CÑA:msg CÑD:busy CÑA:msg BÑA:sig AÑD:free

pAÑB:bwinqçB “AB?bwin pBÑA:sigqçB “BA!sig pCÑD:busyqçB “ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-35
SLIDE 35

Checking Compatibility (i) – Representability

Representability

§ The projected TSpSq ” original machine § Each branching in each machine must be represented in TS

B0 B1 B2

Bob

AB?bwin CB?blose BC!close BA!sig

pA0,B0,C0,D0q pA0,B0,C2,D1q pA1,B0,C1,D0q pA1,B0,C4,D1q pA1,B1,C0,D0q pA1,B1,C2,D1q pA1,B2,C3,D0q pA1,B2,C5,D1q pA2,B0,C3,D0q pA3,B2,C0,D1q pA2,B0,C5,D1q pA4,B0,C0,D1q CÑD:busy AÑC:cwin AÑB:bwin AÑC:cwin AÑB:bwin CÑD:busy CÑB:blose CÑB:blose CÑD:busy BÑC:close BÑC:close CÑD:busy BÑA:sig BÑA:sig CÑA:msg CÑD:busy CÑA:msg BÑA:sig AÑD:free

pAÑB:bwinqçB “AB?bwin pBÑA:sigqçB “BA!sig pCÑD:busyqçB “ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-36
SLIDE 36

Checking Compatibility (ii) – Branching Property

Each branching n1 e e1 in TS must be either

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-37
SLIDE 37

Checking Compatibility (ii) – Branching Property

Each branching n1 e e1 in TS must be either

§ commuting:

n1 n2 n3 n4 e e1 e1 e

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-38
SLIDE 38

Checking Compatibility (ii) – Branching Property

Each branching n1 e e1 in TS must be either

§ or, each last node nk

n1 n2 nk e e1 e e1 e e1 e1 ek´1 must be a “well-formed” choice, i.e.,

§ for each participant § it receives a different message in each branch, or § it is not involved in the choice § there is a unique sender § there is no “race” between branches

Last node, reachable from n1, from which e and e1 can be fired.

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-39
SLIDE 39

pA0,B0,C0,D0q pA0,B0,C2,D1q pA1,B0,C1,D0q pA1,B0,C4,D1q pA1,B1,C0,D0q pA1,B1,C2,D1q pA1,B2,C3,D0q pA1,B2,C5,D1q pA2 pA ,B ,C ,D q CÑD:busy AÑC:cwin AÑB:bwin AÑC:cwin AÑB:bwin CÑD:busy CÑB:blose CÑB:blose CÑD:busy BÑC:close BÑC:close CÑD:busy BÑA:sig BÑA:sig CÑD:busy

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-40
SLIDE 40

pA0,B0,C0,D0q pA0,B0,C2,D1q pA1,B0,C1,D0q pA1,B0,C4,D1q pA1,B1,C0,D0q pA1,B1,C2,D1q pA1,B2,C3,D0q pA1,B2,C5,D1q pA2 pA ,B ,C ,D q CÑD:busy AÑC:cwin AÑB:bwin AÑC:cwin AÑB:bwin CÑD:busy CÑB:blose CÑB:blose CÑD:busy BÑC:close BÑC:close CÑD:busy BÑA:sig BÑA:sig CÑD:busy

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-41
SLIDE 41

pA0,B0,C0,D0q pA0,B0,C2,D1q pA1,B0,C1,D0q pA1,B0,C4,D1q pA1,B1,C0,D0q pA1,B1,C2,D1q pA1,B2,C3,D0q pA1,B2,C5,D1q pA2 pA ,B ,C ,D q CÑD:busy AÑC:cwin AÑB:bwin AÑC:cwin AÑB:bwin CÑD:busy CÑB:blose CÑB:blose CÑD:busy BÑC:close BÑC:close CÑD:busy BÑA:sig BÑA:sig CÑD:busy

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-42
SLIDE 42

pA0,B0,C0,D0q pA0,B0,C2,D1q pA1,B0,C1,D0q pA1,B0,C4,D1q pA1,B1,C0,D0q pA1,B1,C2,D1q pA1,B2,C3,D0q pA1,B2,C5,D1q pA2 pA ,B ,C ,D q CÑD:busy AÑC:cwin AÑB:bwin AÑC:cwin AÑB:bwin CÑD:busy CÑB:blose CÑB:blose CÑD:busy BÑC:close BÑC:close CÑD:busy BÑA:sig BÑA:sig CÑD:busy

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-43
SLIDE 43

pA0,B0,C0,D0q pA0,B0,C2,D1q pA1,B0,C1,D0q pA1,B0,C4,D1q pA1,B1,C0,D0q pA1,B1,C2,D1q pA1,B2,C3,D0q pA1,B2,C5,D1q pA2 pA ,B ,C ,D q CÑD:busy AÑC:cwin AÑB:bwin AÑC:cwin AÑB:bwin CÑD:busy CÑB:blose CÑB:blose CÑD:busy BÑC:close BÑC:close CÑD:busy BÑA:sig BÑA:sig CÑD:busy

A : AB!bwin ‰ AC!cwin B : AB?bwin ‰ CB?blose D : not involved in the choice C : AC?cwin ‰ BC?close

No race, e.g., between AC?cwin and BC?close

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-44
SLIDE 44

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB : ε CB : ε AC : ε BA : ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-45
SLIDE 45

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB : ε CB : ε AC : ε BA : ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-46
SLIDE 46

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

apple

CB : ε AC : ε BA : ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-47
SLIDE 47

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

apple

CB : ε AC :

cabbage

BA : ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-48
SLIDE 48

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

apple

CB : ε AC : ε BA : ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-49
SLIDE 49

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

apple

CB :

date

AC : ε BA : ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-50
SLIDE 50

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

apple

CB :

date

AC : ε BA : ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-51
SLIDE 51

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

apple

CB : ε AC : ε BA : ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-52
SLIDE 52

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

apple

CB : ε AC : ε BA :

banana

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-53
SLIDE 53

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

apple

CB : ε AC : ε BA : ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-54
SLIDE 54

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

apple¨ cake

CB : ε AC : ε BA : ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-55
SLIDE 55

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

cake

CB : ε AC : ε BA : ε

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-56
SLIDE 56

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

cake

CB : ε AC : ε BA :

biscuit

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-57
SLIDE 57

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

cake

CB : ε AC : ε BA :

biscuit

ORPHAN MESSAGE CONFIGURATION!

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-58
SLIDE 58

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

cake

CB : ε AC : ε BA :

biscuit

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-59
SLIDE 59

Violating the no-race condition

AB!apple AC!cabbage BA?banana AB!cake AC!carrot BA?banana AB!apple BA?biscuit AB?apple CB?date BA!banana AB?cake CB?date BA!banana AB?apple BA!biscuit AC?carrot AC?cabbage CB!date

A B C

AÑB:apple AÑC:cabbage CÑB:date BÑA:banana AÑB:cake AÑC:carrot CÑB:date BÑA:banana AÑB:apple BÑA:biscuit

AB :

cake

CB : ε AC : ε BA :

biscuit

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-60
SLIDE 60
  • 3. Build a global graph
  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-61
SLIDE 61

1: From TS to Petri Net

pA0,B0,C0,D0q pA0,B0,C2,D1q pA1,B0,C1,D0q pA1,B0,C4,D1q pA1,B1,C0,D0q pA1,B1,C2,D1q pA1,B2,C3,D0q pA1,B2,C5,D1q pA2,B0,C3,D0q pA3,B2,C0,D1q pA2,B0,C5,D1q pA4,B0,C0,D1q CÑD:busy AÑC:cwin AÑB:bwin AÑC:cwin AÑB:bwin CÑD:busy CÑB:blose CÑB:blose CÑD:busy BÑC:close BÑC:close CÑD:busy BÑA:sig BÑA:sig CÑA:msg CÑD:busy CÑA:msg BÑA:sig AÑD:free

p1 AÑB:bwin p3 BÑC:close p5 BÑA:sig p7 AÑC:cwin p4 CÑB:blose p6 CÑA:msg p8 AÑD:free p2 CÑD:busy p9

We use the work of Cortadella et al. (1998), based on the theory of regions, to derive a safe and extended free-choice Petri net from the Synchronous Transition System.

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-62
SLIDE 62

2: From Petri Net to One-source Petri Net

p1

AÑB:bwin

p3

BÑC:close

p5

BÑA:sig

p7

AÑC:cwin

p4

CÑB:blose

p6

CÑA:msg

p8

AÑD:free

p2

CÑD:busy

p9 p1

AÑB:bwin

p3

BÑC:close

p5

BÑA:sig

p7

AÑC:cwin

p4

CÑB:blose

p6

CÑA:msg

p8

AÑD:free

p2

CÑD:busy

p9 t0 p0

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-63
SLIDE 63

3: From One-source Petri Net to Joined Petri Net

p1

AÑB:bwin

p3

BÑC:close

p5

BÑA:sig

p7

AÑC:cwin

p4

CÑB:blose

p6

CÑA:msg

p8

AÑD:free

p2

CÑD:busy

p9 t0 p0

p1 AÑB:bwin p3 BÑC:close p10 t2 p5 BÑA:sig p7 AÑC:cwin p4 CÑB:blose p6 CÑA:msg p8 AÑD:free p2 CÑD:busy p9 t1 p11 t0 p0

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-64
SLIDE 64

4 & 5 : From Joined Petri Net to Global Graph

p1 AÑB:bwin p3 BÑC:close p10 t2 p5 BÑA:sig p7 AÑC:cwin p4 CÑB:blose p6 CÑA:msg p8 AÑD:free p2 CÑD:busy p9 t1 p11 t0 p0

p1

AÑB:bwin

p3

BÑC:close

p10 t2 p5

BÑA:sig

p7

AÑC:cwin

p4

CÑB:blose

p6

CÑA:msg

p8

AÑD:free

p2

CÑD:busy

p9 t1 p11 t0 p0 AÑC:cwin CÑB:blose AÑB:bwin BÑC:close CÑD:busy BÑA:sig CÑA:msg AÑD:free

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-65
SLIDE 65

Prototype Implementation

https://bitbucket.org/julien-lange/gmc-synthesis

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-66
SLIDE 66

Experimental Evaluation

S

|P| |N| |Ù|

GMC

|G|

Time (s) Running Example 4 12 19

  • 16

0.184 Running Exampleˆ 2 8 144 456

  • 32

22.307 Bargain 3 4 4

  • 8

0.103 Bargainˆ 2 6 16 32

  • 16

0.161 Alternating 3-bit 2 24 48

  • 18

3.164 Alternating 3-bitˆ 2 4 576 2304

  • 34

12.069 TPMContract v2ˆ 2 4 25 80

  • 30

0.362 Sanitary Agency 4 17 21

  • 22

0.241 Sanitary Agencyˆ 2 8 196 476

  • 44

3.165 Health System 6 10 11

  • 14

0.17 Health Systemˆ 2 12 100 220

  • 28

1.702 Logistic 4 13 17

  • 27

0.276 Logisticˆ 2 8 169 442

  • 54

2.155 Cloud System v4 4 7 8

  • 12

0.14 Cloud System v4ˆ 2 8 49 112

  • 24

0.432

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-67
SLIDE 67

Experimental Evaluation

S

|P| |N| |Ù|

GMC

|G|

Time (s) Running Example 4 12 19

  • 16

0.184 Running Exampleˆ 2 8 144 456

  • 32

22.307 Bargain 3 4 4

  • 8

0.103 Bargainˆ 2 6 16 32

  • 16

0.161 Alternating 3-bit 2 24 48

  • 18

3.164 Alternating 3-bitˆ 2 4 576 2304

  • 34

12.069 TPMContract v2ˆ 2 4 25 80

  • 30

0.362 Sanitary Agency 4 17 21

  • 22

0.241 Sanitary Agencyˆ 2 8 196 476

  • 44

3.165 Health System 6 10 11

  • 14

0.17 Health Systemˆ 2 12 100 220

  • 28

1.702 Logistic 4 13 17

  • 27

0.276 Logisticˆ 2 8 169 442

  • 54

2.155 Cloud System v4 4 7 8

  • 12

0.14 Cloud System v4ˆ 2 8 49 112

  • 24

0.432

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-68
SLIDE 68

From Communicating Timed Automata to Timed Choreographies

U1 U0 U2 UW!task

x ă 1 x :“ 0

AU?result

x ď 15

W0 W1 W2 UW?task

y “ 1 y :“ 0, y1 :“ 0

WA!data

y ă 1^ y1 ă 10 y :“ 0

WA!stop

y ă 1

A0 A1 A2 WA?data

z “ 1 z :“ 0

WA?stop

z “ 1 z :“ 0

AU!result

z ď 5

User pUq Worker pWq Aggregator pAq

§ Each machine owns several clocks (not shared) § Time elapses at the same pace for each clock

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-69
SLIDE 69

U (x ă 1|x :“ 0)

task

W (y “ 1|y :“ 0,y1 :“ 0) W (y ă 1^ y1 ă 10|y :“ 0)

data

A (z “ 1|z :“ 0) W (y ă 1)

stop

A (z “ 1|z :“ 0) A (z ď 5)

result

U (x ď 15) § Construction as in the untimed setting § Additional safety checks for time constraints

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-70
SLIDE 70

Safety checks for CTAs

§ MC: (Generalised) Multiparty Compatibility § IE: Interaction Enabling § CE: Cycle Enabling

Property S „ pTSpSqçpqpPP Safety Progress Non-Zeno Eventual Reception MC

✗ ✗

MC+IE

MC+CE

MC+IE+CE

  • L. Bocchi, J. Lange, and N. Yoshida. Meeting Deadlines Together.

Draft: www.doc.ic.ac.uk/˜jlange/cta/

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-71
SLIDE 71

Summing up

§ An effective way of checking properties of CFSMs, and whether

  • ne can construct a global graph from them.

§ An algorithm based on the theory of regions. § A CFSMs characterisation of well-formed generalised global

types.

§ https://bitbucket.org/julien-lange/gmc-synthesis § An extension for communicating timed automata

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-72
SLIDE 72

References

§ Julien Lange, Emilio Tuosto, and Nobuko Yoshida. “From Communicating Machines to Graphical Choreographies”. In: POPL 2015. 2015 § Laura Bocchi, Julien Lange, and Nobuko Yoshida. Meeting Deadlines Together.

www.doc.ic.ac.uk/˜jlange/cta/. 2015

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-73
SLIDE 73

Related work (i)

§ Pierre-Malo Deni´ elou and Nobuko Yoshida. “Multiparty Session Types Meet Communicating Automata”. In: ESOP. LNCS. Springer, 2012 § Julien Lange and Emilio Tuosto. “Synthesising Choreographies from Local Session Types”. In: CONCUR. LNCS. Springer, 2012 § Pierre-Malo Deni´ elou and Nobuko Yoshida. “Multiparty Compatibility in Communicating Automata: Characterisation and Synthesis of Global Session Types”. In: ICALP. LNCS. 2013 § Laura Bocchi, Weizhen Yang, and Nobuko Yoshida. “Timed Multiparty Session Types”. In: CONCUR 2014. 2014 § Pavel Krcal and Wang Yi. “Communicating Timed Automata: The More Synchronous, the More Difficult to Verify”. In: CAV. LNCS. 2006

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-74
SLIDE 74

Related work (ii)

§ Kohei Honda, Nobuko Yoshida, and Marco Carbone. “Multiparty asynchronous session types”. In: POPL. ACM, 2008 § Dimitris Mostrous, Nobuko Yoshida, and Kohei Honda. “Global Principal Typing in Partially Commutative Asynchronous Sessions”. In: ESOP. LNCS. Springer, 2009 § Samik Basu, Tevfik Bultan, and Meriem Ouederni. “Synchronizability for Verification of Asynchronously Communicating Systems”. In: VMCAI. LNCS. Springer, 2012 § Samik Basu, Tevfik Bultan, and Meriem Ouederni. “Deciding choreography realizability”. In: POPL. ACM, 2012

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies

slide-75
SLIDE 75

Thanks!

Any questions?

https://bitbucket.org/julien-lange/gmc-synthesis

  • L. Bocchi, J. Lange, E. Tuosto, N. Yoshida

From Communicating Machines to Graphical Choreographies