37
Process Algebra (2IF45) Abstraction in Process Algebra Suzana Andova

Process Algebra (2IF45) Abstraction in Process Algebra

  • Upload
    rosa

  • View
    59

  • Download
    0

Embed Size (px)

DESCRIPTION

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. Abstraction. Abstraction is used to - PowerPoint PPT Presentation

Citation preview

Page 1: Process Algebra (2IF45) Abstraction in Process Algebra

Process Algebra (2IF45)

Abstraction in Process Algebra

Suzana Andova

Page 2: Process Algebra (2IF45) Abstraction in Process Algebra

2

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

Process Algebra (2IF45)

Page 3: Process Algebra (2IF45) Abstraction in Process Algebra

3

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

Process Algebra (2IF45)

Question: How do we chose to relate behaviours with internal steps?Branching bisimulation

Page 4: Process Algebra (2IF45) Abstraction in Process Algebra

4 Process Algebra (2IF45)

Branching bisimulation – simple examples first

a

b

is branching bisim to a

a b

“ related states must have the same potential which does not change until an observable action is executed ”

Page 5: Process Algebra (2IF45) Abstraction in Process Algebra

5 Process Algebra (2IF45)

Branching bisimulation – simple examples first

a b

is branching bisim to a

b

it is not branching bisim to a

b

Page 6: Process Algebra (2IF45) Abstraction in Process Algebra

6

Branching bisimilar processes

t

t’

a

s a

s’

t’’

t

s

s’t’’

t s

s’

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:

1. for all states s, t, s’ S, whenever (s, t) R and s → s’ for some a A, then there are states t’, t’’ S such that t t’ and t’ → t’’ and (s, t’), (s’,t’’) R;2. vice versa, for all states s, t, s’ S, whenever (s, t) R and t → t’ for some a A, then there

are states s’,s’’ S such that s s’ and s’ → s’’ and (s’, t), (s’’,t’) R;3. if (s, t) R and s then there is a state t’ such that t t’ , t’ and (s, t’) R4. 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

aa

a

a

Page 7: Process Algebra (2IF45) Abstraction in Process Algebra

7

less

pow

er o

f the

obs

erve

rSpectrum of behavioural relations

Page 8: Process Algebra (2IF45) Abstraction in Process Algebra

8

most powerful

Page 9: Process Algebra (2IF45) Abstraction in Process Algebra

9

Weak bisimulation just a short comparison

Process Algebra (2IF45)

a b c d1 d2 d3 d4

a b c d1 d2 d3 d4

b

a b c d1 d2 d3 d4

b

Page 10: Process Algebra (2IF45) Abstraction in Process Algebra

10

Branching bisimulation and composition

Page 11: Process Algebra (2IF45) Abstraction in Process Algebra

11

Branching bisimulation and composition

a

a

a

a

b

b b

branching bisimilar!

branching bisimilar? NO!

+ +

Page 12: Process Algebra (2IF45) Abstraction in Process Algebra

12

Branching bisimulation and composition

a

a

a

a

b

b b

branching bisimilar!

branching bisimilar? NO!

+ +

Painful conclusion: branching bisimilation is not compositional.

Page 13: Process Algebra (2IF45) Abstraction in Process Algebra

13

Branching bisimulation and composition

a

a

a

a b b

branching bisimilar components!

+ +

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!

Not branching bisimilar compositions!

Page 14: Process Algebra (2IF45) Abstraction in Process Algebra

14

Rooted Branching Bisimilar processes

t’

q

b

s’ b

p

r

t’

s’

pq

t s’

p

t’

t s a a

t s a a

t s a a

R is Rooted BB between state (s, t) R if R is Branching Bisimulation relation (as already defined) and the root condition:

1. if s → s’ for a A, then there is a state t’ S such that t → t’ and (s’, t’) R;2. if t → t’ for a A, then there is a state s’ S such that s → 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

a a

a

Rooted branching bisimulation is strengthened variant of branching bisimulation strict enough to obtain compositionality

a

(aA i.e. can be from A or can be )

Page 15: Process Algebra (2IF45) Abstraction in Process Algebra

15 Process Algebra (2IF45)

Axiomatizing Rooted Branching Bisimulations

Language: BPA(A)

Signature: 0, 1, (a._ )aA, , +, • Language terms T(BPA(A,))

Closed terms C(BPA(A))

Equality of terms

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)

Completeness

Soundness

Deduction rules for BPA(A) (a A): x x’ x + y x’

a

a

1 x (x + y)

a.x x a

y y’ x + y y’

aa

y (x + y) ⑥

x x’ x y x’

a

a

x y (x y)

x y y’ x y y’

a

a

Strong Bisimilarity on LTSs

Page 16: Process Algebra (2IF45) Abstraction in Process Algebra

16 Process Algebra (2IF45)

Axiomatizing Rooted Branching Bisimulations

Language: BPA(A)

Signature: 0, 1, (a._ )aA, , +, • Language terms T(BPA(A,))

Closed terms C(BPA(A))

Strong Bisimilarity on LTSs Equality of terms

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)

Completeness

Soundness

Deduction rules for BPA(A) (a A): x x’ x + y x’

a

a

1 x (x + y)

a.x x a

y y’ x + y y’

aa

y (x + y) ⑥

x x’ x y x’ y

a

a

x y (x y)

x y y’ x y y’

a

a

Rooted Branching

Page 17: Process Algebra (2IF45) Abstraction in Process Algebra

17

x y

x+

+

x y+

.(x+y) + x = x+y

Turned into equation looks like:

Axiomazing Rooted branching bisimulation

bb

Page 18: Process Algebra (2IF45) Abstraction in Process Algebra

18

a

x y

x+

+

a

x y+

rb

B axiom a.(.(x+y) + x) = a.(x+y)

Axiomazing Rooted branching bisimulation

bb

Turned into equation looks like:

Page 19: Process Algebra (2IF45) Abstraction in Process Algebra

19 Process Algebra (2IF45)

Axiomatizing Rooted Branching Bisimulations

Language: BPA(A)

Signature: 0, 1, (a._ )aA, , +, • Language terms T(BPA(A,))

Closed terms C(BPA(A))

Strong Bisimilarity on LTSs Equality of terms

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)

a.(.(x+y) + x) = a.(x+y)

Completeness

Soundness

Deduction rules for BPA(A) (a A): x x’ x + y x’

a

a

1 x (x + y)

a.x x a

y y’ x + y y’

aa

y (x + y) ⑥

x x’ x y x’ y

a

a

x y (x y)

x y y’ x y y’

a

a

Rooted Branching

Page 20: Process Algebra (2IF45) Abstraction in Process Algebra

20

Home work

• Prove soundness of B axiom wrt rooted BB• Read the proof of ground completeness

Process Algebra (2IF45)

Page 21: Process Algebra (2IF45) Abstraction in Process Algebra

21 Process Algebra (2IF45)

Combining internal step with other operators Language: BPA(A)

Signature: 0, 1, (a._ )aA, , +, • Language terms T(BPA(A,))

Closed terms C(BPA(A))

Axioms Deduction rules

Page 22: Process Algebra (2IF45) Abstraction in Process Algebra

22 Process Algebra (2IF45)

Combining internal step with other operators:Hiding operator

Language: BPA(A)

Signature: 0, 1, (a._ )aA, , +, •, I (I A)

Language terms T(BPA(A,))

Closed terms C(BPA(A))

Axioms for I Deduction rules for I

turns external actions into internal steps

Page 23: Process Algebra (2IF45) Abstraction in Process Algebra

23 Process Algebra (2IF45)

Combining internal step with other operators:Encapsulation operator

Language with

Signature: 0, 1, (a._ )aA, , +, H (H A) blocks actions

Page 24: Process Algebra (2IF45) Abstraction in Process Algebra

24 Process Algebra (2IF45)

Combining internal step with other operators:Parallel composition and communication

Language: TCP(A)

Signature: 0, 1, (a._ )aA, , +, •, I (I A), ||, |, ╙, H,

Language terms T(BPA(A, ))

Closed terms C(BPA(A, )) Axioms for parallel composition with silent step:

x ╙ .y = x ╙ y

x |.y = 0

Page 25: Process Algebra (2IF45) Abstraction in Process Algebra

25

Exercises

• see distributed copies

Process Algebra (2IF45)

Page 26: Process Algebra (2IF45) Abstraction in Process Algebra

26

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

Process Algebra (2IF45)

Page 27: Process Algebra (2IF45) Abstraction in Process Algebra

27

Abstraction and Recursion and Fairness

Process Algebra (2IF45)

X

Y

a

0

Z

U

a

0

Observation:1. they are rooted bb bisimilar2. implicitly internal loop is left eventually

= fairness

Page 28: Process Algebra (2IF45) Abstraction in Process Algebra

28

Abstraction and Recursion and Fairness

Process Algebra (2IF45)

X

Y

a

0

X = .YY = .Y + a.0

Z

U

a

0

Z = .UU = a.0

RSP+RDP? X = Z

Observation on LTSs:1. they are rooted bb bisimilar2. implicitly internal loop is left eventually

= fairness

As recursive specifications:

Page 29: Process Algebra (2IF45) Abstraction in Process Algebra

29

Abstraction and Recursion and Fairness

Process Algebra (2IF45)

X

Y

a

0

X = .YY = .Y + a.0

Z

U

a

0

Z = .UU = 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

Observation on LTSs:1. they are rooted bb bisimilar2. implicitly internal loop is left eventually

= fairness

As recursive specifications:

Page 30: Process Algebra (2IF45) Abstraction in Process Algebra

30 Process Algebra (2IF45)

X = .YY = .Y + a.0

X’ = i.Y’Y’ = i.Y’ + a.0

for some action i to be turned internal “soon”by applying I for I = {i}

represents

X

Y

a

0

X’

Y’

i

a

0

iapplying {i}

Abstraction and Recursion and Fairness: problem 1. dealing with guardedness

Page 31: Process Algebra (2IF45) Abstraction in Process Algebra

31 Process Algebra (2IF45)

Z = .UU = a.0

Z’ = i.U’U’ = a.0

Z’

U’

i

a

0

Z

U

0

applying {i}

a

Abstraction and Recursion and Fairness: problem 1. dealing with guardedness

X = .YY = .Y + a.0

X’ = i.Y’Y’ = i.Y’ + a.0

for some action i to be turned internal “soon”by applying I for I = {i}

represents

X

Y

a

0

X’

Y’

i

a

0

iapplying {i}

represents

Page 32: Process Algebra (2IF45) Abstraction in Process Algebra

32 Process Algebra (2IF45)

Z = .UU = a.0

Z’ = i.U’U’ = a.0

Z’

U’

i

a

0

applying {i} Z

U

0

a

Abstraction and Recursion and Fairness: problem 1. dealing with guardedness

X = .YY = .Y + a.0

X’ = i.Y’Y’ = i.Y’ + a.0

for some action i to be turned internal “soon”by applying I for I = {i}

represents

X

Y

a

0

X’

Y’

i

a

0

iapplying {i}

represents

OK! OK!

How to connect them

?

Page 33: Process Algebra (2IF45) Abstraction in Process Algebra

33 Process Algebra (2IF45)

X’ = i.Y’Y’ = i.Y’ + a.0

Something like this shall help:

Y’ = i.Y’ + a.0 . I(Y’) = . I(a.0)

Abstraction and Recursion and Fairness: problem 2. derivation rulesWe want to derive that I(X’) = I(Z’)! We need new rules for this!

Page 34: Process Algebra (2IF45) Abstraction in Process Algebra

34 Process Algebra (2IF45)

a bit more general rule:

x1 = i1.x1 + y1, i1 I

. I(x1) = . I(y1)

Abstraction and Recursion and Fairness: Fairness rule KFAR1

b

Page 35: Process Algebra (2IF45) Abstraction in Process Algebra

35 Process Algebra (2IF45)

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))

Abstraction and Recursion and Fairness: Fairness rule KFARn

b

Page 36: Process Algebra (2IF45) Abstraction in Process Algebra

36 Process Algebra (2IF45)

Abstraction and Recursion and Fairness:Example of tossing a coin

Page 37: Process Algebra (2IF45) Abstraction in Process Algebra

37

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.

Process Algebra (2IF45)