Presentation is loading. Please wait.

Presentation is loading. Please wait.

Process Algebra (2IF45) Probabilistic Process Algebra Suzana Andova.

Similar presentations


Presentation on theme: "Process Algebra (2IF45) Probabilistic Process Algebra Suzana Andova."— Presentation transcript:

1 Process Algebra (2IF45) Probabilistic Process Algebra Suzana Andova

2 1 Outline of the lecture Why probabilistic extension Introduction to probabilistic choice operator Probabilistic strong bisimulation Defining Probabilistic Basic Process Algebra Process Algebra (2IF45)

3 2 Process: Flipping a coin until tail comes out, then stop. S = flip.( .head.S + .tail.1) −‘+’ represents that we do not know which way the choice is made −We hope (and pray) that “ Eventually tail comes out!” −Praying = fairness assumption −Sometimes this is considered as “overspecification” of the choice Example of flipping a coin: can we do differently?

4 3 Process Algebra (2IF45) Process: Flipping a coin until tail comes out, then stop. S = flip.( .head.S + 1/2 .tail.1) −‘+’ represents that we do not know which way the choice is made but we do know or we can estimate to fair coin −We hope (and pray) that “ Eventually tail comes out!” Certainly eventually tail comes out −Praying = fairness assumption −Sometimes this is considered as “overspecification” of the choice −Now the choice is specified as it is in the real system (or much closer) Example of flipping a coin: can we do differently?

5 4 Process Algebra (2IF45) Process: Flipping a coin until tail comes out, then stop. S = flip.( .head.S + 1/2 .tail.1) −‘+’ represents that we do not know which way the choice is made but we do know or we can estimate to fair coin −We hope (and pray) that “ Eventually tail comes out!” Certainly eventually tail comes out −Praying = fairness assumption −Sometimes this is considered as “overspecification” of the choice −Now the choice is specified as it is in the real system (or much closer) Example of flipping a coin: can we do differently? x How to define?

6 5 What is probability? Process Algebra (2IF45) Probabilistic description of frequency of outcomes in a repeated experiment (e.g. throwing a die) Outcome of one experiment is an event (e.g. tail coming up is an event), they form sample space (state space) Probability describes the frequency an event occurs Markov process: every next experiment doesn’t depend on the previous outcome (for instance throwing a die) vs. Non-Markov processes: temperature in Eindhoven today depends on the temperature yesterday Discrete vs. continuous (time) random process (Non-)Deterministic universe vs. randomness

7 6 What is probability? Process Algebra (2IF45) Probabilistic description of frequency of outcomes in a repeated experiment (e.g. throwing a die) Outcome of one experiment is an event (e.g. tail coming up is an event), they form sample space (state space) Probability describes the frequency an event occurs Markov process: every next experiment doesn’t depend on the previous outcome (for instance throwing a die) vs. Non-Markov processes: temperature in Eindhoven today depends on the temperature yesterday Discrete vs. continuous (time) random process (Non-)Deterministic universe vs. randomness

8 7 Process Algebra (2IF45) Probabilistic algorithms are more efficient than (non)deterministic algorithms Some problems can be only solved by probabilistic algorithms and it is proven that no (non)deterministic solution exists “It is shown that distributed systems of probabilistic processors are essentially more powerful that distributed systems of deterministic processors” in A symmetric and fully distributed solution to the Dining Philosophers problem, D. Lehmann and M. Rabin, 1981 Impossibility of Distributed Consensus with One Fault Process (consensus problem in asynchronous system) M. Fisher, N. Lynch, M. Peterson, 1985 On randomization in sequential and distributed algorithms, R.Guptan, S.Bhaskar, S.A.Smolka, 1994 Non-determinism and randomness

9 8 Discrete Markov chains: (very) simple random processes Process Algebra (2IF45) 1/6 1 1/2 1 1 1/3 1/6 1 1/2 5/6 1/6 1 1 1 1 1 1 1

10 9 Markov chains + reactive systems = fully probabilistic systems Process Algebra (2IF45) 5/6, NotSix 1/6, six ½, head 1, done ½, tail 1,done

11 10 Process Algebra (2IF45) Markov chains + non-determinism = Probabilistic LTSs NotSix 1/6 six tail ½ done die coin ½ head 5/6 1

12 11 Probabilistic Labelled Transition Systems - PLTS Process Algebra (2IF45)

13 12 Probabilistic LTS Process Algebra (2IF45) Basic ingredients of a PLTS: states (two types of states) non-detereministic states set N probabilistic states set P transitions (two types of transitions) action transitions labelled with actions and t  P probabilistic transitions labelled with probabilities and t  N For a probabilistic state s,   = 1  s  ts  t  s  ts  t a s  ts  t NotSix 1/6 six tail ½ done die coin ½ head 5/6 1

14 13 Probabilistic LTS Process Algebra (2IF45) Basic ingredients of a PLTS: states (two types of states) non-detereministic states set N probabilistic states set P transitions (two types of transitions) action transitions labelled with actions and t  P probabilistic transitions labelled with probabilities and t  N For a probabilistic state s,   = 1  s  ts  t  s  ts  t a s  ts  t NotSix 1/6 six tail ½ done die coin ½ head 5/6

15 14 Probabilistic LTS Process Algebra (2IF45) For a probabilistic state s  P and a set of states C  S we define the total probability of s to reach C as Prob(s,C) =    s  t, t  C Note:Only in one step!

16 15 Probabilistic LTS Process Algebra (2IF45) Examples: Prob(9, {3,4}) = 1/6 Prob(9, {1}) = 0 Prob(10,{5,6}) = 1 Prob(s,C) =    s  t, t  C 9 4 5/6 1/6 10 7 ½ pass 11 ½ h 1 sel_d sel_c 5 6 2 3 8 1 six not_six h t 1 1 1

17 16 Probabilistic LTS Process Algebra (2IF45) C1 = {2}, C2={3}, C3 = {9, 13}, C4 = {10,11,12}, Prob(1, C1) = 1/3 Prob(1, C2) = 2/3 Prob(1,C3) = Prob(1,C4) = 0 Prob(5,C4) = 1 Prob(6,C4) = 1 Prob(7,C4) = 1/3 Prob(5,C3) = 0 Prob(6,C3) = 0 Prob(7,C3) = 2/3 Prob(4,C3) = 1 Prob(8,C3) = 1 Prob(4,C4) = 0 Prob(8,C4) = 0 1 2/3 b 3 2 5 1/3 a 9 c 1 10 c c b 7 6 11 1/3 12 c c a 8 1 13 c b 1 c 2/3 4 1 E1 = {9,10,11,12,13}, E2={2,3} Prob(1, E2) = 1 Prob(1,E1) = Prob(1,E2) = 0 Prob(5,E1) = 1 Prob(6,E1) = 1 Prob(7,E1) = 1/3 +2/3 = 1 Prob(4,E1) = 1 Prob(8,E1) = 1 Prob(4,E2) = …=Prob(8,E2)= 0

18 17 Probabilistic LTS Process Algebra (2IF45) 1 2/3 b 3 2 5 1/3 a 9 c 1 10 c c b 7 6 11 1/3 12 c c a 8 1 13 c b 1 c 2/3 4 1 E1 = {9,10,11,12,13}, E2={2,3} Prob(1, E2) = 1 Prob(1,E1) = Prob(1,E2) = 0 Prob(5,E1) = 1 Prob(6,E1) = 1 Prob(7,E1) = 1/3 +2/3 = 1 Prob(4,E1) = 1 Prob(8,E1) = 1 Prob(4,E2) = …=Prob(8,E2)= 0 a 2  42  4 a 3  83  8 b 2  5 b 3  6 b 3  7 c 9  0 c 10  0 c 11  0 c 12  0 c 13  0

19 18 Process Algebra (2IF45) Bisimulation on LTSs An equivalence relation R on the set of state S = N  P of an PLTS is probabilistic strong bisimulation iff the following conditions hold: 0. R  N x N  P x P 1.for all states s, t  N, whenever (s, t)  R and s  s’ for some a  A and s’  S, then there is a state t’  S such that t  t’ and (s’, t’)  R; 2.for all states s, t  P, Prob(s, C) = Prob(t, C) for all C  S/R Two PLTSs s and t are probabilistic strong bisimilar, s p t, iff there is a probabilistic strong bisimulation R such that (s, t)  R a a

20 19 Example of bisimilar PLTS Process Algebra (2IF45) 1 2/3 b 3 2 5 1/3 a 9 c 1 10 c c b 7 6 11 1/3 12 c c a 8 1 13 c b 1 c 2/3 4 1 b 1 a 1 c 1

21 20 Composing PLTSs: Towards defining the language of probabilistic systems

22 21 Process Algebra (2IF45) Probabilistic Basic Process Algebra PBPA(A) Language: PBPA(A) Signature: 0, (a._ ) a  A, +, ⊕ , where   (0,1) Language terms T(PBPA(A)) Axioms of PBPA(A): (A1) x+ y = y+x (A2) (x+y) + z = x+ (y + z) (A3) x + x = x (A4) x+ 0 = x Deduction rules for PBPA(A): x  x’ x + y  x’ a a  11  x  (x + y)   a.x  x  a  y  y’ x + y  y’ a a y  (x + y)  ⑥ Strong Probabilistic Bisimilarity on PLTSs Equality of terms

23 22 SOS rules for PBPA(A) Process Algebra (2IF45) 1 a a.0 a.0? 0?

24 23 SOS rules for PBPA(A) Process Algebra (2IF45) 1 a a.0 0

25 24 SOS rules for PBPA(A): action prefix Process Algebra (2IF45) 1 a a.0 0 Deduction rules a.x  a.x 1 a.x  x a

26 25 SOS rules for PBPA(A): probabilistic choice Process Algebra (2IF45) 1 a b 1 1/2 a b  1/2 = a.0b.0 a.0  1/2 b.0

27 26 Process Algebra (2IF45) SOS rules for PBPA(A): probabilistic choice Deduction rules x  x’ x   y  x’ a.x  a.x  1 y  y’ x   y  y’ (1-  )    a.x  x a 1 a b 1 1/2 a b  1/2 = a.0b.0 a.0  1/2 b.0

28 27 10 January 2008 1/2 a b + = 1/3 c d 2/3 1/3 ab 1/6 a 1/3 d c c d b SOS rules for PBPA(A): non-deterministic choice

29 28 1/2 a b + = 1/3 c d 2/3 1/3 ab 1/6 a 1/3 d c c d b SOS rules for PBPA(A): non-deterministic choice Deduction rules x  x’ x   y  x’ a.x  a.x  1 y  y’ x   y  y’ (1-  )  x  x’, y  y’ x +y  x’ + y’      a.x  x a

30 29 SOS rules for PBA(A): action transitions Process Algebra (2IF45) Deduction rules for action transitions x  x’ x + y  x’ a.x  x a a a y  y’ x + y  y’ a a

31 30 Process Algebra (2IF45) PBPA(A) Probabilistic Basic Process Algebra Language: PBPA(A) Signature: 0, (a._ ) a  A, +, ⊕ , where   (0,1) Language terms T(PBPA(A)) Axioms of PBPA(A): (A1) x+ y = y+x (A2) (x+y) + z = x+ (y + z) (A3) x + x = x (A4) x+ 0 = x Deduction rules for PBPA(A): x  x’ x + y  x’ a a  11  x  (x + y)   a.x  x  a  y  y’ x + y  y’ a a y  (x + y)  ⑥ Strong Probabilistic Bisimilarity on PLTSs Equality of terms DONE! 7 SOS rules 4 for probabilistic transitions 3 for action transitions

32 31 Process Algebra (2IF45) Axioms of PBPA(A) PBPA(A) Signature: 0, a._, _+_,   (A1) x+ y = y+x (A2) (x+y) + z = x+ (y + z) (A3) x + x = x but (AA3) a.x+a.x = a.x (A4) x+ 0 = x

33 32 Process Algebra (2IF45) Axioms of PBPA(A) PBPA(A) Signature: 0, a._, _+_,   (PA1) x   y = y  1-  x (PA2) x   (y   z) = (x   y)  z where  =  /(  +  -  ) and =  +  -  (PA3) x   x = x (PA4) (x   y) + z = (x + z)   (y + z)

34 33 Process Algebra (2IF45) PBPA(A) Probabilistic Basic Process Algebra Language: PBPA(A) Signature: 0, (a._ ) a  A, +, ⊕ , where   (0,1) Language terms T(PBPA(A)) Axioms of PBPA(A): (A1) x+ y = y+x (A2) (x+y) + z = x+ (y + z) (AA3) a.x+a.x = a.x (A4) x+ 0 = x (PA1) x   y = y  1-  x (PA2) x   (y   z) = (x   y)  z where  =  /(  +  -  ) and =  +  -  (PA3) x   x = x (PA4) (x   y) + z = (x + z)   (y + z) Deduction rules for PBPA(A): x  x’ x + y  x’ a a  11  x  (x + y)   a.x  x  a  y  y’ x + y  y’ a a y  (x + y)  ⑥ Strong Probabilistic Bisimilarity on PLTSs Equality of terms DONE! 7 SOS rules 4 for probabilistic transitions 3 for action transitions

35 34 Conclusion of the lecture We have defined: Probabilistic strong bisimulation Probabilistic choice operator Operational semantics and SOS rules Axiomatization for PBPA(A) wrt strong probabilistic bisimulation Process Algebra (2IF45)

36 35 Process Algebra (2IF45) Extending the language with parallel composition – Probabilistic TCP(A,  ) Specify processes that can execute certain actions from a given set A The language of the Probabilistic Theory of Communicating Processes, namely, the operators in the signature 0 deadlock constant (inaction) 1 successful termination a._ action prefix for a in A + non-deterministic choice   probabilistic choice for   (0,1) communication function  (_,_) parallel composition _ || _ communication composition _ | _

37 36 10 January 2008 SOS semantics of PTCP(A,  ) where a and c communicate in e, and no other communication is defined (in this examples) 1/3 a b 2/3 1/2 c d ||= 1/3 c b 1/6 a a c d bd e 1 a a ddb Deduction rules  x  x’  H (x)   H (x’)   x  x’, y  y’ x || y  x’|| y’   x  x’, y  y’ x | y  x’ | y’    c 11 bc 111 1

38 37 Deduction rules for action transitions and termination x  x’ x || y  x’ || y a a x  y  x || y  y  y’ x || y  x || y’ a a x  y  x | y  x  x’ y  y’,  (a,b) = c x || y  x’ || y’ a c b x  x’ y  y’,  (a,b) = c x | y  x’ || y’ a c b x  x’, a  H  H (x)   H (x’) a a SOS semantics of PTCP(A,  )

39 38 Process Algebra (2IF45) Axioms (not seen yet) of TCP(A,  ) x|| y = x ╙ y + y ╙ x + x | y, only if x=x+x and y=y+y x || (y   z) = (x || y)   (x || z) (x   y) || z = (x || z)   (y || z) x | (y   z) = (x | y)   (x | z) (x   y) | z = (x | z)   (y | z)  H (x   y) =  H (x)    H (y) x ╙ (y   z) = (x ╙ y)   (x ╙ z) (x   y) ╙ z = (x ╙ z)   (y ╙ z)

40 39 Exercises Process Algebra (2IF45) 1.Consider process terms p = a.0 + a.0, q = a.0  1/3 b.0, r = c.(d.0  1/2 b.0). Draw the PLTSs of p, q and r using the SOS semantic rules. Use the rules compute the PLTS of  H (p || q || r) if  (b,c) = e and H={b,c} Using the axioms derive a PBPA(A) process term t such that PTCP(A,  )├  H (p || q || r) = t, if  (b,c) = e and H={b,c}. Draw the PLTS of t and establish a probabilistic bisimulation relation between PLTS of t and PLTS of  H (p || q || r).


Download ppt "Process Algebra (2IF45) Probabilistic Process Algebra Suzana Andova."

Similar presentations


Ads by Google