Lecture13

Process Algebra (2IF45)
Probabilistic Process Algebra
Suzana Andova
Outline of the lecture
• Semantics of non-determinism in probabilistic setting
• Analysing probabilistic systems and schedulers
• Probabilistic branching bisimulation
1
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))
Deduction rules for PBPA(A):
a
1 x
a.x

a.x
 a.x

y  y’
1 
x  y (1-)
 y’
a x’
x 
x a x’
x + y 
x’
x  y  x’


x 
ya
x’,y’y  y’

a
xx +y
+ y
 x’
y’ + y’
a
x  x’
x
a
a
a.x  x (x + y)  x +y 
x’
a
y  y’
a
y
x⑥+ y 
y’
Axioms of PBPA(A):
(A1) x+ y = y+x
(A2) (x+y) + z = x+ (y + z)
(A3) x + x = x
(A4) x+ 0 = x
(x + y) 
Strong Probabilistic
Bisimilarity on PLTSs
2
Equality of terms
Process Algebra (2IF45)
SOS rules for PBPA(A): non-deterministic choice
1/2 1/2
a
b
+
1/3 2/3
c
1/6
=
d
a
Deduction rule


x  x’, y  y’

x +y  x’ + y’
3
c
1/3
a
1/6
d
b
1/3
c b
d
Non-deterministic choice: idempotence?
1/3 2/3
a
+
b
1/9
1/3 2/3
a
=
b
a
a
2/9
a
2/9
b
b
4/9
a b
?
1/3 2/3
a
4
b
p
1/9
a
a
4/9
4/9
a
b
b
b
b
Axioms of PBPA(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
(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)
5
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))
Deduction rules for PBPA(A):
a
1 x
a.x

a.x
 a.x

y  y’
1 
x  y (1-)
 y’
Axioms of PBPA(A):
a x’
x 
x a x’
x + y 
x’
x  y  x’


x 
ya
x’,y’y  y’

a
xx +y
+ y
 x’
y’ + y’
(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
a
x  x’
x
a
a
a.x  x (x + y)  x +y 
x’
a
y  y’
a
y
x⑥+ y 
y’
(x + y) 
(PA2) x  (y  z) = (x  y)  z
where = /( + - ) and  =  + - 
(PA3) x  x = x
(PA4) (x  y) + z = (x + z)  (y + z)
Strong Probabilistic
Bisimilarity on PLTSs
6
Equality of terms
Process Algebra (2IF45)
Process Algebra (2IF45)
Analysing Probabilistic systems
Dr. Suzana Andova
Analysing PLTSs – main ingredients
x n
p
k
s
0
What can we measure on x?
The set of all paths in x starting in p?!
8
Process Algebra (2IF45)
Analysing PLTSs – main ingredients
Property1: After finitely many c’s, a is observed
(Measured set = all paths with trace in c*a)
x n
Property2: After finitely many c’s, action b occurs
(Measured set = all paths with trace in c*b)
p
k
s
0
Property3: After an even number of c’s, action a occurs
(Measured set = all paths with trace in (cc)*a)
Property4: After an even number of c’s, action a or
action b occurs
Property5: Eventually deadlock is reached (state 0)
(Measured set = all paths that have 0 as last
state)
What can we measure on x?
The set of all paths in x starting in p?!
9
Process Algebra (2IF45)
Example 1 (cont.)
Property1: After finitely many c’s, a is observed
p
x n
1/3
k
a
p
1/6
1/2
s
0
s
c
b
p
1/3
k
s
k
a
0
10
1/6
1/2
s
0
s
c
b
p
.
.
.
Process Algebra (2IF45)
Example 1 (cont.)
Property1: After finitely many c’s, a is observed
p
x n
1/3
k
a
p
1/6
1/2
s
0
s
c
b
p
1/3
k
s
k
a
0
11
1/6
1/2
s
0
s
c
b
p
.
.
.
Process Algebra (2IF45)
Example 1 (cont.)
Property1: After finitely many c’s, a is observed
p
x n
1/3
k
a
p
1/6
1/2
s
0
s
c
b
p
1/3
k
s
k
a
0
s
0
s
c
b
p
.
.
.
Prob(SetPaths1) = ?
12
1/6
1/2
Process Algebra (2IF45)
Example 1 (cont.)
Property1: After finitely many c’s, a is observed
p
x n
1/3
k
a
p
1/6
1/2
s
0
s
c
b
p
1/3
k
s
k
a
0
1/6
1/2
s
0
= k0 1/3x(1/6)^k = (1/3)/ (1-1/6) = 2/5
Process Algebra (2IF45)
c
b
Prob(SetPaths1) = 1/3 + 1/6x1/3 + (1/6)^2x1/3 + ….
13
s
p
.
.
.
Example 1 (cont.)
Property3: After
an even number
1/6
of c’s, action a
s
occurs
c
p
1/3
x n
1/2
k
s
a
0
b
p
1/3
p
k
k
s
1/6
1/2
s
a
0
s
c
b
p
1/3
0
k
a
Prob(SetPaths3) = ?
16
Process Algebra (2IF45)
1/6
1/2
s
0
s
c
b
p
.
.
Example 1 (cont.)
Property1: After finitely many c’s, a is observed
x n
Property2: After finitely many c’s, action b occurs
Property3: After even number of c’s, action a occurs
Property4: After even number of c’s, action a or action b
occurs
p
k
s
Property5: Eventually deadlock is reached (state 0)
(Measured set = ?)
0
Prob(SetPaths5) = ?
17
Process Algebra (2IF45)
Example 2
y n
p
1/3
p
k
s
k
s
a
b
1/6
1/2
0
s
c
b
0
p
1/3
k
s
a
0
What can we measure on y?
The set of all paths in y starting in p?!
18
Process Algebra (2IF45)
1/6
1/2
b
s
c
b
p
.
.
.
Example 2
y n
Property1: After finitely many c’s, a is observed
p
1/3
p
k
s
k
s
a
b
1/6
1/2
0
s
c
b
0
p
1/3
k
s
a
0
What can we measure on y?
The set of all paths in y starting in p?!
19
Process Algebra (2IF45)
1/6
1/2
b
s
c
b
p
.
.
.
Example 2
y n
Property1: After finitely many c’s, a is observed
p
1/3
p
k
s
k
s
a
b
1/6
1/2
0
s
c
b
0
p
1/3
k
s
a
0
What can we measure on y?
The set of all paths in y starting in p?!
20
Process Algebra (2IF45)
1/6
1/2
b
s
c
b
p
.
.
.
Example 2
y n
Property1: After finitely many c’s, a is observed
p
1/3
p
k
s
k
s
a
b
1/6
1/2
0
s
c
b
0
p
1/3
k
1/6
1/2
s
a
0
b
Process Algebra (2IF45)
c
b
What can we measure on y?
Nothing, unless we resolve the non-determinism!
21
s
p
.
.
.
Example 2
y n
Property1: After finitely many c’s, a is observed
p
1/3
p
k
s
k
s
a
b
1/6
1/2
0
s
c
b
0
p
1/3
k
1/6
1/2
s
a
0
b
22
Process Algebra (2IF45)
c
b
What can we measure on y?
Nothing, unless we resolve the non-determinism!
HOW? By schedulers!
s
p
.
.
.
Schedulers
23
•
•
Schedulers are used to resolve non-determinism
A scheduler “decides” the next step to be performed from a given nondeterministic state
•
It maps a finite path, ending in a non-deterministic state, to an action
transition (many detail is missing in this sentence, read the lecture notes for
the formal definition)
•
Analysis of a system with non-determinism is relative to the chosen
scheduler.
•
Different types of schedulers: randomized vs. deterministic.
•
Special kind of deterministic schedulers are simple schedulers.
Process Algebra (2IF45)
Example 2 (cont.)
Property1: After finitely many c’s, a is observed?
First select a scheduler, then compute this set,
and its probability
1. Let us define a scheduler
24
.
Process Algebra (2IF45)
Example 2 (cont.) – scheduler 
y
n
p
1/3
k
p
1/6
1/2
s
a
n
c
0
p
1/3
s
k
1/6
1/2
k
s
c
0
0
b
Computation tree CTy(p, )
25
n
Process Algebra (2IF45)
p
.
.
.
Example 2 (cont.) – scheduler 
y
Property1: After finitely many c’s, a is observed
n
p
1/3
p
k
1/6
1/2
s
a
n
c
0
s
k
p
1/3
k
0
1/6
1/2
s
c
0
b
Prob(FPaths(y, trace = c*a)) = 12/35
How?
26
n
Process Algebra (2IF45)
p
.
.
Example 2 (cont.) – scheduler 1
y
p
n
1/3
k
p
1/6
1/2
s
a
0
s
c
b
p
1/3
s
k
0
k
1/6
1/2
s
a
0
s
c
b
p
.
.
.
Computation tree CTy(p, 1)
27
Process Algebra (2IF45)
Example 2 (cont.) – scheduler 1
y
Property1: After finitely many c’s, a is observed
n
p
1/3
p
k
1/6
1/2
s
a
0
c
b
p
1/3
s
k
s
k
0
1/6
1/2
s
a
0
Process Algebra (2IF45)
c
b
Prob1(FPaths(y, trace = c*a) )= 2/5
How? Can we do better?
28
s
p
.
.
.
Example 2 (cont.)
Property1: After finitely many c’s, a is observed?
First select a scheduler, then compute this set,
and its probability
1.1. Let us define a scheduler 
1.2. Scheduler 1 is the maximal scheduler
1.3. Scheduler 2 is the minimal scheduler
29
Process Algebra (2IF45)
Process Algebra (2IF45)
Parallel composition of PLTSs
SOS semantics of PTCP(A, )
1/6
1/3 2/3
||
b
a
1/2 1/2
c
=
a
d
1
c
e
1/3
c
11
c
a b
1/6
1/3
b
d d
b
1
a
11
b a
c d
where a and c communicate in e,
and no other communication is defined (in this examples)
Deduction rules for probabilistic transitions


x  x’, y  y’
x || y 
 x’|| y’
31


x 
x’, y  y’

x|y
x’ | y’
10 January 2008

x  x’

H(x)  H(x’)
1
d
SOS semantics of PTCP(A, )
• Deduction rules for action transitions
a
x
x’
a
x || y 
x’ || y
a
y
y’
a
x || y 
x || y’
a
b
x
x’ y 
y’, (a,b) = c
c
x || y 
x’ || y’
a
b
x
x’ y 
y’, (a,b) = c
c
x|y
x’ || y’
x  x’ , aH
a
H(x)  H(x’)
a
32
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)
╙ (y  z) = (x ╙ y)  (x ╙ z)
(x  y) ╙ z = (x ╙ z)  (y ╙ z)
x
33
Process Algebra (2IF45)