process algebra (2if45) probabilistic extension: semantics parallel composition dr. suzana andova

23
Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

Upload: brittney-henderson

Post on 17-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

Process Algebra (2IF45)

Probabilistic extension: semanticsParallel composition

Dr. Suzana Andova

Page 2: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

2

Probabilistic LTS

Process Algebra (2IF45)

Basic ingredients of a PLTS: • states

• non-detereministic states set N• probabilistic states set P

• transitions• action transitions labelled with actions and t P• probabilistic transitions labelled with probabilities

and t N• For a probabilistic state s,

= 1

s t

s t

as t

Page 3: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

3 Process Algebra (2IF45)

Equational theory. Language

• Specify processes that can execute certain actions from a given set A

• The language of the Probabilistic Basic Process Algebra, 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)

Page 4: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

4 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

Page 5: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

5 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)

Page 6: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

6

Probabilistic LTS

Process Algebra (2IF45)

1 2/3

b32

5

1/3

a

9

c

1

10

c c

b

76

11

1/3

12

c c

a

8

1

13

c

b

1

c

2/3

4 1

b

1

a

1

c

1

Page 7: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

7

SOS rules for PBPA(A)

Process Algebra (2IF45)

1

a

Process terms in the language of

the Probabilistic Basic Process Algebra,

• 0 deadlock constant (inaction)

• 1 successful termination

• a._ action prefix for a in A

• + non-deterministic choice

probabilistic choice for (0,1)

a.0

a.0?

0?

Page 8: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

8

SOS rules for PBPA(A)

Process Algebra (2IF45)

1

a

Process terms in the language of

the Probabilistic Basic Process Algebra,

• 0 deadlock constant (inaction)

• 1 successful termination

• a._ action prefix for a in A

• + non-deterministic choice

probabilistic choice for (0,1)

a.0

a.0

0

Page 9: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

9 Process Algebra (2IF45)

SOS rules for PBPA(A)

Signature: 0, a._ , _+_,

Set of closed terms C(PBPA(A))

Behaviour expressed by

• action transitions _ _ for a in A

• probabilistic transitions _ _ for (0,1]

• Behavioural equivalence is bisimilarity

a

Deduction rules

a.x a.x1

a.x xa

Page 10: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

10

SOS rules for PBPA(A)

Process Algebra (2IF45)

1

a b

1 1/2

a b

1/21/2 =

a.0 b.0 a.0 1/2 b.0

Page 11: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

11 Process Algebra (2IF45)

SOS rules for PBPA(A)

Deduction rules x x’

x y x’ a.x a.x

1 y y’

x y y’ (1-)

a.x xa

1

a b

1 1/2

a b

1/21/2 =

a.0 b.0 a.0 1/2 b.0

Page 12: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

12 10 January 2008

1/2

a b

1/2+ =

1/3

c d

2/3 1/3

a b

1/61/6

a

1/3

dc cdb

SOS rules for PBPA(A)

Page 13: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

13

1/2

a b

1/2+ =

1/3

c d

2/3 1/3

a b

1/61/6

a

1/3

dc cdb

SOS rules for PBPA(A)

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 xa

Page 14: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

14

SOS for action transitions

Process Algebra (2IF45)

• Deduction rules for action transitions and termination

1

x x’

x + y x’ a.x x

a

a

x (x + y)

a y y’

x + y y’

a

a

y (x + y)

Page 15: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

15 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 _ | _

Page 16: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

16 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/2|| =

1/3

c b

1/31/6

a

1/6

ac

db de

1

a a dd b

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

b c

1 11 1

Page 17: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

17

• Deduction rules for action transitions and termination

x x’

x || y x’ || y

a

a

x yx || y

y y’

x || y x || y’

a

a

x yx | 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’ , aH

H(x) H(x’) a

a

SOS semantics of PTCP(A, )

Page 18: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

18 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)

Page 19: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

19

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).

Page 20: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

20

Unreliable communication – nondeterministic spec

Process Algebra (2IF45)

S R2

S = s1(x).Sx

Sx = i.s2(x).1 + i.s2(err).Sx

R = r2(x).r3(x).1 + r2(err).R

Sys = H(S || R)

Sys =s1(x). H(Sx || R)

H(Sx || R) = i.c2(x).s3(x).1 + i. c2(err). H(Sx || R)

1 3

Sys

s1(x)

c2(x)

s3(x)

i i

c2(err)

Page 21: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

21

Unreliable communication – probabilistic spec

Process Algebra (2IF45)

S R2

Specification of components:

PS = s1(x).PSx

PSx = s2(x).1 9/10 s2(err).PSx

R = r2(x).r3(x).1 + r2(err).R

Specification of the whole system,

derived from spec. above

PSys = H(PS || R)

PSys =s1(x). H(PSx || R)

H(PSx || R) = c2(x).s3(x).1 9/10 c2(err). H(PSx || R)

1 3

PSys

s1(x)

c2(x)

s3(x)

1/10

c2(err)

1

9/10

1

Page 22: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

22

Unreliable communication – probabilistic spec

Process Algebra (2IF45)

Benefits of probabilistic wrt nondeterministic specification:

- no fairness assumption needed

- performance analysis is possible , for instance for this example we can compute the average number of the message x needs to be sent by S in order to be received by R; This number, of course, depends on the probability by which the message is correctly sent. Thus, for exaple, we compute, using probability theory techniques, that :

- for 1/10 vs. 9/10 in average a message needs to be sent 1.2 times

- for ½ vs. ½ in average a message needs to be sent 2 time

PSys

s1(x)

c2(x)

s3(x)

1/10

c2(err)

1

9/10

1

Page 23: Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova

23

ABP with unreliable channels

Process Algebra (2IF45)

SK2

S = S0 S1 S

Sn = d r1(d).Snd

Snd = s2(dn). Tnd

Tnd = r6(1-n).Snd + s6(err).Snd + r6(n).1

R = R1 R0 R

Rn = r3(err).s5(n).Rn

+ d,n r3(dn).s5(n).Rn + d,n r3(d(1-n)).s4(d).s5(1-n).1

K = d,n r2(dn).(i.s3(dn).K + i.s3(err).K)

L = n r5(n).(i.s6(n).K + i.s6(err).L)

Specify K and L with probabilistic choice operator.

Derive the spec. of the whole system

1 3R

L6 5

4