320 likes | 494 Views
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. PBPA (A) Probabilistic Basic Process Algebra.
E N D
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 Process Algebra (2IF45)
PBPA(A) Probabilistic Basic Process Algebra Language: PBPA(A) Signature: 0, (a._ )aA, +, ⊕,where (0,1) Language terms T(PBPA(A)) • Deduction rules for PBPA(A): a x x’ x + y x’ x x’ x y x’ 1 a.x a.x 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 a x x’, y y’ x +y x’ + y’ a.x x a y y’ x y y’ y y’ x + y y’ a (1-) 1 a x x’ x + y x’ x (x + y) a a.x x a a y y’ x + y y’ a y (x + y) ⑥ Strong Probabilistic Bisimilarity on PLTSs Equality of terms Soundness Completeness Process Algebra (2IF45)
SOS rules for PBPA(A): non-deterministic choice Deduction rule x x’, y y’ x +y x’ + y’ 1/6 1/3 1/3 1/2 1/3 1/2 2/3 1/6 + = d c b a b c d a b d a c
Non-deterministic choice: idempotence? ? p 1/9 4/9 1/9 4/9 4/9 1/3 2/3 2/9 1/3 1/3 2/3 2/3 2/9 + = b b a b a b a b a b a a b a b a b b a a
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) = (xy) z • where = /( + - ) and = + - • (PA3) x x = x • (PA4) (x y) + z = (x + z) (y + z) 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) • (AA3) a.x+a.x = a.x • (A4) x+ 0 = x • (PA1) x y = y 1- x • (PA2) x(y z) = (xy) z • where = /( + - ) and = + - • (PA3) x x = x • (PA4) (x y) + z = (x + z) (y + z) • Deduction rules for PBPA(A): a x x’ x + y x’ x x’ x y x’ 1 a.x a.x a a x x’, y y’ x +y x’ + y’ a.x x a y y’ x y y’ y y’ x + y y’ a (1-) 1 a x x’ x + y x’ x (x + y) a a.x x a a y y’ x + y y’ a y (x + y) ⑥ Strong Probabilistic Bisimilarity on PLTSs Equality of terms Soundness Completeness 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?! 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) 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) x n p k s 0 What can we measure on x? The set of all paths in x starting in p?! Process Algebra (2IF45)
Example 1 (cont.) Property1: After finitely many c’s, a is observed x n p 1/3 1/6 1/2 p k s s c b a 0 p 1/3 1/6 k s 1/2 k s s 0 c b a 0 p . . . Process Algebra (2IF45)
Example 1 (cont.) Property1: After finitely many c’s, a is observed x n p 1/3 1/6 1/2 p k s s c b a 0 p 1/3 1/6 k s 1/2 k s s 0 c b a 0 p . . . Process Algebra (2IF45)
Example 1 (cont.) Property1: After finitely many c’s, a is observed x n p 1/3 1/6 1/2 p k s s c b a 0 p 1/3 1/6 k s 1/2 k s s 0 c b a 0 p . . . Prob(SetPaths1) = ? Process Algebra (2IF45)
Example 1 (cont.) Property1: After finitely many c’s, a is observed x n p 1/3 1/6 1/2 p k s s c b a 0 p 1/3 1/6 k s 1/2 k s s 0 c b a 0 p . . . Prob(SetPaths1) = 1/3 + 1/6x1/3 + (1/6)^2x1/3 + …. = k0 1/3x(1/6)^k = (1/3)/ (1-1/6) = 2/5 Process Algebra (2IF45)
Example 1 (cont.) Property3: After an even number of c’s, action a occurs x p n 1/3 1/6 1/2 k s s c b a p 0 p 1/3 1/6 1/2 k s k s s c b a 0 0 p 1/3 1/6 1/2 k s s c b a 0 Prob(SetPaths3) = ? p . . . Process Algebra (2IF45)
Example 1 (cont.) 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 = ?) x n p k s 0 Prob(SetPaths5) = ? Process Algebra (2IF45)
Example 2 y n p 1/3 1/6 1/2 k s s a c p b 0 b p 1/3 1/6 1/2 k s k k s s a c b 0 0 p b . . . What can we measure on y? The set of all paths in y starting in p?! Process Algebra (2IF45)
Example 2 y Property1: After finitely many c’s, a is observed n p 1/3 1/6 1/2 k s s a c p b 0 b p 1/3 1/6 1/2 k s k k s s a c b 0 0 p b . . . What can we measure on y? The set of all paths in y starting in p?! Process Algebra (2IF45)
Example 2 Property1: After finitely many c’s, a is observed y n p 1/3 1/6 1/2 p k s s a c b 0 b p k s k 1/3 1/6 1/2 0 k s s a c b 0 p b . . . What can we measure on y? The set of all paths in y starting in p?! Process Algebra (2IF45)
Example 2 Property1: After finitely many c’s, a is observed y n p 1/3 1/6 1/2 p k s s a c b 0 b p k s k 1/3 1/6 1/2 0 k s s a c b 0 p b . . . What can we measure on y? Nothing, unless we resolve the non-determinism! Process Algebra (2IF45)
Example 2 Property1: After finitely many c’s, a is observed y n p 1/3 1/6 1/2 p k s s a c b 0 b p k s k 1/3 1/6 1/2 0 k s s a c b 0 p b . . . What can we measure on y? Nothing, unless we resolve the non-determinism! HOW? By schedulers! Process Algebra (2IF45)
Schedulers • 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. 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 • Let us define a scheduler . Process Algebra (2IF45)
Example 2 (cont.) – scheduler y p n 1/3 1/6 1/2 k s n a c p 0 p 1/3 1/6 1/2 k s k k s n c 0 0 p b . . . Computation tree CTy(p, ) Process Algebra (2IF45)
Example 2 (cont.) – scheduler Property1: After finitely many c’s, a is observed y p n 1/3 1/6 1/2 k s n a c p 0 p 1/3 1/6 1/2 k s k k s n c 0 0 p b . . Prob(FPaths(y, trace = c*a)) = 12/35 How? Process Algebra (2IF45)
Example 2 (cont.) – scheduler 1 y p n 1/3 1/6 1/2 k s s a c p b 0 p 1/3 1/6 1/2 k s k k s s a c b 0 0 p . . . Computation tree CTy(p, 1) Process Algebra (2IF45)
Example 2 (cont.) – scheduler 1 Property1: After finitely many c’s, a is observed y p n 1/3 1/6 1/2 k s s a c p b 0 p 1/3 1/6 1/2 k s k k s s a c b 0 0 p . . . Prob1(FPaths(y, trace = c*a) )= 2/5 How? Can we do better? 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.1. Let us define a scheduler 1.2. Scheduler 1 is the maximal scheduler 1.3. Scheduler 2 is the minimal scheduler Process Algebra (2IF45)
SOS semantics of PTCP(A, ) 1/6 1/6 1/3 1/3 1/2 1/3 1/2 2/3 || = c c b d a b d a e d b a c 1 1 1 1 1 1 1 c a b c d b d a • Deduction rules for probabilistic transitions where a and c communicate in e, and no other communication is defined (in this examples) x x’, y y’ x | y x’ | y’ x x’ H(x) H(x’) x x’, y y’ x || y x’|| y’
SOS semantics of PTCP(A, ) • Deduction rules for action transitions a y y’ x || y x || y’ a x x’ x || y x’ || y a a a b x x’ y y’, (a,b) = c x || y x’ || y’ a b x x’ y y’, (a,b) = c x | y x’ || y’ c c a x x’ , aH H(x) H(x’) a
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) Process Algebra (2IF45)