Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— 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 - WS-FM 2006 Hernán Melgratti@IMTLucca 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

3 - WS-FM 2006 Hernán Melgratti@IMTLucca 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

4 - WS-FM 2006 Hernán Melgratti@IMTLucca Orc in one slide Basic services or sites: M,M 1,M 2,… Providing functionalities Site call: M(p 0,…,p n ) 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(q 0,…,q n )  f, and E occurs in f

5 - WS-FM 2006 Hernán Melgratti@IMTLucca 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

6 - WS-FM 2006 Hernán Melgratti@IMTLucca Orc into Petri Nets 1-answer0-answer call return Site invocation

7 - WS-FM 2006 Hernán Melgratti@IMTLucca Orc into Petri Nets 1-answer0-answer call return Site invocation f > x > g

8 - WS-FM 2006 Hernán Melgratti@IMTLucca Orc into Petri Nets 1-answer0-answer call return Site invocation f g f > x > g

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

10 - WS-FM 2006 Hernán Melgratti@IMTLucca Orc into Petri Nets 1-answer0-answer call return Site invocation f g f | g f > x > g

11 - WS-FM 2006 Hernán Melgratti@IMTLucca Orc into Petri Nets 1-answer0-answer call return Site invocation f g fg f > x > g f | g

12 - WS-FM 2006 Hernán Melgratti@IMTLucca Orc into Petri Nets 1-answer0-answer call return Site invocation f g fg f > x > g f | g

13 - WS-FM 2006 Hernán Melgratti@IMTLucca Orc into Petri Nets 1-answer0-answer call return Site invocation f g fg f > x > g f | g

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

15 - WS-FM 2006 Hernán Melgratti@IMTLucca An Orc Process as a PN 1-answer0-answer1-answer0-answer Call_CNNCall_BBC (CNN(d) | BBC(d))> x > email(a,x)

16 - WS-FM 2006 Hernán Melgratti@IMTLucca An Orc Process as a PN 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC Return_BBC (CNN(d) | BBC(d))> x > email(a,x)

17 - WS-FM 2006 Hernán Melgratti@IMTLucca An Orc Process as a PN 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC Return_BBC (CNN(d) | BBC(d))> x > email(a,x) 1-answer0-answer Return_Email Call_Email

18 - WS-FM 2006 Hernán Melgratti@IMTLucca Mapping the Asym. composition f where x:  g fg

19 - WS-FM 2006 Hernán Melgratti@IMTLucca Mapping the Asym. composition f where x:  g fg

20 - WS-FM 2006 Hernán Melgratti@IMTLucca Mapping the Asym. composition f where x:  g fg

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

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

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

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

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

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

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

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

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

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

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

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

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

34 - WS-FM 2006 Hernán Melgratti@IMTLucca Join Join processes can be seen as dynamic and reconfigurable, coloured nets

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

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

37 - WS-FM 2006 Hernán Melgratti@IMTLucca Join Join processes can be seen as dynamic and reconfigurable, coloured nets a x a  x   def c  y   y  x  in c  c  c y x c y

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

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

40 - WS-FM 2006 Hernán Melgratti@IMTLucca Orc into Join f w g z w  v   { g } z def in { f } w v { f | g } z fg z { f } z | { g } z f w v g v val x w  v  | tok   val x  def in { f } w | { g } z | tok  { f where x:  g } z { f > x > g } z

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

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

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

44 - WS-FM 2006 Hernán Melgratti@IMTLucca 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


Download ppt "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."

Similar presentations


Ads by Google