Nested Commits for Mobile Calculi: Extending Join - PowerPoint PPT Presentation

1 / 44
About This Presentation
Title:

Nested Commits for Mobile Calculi: Extending Join

Description:

Multiway (several parties can start separately but commit on ... IFIP-TCS 2004, Toulouse, August 21-27 2004. Example I: Hotel Booking. H def WaitBooking [ def ... – PowerPoint PPT presentation

Number of Views:69
Avg rating:3.0/5.0
Slides: 45
Provided by: Hern66
Category:

less

Transcript and Presenter's Notes

Title: Nested Commits for Mobile Calculi: Extending Join


1
Nested Commits for Mobile Calculi Extending Join
  • Roberto Bruni, Hernán Melgratti and Ugo Montanari

2
Motivation
  • To develop a process description language with
    primitives for agreements or negotiations
  • Multiway (several parties can start separately
    but commit on reached agreement)
  • Non-perfect compensations (certain actions cannot
    be undone)
  • Programmable abort / compensation
  • Different levels of abstraction

3
Committed Join (cJoin)
  • Join primitives for negotiations
  • Syntax

P,Q 0 x?y? def D in P PQ D,E
J?P D?E J,K x?y? JK
Processes
Definitions
Patterns
4
Committed Join (cJoin)
  • Join primitives for negotiations
  • Syntax

Messages
M,N 0 x?y? MN P,Q 0 x?y? def D
in P PQ D,E J?P D?E J,K x?y?
JK
Processes
Definitions
Patterns
5
Committed Join (cJoin)
  • Join primitives for negotiations
  • Syntax

Messages
M,N 0 x?y? MN P,Q M def D in P
PQ D,E J?P D?E J,K x?y? JK
Processes
Definitions
Patterns
6
Committed Join (cJoin)
  • Join primitives for negotiations
  • Syntax

Messages
Programmable abort
M,N 0 x?y? MN P,Q M def D in P
PQ abort PQ D,E J?P D?E J?P J,K
x?y? JK
Processes
Definitions
Patterns
Merge definition
7
Committed Join (cJoin)
  • Operational Semantics (CHAM Style)

0 ?
PQ ? P,Q
D?E ? D,E
def D in P ? D?dn(D) , P?dn(D) range(?) fresh
J? P, J? ? J? P, P?




heating and cooling
reaction
8
Committed Join (cJoin)
  • Operational Semantics (CHAM Style)

0 ?
PQ ? P,Q
D?E ? D,E
def D in P ? D?dn(D) , P?dn(D) range(?) fresh
J? P, J? ? J? P, P?
PQ ? P , ?? Q?



Contract P evolves in isolation
Compensation Q is kept frozen
9
Committed Join (cJoin)
  • Operational Semantics (CHAM Style)

0 ?
PQ ? P,Q
D?E ? D,E
def D in P ? D?dn(D) , P?dn(D) range(?) fresh
J? P, J? ? J? P, P?
PQ ? P , ?? Q?
Mdef D in 0 ,?? Q? ? M


Global Resources
Commit
10
Committed Join (cJoin)
  • Operational Semantics (CHAM Style)

0 ?
PQ ? P,Q
D?E ? D,E
def D in P ? D?dn(D) , P?dn(D) range(?) fresh
J? P, J? ? J? P, P?
PQ ? P , ?? Q?
Mdef D in 0 ,?? Q? ? M
abort P ,?? Q? ? Q

Compensation on Abort
11
Committed Join (cJoin)
  • Operational Semantics (CHAM Style)

0 ?
PQ ? P,Q
D?E ? D,E
def D in P ? D?dn(D) , P?dn(D) range(?) fresh
J? P, J? ? J? P, P?
PQ ? P , ?? Q?
Mdef D in 0 ,?? Q? ? M
abort P ,?? Q? ? Q
J1Jn?P, ?i Ji?, Si,?? Qi? ? J1Jn?P, ?iSi, P?, ? ?iQi?
Merge n ongoing contracts
12
Committed Join Features
  • Commit means termination

M def D in 0 ,?? Q? ? M
13
Committed Join Features
  • Commit means termination
  • Global resources produced inside a negotiation
    are available at commit

14
Committed Join Features
  • Commit means termination
  • Global resources produced inside a negotiation
    are available at commit
  • Explicit abort and compensation

abort P ,?? Q? ? Q
15
Committed Join Features
  • Commit means termination
  • Global resources produced inside a negotiation
    are available at commit
  • Explicit abort and compensation
  • Cooperation between contracts are given by
    merging definitions (multiway contracts)
  • ,J1J2 ?P, J1t P1 Q1, J2t P2 Q2 ?
  • ,J1J2 ?P, Pt P1 P2 Q1 Q2

16
Committed Join Features
  • Commit means termination
  • Global resources produced inside a negotiation
    are available at commit
  • Explicit abort and compensation
  • Cooperation between contracts are given by
    merging definitions (multiway contracts)
  • Multi-level nesting

P1 Q1 P2Q2 Q
17
Committed Join Features
  • Commit means termination
  • Global resources produced inside a negotiation
    are available at commit
  • Explicit abort and compensation
  • Cooperation between contracts are given by
    merging definitions (multiway contracts)
  • Multi-level nesting

P1 Q1 P2Q2 Q ? M1 P2Q2
Q
18
Committed Join Features
  • Commit means termination
  • Global resources produced inside a negotiation
    are available at commit
  • Explicit abort and compensation
  • Cooperation between contracts are given by
    merging definitions (multiway contracts)
  • Multi-level nesting

P1 Q1 P2Q2 Q ? M1 P2Q2
Q ? M1 M2 Q
19
Committed Join Features
  • Commit means termination
  • Global resources produced inside a negotiation
    are available at commit
  • Explicit abort and compensation
  • Cooperation between contracts are given by
    merging definitions (multiway contracts)
  • Multi-level nesting

P1 Q1 P2Q2 Q ? M1 P2Q2
Q ? M1 M2 Q ? M1 M2
20
Committed Join Features
  • Commit means termination
  • Global resources produced inside a negotiation
    are available at commit
  • Explicit abort and compensation
  • Cooperation between contracts are given by
    merging definitions (multiway contracts)
  • Multi-level nesting

P1 Q1 P2Q2 Q ? abort P1
Q1 P2Q2 Q

21
Committed Join Features
  • Commit means termination
  • Global resources produced inside a negotiation
    are available at commit
  • Explicit abort and compensation
  • Cooperation between contracts are given by
    merging definitions (multiway contracts)
  • Multi-level nesting

P1 Q1 P2Q2 Q ? abort P1
Q1 P2Q2 Q
? Q1 P2Q2 Q

22
Committed Join Features
  • Commit means termination
  • Global resources produced inside a negotiation
    are available at commit
  • Explicit abort and compensation
  • Cooperation between contracts are given by
    merging definitions (multiway contracts)
  • Multi-level nesting

P1 Q1 P2Q2 Q ? abort P1
Q1 P2Q2 Q
? Q1 P2Q2 Q
? abort Q1 P2Q2
Q
23
Committed Join Features
  • Commit means termination
  • Global resources produced inside a negotiation
    are available at commit
  • Explicit abort and compensation
  • Cooperation between contracts are given by
    merging definitions (multiway contracts)
  • Multi-level nesting

P1 Q1 P2Q2 Q ? abort P1
Q1 P2Q2 Q
? Q1 P2Q2 Q
? abort Q1 P2Q2
Q ? Q
24
Example I Hotel Booking
H ? def WaitBooking? ? ? def
request?o? ? o?? price?? ? price??
confirm?v? ? BookedRoom?v? ?
price?? ? abort in offeringRoom
?request,confirm? Q ? BookedRoom?v?
? in WaitBooking? ?
25
Example I Hotel Booking
H ? def WaitBooking? ? ? def
request?o? ? o?? price?? ? price??
confirm?v? ? BookedRoom?v? ?
price?? ? abort in offeringRoom
?request,confirm? Q ? BookedRoom?v?
? in WaitBooking? ? C ? def
BookingHotel? ? ? def hotelMsg ?r,c? ? def
offer?? ? c?visa? HotelFound
? offer?? ? abort in r?offer?
in searchRoom ?hotelMsg? Q in
BookingHotel? ?
26
Example I Hotel Booking
H ? def WaitBooking? ? ? def
request?o? ? o?? price?? ? price??
confirm?v? ? BookedRoom?v? ?
price?? ? abort in offeringRoom
?request,confirm? Q ? BookedRoom?v?
? in WaitBooking? ? C ? def
BookingHotel? ? ? def hotelMsg ?r,c? ? def
offer?? ? c?visa? HotelFound? ?
? offer?? ? abort in
r?offer? in searchRoom ?hotelMsg? Q
in BookingHotel? ? HB ? def
searchRoom?hm? offeringRoom ?r,c? ? hm?r,c?
in H C
27
Example I Hotel Booking
, WaitBooking? ? , BookingHotel ? ? ? ? ,
, offeringRoom?request,confirm? Q , ,
searchRoom?hotelMsg? Q ? , ,
hotelMsg?request,confirm? Q Q ? , ,
request?offer? Q Q ? , , offer??,
price?? Q Q ? , , confirm?visa?,
HotelFound , price?? Q Q ? , ,
BookedRoom?visa?, HotelFound ? ? Q Q ?
, BookedRoom?visa?, HotelFound? ?
28
Example I Trip Booking I
H as before F ? def WaitBooking ? ? ? def
request?o? ? o?? price??
? price?? confirm?v? ? BookedFlight?v?
? price?? ? abort in
offeringFlight ?request,confirm? Q ?
BookedFlight?v? ? in WaitBooking ? ?

local name, different from homonym name in H
29
Example I Trip Booking II
both needed to commit
C ? def hotelOK?fc? flightOK?hc? ? fc? ? hc?
? ? BookingHotel? ?? def hotelMsg?r,c?
? def offer?? ? c?visa? hotelOK?flightConf?
? offer?? ? abort ?
flightConf ? HotelFound? ? in
r?offer? in searchRoom ?hotelMsg? Q
? BookingFlight? ??def flightlMsg?r,c? ? def
offer?? ? c?visa? flightOK?hotelConf?
? offer?? ? abort ? hotelConf ?
FlightFound? ? in r?offer? in
searchFlight ?flightMsg? Q in
BookingHotel BookingFlight
30
Example I Trip Booking II
both needed to commit
C ? def hotelOK?fc? flightOK?hc? ? fc? ? hc?
? ? BookingHotel? ?? def hotelMsg?r,c?
? def offer?? ? c?visa? hotelOK?flightConf?
? offer?? ? abort ?
flightConf ? HotelFound? ? in
r?offer? in searchRoom ?hotelMsg? Q
? BookingFlight? ??def flightlMsg?r,c? ? def
offer?? ? c?visa? flightOK?hotelConf?
? offer?? ? abort ? hotelConf ?
FlightFound? ? in r?offer? in
searchFlight ?flightMsg? Q in
BookingHotel BookingFlight TB ? def
searchRoom?hm? offeringRoom ?r,c? ? hm?r,c?
? searchFlight?fm? offeringFlight ?r,c?
? fm?r,c? in H F C
31
Zero-safe nets
  • Synchronization mechanism for transitions
  • Places are divided in
  • Stable Ordinary places
  • Zero-safe Idealized resources, invisible to
    external observers

32
Zero-safe nets
  • Synchronization mechanism for transitions
  • Places are divided in
  • Stable Ordinary places
  • Zero-safe Idealized resources, invisible to
    external observers

33
Zero-safe nets
  • Synchronization mechanism for transitions
  • Places are divided in
  • Stable Ordinary places
  • Zero-safe Idealized resources, invisible to
    external observers

send
receive
34
Zero-safe nets
  • Synchronization mechanism for transitions
  • Places are divided in
  • Stable Ordinary places
  • Zero-safe Idealized resources, invisible to
    external observers

send
receive
35
Zero-safe nets
  • Synchronization mechanism for transitions
  • Places are divided in
  • Stable Ordinary places
  • Zero-safe Idealized resources, invisible to
    external observers

send
receive
36
Zero-safe nets
  • Synchronization mechanism for transitions
  • Places are divided in
  • Stable Ordinary places
  • Zero-safe Idealized resources, invisible to
    external observers

send
receive
37
Zero-safe nets Encoding
  • Given a ZS net N(T,S)
  • Places ports
  • Transitions firing rules
  • Tokens messages
  • Encoding of a marking S
  • E E? ?
  • S1S2 S1 S2

38
Zero-safe nets Encoding
  • Encoding of (basic) transitions

39
Zero-safe nets Encoding
  • Encoding of (basic) transitions

E? ? ? def z? ? ? 0 in e?z? E? ?
e1?z? ? e2?z?
e?z? ? e1?z? e2?z?
e1?z1? e2?z2? ? e?z1?
e?z? ? E? ?
e?z? ? 0
40
Zero-safe nets Encoding
  • cJoin process for a ZS net
  • Let N(T,S) be a ZS net,
  • PN def T in S
  • Theorem
  • Let N(T,S) be a ZS net. (S,?) ? (S,?)
  • iff def T in S ? def T in
    S

41
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

42
Serializability Shallowness
  • Shallow processes any computation increases the
    height of nesting structure in at most 1
  • P is shallow if every definition D in P satisfies

D J ? P, where nest(P ) 0,
or P R Q and nest( R Q ) 0
D J ? P, and nest(P ) 0
43
Serializability
  • Serializability as big step reduction relation
    (?) between shallow processes
  • Theorem S ?cJ S iff S ? S

44
Final Remarks
  • cJoin models multi-way transactions by describing
    interacting agents but not their global structure
  • Compensations do not undo precommitted
    activities.
  • Can such compensations be encoded in cJoin?
  • Are cJoin primitives implementable?
  • We plan to use the D2PC protocol
  • The subcalculus of flat processes can be
    implemented
Write a Comment
User Comments (0)
About PowerShow.com