1 / 27

Process Algebra (2IF45) Extending the Basic Process Algebra: Parallel composition

Process Algebra (2IF45) Extending the Basic Process Algebra: Parallel composition. Dr. Suzana Andova. Extended BPA(A). TCP(A,  ) Signature: constants 0,1 action prefix a._ non-deterministic choice _+_ sequential composition _  _

Download Presentation

Process Algebra (2IF45) Extending the Basic Process Algebra: Parallel composition

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Process Algebra (2IF45)Extending the Basic Process Algebra:Parallel composition Dr. Suzana Andova

  2. Extended BPA(A) TCP(A, ) Signature: constants 0,1 action prefix a._ non-deterministic choice _+_ sequential composition _  _ parallel composition _ || _ communication composition. _ | _

  3. Parallel composition and communication by intuition (recap) in_plate || = cut_cake water cut_cake water water water cut_cake in_plate in_plate coffee coffee coffee coffee cut_cake in_plate sit_sofa in_cup in_cup in_cup in_cup cut_cake in_plate watchTV sit_sofa on_sofa_together watchTV watchTV_together communication function (sit_sofa, sit_sofa) = on_sofa_together (watchTV, watchTV) = watchTV_together

  4. Term deduction system for parallel composition and communication • Deduction rules a a y  y’ x || y  x || y’ x  x’ x || y  x’ || y x y x | y 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 Process Algebra (2IF45)

  5. Parallel composition and communication by the SOS rules in_plate || = cut_cake sit_sofa water cut_cake water water water sit_sofa cut_cake in_plate in_plate coffee coffee coffee ... ... … coffee cut_cake sit_sofa in_plate sit_sofa in_cup in_cup in_cup in_cup cut_cake in_plate sit_sofa watchTV sit_sofa sit_sofa sit_sofa on_sofa_together ... watchTV watchTV_together communication function (sit_sofa, sit_sofa) = on_sofa_together (watchTV, watchTV) = watchTV_together

  6. Parallel composition and communication by the SOS rules in_plate || = cut_cake sit_sofa X water cut_cake water water water sit_sofa cut_cake in_plate X in_plate coffee coffee coffee ... ... … coffee cut_cake sit_sofa in_plate X sit_sofa in_cup in_cup in_cup in_cup cut_cake in_plate sit_sofa X watchTV sit_sofa sit_sofa sit_sofa on_sofa_together X X ... watchTV watchTV_together communication function (sit_sofa, sit_sofa) = on_sofa_together (watchTV, watchTV) = watchTV_together

  7. Encapsulation (action blocking) • TCP(A, ) • Signature: constants 0,1 • action prefix a._ • non-deterministic choice _+_ • sequential composition _  _ • parallel composition _ || _ • communication composition. _ | _ • encapsulation H(_), where H  A • Deduction rules a x  x’ H(x)  H(x’) a x H(x) 

  8. Encapsulation (action blocking) • TCP(A, ) • Signature: constants 0,1 • action prefix a._ • non-deterministic choice _+_ • sequential composition _  _ • parallel composition _ || _ • communication composition. _ | _ • encapsulation H(_), where H  A • Deduction rules a x  x’ , a  H H(x)  H(x’) a x H(x) 

  9. Parallel composition, communication and encalsulation in_plate || = cut_cake water cut_cake water water water cut_cake in_plate in_plate coffee coffee coffee coffee cut_cake in_plate sit_sofa in_cup in_cup in_cup in_cup cut_cake in_plate watchTV sit_sofa on_sofa_together communication function (sit_sofa, sit_sofa) = on_sofa_together (watchTV, watchTV) = watchTV_together watchTV watchTV_together Blocked actions: H = {sit_sofa, watchTV}

  10. Deduction system vs. Equational theory • TCP(A, ) • Signature: constants 0,1 • action prefix a._ • non-deterministic choice _+_ • sequential composition _  _ parallel composition _ || _ communication composition. _ | _ encapsulation H(_), where H  A Deduction rules term label term1 term2 ?  Equivalence relation Set of Axioms (basic equalities) term1 = term2 Derivation gives more (derived) equalities Axiom ├ term1= term4 consistency Process Algebra (2IF45)

  11. TCP(A) – Axiomatization TCP(A, ) Signature: constants 0,1 action prefix a._ non-deterministic choice _+_ sequential composition _  _ parallel composition _ || _ communication composition. _ | _ encapsulation H(_), where H  A if (a,b) = c a.0 | b.1 = ? a.1 | b.1 = ? if (a,d) is not defined a.0 | d.1 = ? 0 | a.1 = ? (b.0 + d.1) | a.0 = ? b.1 | a.0 = ? 1 | 1 = ? a.0 | 1 = ? a.x | b.y = c.(x || y) if (a,b) = c a.x | b.y = 0 if (a,b) not defined 0 | x = 0 (x + y) | z = x | z + y | z x | y = y | x (x | y) | z = x | (y | z) 1 | 1 = 1 a.x | 1 = 0

  12. TCP(A) – Axiomatization (cont.) TCP(A, ) Signature: constants 0,1 action prefix a._ non-deterministic choice _+_ sequential composition _  _ parallel composition _ || _ communication composition. _ | _ encapsulation H(_), where H  A leftmerge╙ x || y = x╙ y + y╙ x + x | y x || 1 = x (x || y) || z = x || (y || z) 0╙ x = 0 1╙ x = 0 a.x╙ y = a.(x || y) (x + y) ╙ z = x ╙ z + y ╙ z (x ╙ y) ╙ z = (x | y) ╙ z = x | (y ╙ z) • a.0|| (b.0 + c.1) = ? • a.b.0 || 1 = ? • 0╙ a.1 = ? • 1╙ a.1 = ? • a.b.0╙ c.0 = ? x ╙ (y || z) Process Algebra (2IF45)

  13. TCP(A) – Axiomatization (cont.) TCP(A, ) Signature: constants 0,1 action prefix a._ non-deterministic choice _+_ sequential composition _  _ parallel composition _ || _ communication composition. _ | _ encapsulation H(_), where H  A leftmerge╙ • H(a.b.c.0) = ? • H(a.0 + b.c.0) = ? • H(0) = ? • H(1) = ? H(0) = 0 H(1) = 1 H(a. x) = 0 if a H H(a. x) = a.H(x) if aH H(x + y) = H(x) + H(y) Process Algebra (2IF45)

  14. Example: Specifying a Buffer Assume a set of data elements D = {0,1} • One place buffer BufOne = r1(0).s2(0).BufOne + r1(1).s2(1).BufOne 1 BufOne 2 Process Algebra (2IF45)

  15. Example: Buffer Assume a set of data elements D = {0,1} II. Two place buffer BufTwo = r1(0).B0 + r1(1).B1 B0 = s2(0).BufTwo + r1(0).s2(0).B0 + r1(1).s2(0).B1 B1 = s2(1).BufTwo + r1(0).s2(1).B0 + r1(1).s2(1).B1 1 2 BufTwo Process Algebra (2IF45)

  16. Example: Buffer Assume a set of data elements D = {0,1} III. Implementing a Two place buffer with Two One place buffers 1 3 2 Process Algebra (2IF45)

  17. Example: Buffer Assume a set of data elements D = {0,1} III. Implementing a Two place buffer with Two One place buffers 1 3 2 OnePlaceBuf OnePlaceBuf communication at port 3 Process Algebra (2IF45)

  18. Example: Buffer Assume a set of data elements D = {0,1} III. Implementing a Two place buffer with Two One place buffers 1 3 2 BufOne13 = r1(0).s3(0).BufOne13 + r1(1).s3(1).BufOne13 BufOne32 = r3(0).s2(0).BufOne32 + r3(1).s2(1).BufOne32 communication: (r3(x), s3(x)) = c3(x), for x  D blocking: H = {r3(x), s3(x) | x D} BufTwoInOne = ∂H( BufOne13 || BufOne32 ) Process Algebra (2IF45)

  19. Example: Buffer Assume a set of data elements D = {0,1} III. Implementing a Two place buffer with Two One place buffers 1 3 2 BufOne13 = r1(0).s3(0).BufOne13 + r1(1).s3(1).BufOne13 BufOne32 = r3(0).s2(0).BufOne32 + r3(1).s2(1).BufOne32 communication: (r3(x), s3(x)) = c3(x), for x  D blocking: H = {r3(x), s3(x) | x D} BufTwoInOne = ∂H( BufOne13 || BufOne32 ) Process Algebra (2IF45)

  20. Example: Buffer Assume a set of data elements D = {0,1} III. Implementing a Two place buffer with Two One place buffers 1 3 2 BufOne13 = r1(0).s3(0).BufOne13 + r1(1).s3(1).BufOne13 BufOne32 = r3(0).s2(0).BufOne32 + r3(1).s2(1).BufOne32 communication: (r3(x), s3(x)) = c3(x), for x  D blocking: H = {r3(x), s3(x) | x D} BufTwoInOne = ∂H( BufOne13 || BufOne32 ) DONE?! Process Algebra (2IF45)

  21. Example: Buffer !Computation/Derivation! III. Implementing a Two place buffer with Two One place buffers BufOne13 = r1(0).s3(0).BufOne13 + r1(1).s3(1).BufOne13 BufOne32 = r3(0).s2(0).BufOne32 + r3(1).s2(1).BufOne32 • communication: (r3(x), s3(x)) = c3(x), for x  D • blocking: H = {r3(x), s3(x) | x  D} BufTwoInOne = ∂H( BufOne13 || BufOne32 ) = ∂H( BufOne13 ||_ BufOne32 + BufOne32 ||_ BufOne13+ BufOne13 | BufOne32 ) = ∂H(BufOne13 ||_ BufOne32) +∂H(BufOne32 ||_ BufOne13) + ∂H(BufOne13 | BufOne32 ) = r1(0).∂H(s3(0).BufOne13 || BufOne32) + r1(1).∂H(s3(1).BufOne13 || BufOne32) +0 +0= r1(0).∂H(s3(0).BufOne13 ||_ BufOne32 + BufOne32 ||_s3(0).BufOne13 + s3(0).BufOne13 | BufOne32) + r1(1).∂H(s3(1).BufOne13 ||_ BufOne32 + BufOne32 ||_s3(1).BufOne13 + s3(1).BufOne13 || BufOne32 ) = r1(0).c3(0).∂H(BufOne13 || s2(0).BufOne32 + 0) + r1(1).c3(1).∂H(BufOne13 || s2(1).BufOne32 + 0 ) =

  22. Example: Buffer !Computation/Derivation! (cont.) III. Implementing a Two place buffer with Two One place buffers BufOne13 = r1(0).s3(0).BufOne13 + r1(1).s3(1).BufOne13 BufOne32 = r3(0).s2(0).BufOne32 + r3(1).s2(1).BufOne32 • communication: (r3(x), s3(x)) = c3(x), for x  D • blocking: H = {r3(x), s3(x) | x  D} BufTwoInOne = ∂H( BufOne13 || BufOne32 ) = r1(0).c3(0).∂H(BufOne13 || s2(0).BufOne32 + 0) + r1(1).c3(1).∂H(BufOne13 || s2(1).BufOne32 + 0 ) = r1(0).c3(0).X0 + r1(1).c3(1).X1 X0 = ∂H(BufOne13 || s2(0).BufOne32) = ∂H(BufOne13 ||_ s2(0).BufOne32) + ∂H(s2(0).BufOne32 ||_ BufOne13) = ( r1(0).∂H(s3(0).BufOne13 || s2(0).BufOne32)+r1(1).∂H(s3(1).BufOne13|| s2(0).BufOne32) + s2(0). ∂H(BufOne32 || BufOne13) = ( r1(0).s2(0).∂H(s3(0).BufOne13 || BufOne32) + r1(1).s2(0).∂H(s3(1).BufOne13|| BufOne32) + s2(0). ∂H(BufOne32 || BufOne13)

  23. Example: Buffer !Computation/Derivation! (cont.) III. Implementing a Two place buffer with Two One place buffers BufOne13 = r1(0).s3(0).BufOne13 + r1(1).s3(1).BufOne13 BufOne32 = r3(0).s2(0).BufOne32 + r3(1).s2(1).BufOne32 • communication: (r3(x), s3(x)) = c3(x), for x  D • blocking: H = {r3(x), s3(x) | x  D} BufTwoInOne = ∂H( BufOne13 || BufOne32 ) = r1(0).c3(0).∂H(BufOne13 || s2(0).BufOne32 + 0) + r1(1).c3(1).∂H(BufOne13 || s2(1).BufOne32 + 0 ) = r1(0).c3(0).X0 + r1(1).c3(1).X1 X0 = ∂H(BufOne13 || s2(0).BufOne32) = ( r1(0).s2(0).c3(0).∂H(.BufOne13 || s2(0).BufOne32) + r1(1).s2(0). c3(1).∂H(.BufOne13|| s2(1).BufOne32) + s2(0). ∂H(BufOne32 || BufOne13) = r1(0).s2(0).c3(0).X0 + r1(1).s2(0). c3(1). X1 + s2(0). BufTwoInOne

  24. Example: BufTwoInOne Recursive Specification III. Implementing a Two place buffer with Two One place buffers BufOne13 = r1(0).s3(0).BufOne13 + r1(1).s3(1).BufOne13 BufOne32 = r3(0).s2(0).BufOne32 + r3(1).s2(1).BufOne32 • communication: (r3(x), s3(x)) = c3(x), for x  D • blocking: H = {r3(x), s3(x) | x  D} BufTwoInOne = r1(0).c3(0).X0 + r1(1).c3(1).X1 X0 = r1(0).s2(0).c3(0).X0 + r1(1).s2(0). c3(1). X1 + s2(0). BufTwoInOne X1 = r1(0).s2(1).c3(0).X0 + r1(1).s2(1). c3(1). X1 + s2(1). BufTwoInOne

  25. Example: BufTwoInOne Recursive Specification III. Implementing a Two place buffer with Two One place buffers BufOne13 = r1(0).s3(0).BufOne13 + r1(1).s3(1).BufOne13 BufOne32 = r3(0).s2(0).BufOne32 + r3(1).s2(1).BufOne32 • communication: (r3(x), s3(x)) = c3(x), for x  D • blocking: H = {r3(x), s3(x) | x  D} BufTwoInOne = r1(0).c3(0).X0 + r1(1).c3(1).X1 X0 = r1(0).s2(0).c3(0).X0 + r1(1).s2(0). c3(1). X1 + s2(0). BufTwoInOne X1 = r1(0).s2(1).c3(0).X0 + r1(1).s2(1). c3(1). X1 + s2(1). BufTwoInOne II. Back to our original specification: Two place buffer BufTwo = r1(0).B0 + r1(1).B1 B0 = s2(0).BufTwo + r1(0).s2(0).B0 + r1(1).s2(0).B1 B1 = s2(0).BufTwo + r1(0).s2(0).B0 + r1(1).s2(0).B1 ?

  26. Example: Specifying a Bag • Assume a set of data elements D = {0,1} • Bn,m is the process that specify the current content of B • n is the number of 0s • m is the number of 1s • B0,0 = r1(0). + r1(1). • B ……. 1 2

  27. Example: Specifying a Bag with a finite specification? • Assume a set of data elements D = {0,1} • Bn,m is the process that specify the current content of B • n is the number of 0s • m is the number of 1s • Bag = r1(0). + r1(1). • …….

More Related