1 Nominal Calculi for Transactions: CJOIN Roberto Bruni Dipartimento di Informatica Università di...

60
1 Nominal Calculi for Transactions: CJOIN Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and Orchestration IMT- Institutions Markets Technologies - Alti Studi Lucca
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    217
  • download

    2

Transcript of 1 Nominal Calculi for Transactions: CJOIN Roberto Bruni Dipartimento di Informatica Università di...

1

Nominal Calculi for Transactions: CJOIN

Roberto BruniDipartimento di Informatica Università di Pisa

Models and Languages for Coordination and Orchestration

IMT- Institutions Markets Technologies - Alti Studi Lucca

2

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Contents Introduction cJoin: syntax + semantics Examples Serializability cJoin in Join

3

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Contents Introduction cJoin: syntax + semantics Examples Serializability cJoin in Join

4

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Flow Diagrams meet Process Description Languages [from cCSP slides]

Many proposals to describe business processes unambiguously XML-based

WSFL, XLANG, WSCI, BPEL4WS Extensions of known mobile calculi

committed Join, t-calculus, web-calculus Flow-based

Compensating CSP (Butler, Hoare, Ferreira) previously Structured Activity Compensation (StAC)

Sagas Calculus (Bruni, Melgratti, Montanari)

5

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Interaction and Agreements

In long lasting negotiations partial agreements can be reached and locally committed by parties to be compensated in case of failure to be published / confirmed on success

In commercial applications, separately designed and implemented components must interact avoiding ad-hoc proprietary solutions offering alternatives to centralized transaction

managers hiding the coordination layer (separation of concerns)

6

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Distributed Negotiations Negotiations / Contracts

commit, abort, compensation hierarchical decisions dynamic membership fully distributed control

Process cooperation coordination / orchestration / choreography different platforms and policies

Data integration unstructured documents in different formats

7

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Prerequisites forModeling Contracts

Local and global resources Local sub-contracts and decisions Global results posted upon commit Abort of ongoing contracts

All participants must be informed Compensations can be activated

Either abort or commit (no divergence) Dynamic joining of participants

Contracts can be merged Nested structure of contracts

8

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

cJoin committed Join

Process Description Language (PDL) presentation Non ACID (unrealistic in highly distributed systems) Multiway (several parties can start separately but

commit on reached agreement) Compensations (certain acts cannot be undone) Programmable commit / abort / compensation Concurrency and distribution (Distributed 2PC) Different levels of abstraction

9

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Contents Introduction cJoin: syntax + semantics Examples Serializability cJoin in Join

10

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Committed Join: Syntax

M,N::= 0 | xŷ | M|NP,Q ::= M | def D in P | P|Q | abort |

[P:Q]D,E ::= JP | DE | JP J,K ::= xŷ | J|K

messages

programmable abort

compensation

contract

boundaries

merge definitions (boards):

defined boards must be disjoint from ordinary

defined names

11

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Committed Join: Semantics0

P|Q P,Q

DE D,E

def D in P Ddn(D) , Pdn(D) range() fresh

J P, J J P, P

12

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Committed Join: Semantics0

P|Q P,Q

DE D,E

def D in P Ddn(D) , Pdn(D) range() fresh

J P, J J P, P

[P:Q] { P , Q }

compensation is kept frozen

contract P can evolve in isolation

13

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Committed Join: Semantics0

P|Q P,Q

DE D,E

def D in P Ddn(D) , Pdn(D) range() fresh

J P, J J P, P

[P:Q] { P , Q }

{ M|def D in 0 , Q } M

commitglobal resources

14

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Committed Join: Semantics0

P|Q P,Q

DE D,E

def D in P Ddn(D) , Pdn(D) range() fresh

J P, J J P, P

[P:Q] { P , Q }

{ M|def D in 0 , Q } M

{ abort |P , Q } Qcompensation on abort

15

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Committed Join: Semantics0

P|Q P,Q

DE D,E

def D in P Ddn(D) , Pdn(D) range() fresh

J P, J J P, P

[P:Q] { P , Q }

{ M|def D in 0 , Q } M

{ abort |P , Q } Q

J1|…|JnP, i{ Ji, Si, Qi } J1|…|JnP, {P, iSi, iQi }

merge n ongoing contracts

16

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Join vs cJoin

PROPOSITIONcJOIN is a conservative extension of

JOIN:P J Q iff P

cJ Q (for P and Q JOIN

processes)(Proof by obviousness ;-) )

17

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Playful Digression:5 Fast Proof Methods...

Proof by tautology "It's true because it's true."

Proof by logic "If it is on the exercise list, then it must be true!"

Proof by lost reference "I know I saw it somewhere......"

Proof by lack of interest "Does anyone really want to see this?"

Proof by insignificance "Who really cares, anyway?"

18

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Playful Digression: ... and 5 Irrefutable Proof Methods

Proof by divine word "And the Lord said, 'Let it be true,' and it was true."

Proof by supplication "Oh please, let it be true."

Proof by necessity "It had better be true, or the entire structure of

mathematics would crumble to the ground." Proof by design

"If it's not true in today's math, invent a new system in which it is."

19

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Contents Introduction cJoin: syntax + semantics Examples Serializability cJoin in Join

20

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

A Multi-Way Contract…, J[P:Q] , J …, J[P:Q] , [P:Q]

…, J’[P’:Q’] , J’ …, J’[P’:Q’] , [P’:Q’]

…, J1|J2M , [J1:Q],[J2:Q’] …, J1|J2M , [M:Q|Q’]

…, [M:Q|Q’] …, M

21

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Multi-Level Nesting

…, J[ [P1:Q1]|[P2:Q2] :Q] , J

…, J[ [P1:Q1]|[P2:Q2] :Q] ,

[ [P1 :Q1] |

[P2 :Q2] : Q]

…, [[M1 :Q1]|[P2 :Q2]:Q]

…, [ M1 | [P2 :Q2] : Q]

…, [ M1 | [M2 :Q2] : Q] …, [ M1 | M2 : Q]

…, [M1 | M2 : Q] …, M1 , M2

22

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Nested Abort I

…, J[ [P1:Q1]|[P2:Q2] :Q] , J

…, J[ [P1:Q1]|[P2:Q2] :Q] ,

[ [P1 :Q1] |

[P2 :Q2] : Q]

…, [ [abort :Q1] |

[P2 :Q2] : Q] …, [ Q1 | [P2 :Q2] : Q]

…, [ M1 | [M2 :Q2] : Q] …, [ M1 | M2 : Q]

…, [M1 | M2 : Q] …, M1 , M2

23

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Nested Abort II

…, J[ [P1:Q1] |P2 : Q ] , J …, J[ [P1:Q1] | P2 : Q ] ,

[ [P1 :Q1] | P2 : Q]

…, [ [P1 :Q1] | abort : Q ]

Q

24

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Hotel Booking IH def WaitBooking [ def requesto o$ | price$

price$ | confirmv BookedRoomv price$ abort in offeringRoom request,confirm : Q ]

BookedRoomv … in WaitBooking | …

25

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Hotel Booking IH def WaitBooking [ def requesto o$ | price$

price$ | confirmv BookedRoomv price$ abort in offeringRoom request,confirm : Q ]

BookedRoomv … in WaitBooking | …

C def BookingHotel [def hotelMsg r,c def offer$ cvisa | HotelFound

offer$ abort in rofferin searchRoom hotelMsg : Q’ ]

in BookingHotel | …

26

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Hotel Booking IH def WaitBooking [ def requesto o$ | price$

price$ | confirmv BookedRoomv price$ abort in offeringRoom request,confirm : Q ]

BookedRoomv … in WaitBooking | …

C def BookingHotel [def hotelMsg r,c def offer$ cvisa | HotelFound

offer$ abort in rofferin searchRoom hotelMsg : Q’ ]

in BookingHotel | …

HB def searchRoomhm | offeringRoom r,c hmr,c in H | C

27

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Hotel Booking II…, WaitBooking , BookingHotel

…, […, offeringRoomrequest,confirm : Q ] , […, searchRoomhotelMsg : Q’]

…, […, hotelMsgrequest,confirm : Q | Q’]

…, […, requestoffer : Q | Q’]

…, […, offer$, price$ : Q | Q’]

…, […, confirmvisa, HotelFound , price$ : Q | Q’]

…, […, BookedRoomvisa, HotelFound : Q | Q’]

…, BookedRoomvisa, HotelFound

28

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Trip Booking IH as before

F def WaitBooking [ def requesto o$ | price$ price$ | confirmv BookedFlightv price$ abort in offeringFlight request,confirm : Q ]

BookedFlightv … in WaitBooking | …

local name, different from homonym name

in H

29

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Trip Booking IIC def hotelOKfc | flightOKhc fc | hc BookingHotel [def hotelMsgr,c def offer$ cvisa | hotelOKflightConf

offer$ abort flightConf HotelFound in rofferin searchRoom hotelMsg : Q’ ]

BookingFlight [def flightlMsgr,c def offer$ cvisa | flightOKhotelConf

offer$ abort hotelConf FlightFound in rofferin searchFlight flightMsg : Q’’ ]

in BookingHotel | BookingFlight | …

TB def searchRoomhm | offeringRoom r,c hmr,c searchFlightfm | offeringFlight r,c fmr,c in H | F | C

both needed to commit

30

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Committed Join Features Negotiations can be defined in terms of

concurrent sub-negotiations Cooperation between contracts are given by

merging definitions Global resources produced inside a

negotiation are made available at commit time

Commit requires termination Programmable abort and compensation

31

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Example: Mailing List IML MailingListk MLDef

32

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Example: Mailing List IML MailingListk MLDef

MLDef def …

in lstnil | kadd, tell, close

33

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Example: Mailing List IML MailingListk MLDef

MLDef def nil... ...

lsty | addx … lsty | tellv … lsty | close …

in lstnil | kadd, tell, close

34

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Example: Mailing List IML MailingListk MLDef

MLDef def nil... ...

lsty | addx def zv,tid xv | yv, tid in

lstz lsty | tellv … lsty | close …

in lstnil | kadd, tell, close

35

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Example: Mailing List IML MailingListk MLDef

MLDef def nil... ...

lsty | addx def zv, tid xv | yv, tid in

lstz lsty | tellv [def tid 0 in yv, tid | lsty :

lsty] lsty | close …

in lstnil | kadd, tell, close

36

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Example: Mailing List IML MailingListk MLDef

MLDef def nilv, tid tid

lsty | addx def zv, tid xv | yv, tid in

lstz lsty | tellv [def tid 0 in yv, tid | lsty :

lsty] lsty | close …

in lstnil | kadd, tell, close

37

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Example: Mailing List IML MailingListk MLDef

MLDef def nilv, tid tid

lsty | addx def zv, tid xv | yv, tid in

lstz lsty | tellv [def tid 0 in yv, tid | lsty :

lsty] lsty | close 0

in lstnil | kadd, tell, close

38

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Example: Mailing List IML MailingListk MLDef

MLDef def nilv, tid tid

lsty | addx def zv, tid xv | yv, tid in

lstz lsty | tellv [def tid 0 in yv, tid | lsty :

lsty] lsty | close 0

in lstnil | kadd, tell, close

Emp employeesa,t,c aAlice | aBob | tNews

39

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Example: Mailing List IML MailingListk MLDef

MLDef def nilv, tid tid

lsty | addx def zv, tid xv | yv, tid in

lstz lsty | tellv [def tid 0 in yv, tid | lsty :

lsty] lsty | close 0

in lstnil | kadd, tell, close

Emp employeesa,t,c aAlice | aBob | tNews

SYS def ML Emp in MailingListemployees

40

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

INIT

DISPATCH

COMMIT

Example: Mailing List II…, MailingListemployees …, lstnil , employeesadd, tell, close …, lstnil , addAlice , addBob , tellNews …, z1v, tid Alicev | nilv, tid , lstz1 , addBob , tellNews

…, z2v, tid Bobv | z1v, tid , lstz2 , tellNews

…, [ tid 0 , z2News, tid , lstz2 : lstz2]

…, [ tid 0 , BobNews , z1News, tid , lstz2 : lstz2]

…, [ tid 0 , BobNews , AliceNews , nilNews, tid , lstz2 :

lstz2]

…, [ tid 0 , BobNews , AliceNews , tid , lstz2 : lstz2]

…, [ tid 0 , BobNews , AliceNews , lstz2 : lstz2]

…, [ BobNews , AliceNews , lstz2 , tid 0 : lstz2]

…, BobNews , AliceNews , lstz2

41

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

EIGHTH HOMEWORK Modify Emp and MLDef to serialize the

subscriptions to the list and the dispatch of the news, i.e. in such a way that: Bob is subscribed only after Alice the news is dispatched only after Bob is

subscribed

42

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

ZS nets, Join and cJoin ZS nets can be encoded in Join by attaching the

dynamic creation of a local DTC to transitions Implementation of D2PC (transparent to users) Tokens must carry several channel names Each firing must undergo local DTCs approval

cJoin primitives allow a straightforward encoding No further protocol is needed Tokens carry just one contract identifier Firings directly correspond to reactions

43

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

ZS nets in cJoin IWe encode basic nets, which are expressive enough:

fork

open join close calc

[[ E open e ]] = E [def z0 in ez : E ]

[[ e calc e’ ]] = ez e’z

[[ e fork e’, e’’ ]] = ez e’z | e’’z

[[ e’, e’’ join e ]] = e’z’ | e’’z’’ ez’

[[ e close E ]] = e z E

given a net (T,S) we define an agent def [[ T ]] in [[S]] , wheredummy definition

(JOIN way of declaring a local id)

z’ and z’’ have now identical scope and

meaning

44

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

THEOREM(S,) * (S',) iff def [[ T ]] in [[S]] *

def [[ T ]] in

[[S']]

ZS nets in cJoin II

45

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Matching the Prerequisites Local and global resources Local sub-contracts and decisions Global results posted upon commit Abort of ongoing contracts

All participants must be informed Compensations can be activated

Either abort or commit (no divergence) Dynamic joining of participants

Contracts can be merged Nested structure of contracts

membranes / scoping nestin

g commit reaction

several variants of abort

would limit the

expressiveness

merge definitions (boards)

multi-level

46

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Contents Introduction cJoin: syntax + semantics Examples Serializability cJoin in Join

47

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Serializability A serializable transaction admits an

abstract representation as a single transition

cJoin negotiations may interact with other negotiations (not serializable in the previous sense)

But all cooperating negotiations can be viewed as a single transition

Moreover, we would like this property to hold at every level of nesting

48

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Shallowness A simple type system guarantees

serializability Shallow processes

the start of a sub-negotiation can be postponed until all the cooperating sub-negotiations needed to commit can be generated inside its parent negotiation

Proof via correspondence w.r.t. big step semantics

49

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

P is shallow if every definition D in P satisfies:

Any reaction in shallow processes increases the height of the nesting structure by at most 1

Shallow Processes

nest ( 0 ) = nest ( abort ) = nest ( xŷ ) = 0nest ( def D in P ) = nest ( P ) nest ( [ P : Q ]) = nest ( P ) + 1

nest ( P | Q ) = max{nest ( P ), nest ( Q )}

either D = J P, where nest ( P ) = 0, or P = [ R : Q ] and nest ( R | Q ) = 0

or D = J P, and nest (P) = 0

50

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Shallow board definitions are ranged over by B, B',...

A shallow process P is stable if nest ( P ) = 0 Stable processes are ranged over by S, S', ...

Stable Processes

51

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Serializability Serializability as big step reduction relation

() between shallow processes

Theorem: S *cJ S’ iff S S’

D ├ P D ├ P’ D ├ Q D ├ Q’

D ├ P | Q D ├ P’ | Q’

(Par)

D ├ P D ├ P’’ D ├ P’’ D ├ P’

D ├ P D ├ P’

(Seq)

D J P ├ J D J P ├ P

(Global Firing)

|B| ├ S |B| ├ S’

D B ├ [S : Q] D B ├ [S’ : Q]

(Local Firing)

D iJi S ├ I [ Di ├ Ji | Si : Qi] D I Ji S ├ [iDi ├ I Si | S: I Qi]

(Merge)

D ├ [M | D’ ├ 0 : S] D ├ M

(Local Commit)

D ├ [abort | P : S] D ├ S

(Abort)

D ├ P D ├ P

(Idle)

52

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Contents Introduction cJoin: syntax + semantics Examples Serializability cJoin in Join

53

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Encoding of cJoin in Join Aim:

Define an implementation of cJoin in Join Associate to every cJoin process a Join process

that simulates its behavior Ideas:

Consider flat processes only Identification of basic forms for definitions

expressive enough to model all flat cJoin processes a type system singles out canonical forms of processes

Reuse controllers of the D2PC protocol

54

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Flat cJoin Negotiations cannot be nested Type system for cJoin Processes:

P: �0, P does not contain [_:_] at all P: �1, P may contain [_:_] just in definitions P: �2, P may have/generate flat negotiations, not nested D: �0, D does not contain [_:_] at all D: �1, D may initiate flat negotiations, not nested

Subject Reduction holds for �0 and �2 not for �1

Join Processes have type �0 Flat cJoin: The sub-calculus of all P: �2

55

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Canonical Flat cJoin Inspired by the basic shapes of ZS nets Few elementary definition patterns

Any flat process can be written in canonical form canonical processes are flat any process is bisimilar to its canonical form

Open xŷ P & P: �2 & count(P) = 1

Ord-Mov xŷ P & P: �1 & count(P) 2

Merge-Mov

xŷ P & P: �0 & count(P) 2

Ord-Join xŷ1 | xŷ2 P & P: �1 & count(P) = 1

Merge-Join

xŷ1 |…|xŷn

P& P: �0 & count(P) = 1

56

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Encoding: Main Ideas Any message in a negotiation is managed by

a coordinator Coordinators perform a slight variant of the

D2PC protocol handling of failures is more complex here

Adequacy theorems: correctness and completeness of compilation

JoCaml has been extended with cJoin primitives PhD Thesis of Hernán Melgratti

57

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Concluding remarks cJoin models multi-way transactions by

describing interacting agents but not their global structure choreography is the main issue

Flat cJoin can be implemented in Join commit is fully distributed extensions of other Join implementations are

planned cJoin compensations do not undo

precommitted activities can such compensations be encoded in cJoin?

58

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

Recent Related Work: Extensions of -calculus

t inspired by long-running transactions in BizTalk additional primitives

context(P,Pf,Pc) done abort

unique entry point transactional contexts are not isolated

not influencing commit / abort web

timed variant of t

59

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

References Nested commits for mobile calculi: extending

join (Proc. IFIP-TCS’04, Kluwer) R. Bruni, H. Melgratti, U. Montanari

Flat committed join in join (Proc. COMETA’03, ENTCS)

R. Bruni, H. Melgratti, U. Montanari Models and languages for global computing

transactions, Part II (PhD Thesis, Univ. of Pisa, 2005) H. Melgratti

60

Roberto Bruni @ IMT Lucca 20 April 2005

Models and Languages for Coordination and Orchestration

InstitutionsMarketsTechnologies

IMT

That's All Folks!