process algebra (2if45) extending process algebra: parallel composition more examples
DESCRIPTION
Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples. Dr. Suzana Andova. TCP language. TCP(A, ) A is a pre-defied set of atomic actions is a pre-defined communication function Signature: (constructs of the language) constants 0,1 - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/1.jpg)
Process Algebra (2IF45)
Extending Process Algebra:Parallel composition More examples
Dr. Suzana Andova
![Page 2: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/2.jpg)
2
TCP language TCP(A, ) A is a pre-defied set of atomic actions is a pre-defined communication functionSignature: (constructs of the language)
constants 0,1 action prefix a._ non-deterministic choice _+_ sequential composition _ _
Process behaviour specification described by process equations, • recursive specifications• guarded recursive process variables and guarded process specifications• uniqueness of the process defined by a guarded Rspec• Additional mechanism for “equating” recursive specifications: RDP and RSP,
where “equating” = they define the same (up to bisimulation) process
parallel composition _ || _ communication composition. _ | _
encapsulation H(_), where H A
![Page 3: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/3.jpg)
3 Process Algebra (2IF45)
components’ specifications
System specification manipulation (recap)
the whole system specification
the state space
reductionon specification
reductionon specification
reductionon LTSs
composition by axiom
SOS rules
• simpler• smaller• in a particular form (basic)• …
![Page 4: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/4.jpg)
4
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). B1,0 + r1(1). B0,1B0, m+1 = r1(0). B1,m+1 + r1(1). B0,m+2 + s2(1). B0,mBn+1,0 = r1(0). Bn+2,0 + r1(1). Bn+1,1 + s2(0). Bm,0Bn+1, m+1 = r1(0). Bn+2,m+1 + r1(1). Bn+1,m+2 + s2(0). Bn,m+1 + s2(1).Bn+1, m 1 2
![Page 5: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/5.jpg)
5
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). B1,0 + r1(1). B0,1B0, m+1 = r1(0). B1,m+1 + r1(1). B0,m+2 + s2(1). B0,mBn+1,0 = r1(0). Bn+2,0 + r1(1). Bn+1,1 + s2(0). Bn,0Bn+1, m+1 = r1(0). Bn+2,m+1 + r1(1). Bn+1,m+2 + s2(0). Bn,m+1 + s2(1).Bn+1, m
This is an infinite recursive specification!Can we do better?
1 2
![Page 6: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/6.jpg)
6
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
Bag = r1(0). (Bag || s2(0)) + r1(1). (Bag || s2(1))
Do they define the same process, namely a bag process?TCP, RSP, RDP |- Bag = B0,0?
![Page 7: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/7.jpg)
7
Example: Specifying a Bag
Bag = r1(0). (Bag || s2(0)) + r1(1). (Bag || s2(1))
1. Define new equations Dn,m using Bag such that Bag is exactly D0,0
2. and prove that TCP, RSP, RDP |- D0,0 = B0,0!
B0,0 = r1(0). B1,0 + r1(1). B0,1B0, m+1 = r1(0). B1,m+1 + r1(1). B0,m+2 + s2(1). B0,mBn+1,0 = r1(0). Bn+2,0 + r1(1). Bn+1,1 + s2(0). Bn,0Bn+1, m+1 = r1(0). Bn+2,m+1 + r1(1). Bn+1,m+2 + s2(0). Bn,m+1 + s2(1).Bn+1, m
![Page 8: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/8.jpg)
8
Example: Specifying a Bag
Bag = r1(0). (Bag || s2(0)) + r1(1). (Bag || s2(1))
1. Define new equations Dn,m using BagDn,m = Bag || (s2(0).s2(0)…. s2(0).1 )
|| (s2(1).s2(1).… s2(1).1 )
such that Bag is exactly D0,0 2. and prove that TCP, RSP, RDP |- D0,0 = B0,0?
B0,0 = r1(0). B1,0 + r1(1). B0,1B0, m+1 = r1(0). B1,m+1 + r1(1). B0,m+2 + s2(1). B0,mBn+1,0 = r1(0). Bn+2,0 + r1(1). Bn+1,1 + s2(0). Bn,0Bn+1, m+1 = r1(0). Bn+2,m+1 + r1(1). Bn+1,m+2 + s2(0). Bn,m+1 + s2(1).Bn+1, m
n (n0)
m (m0)
![Page 9: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/9.jpg)
9
Example: Specifying a Bag
Bag = r1(0). (Bag || s2(0)) + r1(1). (Bag || s2(1))
Dn,m = Bag || s2(0) n1 || s2(1) m1 for n,m 0
Our goal is to show that Dn,m = Bn,m, for any n and any m Namelly to show that I. D0,0 = B0,0 II. D0,m+1 = B, 0, m+1 (only this case on the next slides)III. Dn+1, 0 = Bn+1,0IV. Dn+1,m+1 = Bn+1,m+1
Observe thatD0,0 = Bag
?
![Page 10: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/10.jpg)
10
Example: Specifying a Bag
Bag = r1(0). (Bag || s2(0)) + r1(1). (Bag || s2(1))
Dn,m = Bag || s2(0) n1 || s2(1) m1 for n,m 0
II. D0,m+1 = Bag || (s2(1) m+11) = Bag ||_ s2(1) m+11 + s2(1) m+11 ||_ Bag = (r1(0). (Bag || s2(0) ) + r1(1). (Bag || s2(1))) ||_ (s2(1) m+11)
+ (s2(1) m+11) ||_ Bag = (r1(0). (Bag || s2(0))) ||_ (s2(1) m+11) + (r1(1). (Bag || s2(1))) ||_ (s2(1) m+11) + (s2(1) m+11) ||_ Bag =
no communication
Observe thatD0,0 = Bag
![Page 11: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/11.jpg)
11
Example: Specifying a Bag
Bag = r1(0). (Bag || s2(0)) + r1(1). (Bag || s2(1))
Dn,m = Bag || s2(0) n1 || s2(1) m1 for n,m 0
II. D0,m+1 = Bag || s2(1) m+11 = Bag ||_ s2(1) m+11 + s2(1) m+11 ||_ Bag = (r1(0). (Bag || s2(0) ) + r1(1). (Bag || s2(1))) ||_ (s2(1) m+11)
+ (s2(1) m+11) ||_ Bag = (r1(0). (Bag || s2(0))) ||_ s2(1) m+11 + (r1(1). (Bag || s2(1))) ||_ s2(1) m+11 + s2(1) m+11 ||_ Bag = r1(0). ((Bag || s2(0)) || s2(1) m+11) + r1(1). ((Bag || s2(1)) || s2(1) m+11) + s2(1). (s2(1)m1|| Bag)
Observe thatD0,0 = Bag
s2(1) m+11 ||_ Bag =
s2(1).s2(1) m1 ||_ Bag =
s2(1). (s2(1) m1|| Bag)
![Page 12: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/12.jpg)
12
Example: Specifying a Bag
Bag = r1(0). (Bag || s2(0)) + r1(1). (Bag || s2(1))
Dn,m = Bag || s2(0) n1 || s2(1) m+11 for n,m 0
II. D0,m+1 = Bag || s2(1) m+11 = Bag ||_ s2(1) m+11 + s2(1) m+11 ||_ Bag = (r1(0). (Bag || s2(0) ) + r1(1). (Bag || s2(1))) ||_ (s2(1) m+11)
+ (s2(1) m+11) ||_ Bag = (r1(0). (Bag || s2(0))) ||_ s2(1) m+11 + (r1(1). (Bag || s2(1))) ||_ s2(1) m+11 + s2(1) m+11 ||_ Bag = r1(0). ((Bag || s2(0)) || s2(1) m+11) + r1(1). ((Bag || s2(1)) || s2(1) m+11) + s2(1). (s2(1)m1|| Bag)= r1(0). (D1,m+1) + r1(1). (D0,m+2) + s2(1). (D0,m)
Observe thatD0,0 = Bag
s2(1).1 || s2(1) m+11 =s2(1) m+11
![Page 13: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/13.jpg)
13
Example: Specifying a Bag - Conclusion
Bag = r1(0). (Bag || s2(0)) + r1(1). (Bag || s2(1))
Dn,m = Bag || s2(0) n1 || s2(1) m+11
From RDP and RSP it follows that I. D0,0 = B0,0II. D0,m+1 = B0,m+1III. Dn+1,0= Bn+1,0IV. Dn+1,m+1 = Bn+1,m+1
Final conclusion: B0,0 = Bag
Observe thatD0,0 = Bag
![Page 14: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/14.jpg)
14
Example: Buffer - Revision
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
Process Algebra (2IF45)
1 2BufTwo
![Page 15: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/15.jpg)
15
Example: Buffer
Assume a set of data elements D = {0,1}III. Implementing a Two place buffer with Two One place buffers
Process Algebra (2IF45)
21 3
BufOne13 = r1(0).s3(0).BufOne13 + r1(1).s3(1).BufOne13BufOne32 = r3(0).s2(0).BufOne32 + r3(1).s2(1).BufOne32communication: (r3(x), s3(x)) = c3(x), for x D blocking: H = {r3(x), s3(x) | x D}
BufTwoInOne = ∂H( BufOne13 || BufOne32 )
![Page 16: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/16.jpg)
16
Example: BufTwoInOne Recursive Specification
III. Implementing a Two place buffer with Two One place buffersBufOne13 = r1(0).s3(0).BufOne13 + r1(1).s3(1).BufOne13BufOne32 = 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
NOT YET!
![Page 17: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/17.jpg)
Process Algebra (2IF45)
Extending Process Algebra:Abstraction
Dr. Suzana Andova
![Page 18: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/18.jpg)
18 Process Algebra (2IF45)
components’ specifications
System specification manipulation (recap)
the whole system specification
the state space
reductionon specification
reductionon specification
reductionon LTSs
composition by axiom
SOS rules
• simpler• smaller• in a particular form (basic)• …
![Page 19: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/19.jpg)
19
TCP language extended with hiding feature TCP(A, ) A is a pre-defied set of atomic actions internal (silent) action , A is a pre-defined communication functionSignature: (constructs of the language)
constants 0,1 action prefix a._ non-deterministic choice _+_ sequential composition _ _
hiding operator I for I A Process behaviour specification described by process equations,
• guarded recursive process variables and guarded process specifications• equivalence relation that treats differently
parallel composition _ || _ communication composition. _ | _
encapsulation H(_), where H A
![Page 20: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/20.jpg)
20 Process Algebra (2IF45)
Towards equivalence relation(s)
in1euro
!coffee !coffee
in50c
in50c
!coffee !coffee
hiding reducing
!tea !coffee
40c 50c
!tea !coffee
hiding reducing
?
?
Think about different ways to reduce these processes?
Which reduced process preserves “the same moment of choice” as in the original process with s?
![Page 21: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/21.jpg)
21 Process Algebra (2IF45)
reducing insert
40c
hiding ? coffee
insert
coffee
reducing insert
card
hiding ?
coffee
coin
insert
coffee
Towards equivalence relation(s)
![Page 22: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/22.jpg)
22
Towards our equivalence relation -Conclusions
• Some internal steps cannot be removed. • Some internal steps can be removed. They are called inert!• Inert internal steps occur in following situations:
a
P Q
P+
+
…
a
P Q+
…
reduces to
![Page 23: Process Algebra (2IF45) Extending Process Algebra: Parallel composition More examples](https://reader034.vdocuments.site/reader034/viewer/2022052512/56814bf2550346895db8de08/html5/thumbnails/23.jpg)
23
Towards our equivalence relation -Conclusions
• Some internal steps cannot be removed. • Some internal steps can be removed. They are called inert!• Inert internal steps occur in following situations:• Relation to be established is:
a
P Q
P+
+
…
a
P Q+
…
reduces to