Middle School Student Analogy Process in Solving Algebra ...
Process Algebra (2IF45) Probabilistic Process Algebra
description
Transcript of Process Algebra (2IF45) Probabilistic Process Algebra
Process Algebra (2IF45)
Probabilistic Process Algebra
Suzana Andova
2
Outline of the lecture
• Semantics of non-determinism in probabilistic setting• Analysing probabilistic systems and schedulers
• Probabilistic branching bisimulation
Process Algebra (2IF45)
3 Process Algebra (2IF45)
PBPA(A) Probabilistic Basic Process Algebra
Language: PBPA(A)
Signature: 0, (a._ )aA, +, ⊕, 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
x x’ x + y x’
aa
1
x (x + y)
a.x x a
y y’ x + y y’
aa
y (x + y)
⑥
Strong Probabilistic Bisimilarity on PLTSs
Equality of termsSoundness
Completeness
Deduction rules for PBPA(A):
x x’ x y x’
a.x a.x1
y y’ x y y’ (1-)
x x’, y y’ x +y x’ + y’
a.x xa x x’ x + y x’
y y’ x + y y’
a
a
a
a
4
1/2
a b
1/2 + =1/3
c d
2/3 1/3
a b
1/61/6
a
1/3
dc cd b
SOS rules for PBPA(A): non-deterministic choice
x x’, y y’ x +y x’ + y’
Deduction rule
5
1/3
a b
2/3 + =1/3
a b
2/3 2/9
a b
2/91/9
a
4/9
ba ab b
Non-deterministic choice: idempotence?
?p
1/3
a b
2/3 4/9
a
1/9
a
4/9
ba b b
6 Process Algebra (2IF45)
Axioms of PBPA(A)
(A1) x+ y = y+x(A2) (x+y) + z = x+ (y + z)
(A3) x + x = xbut (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)
7 Process Algebra (2IF45)
PBPA(A) Probabilistic Basic Process Algebra
Language: PBPA(A)
Signature: 0, (a._ )aA, +, ⊕, where (0,1) Language terms T(PBPA(A))
x x’ x + y x’
aa
1
x (x + y)
a.x x a
y y’ x + y y’
aa
y (x + y)
⑥
Strong Probabilistic Bisimilarity on PLTSs
Equality of termsSoundness
Completeness
Deduction rules for PBPA(A):
x x’ x y x’
a.x a.x1
y y’ x y y’ (1-)
x x’, y y’ x +y x’ + y’
a.x xa x x’ x + y x’
y y’ x + y y’
a
a
a
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) zwhere = /( + - ) and = + -
(PA3) x x = x
(PA4) (x y) + z = (x + z) (y + z)
Process Algebra (2IF45)
Analysing Probabilistic systems
Dr. Suzana Andova
9
Analysing PLTSs – main ingredients
Process Algebra (2IF45)
What can we measure on x? The set of all paths in x starting in p?!
n
p
k s
0
x
10
Analysing PLTSs – main ingredients
Process Algebra (2IF45)
n
p
k s
0
x Property1: After finitely many c’s, a is observed(Measured set = all paths with trace in c*a)
Property2: After finitely many c’s, action b occurs(Measured set = all paths with trace in c*b)
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?!
11
Example 1 (cont.)
Process Algebra (2IF45)
Property1: After finitely many c’s, a is observed
n
p
k s
0
x p
k s s
0 p
1/3 1/2 1/6
a b c
k s s
0 p
1/2 1/6
a b c
1/3
.
.
.
12
Example 1 (cont.)
Process Algebra (2IF45)
Property1: After finitely many c’s, a is observed
n
p
k s
0
x p
k s s
0 p
1/3 1/2 1/6
a b c
k s s
0 p
1/2 1/6
a b c
1/3
.
.
.
13
Example 1 (cont.)
Process Algebra (2IF45)
Property1: After finitely many c’s, a is observed
n
p
k s
0
x p
k s s
0 p
1/3 1/2 1/6
a b c
k s s
0 p
1/2 1/6
a b c
1/3
.
.
.Prob(SetPaths1) = ?
14
Example 1 (cont.)
Process Algebra (2IF45)
Property1: After finitely many c’s, a is observed
n
p
k s
0
x p
k s s
0 p
1/3 1/2 1/6
a b c
k s s
0 p
1/2 1/6
a b c
1/3
.
.
.Prob(SetPaths1) = 1/3 + 1/6x1/3 + (1/6)^2x1/3 + ….
= k0 1/3x(1/6)^k = (1/3)/ (1-1/6) = 2/5
17
Example 1 (cont.)
Process Algebra (2IF45)
n
p
k s
0
x
p
k s s
0 p
1/3 1/2 1/6
a b c
k s s
0 p
1/2 1/6
a b c
1/3
.
.
.
k s s
0 p
1/3 1/2 1/6
a b cProb(SetPaths3) = ?
Property3: After an even number
of c’s, action a
occurs
18
Example 1 (cont.)
Process Algebra (2IF45)
n
p
k s
0
x
Prob(SetPaths5) = ?
Property1: After finitely many c’s, a is observed
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
Property5: Eventually deadlock is reached (state 0) (Measured set = ?)
19
Example 2
Process Algebra (2IF45)
n
p
k s
0
y
k
p
k s s
0 p
1/3 1/2 1/6
a
bc
k s s
0 p
1/2 1/6
a b c
1/3
.
.
.
b
b
What can we measure on y? The set of all paths in y starting in p?!
20
Example 2
Process Algebra (2IF45)
n
p
k s
0
y
k
p
k s s
0 p
1/3 1/2 1/6
a
bc
k s s
0 p
1/2 1/6
a b c
1/3
.
.
.
b
b
What can we measure on y? The set of all paths in y starting in p?!
Property1: After finitely many c’s, a is observed
21
Example 2
Process Algebra (2IF45)
n
p
k s
0
y
k
p
k s s
0 p
1/3 1/2 1/6
a
bc
k s s
0 p
1/2 1/6
a b c
1/3
.
.
.
b
b
What can we measure on y? The set of all paths in y starting in p?!
Property1: After finitely many c’s, a is observed
22
Example 2
Process Algebra (2IF45)
n
p
k s
0
y
k
p
k s s
0 p
1/3 1/2 1/6
a
bc
k s s
0 p
1/2 1/6
a b c
1/3
.
.
.
b
b
What can we measure on y?
Property1: After finitely many c’s, a is observed
Nothing, unless we resolve the non-determinism!
23
Example 2
Process Algebra (2IF45)
n
p
k s
0
y
k
p
k s s
0 p
1/3 1/2 1/6
a
bc
k s s
0 p
1/2 1/6
a b c
1/3
.
.
.
b
b
What can we measure on y?
Property1: After finitely many c’s, a is observed
Nothing, unless we resolve the non-determinism!
HOW? By schedulers!
24 Process Algebra (2IF45)
• Schedulers are used to resolve non-determinism• A scheduler “decides” the next step to be performed from a given non-
deterministic 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.
Schedulers
25
Example 2 (cont.)
Process Algebra (2IF45)
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 .
26
Example 2 (cont.) – scheduler
Process Algebra (2IF45)
Computation tree CTy(p, )
n
p
k s
0
y
k
p
k s n
0 p
1/3 1/2 1/6
a c
k s n
0 p
1/2 1/6
b
c
1/3
.
.
.
27
Example 2 (cont.) – scheduler
Process Algebra (2IF45)
Prob(FPaths(y, trace = c*a)) = 12/35 How?
n
p
k s
0
y
k
Property1: After finitely many c’s, a is observed
p
k s n
0 p
1/3 1/2 1/6
a c
k s n
0 p
1/2 1/6
b
c
1/3
.
.
28
Example 2 (cont.) – scheduler 1
Process Algebra (2IF45)
n
p
k s
0
y
k
p
k s s
0 p
1/3 1/2 1/6
a c
k s s
0 p
1/2 1/6
a b c
1/3
.
.
.
b
Computation tree CTy(p, 1)
29
Example 2 (cont.) – scheduler 1
Process Algebra (2IF45)
n
p
k s
0
y
k
.
.
.
p
k s s
0 p
1/3 1/2 1/6
a c
k s s
0 p
1/2 1/6
a b c
1/3b
Property1: After finitely many c’s, a is observed
Prob1(FPaths(y, trace = c*a) )= 2/5 How? Can we do better?
30
Example 2 (cont.)
Process Algebra (2IF45)
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 scheduler1.3. Scheduler 2 is the minimal scheduler
Process Algebra (2IF45)
Parallel composition of PLTSs
32
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 d
e1
a a dd b
Deduction rules for probabilistic transitions 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
33
• Deduction rules for action transitions
x x’ x || y x’ || y
a
a y y’ x || y x || y’
a
a
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, )
34 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)