1 / 44

Translating Orc Features into Petri Nets and the Join Calculus

Translating Orc Features into Petri Nets and the Join Calculus. Hernán Melgratti IMT Lucca Institute for Advance Studies Joint Work with Roberto Bruni and Emilio Tuosto. Aims. To distill Orc primitives Orc is an orchestration language It is a process calculus

gurit
Download Presentation

Translating Orc Features into Petri Nets and the Join Calculus

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Translating Orc Features into Petri Nets and the Join Calculus Hernán Melgratti IMT Lucca Institute for Advance Studies Joint Work with Roberto Bruni and Emilio Tuosto

  2. Aims • To distill Orc primitives • Orc is an orchestration language • It is a process calculus • It does not provide any explicit mechanism for name creation Hernán Melgratti@IMTLucca

  3. Roadmap • Is it an Orc process an ordinary Petri net? • Place / transition Petri nets are not enough • The need of distinguishing different evaluations of the same expression • The need of killing executions • So, we encode Orc into the Join calculus Hernán Melgratti@IMTLucca

  4. Orc in one slide • Basic services or sites: M,M1,M2,… • Providing functionalities • Site call: M(p0,…,pn) • Return at most one result • Pipeline: f>x>g • Sequential composition (x occurs bound in g) • Symmetric Parallelism: f|g • Independent computation • Asymmetric Parallelism: g where x:f • x occurs bound in f • Recussion: E(q0,…,qn) f, and E occurs in f Hernán Melgratti@IMTLucca

  5. Orc by example [KCM06] • CNN and BBC are news services • CNN(d) • It may return 0 or 1 value • CNN(d) | BBC(d) • May produce 0, 1, or 2 values • (CNN(d) | BBC(d)) > x > email(a,x) • email may be called 0, 1, or 2 times • email(a,x) where x:(CNN(d)| BBC(d)) • email is called at most one Hernán Melgratti@IMTLucca

  6. Site invocation call 1-answer 0-answer return Orc into Petri Nets Hernán Melgratti@IMTLucca

  7. call 1-answer 0-answer return Orc into Petri Nets Site invocation f > x > g Hernán Melgratti@IMTLucca

  8. call 1-answer 0-answer return g Orc into Petri Nets Site invocation f > x > g f Hernán Melgratti@IMTLucca

  9. call 1-answer 0-answer return Orc into Petri Nets Site invocation f > x > g Actually we need coloured tokens f x x g Hernán Melgratti@IMTLucca

  10. call 1-answer 0-answer return Orc into Petri Nets Site invocation f > x > g f | g f g Hernán Melgratti@IMTLucca

  11. call 1-answer 0-answer return Orc into Petri Nets Site invocation f > x > g f | g f f g g Hernán Melgratti@IMTLucca

  12. call 1-answer 0-answer return Orc into Petri Nets Site invocation f > x > g f | g f f g g Hernán Melgratti@IMTLucca

  13. call 1-answer 0-answer return Orc into Petri Nets Site invocation f > x > g f | g f f g g Hernán Melgratti@IMTLucca

  14. An Orc Process as a PN (CNN(d) | BBC(d))> x > email(a,x) Hernán Melgratti@IMTLucca

  15. An Orc Process as a PN (CNN(d) | BBC(d))> x > email(a,x) Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Hernán Melgratti@IMTLucca

  16. An Orc Process as a PN (CNN(d) | BBC(d))> x > email(a,x) Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Return_CNN Return_BBC Hernán Melgratti@IMTLucca

  17. An Orc Process as a PN (CNN(d) | BBC(d))> x > email(a,x) Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Return_CNN Return_BBC Call_Email 1-answer 0-answer Return_Email Hernán Melgratti@IMTLucca

  18. Mapping the Asym. composition f where x: g f g Hernán Melgratti@IMTLucca

  19. Mapping the Asym. composition f where x: g f g Hernán Melgratti@IMTLucca

  20. Mapping the Asym. composition f where x: g f g Hernán Melgratti@IMTLucca

  21. Mapping the Asym. composition email(a,x) where x:(CNN(d)| BBC(d)) Hernán Melgratti@IMTLucca

  22. Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Return_CNN Mapping the Asym. composition email(a,x) where x:(CNN(d)| BBC(d)) Call_Email 1-answer 0-answer Return_Email Return_BBC Hernán Melgratti@IMTLucca

  23. Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Return_CNN Mapping the Asym. composition email(a,x) where x:(CNN(d)| BBC(d)) Call_Email 1-answer 0-answer Return_Email Return_BBC Hernán Melgratti@IMTLucca

  24. Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Return_CNN Mapping the Asym. composition email(a,x) where x:(CNN(d)| BBC(d)) Call_Email 1-answer 0-answer Return_Email Return_BBC Hernán Melgratti@IMTLucca

  25. Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Return_CNN Mapping the Asym. composition email(a,x) where x:(CNN(d)| BBC(d)) Call_Email 1-answer 0-answer lock Return_Email Return_BBC Hernán Melgratti@IMTLucca

  26. email(a,x) where x:(CNN(d)| BBC(d)) f > d > But it doesn’t work Hernán Melgratti@IMTLucca

  27. Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Return_CNN But it doesn’t work email(a,x) where x:(CNN(d)| BBC(d)) f > d > Call_Email 1-answer 0-answer lock Return_Email Return_BBC Hernán Melgratti@IMTLucca

  28. Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Return_CNN But it doesn’t work email(a,x) where x:(CNN(d)| BBC(d)) f > d > Call_Email 1-answer 0-answer lock Return_Email Return_BBC Hernán Melgratti@IMTLucca

  29. Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Return_CNN But it doesn’t work email(a,x) where x:(CNN(d)| BBC(d)) f > d > Call_Email 1-answer 0-answer lock Return_Email Return_BBC Hernán Melgratti@IMTLucca

  30. Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Return_CNN But it doesn’t work email(a,x) where x:(CNN(d)| BBC(d)) f > d > Call_Email 1-answer 0-answer lock Return_Email Return_BBC Hernán Melgratti@IMTLucca

  31. Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Return_CNN But it doesn’t work email(a,x) where x:(CNN(d)| BBC(d)) f > d > Call_Email 1-answer 0-answer lock Return_Email Return_BBC Hernán Melgratti@IMTLucca

  32. Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Return_CNN But it doesn’t work email(a,x) where x:(CNN(d)| BBC(d)) f > d > Call_Email 1-answer 0-answer lock Return_Email Return_BBC Hernán Melgratti@IMTLucca

  33. Call_CNN Call_BBC 1-answer 0-answer 1-answer 0-answer Return_CNN But it doesn’t work email(a,x) where x:(CNN(d)| BBC(d)) f > d > • In any case we sequentialise several evaluations of the same expression • We should kill the running computation (i.e., remove tokens from the net). • This can be done by using inhibitor or reset arcs Call_Email 1-answer 0-answer lock Return_Email Return_BBC Hernán Melgratti@IMTLucca

  34. Join • Join processes can be seen as dynamic and reconfigurable, coloured nets Hernán Melgratti@IMTLucca

  35. Join • Join processes can be seen as dynamic and reconfigurable, coloured nets a x b x ax xb Hernán Melgratti@IMTLucca

  36. a a a c c b b b x x b b x x def ax xb def ax xb   in aa | cb in ab | cb Join • Join processes can be seen as dynamic and reconfigurable, coloured nets a a c x b x def ax xb in aa | ac Hernán Melgratti@IMTLucca

  37. a x c c y y x ax def cy yx incc Join • Join processes can be seen as dynamic and reconfigurable, coloured nets Hernán Melgratti@IMTLucca

  38. c a c y y b x c c y y x def ax def cy yx incc cy ay in ab | cc Join • Join processes can be seen as dynamic and reconfigurable, coloured nets a a b x c c y y x def ax def cy yx incc in aa | ab Hernán Melgratti@IMTLucca

  39. f w v Any evaluation of g is done on a fresh copy of the net g z def wv  {g}z in {f}w Orc into Join { f > x > g }z Hernán Melgratti@IMTLucca

  40. { f | g }z { f where x: g }z g f g f w z v v valx def wv | tok  valx  {f}z | {g}z in {f}w| {g}z| tok  Orc into Join { f > x > g }z f w v g z def wv  {g}z in {f}w Hernán Melgratti@IMTLucca

  41. def kv  zv in CNN(d,k) def kv | tok  zv in CNN(d,k) | tok Orc into Join Using the continuation style Site invocation { CNN(d) }z CNN(d,k) We can receive more than one answer for a call Hernán Melgratti@IMTLucca

  42. f where x: g CNN(d) def wv | tok  valx  def kv | tok  zv in {f}w| {g}z| tok  in CNN(d,k) | tok We don’t get exactly the same behaviour When x is chosen g is killed After receiving one answer, the sender is blocked After one x is chosen, all other value produced by g is ignored Only one received answer is considered Hernán Melgratti@IMTLucca

  43. Correspondence • Theorem: Let O be an Orc Program and {O} its encoding in Join. Then, O  {O} when considering the non killing asymmetric composition. Hernán Melgratti@IMTLucca

  44. Final Remarks • The encoding highlights the fact that Orc primitives involve dynamic creation of names • Pruning of asymmetric composition is an operation not common in PC • Is it realistic in a distributed setting? • This can be seen as equivalent to the disabling of input ports Hernán Melgratti@IMTLucca

More Related