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

Slides:



Advertisements
Similar presentations
Process Algebra Book: Chapter 8. The Main Issue Q: When are two models equivalent? A: When they satisfy different properties. Q: Does this mean that the.
Advertisements

Possible World Semantics for Modal Logic
Process Algebra (2IF45) Some Extensions of Basic Process Algebra Dr. Suzana Andova.
Process Algebra (2IF45) Recursion in Process Algebra Suzana Andova
Process Algebra (2IF45) Abstraction in Process Algebra Suzana Andova.
1.6 Behavioral Equivalence. 2 Two very important concepts in the study and analysis of programs –Equivalence between programs –Congruence between statements.
1 Partial Order Reduction. 2 Basic idea P1P1 P2P2 P3P3 a1a1 a2a2 a3a3 a1a1 a1a1 a2a2 a2a2 a2a2 a2a2 a3a3 a3a3 a3a3 a3a3 a1a1 a1a1 3 independent processes.
Process Algebra (2IF45) Abstraction and Recursions in Process Algebra Suzana Andova.
Copyright © Cengage Learning. All rights reserved.
 Dr. Vered Gafni 1 LTL Decidability Enables consistency check, but also base for verification.
Process Algebra (2IF45) Probabilistic Process Algebra Suzana Andova.
Process Algebra (2IF45) Probabilistic Process Algebra Suzana Andova.
Chap6 Relations Def 1: Let A and B be sets. A binary relation from A
Basic Properties of Relations
Representing Relations Using Matrices
Behavioral Equivalence Hossein Hojjat Formal Lab University of Tehran.
Process Algebra (2IF45) Dr. Suzana Andova. 1 Process Algebra (2IF45) Practical issues Lecturer - Suzana Andova - Group: Software Engineering and Technology.
Process Algebra (2IF45) Probabilistic extension: semantics Parallel composition Dr. Suzana Andova.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch and Wolfgang Reisig 1.
Introduction to Computability Theory
CSE115/ENGR160 Discrete Mathematics 04/24/12 Ming-Hsuan Yang UC Merced 1.
Transparency No Formal Language and Automata Theory Chapter 10 The Myhill-Nerode Theorem (lecture 15,16 and B)
07/06/98 知的インタフェース特論 1 Operational Semantics Again, the question? Operational Model = Labeled Transition System If P and Q yields a same LTS. How to define.
Dr. Alexandra I. Cristea CS 319: Theory of Databases: C3.
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
Discrete Mathematics Lecture#11.
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Programming Language Semantics Denotational Semantics Chapter 5 Part III Based on a lecture by Martin Abadi.
Propositional Calculus Math Foundations of Computer Science.
Chapter 4: A Universal Program 1. Coding programs Example : For our programs P we have variables that are arranged in a certain order: Y 1 X 1 Z 1 X 2.
Relations Chapter 9.
Process Algebra (2IF45) Basic Process Algebra (Soundness proof) Dr. Suzana Andova.
CS555Spring 2012/Topic 61 Cryptography CS 555 Topic 6: Number Theory Basics.
Equational Reasoning Math Foundations of Computer Science.
The ACL2 Proof Assistant Formal Methods Jeremy Johnson.
CSE 755, part3 Axiomatic Semantics Will consider axiomatic semantics (A.S.) of IMP: ::=skip | | | | ; | | Only integer vars; no procedures/fns; vars declared.
Reading and Writing Mathematical Proofs
Process Algebra (2IF45) Probabilistic Branching Bisimulation: Exercises Dr. Suzana Andova.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Pushdown Automata (PDAs)
Advanced Topics in SE Spring Process Algebra Hossein Hojjat Formal Methods Lab University of Tehran.
Reactive systems – general
Chapter 9. Section 9.1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and.
2G1516 Formal Methods2005 Mads Dam IMIT, KTH 1 CCS: Operational Semantics And Process Algebra Mads Dam Reading: Peled 8.3, 8.4, 8.6 – rest of ch. 8.
Rewriting Logic Model of Compositional Abstraction of Aspect-Oriented Software FOAL '10Mar. 15, 2010 Yasuyuki Tahara, Akihiko Ohsuga The University of.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
CS6133 Software Specification and Verification
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression.
2G1516 Formal Methods2005 Mads Dam IMIT, KTH 1 CCS: Processes and Equivalences Mads Dam Reading: Peled 8.5.
Concurrency 5 The theory of CCS Specifications and Verification Expressive Power Catuscia Palamidessi
Process Algebra (2IF45) Basic Process Algebra (Completeness proof) Dr. Suzana Andova.
CS104:Discrete Structures Chapter 2: Proof Techniques.
Process Algebra (2IF45) Abstraction Parallel composition (short intro) Suzana Andova.
1 Lecture 3 The Languages of K, T, B and S4. 2 Last time we extended the language PC to the language S5 by adding two new symbols ‘□’ (for ‘It is necessary.
Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and B = {a,b} {( 0, a), (
Process Algebra (2IF45) Assignments Dr. Suzana Andova.
1 Proving Properties of Recursive List Functions CS 270 Math Foundations of CS Jeremy Johnson.
Section 9.1. Section Summary Relations and Functions Properties of Relations Reflexive Relations Symmetric and Antisymmetric Relations Transitive Relations.
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
Relations Chapter 9.
2.5 and 2.6 Properties of Equality and Congruence
Process Algebra (2IF45) Extending Process Algebra: Abstraction
Process Algebra (2IF45) Expressiveness of BPArec
Proving Properties of Recursive List Functions
Formal Methods in software development
Day 5 – Introduction to Proofs
Lesson 6.1 Congruent Segments pp
Presentation transcript:

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

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

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

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

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 Can you come up with some deduction rules for the structural operational semantics of BPA(A)? d b a ? a c c

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

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

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)

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 !

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 = a.0 ? Which desired property is broken by this axiom?

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?

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

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  R 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.

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.

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.

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.

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.

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)

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.

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