Process AlgebraBook: Chapter 8
The Main Issue Q: When are two models equivalent? A: When they satisfy different   properties. Q: Does this mean that the ...
What is process algebra?   An abstract description for nondeterministic    and concurrent systems.   Focuses on the tran...
Different models may have   the same set of executions!                        e   d      a        a      e    d        a ...
Actions: Act={a,b,c,d}{}.  Agents: E, E’, F, F1, F2, G1, G2, …                 E                      F                 ...
Events.            E                     F        a                                        a        a                 ...
Actions and co-actions        E                            F       a                     a        a            E’     ...
Notation          E           a.(b+c)          a           (actually, a.((b.0)+(c.0))              F       E—aF      b   ...
Conventions   “.” has higher priority than “+”.   “.0” or “.(0||0||…||0)” is omitted.
CCS - calculus of concurrent systems[Milner]. Syntax   a,b,c, … actions, A, B, C - agents.   a,b,c, coactions of a,b,c. ...
Semantics (proof rule and axioms).Structural Operational Semantics SOS   a.p –a p   p—ap’ |-- p+q –a p’   q—aq’ |--...
Action Prefixinga.E—aE (Axiom)Thus, a.(b.(c||c)+d)—a(b.(c||c)+d).
Choice   E—aE’                    F—aF’  (E+F)—aE’               (E+F)—aF’ b.(c||c)—b(c||c).Thus,  (b.(c||c)+e)—b(c|...
Concurrent Composition E—aE’           F—aF’E||F—aE’||F   E||F—aE||F’E—aE’, F—aF’ ———————— E||F—E’||F’c—c0, c—c0...
Restriction   E—aE’, a, a R   —————————     ER –aE’RIn this case: allows only internal  interaction of c.c||c—0||0 c|...
Relabeling     E—aE’     ————  E[m] –m(a)E’[m]No axioms/rules for agent 0.
Examples        a    a.E||b.F     b    E||b.F              a.E||F         b                a               E||F
Derivations              a.(b.(c||c)+d)                                     a                     b      b.(c||c)+d       ...
Modeling binary variable                        set_1set_0                                       set_1is_0?              C...
Equational Definition           E                     F          a              a        a               E’           ...
Trace equivalence:Systems have same finite sequences.         E                         F     a                     a     ...
Failures: comparing also what we   cannot do after a finite sequence.             E                     F                 ...
Simulation equivalence                E                    F            a       a                    a        b           ...
Simulation equivalence                   E                       F               a       a                       a        ...
Here, simulation works only in    one direction. No equivalence!                       want to establish                  ...
Simulation equivalent  but not failure equivalent            E                   F        a       a                       ...
Bisimulation: same relation  simulates in both directions             E                        F         a       a        ...
Hierarchy of equivalences               Bisimulation  Simulation                  Failure                 Trace
Example:      a   s1     b    s2 s0               c          d           s3                     b                         ...
Bisimulation between G1 and G2      Let N= N1 U N2      A relation R : N1 x N2 is a bisumulation if       If (m,n) in R ...
Algorithm for bisimulation:    Partition N into blocks B1B2…Bn=N.    Initially: one block, containing all of N.    R...
Correctness of algorithm    Invariant: if (m,n) in R then m and n remain     in the same block throughout the algorithm. ...
Example:     a     s1     b     s2s0                 c           d           s3                        b                  ...
Example:     a     s1      b     s2s0                  c           d             s3                        b              ...
Example:       a     s1      b     s2  s0                  c             d             s3                      b          ...
Example:     a   s1    b     s2s0              c         d          s3                      b                             ...
Example:       a    s1    b     s2  s0               c            d          s3                      b                    ...
Example:       a    s1    b    s2  s0               c            d          s3                     b                      ...
Example:       a    s1     b     s2  s0                c            d           s3                      b                 ...
Example:          a    s1     b    s2     s0                c               d           s3                      b         ...
Upcoming SlideShare
Loading in …5
×

Process Algebra

548 views

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
548
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Process Algebra

  1. 1. Process AlgebraBook: Chapter 8
  2. 2. The Main Issue Q: When are two models equivalent? A: When they satisfy different properties. Q: Does this mean that the models have different executions?
  3. 3. What is process algebra? An abstract description for nondeterministic and concurrent systems. Focuses on the transitions observed rather than on the states reached. Main correctness criterion: conformance between two models. Uses: system refinement, model checking, testing.
  4. 4. Different models may have the same set of executions! e d a a e d a b c b ca-insert coin, b-press pepsi, c-press pepsi-light d-obtain pepsi, e-obtain pepsi-light
  5. 5. Actions: Act={a,b,c,d}{}. Agents: E, E’, F, F1, F2, G1, G2, … E F e d a a e d a E’ F1 F2 b c b c G1 G2Agent E may evolve into agent E’.Agent F may evolve into F1 or F2.
  6. 6. Events. E F a   a a  E’ F1 F2 b c b c G1 G2E—aE’, F—aF1, F—aF2, F1—aG1,F2—aG2. G1—F, G1—F.
  7. 7. Actions and co-actions E F a   a a  E’ F1 F2 b c b c G1 G2For each action a, except for , there is a co-action a. a and a interact (a input, a output).The coaction of a is a.
  8. 8. Notation E a.(b+c) a (actually, a.((b.0)+(c.0)) F E—aF b c F—bG G H F—cH 0 – deadlock/termination.a.E – execute a, then continue according to E.E+F – execute according to E or to F.E||F – execute E and F in parallel.
  9. 9. Conventions “.” has higher priority than “+”. “.0” or “.(0||0||…||0)” is omitted.
  10. 10. CCS - calculus of concurrent systems[Milner]. Syntax a,b,c, … actions, A, B, C - agents. a,b,c, coactions of a,b,c. -silent action. nil - terminate. a.E - execute a, then behave like E. + - nondeterministic choice. || - parallel composition. L - restriction: cannot use letters of L. [f] - apply mapping function f between between letters.
  11. 11. Semantics (proof rule and axioms).Structural Operational Semantics SOS a.p –a p p—ap’ |-- p+q –a p’ q—aq’ |-- p+q –a q’ p—ap’ |-- p|q –a p’|q q—aq’ |-- p|q –a p|q’ p—ap’, q—aq’ |-- p|q – p’|q’ p—ap’ , a  R |-- pL –a p’R p—ap’ |-- p[m]—m(a)p’[m]
  12. 12. Action Prefixinga.E—aE (Axiom)Thus, a.(b.(c||c)+d)—a(b.(c||c)+d).
  13. 13. Choice E—aE’ F—aF’ (E+F)—aE’ (E+F)—aF’ b.(c||c)—b(c||c).Thus, (b.(c||c)+e)—b(c||c).If E—aE’ and F—aF’, then E+F has a nondeterministic choice.
  14. 14. Concurrent Composition E—aE’ F—aF’E||F—aE’||F E||F—aE||F’E—aE’, F—aF’ ———————— E||F—E’||F’c—c0, c—c0, c||c—0||0,c||c—c0||c, c||c—cc||0.
  15. 15. Restriction E—aE’, a, a R ————————— ER –aE’RIn this case: allows only internal interaction of c.c||c—0||0 c||c—c0||cc||c—cc||0(c||c) {c}—(0||0) {c}
  16. 16. Relabeling E—aE’ ———— E[m] –m(a)E’[m]No axioms/rules for agent 0.
  17. 17. Examples a a.E||b.F b E||b.F a.E||F b a E||F
  18. 18. Derivations a.(b.(c||c)+d) a b b.(c||c)+d d (c||c) c 0 c  (0||c) (c||0) c c (0||0)
  19. 19. Modeling binary variable set_1set_0 set_1is_0? C0 C1 is_1? set_0 C0=is_0? . C0 + set_1 . C1 + set_0 . C0 C1=is_1? . C1 + set_0 . C0 + set_1 . C1
  20. 20. Equational Definition E F  a   a a  E’ F1 F2 b c b c G1 G2E=a.(b..E+c..E) E—aE’, A=EF=a.b..F+a.c..F A—aE’
  21. 21. Trace equivalence:Systems have same finite sequences. E F a a a b c c b b E=a.(b+c) F=(a.b)+a.(b+c) Same traces
  22. 22. Failures: comparing also what we cannot do after a finite sequence. E F a a a b c c b bFailure of agent E: (σ, X), where after executingσ from E, none of the events in X is enabled.Agent F has failure (a, {c}), which is not a failureof E.
  23. 23. Simulation equivalence E F a a a b b b b c d c d Relation over set of agents S. RSS. ERF If E’ R F’ and E’—aE’’, then there exists F’’, F’—aF’’, and E’’ R F’’.
  24. 24. Simulation equivalence E F a a a b b b b c d c d Relation over set of agents S. RSS. ERF If E’ R F’ and E’—aE’’, then there exists F’’, F’—aF’’, and E’’ R F’’.
  25. 25. Here, simulation works only in one direction. No equivalence! want to establish E F a a a symmetrically b b b b necessarily c d c d problem!!! Relation over set of agents S. RSS. ERF If E’ R F’ and E’—aE’’, then there exists F’’, F’—aF’’, and E’’ R F’’.
  26. 26. Simulation equivalent but not failure equivalent E F a a a b bLeft agent a.b+a has a failure (a,{b}).
  27. 27. Bisimulation: same relation simulates in both directions E F a a a b bNot in this case: different simulation relations.
  28. 28. Hierarchy of equivalences Bisimulation Simulation Failure Trace
  29. 29. Example: a s1 b s2 s0 c d s3 b a t1 t2 t0 a t4 cA=a.((b.nil)+(c.d.A)) d t3B=(a.(b.nil))+(a.c.d.B)
  30. 30. Bisimulation between G1 and G2  Let N= N1 U N2  A relation R : N1 x N2 is a bisumulation if If (m,n) in R then 1. If m—am’ then n’:n—an’ and (m’,n’) in R 2. If n—an’ then m’:m—am’ and (m’,n’) in R.  Other simulation relations are possible, I.e., m=a=> m’ when m—…—a—m’.
  31. 31. Algorithm for bisimulation:  Partition N into blocks B1B2…Bn=N.  Initially: one block, containing all of N.  Repeat until no change: Choose a block Bi and a letter a. If some of the transitions of Bi move to some block Bj and some not, partition Bi accordingly.  At the end: Structures bisimilar if initial states of two structures are in same blocks.
  32. 32. Correctness of algorithm  Invariant: if (m,n) in R then m and n remain in the same block throughout the algorithm.  Termination: can split only a finite number of times.
  33. 33. Example: a s1 b s2s0 c d s3 b a t1 t2 t0 a t4 c d t3{s0,s1,s2,s3,t0,t1,t2,t3,t4}
  34. 34. Example: a s1 b s2s0 c d s3 b a t1 t2 t0 a t4 c d t3{s0,s1,s2,s3,t0,t1,t2,t3,t4} split on a.{s0,t0},{s1,s2,s3,t1,t2,t3,t4}
  35. 35. Example: a s1 b s2 s0 c d s3 b a t1 t2 t0 a t4 c d t3{s0,t0},{s1,s2,s3,t1,t2,t3,t4} split on b{s0,t0},{s1,t1},{s0,s2,s3,t2,t3,t4}
  36. 36. Example: a s1 b s2s0 c d s3 b a t1 t2 t0 a t4 c d t3{s0,t0},{s1,t1},{s2,s3,t2,t3,t4} split on c{s0,t0},{s1},{t1},{s2,s3,t2,t3,t4}
  37. 37. Example: a s1 b s2 s0 c d s3 b a t1 t2 t0 a t4 c d t3{s0,t0},{s1},{t1},{s2,s3,t2,t3,t4} split on c {s0,t0},{s1},{t1},{t4},{s2,s3,t2,t3}
  38. 38. Example: a s1 b s2 s0 c d s3 b a t1 t2 t0 a t4 c d t3{s0,t0},{s1},{t1},{t4},{s2,s3,t2,t3} split on d {s0,t0},{s1},{t1},{t4},{s3, t3},{s2,t2}
  39. 39. Example: a s1 b s2 s0 c d s3 b a t1 t2 t0 a t4 c d t3{s0,t0},{s1},{t1},{t4},{s2,t2},{s3,t3} split on a {s0},{t0},{s1},{t1},{t4},{s3, t3},{s2,t2}
  40. 40. Example: a s1 b s2 s0 c d s3 b a t1 t2 t0 a t4 c d t3{s0},{t0},{s1},{t1},{t4},{s2,s3,t2,t3} split on d {s0},{t0},{s1},{t1},{t4},{s3},{t3},{s2,t2}

×