Post on 28-Jan-2016
description
Process Algebra (2IF45)
Extending the Basic Process Algebra
Dr. Suzana Andova
2 Process Algebra (2IF45)
Guarded recursive specification
What do we still miss?
Consider three specifications:E = {X = a.Y, Y = a.X} and F = {Z = a.a.Z} G = {Un = a.Un+1, n 0}
X
a
Y
a
Z
a
a.Z
a
U0 U1 U2
a a a…
Can we derive
BPA(A), E, F, G ├ X = Z or BPA(A), E, F, G ├ X = U0 or
BPA(A), E, F, G ├ Z = U0
3 Process Algebra (2IF45)
Deriving equalities of recursive variables
Consider three specifications:E = {X = a.Y, Y = a.X} and F = {Z = a.a.Z} G = {Un = a.Un+1, n 0}
1. BPA(A), E, F, G ├ X = a.a.X which is exactly the form of Z 2. BPA(A), E, F, G ├ X = U0 cannot be derived directly. We introduce new variables X0, X1, … which are defined using X, as:
X0 = X, X1= a.X, X2 = a.a.X, …, Xn = an X, ….,
Now, we want to show that Xn can be rewritten in the form of Un for any n 0!BPA(A), E, F, G ├ X0 = X = a.a.X = a.X1
BPA(A), E, F, G ├ X1 = a.X = a.a.a.X = a.X2
and in general BPA(A), E, F, G ├ Xn = an X = an a.a.X = a.Xn+1
We conclude that Xn is in the same form as Un for any n 0
4
Recursive principles for Deriving equalities of recursive variables
1. Every guarded recursive specification has a solution, this is called Restricted Recursive Definition Principle (RDP-)
2. Every guarded recursive specification has a unique solution, this is called Recursive Specification Principle (RSP)
1. BPA(A), E, F, G ├ X = a.a.X which is exactly the form of Z. Directly from the RSP and RDP- we can conclude
BPA(A), E, F, G, RDP-, RSP ├ X = Z 2. BPA(A), E, F, G ├ X = U0 cannot be derived directly. We introduce new
variables X0, X1, … which are defined using X, as:X0 = X, X1= a.X, X2 = a.a.X, …, Xn = an X, ….,
Now, we want to show that Xn can be rewritten in the form of Un for any n 0!BPA(A), E, F, G ├ X0 = X = a.a.X = a.X1
BPA(A), E, F, G ├ X1 = a.X = a.a.a.X = a.X2
and in general BPA(A), E, F, G ├ Xn = an X = an a.a.X = a.Xn+1
We conclude that Xn is in the same form as Un for any n 0. Directly from the RSP and RDP- we can conclude
BPA(A), E, F, G, RDP-, RSP ├ X0 = U0
and also BPA(A), E, F, G, RDP-, RSP ├ X = X0 = U0
5
Specifying a Stack
Consider a finite set of data elements D = {d1, d2, …, dn} for some n natural number. Define a recursive specification that describes a stack with unlimited capacity. Elements from D can be added or removed from the stack from the top of the stack.
Steps: 1. First, define the set of atomic actions.
2. As a short hand notation you can use universal sum dD
3. Reason how many recursive variables you may need. 4. Specify the behaviour of the stack process.
6
Specifying a Stack
Consider a finite set of data elements D = {d1, d2, …, dn} for some n natural number. Define a recursive specification that describes a stack with unlimited capacity. Elements from D can be added or removed from the stack from the top of the stack.
Steps: 1. First, define the set of atomic actions.
2. As a short hand notation you can use universal sum dD
3. Reason how many recursive variables you may need. 4. Specify the behaviour of the stack process.
Stack1 = S
S = dD push(d).Sd, for any d D
Sd = eD push(e).Sed + dD pop(d).S, for any d D and D*
7
Specifying a Stack again
Consider a finite set of data elements D = {d1, d2, …, dn} for some n natural number. Define a recursive specification that describes a stack with unlimited capacity. Elements from D can be added or removed from the stack from the top of the stack.
Steps: 1. First, define the set of atomic actions. 2. The equational theory is extended with operator (general sequential
composition) 3. Can we do it with finitely many equations now?
Stack2 = T
T = dD push(d). ( ( ….) . pop(d).1)
8
Specifying a Stack again
Consider a finite set of data elements D = {d1, d2, …, dn} for some n natural number. Define a recursive specification that describes a stack with unlimited capacity. Elements from D can be added or removed from the stack from the top of the stack.
Steps: 1. First, define the set of atomic actions. 2. The equational theory is extended with operator3. Can we do it with finitely many equations now?
Stack2 = T
T = dD push(d). ( ( U ) . pop(d).1)U = 1 + T U
Stack
U pop(d)
pop(d)
push(d)
(U pop(e)) (U pop(d))
pop(e)
push(e)
9 Process Algebra (2IF45)
Extending BPA(A) with sequential composition
Question: Can you find a set of axioms for the new operator?
(A1) x+ y = y+x
(A2) (x+y) + z = x+ (y + z)
(A3) x + x = x
(A4) x+ 0 = x
BPA(A)
Signature: constants 0,1
action prefix a._ (unary operator)
non-deterministic choice _+_ (bin. op.)
sequential composition __ (bin.op.)
10 Process Algebra (2IF45)
Extending BPA(A) with sequential composition
BPA(A)
Signature: constants 0,1
action prefix a._ (unary operator)
non-deterministic choice _+_ (bin. op.)
sequential composition __ (bin.op.)
(A1) x+ y = y+x
(A2) (x+y) + z = x+ (y + z)
(A3) x + x = x
(A4) x+ 0 = x
(A5) (x+ y) z = x z+y z
(A6) (x y) z = x (y z)
(A7) 0 x = 0
(A8) x 1 = x
(A9) 1 x = x
(A10) a.x y = a.(x y)
11 Process Algebra (2IF45)
Term deduction system for BPA(A) with sequential composition
• Set of action names (actions): A
• Signature: constants 0,1 (note 0,1 A)
action prefix a._ (unary operator)
non-deterministic choice _+_ (binary operator)
sequential composition __ (binary operator)• Behaviour expressed by action transitions _ _ for a in A and
termination _ • Behavioural equivalence is bisimilarity
a
• Deduction rules
1
x x’
x + y x’ a.x x
a
a
x (x + y)
a y y’
x + y y’
a
a
y (x + y) ⑥
12 Process Algebra (2IF45)
Term deduction system for BPA(A) with sequential composition
• Deduction rules
1
x x’
x + y x’ a.x x
a
a
x (x + y)
a y y’
x + y y’
a
a
y (x + y) ⑥
• Set of action names (actions): A
• Signature: constants 0,1 (note 0,1 A)
action prefix a._ (unary operator)
non-deterministic choice _+_ (binary operator)
sequential composition __ (binary operator)• Behaviour expressed by action transitions _ _ for a in A and
termination _ • Behavioural equivalence is bisimilarity
a
• Deduction rules for sequential com.
x x’
x y x’
a
a
x y (x y)
x y y’
x y y’
a
a
13 Process Algebra (2IF45)
Extending BPA(A) further
BPA(A)
Signature: constants 0,1
action prefix a._
non-deterministic choice _+_
sequential composition _ _
cut_cakewater
coffee
in_cup
in_plate
||
What are possible scenarios?
14 Process Algebra (2IF45)
Extending BPA(A) further and further
cut_cakewater
coffee
in_cup
in_plate
||
What are possible scenarios now?
sit_sofa
watchTV
sit_sofa
watchTV
15 Process Algebra (2IF45)
Term deduction system for BPA(A) extended to TCP(A)
• Set of action names (actions): A
• Signature: constants 0,1 (note 0,1 A)
action prefix a._
non-deterministic choice _+_
sequential composition _ _ • Behaviour expressed by action transitions _ _ for a in A and
termination _ • Behavioural equivalence is bisimilarity
• Deduction rules
1
x x’
x + y x’ a.x x
a
a
x (x + y)
a y y’
x + y y’
a
a
y (x + y) ⑥
• Deduction rules for sequential com.
x x’
x y x’
a
a
x y (x y)
x y y’
x y y’
a
a
16 Process Algebra (2IF45)
Term deduction system for BPA(A) extended to TCP(A)
• Set of action names (actions): A
• Signature: constants 0,1 (note 0,1 A)
action prefix a._
nondeterminism _+_
sequential compos. __• Behaviour expressed by action transitions _ _ for a in A and
termination _ • Behavioural equivalence is bisimilarity
• Deduction rules
x x’
x || y x’ || y
a
a
x yx || y
y y’
x || y x || y’
a
a
x yx | y
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
communication function (_,_)
parallel composition _ || _
communication composition. _ | _
17 Process Algebra (2IF45)
Extending BPA(A) to TCP(A)BPA(A)
Signature: constants 0,1
action prefix a._
non-determ. _+_
sequential comp. __
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)
communication function (_,_)
parallel composition_ || _
communication compos. _ | _
left merge operator _ ╙ _
unary operator ∂H
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
1 | 1 = 1
a.x | 1 = 0
x | y = y | x
(x | y) | z = x | (y | z)
1 | x + 1 = 1
(x | y) ╙ z = x | (y ╙ z)
18
Example
Process Algebra (2IF45)
B
A
C
21
4
3
Specify the communication process:
19
Example
Process Algebra (2IF45)
1. Draw the transition system generated by the operational rules for the process X || Y given by the recursive specification X = a.XY = b.Y
There is no communication, so = .
2. Draw the transition system generated by the operational rules for the process X || Y given by the recursive specification X = a.Y + b.Y; Y = a.X + b.X.
There is no communication, so = . 3. Also draw the transition system generated by the operational rules for the
process Z = (a.1 || b.1) Z4. Are the transition systems found in the previous two items (2 and 3) bisimilar? If
yes, show a bisimulation. If no, argue why not.