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
- WS-FM 2006 Hernán 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
- WS-FM 2006 Hernán 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
- WS-FM 2006 Hernán 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
- WS-FM 2006 Hernán 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 > (a,x) may be called 0, 1, or 2 times (a,x) where x: (CNN(d)| BBC(d)) is called at most one
- WS-FM 2006 Hernán Orc into Petri Nets 1-answer0-answer call return Site invocation
- WS-FM 2006 Hernán Orc into Petri Nets 1-answer0-answer call return Site invocation f > x > g
- WS-FM 2006 Hernán Orc into Petri Nets 1-answer0-answer call return Site invocation f g f > x > g
- WS-FM 2006 Hernán Orc into Petri Nets 1-answer0-answer call return Site invocation Actually we need coloured tokens x x f g f > x > g
- WS-FM 2006 Hernán Orc into Petri Nets 1-answer0-answer call return Site invocation f g f | g f > x > g
- WS-FM 2006 Hernán Orc into Petri Nets 1-answer0-answer call return Site invocation f g fg f > x > g f | g
- WS-FM 2006 Hernán Orc into Petri Nets 1-answer0-answer call return Site invocation f g fg f > x > g f | g
- WS-FM 2006 Hernán Orc into Petri Nets 1-answer0-answer call return Site invocation f g fg f > x > g f | g
- WS-FM 2006 Hernán An Orc Process as a PN (CNN(d) | BBC(d))> x > (a,x)
- WS-FM 2006 Hernán An Orc Process as a PN 1-answer0-answer1-answer0-answer Call_CNNCall_BBC (CNN(d) | BBC(d))> x > (a,x)
- WS-FM 2006 Hernán An Orc Process as a PN 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC Return_BBC (CNN(d) | BBC(d))> x > (a,x)
- WS-FM 2006 Hernán An Orc Process as a PN 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC Return_BBC (CNN(d) | BBC(d))> x > (a,x) 1-answer0-answer Return_ Call_
- WS-FM 2006 Hernán Mapping the Asym. composition f where x: g fg
- WS-FM 2006 Hernán Mapping the Asym. composition f where x: g fg
- WS-FM 2006 Hernán Mapping the Asym. composition f where x: g fg
- WS-FM 2006 Hernán Mapping the Asym. composition (a,x) where x: (CNN(d)| BBC(d))
- WS-FM 2006 Hernán Mapping the Asym. composition Return_BBC (a,x) where x: (CNN(d)| BBC(d)) 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC 1-answer0-answer Return_ Call_
- WS-FM 2006 Hernán Mapping the Asym. composition Return_BBC (a,x) where x: (CNN(d)| BBC(d)) 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC 1-answer0-answer Return_ Call_
- WS-FM 2006 Hernán Mapping the Asym. composition Return_BBC (a,x) where x: (CNN(d)| BBC(d)) 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC 1-answer0-answer Return_ Call_
- WS-FM 2006 Hernán Mapping the Asym. composition Return_BBC (a,x) where x: (CNN(d)| BBC(d)) 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC 1-answer0-answer Return_ Call_ lock
- WS-FM 2006 Hernán But it doesn’t work (a,x) where x: (CNN(d)| BBC(d)) f > d >
- WS-FM 2006 Hernán But it doesn’t work Return_BBC (a,x) where x: (CNN(d)| BBC(d)) 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC 1-answer0-answer Return_ Call_ f > d > lock
- WS-FM 2006 Hernán But it doesn’t work Return_BBC (a,x) where x: (CNN(d)| BBC(d)) 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC 1-answer0-answer Return_ Call_ f > d > lock
- WS-FM 2006 Hernán But it doesn’t work Return_BBC (a,x) where x: (CNN(d)| BBC(d)) 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC 1-answer0-answer Return_ Call_ f > d > lock
- WS-FM 2006 Hernán But it doesn’t work Return_BBC (a,x) where x: (CNN(d)| BBC(d)) 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC 1-answer0-answer Return_ Call_ f > d > lock
- WS-FM 2006 Hernán But it doesn’t work Return_BBC (a,x) where x: (CNN(d)| BBC(d)) 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC 1-answer0-answer Return_ Call_ f > d > lock
- WS-FM 2006 Hernán But it doesn’t work Return_BBC (a,x) where x: (CNN(d)| BBC(d)) 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC 1-answer0-answer Return_ Call_ f > d > lock
- WS-FM 2006 Hernán But it doesn’t work Return_BBC (a,x) where x: (CNN(d)| BBC(d)) 1-answer0-answer Return_CNN 1-answer0-answer Call_CNNCall_BBC 1-answer0-answer Return_ Call_ 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
- WS-FM 2006 Hernán Join Join processes can be seen as dynamic and reconfigurable, coloured nets
- WS-FM 2006 Hernán Join Join processes can be seen as dynamic and reconfigurable, coloured nets a x b x ax xbax xb
- WS-FM 2006 Hernán Join Join processes can be seen as dynamic and reconfigurable, coloured nets a x b x ax xbax xb a c def in a a | a c a x b x ax xbax xb b def in a b | c b b c a x b x ax xbax xb a def in a a | c b b c
- WS-FM 2006 Hernán 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
- WS-FM 2006 Hernán 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 cy aycy ay
- WS-FM 2006 Hernán 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
- WS-FM 2006 Hernán 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
- WS-FM 2006 Hernán 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
- WS-FM 2006 Hernán 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
- WS-FM 2006 Hernán Correspondence Theorem: Let O be an Orc Program and {O} its encoding in Join. Then, O {O} when considering the non killing asymmetric composition.
- WS-FM 2006 Hernán 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