Lecture10web

advertisement
Process Algebra (2IF45)
Abstraction in Process Algebra
Suzana Andova
Outline of the lecture
• Our way of dealing with internal behaviour: branching
bisimulation
• How we capture Abstraction in Process Algebra
• combining it with other concepts
1
Process Algebra (2IF45)
Abstraction
Abstraction is used to
• check the correctness of implementation against the system
specification
• reduce and simplify the model to enable better, fasted and cleaner
model analysis
Question: How do we chose to relate behaviours with internal steps?
Branching bisimulation
2
Process Algebra (2IF45)
Branching bisimulation – simple examples first

a
b
is branching bisim to
b
a
a
“ related states must have the same potential
which does not change until an observable action is executed ”
3
Process Algebra (2IF45)
Branching bisimulation – simple examples first

is branching bisim to


b
a

b
a
it is not branching bisim to
4

Process Algebra (2IF45)
b
a
Branching bisimilar processes
s
t

t’


a
s’
s
t
t’’
s
tt

s’
s’
a
t’’
Branching Bisimulation relation: A binary relation R on the set of state S of an LTS is branching
bisimulation relation iff the following transfer conditions hold:
a
1. for all states s, t, s’  S, whenever (s, t)  R and s →
s’ for some a  A, then there are
a
 t’ and t’ → t’’ and (s, t’), (s’,t’’)  R;
states t’, t’’  S such that t
a
2. vice versa, for all states s, t, s’  S, whenever (s, t)  R and t → t’ for some a  A, then there
a
 s’ and s’ →
are states s’,s’’  S such that s 
s’’ and (s’, t), (s’’,t’)  R;
 t’ , t’ and (s, t’)  R
3. if (s, t)  R and s  then there is a state t’ such that t 
4. whenever (s, t)  R and t  then there is a state s’ such that s 
 s’ , s’ and (s’, t)  R
Two LTSs s and t are branching bisimilar, s b t, iff there is a branching bisimulation relation R
such that (s, t)  R
5
less
6
power of the observer
most powerful
7
Weak bisimulation just a short comparison
a

d1

b
d2
d3
c
d4
b
a

d1

b
d2
d3
c
d4
b
a
d1
8

d2
b
d3

c
d4
Process Algebra (2IF45)
Branching bisimulation and composition
9
Branching bisimulation and composition
branching bisimilar!
b

a
a
+

a
10
+
b
a
b
branching bisimilar? NO!
Branching bisimulation and composition
branching bisimilar!
b

a
a
+

+
b
a
b
branching bisimilar? NO!
a
Painful conclusion: branching bisimilation is not compositional.
11
Branching bisimulation and composition
branching bisimilar
components!
Not branching bisimilar
compositions!
+

a
a

+
b
a
b
a
What to do? Two choices:
1. Make the relation weaker and relate the two compositions too!
2. Make the relation stronger and do not relate the two components
from the beginning!
12
Rooted Branching Bisimilar processes
Rooted branching bisimulation is strengthened variant of
branching bisimulation strict enough to obtain compositionality
s
t
a
a
t’

s’
b
r
a
t’
p
a
q
s
t
s’
a


b
q
s
t
a
t’t
s’

p
p
(aA i.e. can be from A or can be  )
R is Rooted BB between state (s, t)  R if R is Branching Bisimulation relation (as already
defined) and the root condition:
a s’ for a  A, then there is a state t’ S such that ta→ t’ and (s’, t’) R;
1. if s →
2. if t a→ t’ for a  A, then there is a state s’ S such that sa → s’ and (s’, t’) R;
3. s  if and only if t
LTSs s and t are rooted branching bisimilar, s rb t, iff there is a rooted branching bisimulation
relation R such that (s, t)  R
13
Axiomatizing
Rooted Branching Bisimulations
Language: BPA(A)
Signature: 0, 1, (a._ )aA, , +, •
Language terms T(BPA(A,))
Closed terms C(BPA(A))
Deduction rules for BPA(A) (a A):
a
x  x’
a
a.x  x 
a x’ 
x+y
1 
x
(x + y) 
a

a
y  y’
a y’
x+y
y
(x + y) 
x+ y = y+x
(x+y) + z = x+ (y + z)
x+x=x
x+ 0 = x
(x+ y)  z = x  z+y  z
(x  y)  z = x  (y  z)
0x=0
x1=x
1x=x
a.x  y = a.(x  y)

x  x’
a
xy
x’
a
x y 
y’

a
x  y
y’
x y

(x  y) 
Strong Bisimilarity on LTSs
⑥

Soundness
Completeness
14
Process Algebra (2IF45)
Equality of terms
Axiomatizing
Rooted Branching Bisimulations
Language: BPA(A)
Signature: 0, 1, (a._ )aA, , +, •
Language terms T(BPA(A,))
Closed terms C(BPA(A))
Deduction rules for BPA(A) (a A):
a
x  x’
a
a.x  x 
a x’ 
x+y
1 
x
(x + y) 
a

a
y  y’
a y’
x+y
y
(x + y) 

x  x’
a
xy
x’  y 
a
x y 
y’
a
x  y
y’
x y

(x  y) 
Strong Bisimilarity on LTSs
Rooted Branching
15
x+ y = y+x
(x+y) + z = x+ (y + z)
x+x=x
x+ 0 = x
(x+ y)  z = x  z+y  z
(x  y)  z = x  (y  z)
0x=0
x1=x
1x=x
a.x  y = a.(x  y)
⑥

Soundness
Completeness
Process Algebra (2IF45)
Equality of terms
Axiomazing
Rooted branching bisimulation
bb

+
+
+
Turned into equation looks like:
.(x+y) + x =
16
x+y
Axiomazing
Rooted branching bisimulation
rb
a
a
bb

+
+
+
Turned into equation looks like:
B axiom
17
a.(.(x+y) + x) = a.(x+y)
Axiomatizing
Rooted Branching Bisimulations
Language: BPA(A)
Signature: 0, 1, (a._ )aA, , +, •
Language terms T(BPA(A,))
Closed terms C(BPA(A))
x+ y = y+x
(x+y) + z = x+ (y + z)
x+x=x
x+ 0 = x
(x+ y)  z = x  z+y  z
(x  y)  z = x  (y  z)
0x=0
x1=x
1x=x
a.x  y = a.(x  y)
Deduction rules for BPA(A) (a A):
a
x  x’
a
a.x  x 
a x’ 
x+y
1 
x
(x + y) 
a

a
y  y’
a y’
x+y
y
(x + y) 

x  x’
a
xy
x’  y 
a
x y 
y’
a
x  y
y’
x y

(x  y) 
Strong Bisimilarity on LTSs
Rooted Branching
18
⑥

a.(.(x+y) + x) = a.(x+y)
Soundness
Completeness
Process Algebra (2IF45)
Equality of terms
Home work
• Prove soundness of B axiom wrt rooted BB
• Read the proof of ground completeness
19
Process Algebra (2IF45)
Combining internal step with other operators
Language: BPA(A)
Signature: 0, 1, (a._ )aA, , +, •
Language terms T(BPA(A,))
Closed terms C(BPA(A))
Deduction rules
20
Axioms
Process Algebra (2IF45)
Combining internal step with other operators:
Hiding operator
Language: BPA(A)
Signature: 0, 1, (a._ )aA, , +, •, I (I  A)
Language terms T(BPA(A,))
Closed terms C(BPA(A))
Deduction rules for I
21
Axioms for I
Process Algebra (2IF45)
turns external
actions into
internal steps
Combining internal step with other operators:
Encapsulation operator
Language with
Signature: 0, 1, (a._ )aA, , +, H (H  A)
22
Process Algebra (2IF45)
blocks actions
Combining internal step with other operators:
Parallel composition and communication
Language: TCP(A)
Signature: 0, 1, (a._ )aA, , +, •, I (I  A), ||, |,
Language terms T(BPA(A, ))
Closed terms C(BPA(A, ))
Axioms for parallel composition with silent step:
x ╙ .y = x ╙ y
x |.y = 0
23
Process Algebra (2IF45)
╙, H,
Exercises
• see distributed copies
24
Process Algebra (2IF45)
Abstraction, silent steps and Recursion
Guardedness and silent steps:  cannot be a guard of a variable
X = .X has solutions ..a.1 but also ..b.1
Guardedness and hiding operator: I cannot appear in tX in X = tX
X = i.I(X), where i  I has solutions i.i.a.1 but also i.i.b.1
25
Process Algebra (2IF45)
Abstraction and Recursion and Fairness

Z
X


U
Y
a
a
0
26
Observation:
1. they are rooted bb bisimilar
2. implicitly internal loop is left eventually
= fairness
0
Process Algebra (2IF45)
Abstraction and Recursion and Fairness

Z
X
Observation on LTSs:
1. they are rooted bb bisimilar
2. implicitly internal loop is left eventually
= fairness


U
Y
a
a
0
0
As recursive specifications:
X = .Y
Y = .Y + a.0
27
Z = .U
U = a.0
RSP+RDP?
Process Algebra (2IF45)
X=Z
Abstraction and Recursion and Fairness

Z
X
Observation on LTSs:
1. they are rooted bb bisimilar
2. implicitly internal loop is left eventually
= fairness


U
Y
a
a
0
0
As recursive specifications:
X = .Y
Y = .Y + a.0
Z = .U
U = a.0
RSP+RDP?
X=Z
At least two problems:
1. Those are not guarder recursive specifications!
2. Even if they are somehow made guarded, B axiom is not sufficient
to rewrite one spec into another
28
Process Algebra (2IF45)
Abstraction and Recursion and Fairness:
problem 1. dealing with guardedness
for some action i
to be turned internal “soon”
by applying I for I = {i}
X’ = i.Y’
Y’ = i.Y’ + a.0
represents
X = .Y
Y = .Y + a.0


applying {i}
X
i
Y
X’
i
Y’
a
0
29
a
0
Process Algebra (2IF45)
Abstraction and Recursion and Fairness:
problem 1. dealing with guardedness
Z’ = i.U’
U’ = a.0
for some action i
to be turned internal “soon”
by applying I for I = {i}
X’ = i.Y’
Y’ = i.Y’ + a.0
represents
represents
Z = .U
U = a.0
X = .Y
Y = .Y + a.0


applying {i}
X
i
Y
X’
30

i
i
U’
Y’
a
0
applying {i}
Z’
Z
U
a
a
a
0
0
Process Algebra (2IF45)
0
Abstraction and Recursion and Fairness:
problem 1. dealing with guardedness
Z’ = i.U’
U’ = a.0
for some action i
to be turned internal “soon”
by applying I for I = {i}
X’ = i.Y’
Y’ = i.Y’ + a.0
represents
represents
Z = .U
U = a.0
X = .Y
Y = .Y + a.0


applying {i}
X
i
Y
X’
How to
connect them
i
Y’
a
a
0
?
0
i
a
a
0
OK!
Process Algebra (2IF45)
Z’
U’
U
0
OK!
31

applying {i}
Z
Abstraction and Recursion and Fairness:
problem 2. derivation rules
We want to derive that I(X’) = I(Z’)! We need new rules for this!
X’ = i.Y’
Y’ = i.Y’ + a.0
Something like this shall help:
Y’ = i.Y’ + a.0
. I(Y’) = . I(a.0)
32
Process Algebra (2IF45)
Abstraction and Recursion and Fairness:
Fairness rule KFAR1b
a bit more general rule:
x1 = i1.x1 + y1, i1  I
. I(x1) = . I(y1)
33
Process Algebra (2IF45)
Abstraction and Recursion and Fairness:
Fairness rule KFARnb
General KFAR rule is:
x1 = i1.x2 + y1,
x2 = i2.x3 + y2,
…
xn = in.x1 + yn, i1, … in  I , there is ik 

. I(x1) = . (I(y1) + … + I(yn))
34
Process Algebra (2IF45)
Abstraction and Recursion and Fairness:
Example of tossing a coin
35
Process Algebra (2IF45)
Home Work (part2)
• Study the Coin tossing example
• Study the complete proof for ABP, derivation up to abstraction
and derivation by means of fairness derivation rules.
36
Process Algebra (2IF45)
Download