Presentation is loading. Please wait.

Presentation is loading. Please wait.

Process Algebra (2IF45) Basic Process Algebra Dr. Suzana Andova.

Similar presentations


Presentation on theme: "Process Algebra (2IF45) Basic Process Algebra Dr. Suzana Andova."— Presentation transcript:

1 Process Algebra (2IF45) Basic Process Algebra Dr. Suzana Andova

2 1 Deduction system vs. Equational theory (recup) Process Algebra (2IF45) Language (signature) Set of constants and operators term  term 1  term 2 label Deduction rules Terms built from constants, operators and variables Equivalence relation Set of Axioms (basic equalities) term 1 = term 2 Derivation gives more (derived) equalities Axiom ├ term 1 = term 4

3 2 Consistency (recup) Process Algebra (2IF45) Consistency is two-directional 1. Soundness property: Everything that I am able to derive equal using the axiomsmust be bisimilar, namely if PA ├ t = r then t r 2. Ground completeness property: Every closed terms that I can show bisimilar, I have to be able to derive equial using the axioms, namely if t r then PA ├ t = r, for t and r closed terms Extras: 3. Congruence property of the equivalence relation in the semantics with respect to the operators of the language (e.g. ) 4. Basic terms defined in a structural way (a subset of closed terms) 5. Elimination property for closed terms: any closed term is equal to a basic terms

4 3 Process Algebra (2IF45) Basic process algebra Basic ideas. Basic language (Signature) Specify processes that can execute certain actions from a given set A, e.g. A = {?coin, !coffee, !tea} The language of the Basic Process Algebra, namely, the operators in the signature 0 deadlock constant (inaction) 1 successful termination constant (empty process) a._ action prefix for a in A (unary operator) + non-deterministic choice (alternative compositions) !tea !coffee ?coin nondetermini stic choice sequence of activities deadlock state successful termination 1 0 !coffee. 1 + !tea. 0 ?coin. (!coffee. 1 + !tea. 0) ?

5 4 Process Algebra (2IF45) Basic process algebra Basic ideas. Basic language (Signature) Examples Consider the given LTS. Find a (closed) term (process expression) that corresponds to it? Draw transition systems (following your intuition) for the process expressions: a.b.1, c.0, a.b.1 + c.0, c.0 + a.b.1 a.b.0 + c.1, a.(b.0 + c.1) a.b.1 + a.b.1 + 1 Can you come up with some deduction rules for the structural operational semantics of BPA(A)? d b a ? a c c

6 5 Process Algebra (2IF45) Term deduction system for BPA(A). Algebra on LTSs Set of action names (actions): A Signature: constants 0,1 (note 0,1  A) unary operator a._ binary operator _+_ Set of closed terms C(BPA(A)), set of all terms T(BPA(A)) Behaviour expressed by action transitions _  _ for a in A termination _  Behavioural equivalence is bisimilarity a Deduction rules 1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)  ⑥

7 6 Process Algebra (2IF45) Bisimulation and bisimilarity a.1+b.0 b a a b Equivalence in the semantic model generated by the deduction rules is bisimilarity a a.1+b.0 a.1 a a.1+0 a a.1+a.1+0 Bisimulation relation: A binary relation R on the set of state S of an LTS is bisimulation relation iff the following transfer conditions hold: 1. for all states s, t, s’  S, whenever (s, t)  R and s –a-> s’ for some a  A, then there is a state t’  S such that t –a-> t’ and (s’, t’)  R; 2. vice versa, for all states s, t, s’  S, whenever (s, t)  R and t –a-> t’ for some a  L, then there is a state s’  S such that s –a-> s’ and (s’, t’)  R; 3. whenever (s, t)  R and s  then t  ; whenever (s, t)  R and t  then s  ; Two LTSs s and t are bisimilar, s t, iff there is a bisimulation relation R such that (s, t)  R

8 7 Process Algebra (2IF45) Towards axiomatization. Consistency … again Summary We have (so far) defined the SOS semantics of process expressions We aim to define a set of axioms that corresponds to the semantics We have learnt that we should take care of the consistency (soundness direction) if s t then ├ s = t, for any process expressions s and t Question: Suggest your set of axioms which you ‘feel’ is sound with respect to the SOS semantics! (Hint: Use the examples of bisimilar LTSs)

9 8 Process Algebra (2IF45) Towards Axioms of BPA(A) Do we want the axiom: a.(x+y) = a.x + a.y Yes/No? Why? Which desired property is broken by this axiom? Consider that a.(0+1) a.0 + a.1 but from this axiom we can derive ├ a.(0+1) = a.0 + a.1 !

10 9 Process Algebra (2IF45) Towards Axioms of BPA(A) Let us consider axioms: (A1) x+ y = y+x (A2) (x+y) + z = x+ (y + z) (A3) x + x = x Is this a “good” set of axioms? Yes/No? Why? Consider that a.0+0 a.0, but can we derive A1, A2, A3├ a.0 + 0 = a.0 ? Which desired property is broken by this axiom?

11 10 Process Algebra (2IF45) Axioms of BPA(A) BPA(A) Signature: constants 0,1 unary operator a._ binary operator _+_ (A1) x+ y = y+x (A2) (x+y) + z = x+ (y + z) (A3) x + x = x (A4) x+ 0 = x Question: How do we know that this is a “good” set of axioms for our SOS semantics?

12 11 Towards the proof that it is indeed “good” Congruence property of in T(BPA(A)) Process Algebra (2IF45) Congruence relation 1.it is equivalence relation (reflexive, symmetric, transitive) 2.it is preserved by any context C [ _ ] if t 1 r 1 then C [t 1 ] C [r 1 ] Property: Bisimilarity is congruence on the set of terms T(BPA(A)) with respect to the operators of BPA(A). Proof: Need to be checked for all operators, in this case a._ and +. WRT a._: Assume t r. There is a bisimulation relation R and (t,r) in R. Define R1 = { (a.p, a.q) | (p,q) in R} Is R1 bisimulation relation? Check all 4 transfer conditions for Def. of bisimulation. 1.Assume that a.p makes a transition. It can be only (from the rules) a.p -a-> p. Can a.q make a ‘corresponding’ transition? a.q –a-> q, but are the target process terms p and q in relation R1? It seems not, (p,q)  R but (p,q)  R1. Thus R1 is not YET bisimulation, we need to extend it R1 = { (a.p, a.q) | (p,q) in R}  R

13 12 Towards the proof that it is indeed “good” Congruence property of in T(BPA(A)) Process Algebra (2IF45) Property: Bisimilarity is congruence on the set of terms T(BPA(A)) with respect to the operators of BPA(A). Proof (cont): Need to be checked for all operators, in this case a._ and +. WRT a._: Assume t r. There is a bisimulation relation R and (t,r) in R. Define R1 = { (a.p, a.q) | (p,q) in R}  R 2. Checking the second transfer condition. Assume that a.q makes a transition. It can be only (from the rules) a.q -a-> q. Can a.p make a ‘corresponding’ transition? a.p –a-> p, and (now with the extended R1) process terms p and q are R1 related, (p,q)  R1, since R  R1.. 3. Checking the third transfer condition. Assume that a.q , but this is not possible according to the deduction rules. Thus no further investigation is required. 4. Similar as case 3. In similar way it has to be shown for the + operator.

14 13 Towards the proof that it is indeed “good” Soundness property of axioms wrt to Process Algebra (2IF45) Soundness property: If BPA(A) ├ t = r then t r, for any terms t and r in T(BPA(A)). Proof: All we need to show is that each axiom is sound, that is, 1.t + r r + t, for any terms t,r  T(BPA(A)) 2.(t + r) + s (t + r) + s, for any terms t, r, s  T(BPA(A)) 3.t + t t, for any term t  T(BPA(A)) 4.t + 0 t, for any term t  T(BPA(A)) Soundness of A4. We define a relation R = {(p+0, p) | p  T(BPA(A))}. Is it bisimulation relation? Check all 4 transfer conditions for Def. of bisimulation. 1.Assume that p +0 makes a transition, p+0 –a-> p’, for some a  A and q  T(BPA(A)). It can be only (from the rules) that p -a-> p’. We have it almost, but is (p’, p’)  R?? Opsss! R is (again) not defined good. We extend it to R = {(p+0,p) | p  T(BPA(A))}  {(p, p) | p  T(BPA(A))} With this improved definition of R we have it exactly that the target process terms p’ and p’ are R related. NOTE: It is not always the case that the target process terms are the same. In opposite, this is a trivial case.

15 14 Towards the proof that it is indeed “good” Soundness property of axioms wrt to Process Algebra (2IF45) Soundness property: If BPA(A) ├ t = r then t r, for any terms t and r in T(BPA(A)). Soundness of A4 (cont). R = {(p+0,p) | p  T(BPA(A))}  {(p, p) | p  T(BPA(A))} 2. Checking the second transfer condition. Assume that p makes a transition, p –a-> p’, for some a  A and q  T(BPA(A)). Directly from the deduction rule  it follows that p +0 -a-> p’, and the target process terms are (trivially) related, (p’, p’)  R. 3. Checking the third transfer condition. Assume that (p+0) . Either rule  or ⑥ could have been applied to obtain this, meaning that either p  or 0 . But since is NOT 0  then it must be p . This proves that, (p+0)  implies p . 4. Checking the fourth transfer condition. Assume that p . Directly from rule  we obtain that (p +0) . This proves that, p  implies (p+0) . We have to make similar proofs for other three axioms.

16 15 Towards the proof that it is indeed “good” Ground Completeness axiomatization Process Algebra (2IF45) Ground completeness property: If t r then BPA(A) ├ t = r, for any closed terms t and r in C(BPA(A)). Completeness proof(s) are lengthy. There are several (many) propositions before the final result. Prop1. If p is a closed term in BPA(A) and p-a-> p’ then BPA(A) ├ p = a.p’ + p. Prop2. If p and q are closed terms in BPA(A) and p+q q then BPA(A) ├ p+q = q. Prop3. If p and q are closed terms in BPA(A) and p p+ q then BPA(A) ├ p = p +q. Assuming all these properties are correct, we prove the ground completeness property. Proof: Assume that p and q are closed BPA(A) terms and p q. Next we use that is an equivalence relation and congruence, to obtain: p + p p + q thus p p+q. Also p+q q+q and also p+q q. From Prop2 it follows that BPA(A) ├ p = p+q. From Prop3 it follows that BPA(A) ├ p+q = q. Finally BPA(A) ├ p = q.

17 16 Towards the proof that it is indeed “good” Ground Completeness axiomatization Process Algebra (2IF45) Ground completeness property: If t r then BPA(A) ├ t = r, for any closed terms t and r in C(BPA(A)). Completeness proof(s) are lengthy. There are several (many) propositions before the final result. Prop1. If p is a closed term in BPA(A) and p-a-> p’ then BPA(A) ├ p = a.p’ + p. Prop2. If p and q are closed terms in BPA(A) and p+q q then BPA(A) ├ p+q = q. Prop3. If p and q are closed terms in BPA(A) and p p+ q then BPA(A) ├ p = p +q.

18 17 Towards the proof that it is indeed “good” Ground Completeness axiomatization Process Algebra (2IF45) Prop1. If p is a closed term in BPA(A) and p-a-> p’ then BPA(A) ├ p = a.p’ + p. Proof: (Prove the property by structural induction)

19 18 Towards the proof that it is indeed “good” Ground Completeness axiomatization Process Algebra (2IF45) Prop2. If p and q are closed terms in BPA(A) and p+q q then BPA(A) ├ p+q = q. Proof: Prove the property by structural induction on p. You need to use Prop1 and also the following property which you may try to prove too: Prop4. If (p+q) + r r then p+r r and q + r r, for closed terms p,q, r  C(BPA(A)). Assume that p+q q 1.p is 0 (written also as p  0). …….. 2.p is a.p’ for a closed term p’ in C(BPA(A)). ……. 3.p is p’ + p’’. As (p’ + p’’) + q q then from Prop4. …… By induction ……. All together BPA(A) ├ p+q = (p’ + p’’) + q = (p’ + p’’) + (q + q) = (p’ + q) + (p’’ + q) = ………= q.

20 19 Exercises Process Algebra (2IF45) 1.Which terms from C(BPA(A)) (the set of closed terms in BPA(A)) are basic terms? 2.Can you eliminate any of the operators in BPA(A) when they appear in a closed term? 3.Does it hold BPA(A) ├ a.(x + y) = a.x + a.y for any terms x and y? Can you use any of the properties (theorems) we have seen so far? 4.Show that the set of axioms (x + y ) + z = (y + z) + x (A2’) x+x = x (A3) is equivalent to the set of axioms of BPA(A).


Download ppt "Process Algebra (2IF45) Basic Process Algebra Dr. Suzana Andova."

Similar presentations


Ads by Google