Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Formal Models for Transactions: Zero Safe Nets Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and.

Similar presentations


Presentation on theme: "1 Formal Models for Transactions: Zero Safe Nets Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and."— Presentation transcript:

1 1 Formal Models for Transactions: Zero Safe Nets Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and Orchestration IMT- Institutions Markets Technologies - Alti Studi Lucca

2 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 2 Models and Languages for Coordination and Orchestration Contents Orchestration with Petri Nets Transactions with Zero Safe Nets From BizTalk to Zero Safe Nets

3 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 3 Models and Languages for Coordination and Orchestration Why Extending Petri Nets P/T nets can naturally model control flow data flow message passing The basic P/T net model does not offer any synchronization between transitions (only token synchronization) that would be useful for expressing transactions

4 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 4 Models and Languages for Coordination and Orchestration Why Zero-Safe Nets Zero-Safe Nets offers a basis for modeling distributed transactions and workflows simple and natural extension of Petri nets based on a concept easily exportable to other paradigms offering both refined / abstract views admit distributed interpreters / implementations based on unfolding, no backtracking based on join-calculus easy to combine with other net flavors (e.g. read arcs)

5 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 5 Models and Languages for Coordination and Orchestration The Idea Zero-Safe Nets are like P/T Petri nets but places are partitioned in Stable places ordinary places defining observable states Zero-Safe places (or just zero places) idealized resources empty in all observable states temporarily used during transactions (coordinating activities) Transactions as transition synchronizations a computation from observable states to observable states via non-stable markings transactions can end when all tokens in zero places have been consumed

6 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 6 Models and Languages for Coordination and Orchestration Rendez-Vous sendreceive The message can be sent

7 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 7 Models and Languages for Coordination and Orchestration Rendez-Vous sendreceive Sender is blocked until message is received Frozen!

8 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 8 Models and Languages for Coordination and Orchestration Rendez-Vous sendreceive Ready to commit

9 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 9 Models and Languages for Coordination and Orchestration Rendez-Vous sendreceive Coordinated commit

10 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 10 Models and Languages for Coordination and Orchestration Nondeterministic Rendez-Vous send receive

11 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 11 Models and Languages for Coordination and Orchestration Origin of the Name In classic Petri net Theory A place a is n-safe if in any reachable marking it contains at most n tokens A net is n-safe if all its places are such Thus a place / net is 0-safe if in any reachable marking it is empty! Useless? We write zero-safe, not 0-safe Zero places must be empty in any observable marking

12 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 12 Models and Languages for Coordination and Orchestration From Free-Choice to Non-Deadlocking turn left right

13 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 13 Models and Languages for Coordination and Orchestration From Free-Choice to Non-Deadlocking turn left right

14 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 14 Models and Languages for Coordination and Orchestration From Free-Choice to Non-Deadlocking turn left right

15 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 15 Models and Languages for Coordination and Orchestration From Free-Choice to Non-Deadlocking turn left right Success!

16 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 16 Models and Languages for Coordination and Orchestration From Free-Choice to Non-Deadlocking turn left right

17 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 17 Models and Languages for Coordination and Orchestration From Free-Choice to Non-Deadlocking turn left right Deadlock!

18 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 18 Models and Languages for Coordination and Orchestration From Free-Choice to Non-Deadlocking turn left right Only successful choices by design!

19 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 19 Models and Languages for Coordination and Orchestration No Reuse of Stable Tokens Before Commit sendreceive The message can be sent…

20 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 20 Models and Languages for Coordination and Orchestration No Reuse of Stable Tokens Before Commit sendreceive …but no-one can receive it!

21 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 21 Models and Languages for Coordination and Orchestration Multicasting b a z c 2 new receive send reset copy

22 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 22 Models and Languages for Coordination and Orchestration Multicasting b a z c 2 new receive send reset copy

23 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 23 Models and Languages for Coordination and Orchestration Multicasting b a z c 2 new receive send reset copy

24 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 24 Models and Languages for Coordination and Orchestration Multicasting b a z c 2 new receive send reset copy

25 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 25 Models and Languages for Coordination and Orchestration Multicasting b a z c 2 new receive send reset copy

26 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 26 Models and Languages for Coordination and Orchestration Formal Definition A Zero-Safe net is B=(S ,T,pre,post,u 0,Z) N B =(S ,T,pre,post,u 0 ) is the underlying P/T Petri net Z  S is the set of zero places L=S-Z is the set of stable places u 0  L  is the initial marking Note: S  = (L  Z)   L   Z  Markings can be represented as pairs (u,x) u  L  x  Z 

27 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 27 Models and Languages for Coordination and Orchestration Operational Semantics We can exploit the operational semantics (step semantics) of the underlying P/T Petri net N B uxNBvyuxNBvy (u,x)  B (v,y) [underlying steps] (u,  )  B (v,  ) uBvuBv [commit] (u,x)  B (v,x’) (u’,x’)  B (v’,y) (u  u’,x)  B (v  v’,y) [horizontal composition] The key feature is horizontal composition it acts as sequential composition on zero places it acts as parallel composition on stable places

28 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 28 Models and Languages for Coordination and Orchestration Transactions as Transitions The admissible behaviors of the net are those that can be committed Such concurrent transactions can be regarded as atomic activities at the higher level of abstraction In general there can be several P/T Petri nets N such that  N   B We should select an abstract net A (B) which is an ordinary P/T Petri net its places are the stable places of B its transitions are the (minimal) transactions of B not decomposable in parallel activities all other steps can be inferred

29 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 29 Models and Languages for Coordination and Orchestration Rendez-Vous sendreceive B A (B)

30 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 30 Models and Languages for Coordination and Orchestration From Free-Choice to Non-Deadlocking turn left right turn-Lturn-R B A (B)

31 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 31 Models and Languages for Coordination and Orchestration Collective or Individual? Different philosophies can yield different abstract nets Define an algebra of computations Careful axiomatization of horizontal composition  *  Select only those computations  such that  goes from stable marking to stable marking If there exist ,  with  =  then either  =  or  =  Computations are processes of NB Select only those processes that satisfy suitable conditions connected – not decomposable in parallel active processes all and only minimal / maximal places stable full – no idle place CTPh ITPh

32 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 32 Models and Languages for Coordination and Orchestration Multicasting CTPh b a c new 1-1 reset 2 2 1-2 3 3 1-n n+1 …… Infinitely many transitions!

33 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 33 Models and Languages for Coordination and Orchestration Multicasting ITPh b a c new 1-1 reset 2 2 1-2 3 3 1-n n+1 …… 1-n n+1 … Different copy policies are distinguished! Infinitely many transitions!

34 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 34 Models and Languages for Coordination and Orchestration Concurrent Copies sendcopy receive

35 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 35 Models and Languages for Coordination and Orchestration Sequential Copies send copy receive

36 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 36 Models and Languages for Coordination and Orchestration The ITPh “Monster” BCTPhITPh 2 2 n n ……

37 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 37 Models and Languages for Coordination and Orchestration FIFTH HOMEWORK Show that given any Zero Safe net B, we can always find a corresponding Zero Safe net B base that: B base yields the same abstract net as B and B base contains only transitions of the form below: fork open join close drop

38 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 38 Models and Languages for Coordination and Orchestration Extensions of Zero-Safe Nets Read arcs multiple concurrent reading of the same token Data values colored tokens / high level nets Dynamic net reconfiguration many others currently under investigation

39 Roberto Bruni @ IMT Lucca 13 April 2005 Institutions Markets Technologies IMT 39 Models and Languages for Coordination and Orchestration References Zero-safe nets: comparing the collective and individual token approaches (Information and Computation 156(1-2):46-89, 2000) R. Bruni, U. Montanari Extending the zero-safe approach to colored, reconfigurable and dynamic nets (Advances in Petri Nets, LNCS 3098, pp. 321-336, 2002) R. Bruni, H. Melgratti, U. Montanari


Download ppt "1 Formal Models for Transactions: Zero Safe Nets Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and."

Similar presentations


Ads by Google