260 likes | 391 Views
Process Algebra (2IF45) Basic notions of Equational theory. Dr. Suzana Andova. Deduction system for “Counting down”. Language (signature) 0 “zero ” s (_) “ successor function” a (_, _) “ addition” m (_, _) “ multiplication”. Deduction rules. 0 . . . . .
E N D
Process Algebra (2IF45)Basic notions of Equational theory Dr. Suzana Andova
Deduction system for “Counting down” Language (signature) 0 “zero” s(_) “successor function” a(_, _) “addition” m(_, _) “multiplication” Deduction rules 0 Terms s(s(0)) Terms a(s(0),s(0)) a(s(0),s(0)) s(s(0)) 1 s(x) x 1 1 1 s(0) a(s(0),0) x x’ , y a(x,y) x’ 1 y y’ a(x,y) a(x, y’) 1 1 1 1 x, y a(x,y) 0 0 Process Algebra (2IF45)
Deduction system for “Counting down” Language (signature) 0 “zero” s(_) “successor function” a(_, _) “addition” m(_, _) “multiplication” Deduction rules specification 0 dynamic behaviour Terms s(s(0)) Terms a(s(0),s(0)) a(s(0),s(0)) s(s(0)) 1 s(x) x 1 1 ? 1 a(s(0),0) s(0) x x’ , y a(x,y) x’ 1 y y’ a(x,y) a(x, y’) equivalent behaviours equal specification 1 1 1 1 x, y a(x,y) 0 0 Process Algebra (2IF45)
Deduction system vs. Equational theory Language (signature) 0 “zero” s(_) “successor function” a(_, _) “addition” Deduction rules 0 1 1 x x’ , y a(x,y) x’ y y’ a(x,y) a(x, y’) 1 1 Terms e.g. a(s(0),s(0)), 0,. a(x,y) x, y a(x,y) a(s(0),s(0)) s(s(0)) 1 s(x) x 1 1 Equalities on terms …├ a(s(0),s(0)) = s(s(0)) Equivalence relation a(s(0),0) s(0) 1 1 consistency 0 0 Process Algebra (2IF45)
Equational theory reduction on specification componts’ specifications reduction on specification the whole system specification composition by axiom • simpler • smaller • in a particular form (basic) • … reduction on LTSs the state space SOS rules Process Algebra (2IF45)
Example: Towards Equational theory for Arithmetic of Natural numbers P(eano) A(rith.) a(0,s(0)) s(0) a(0,0) 0 1 1 0 0 ? So we need a set of axioms from which we can derive: PA ├ a(0,s(0)) = …..= s(0) and also PA ├ a(0,0) = …..= 0 and also ….. 1. Maybe axioms (Ax11) a(0,s(0)) = s(0) (Ax12) a(0,0) = 0 2. Maybe axioms (Ax21) a(0,s(x)) = s(x) (Ax22) a(0,0) = 0 3. Maybe axioms (Ax31) a(0,y) = y Process Algebra (2IF45)
Example: Towards Equational theory for Arithmetic of Natural numbers PA (cont.) a(0,s(0)) s(a(0,0)) 1 1 0 0 ? So we need a set of axioms from which we can derive: PA ├ a(0,s(0)) = …..= s(a(0,0)) and also PA ├ a(s(0),s(0)) = …..= s(s(0)) ….. 3’. Maybe axioms (Ax31) a(x,s(y)) = s(a(x,y)) (Ax32) a(s(x),y) = s(a(x,y)) 1’. Maybe axioms (Ax11) a(s(0),s(0)) = s(s(0)) (Ax12) a(0,s(0)) = s(0) 2’. Maybe axioms (Ax21) a(s(x),s(y)) = s(s(a(x,y))) Process Algebra (2IF45)
Example: Towards Equational theory for Arithmetic of Natural numbers PA (cont.) 1. Maybe axioms (Ax11) a(0,s(0)) = s(0) (Ax12) a(0,0) = 0 3. Maybe axioms (Ax31) a(0,y) = y not general infinite (Ax31) a(x,s(y)) = s(a(x,y)) (Ax32) a(s(x),y) = s(a(x,y)) (Ax11) a(s(0),s(0)) = s(s(0)) (Ax12) a(0,s(0)) = s(0) 2. Maybe axioms (Ax21) a(0,s(x)) = s(x) (Ax22) a(0,0) = 0 (Ax21) a(s(x),s(y)) = s(s(a(x,y))) Process Algebra (2IF45)
Example: Towards Equational theory for Arithmetic of Natural numbers PA (cont.) 1. Maybe axioms (Ax11) a(0,s(0)) = s(0) (Ax12) a(0,0) = 0 3. Maybe axioms (Ax31) a(0,y) = y not general infinite instance of (Ax31) a(x,s(y)) = s(a(x,y)) (Ax32) a(s(x),y) = s(a(x,y)) (Ax11) a(s(0),s(0)) = s(s(0)) (Ax12) a(0,s(0)) = s(0) 2. Maybe axioms (Ax21) a(0,s(x)) = s(x) (Ax22) a(0,0) = 0 (Ax21) a(s(x),s(y)) = s(s(a(x,y))) Process Algebra (2IF45)
Example: Towards Equational theory for Arithmetic of Natural numbers PA (cont.) 1. Maybe axioms (Ax11) a(0,s(0)) = s(0) (Ax12) a(0,0) = 0 3. Maybe axioms (Ax31) a(0,y) = y not general infinite seems ok! (Ax31) a(x,s(y)) = s(a(x,y)) (Ax32) a(s(x),y) = s(a(x,y)) (Ax11) a(s(0),s(0)) = s(s(0)) (Ax12) a(0,s(0)) = s(0) 3. Maybe axioms (Ax31) a(0,y) = y ? (Ax21) a(s(x),s(y)) = s(s(a(x,y))) ? but can we derive here a(s(x),0) = s(x) ? Process Algebra (2IF45)
Example: Equational theory for Arithmetic of Natural numbers PA (cont.) 3. Maybe axioms (Ax31) a(0,y) = y Axioms in PA (PA1) a(x,0) = x (PA2) a(x,s(y)) = s(a(x,y)) (Ax31) a(x,s(y)) = s(a(x,y)) (Ax32) a(s(x),y) = s(a(x,y)) Process Algebra (2IF45)
Equational Theory • Question: • What did we have to take into account during our quest for the right set of axioms? • Answer: • Consistency between • bisimulation • and • derivation in PA using the axioms Process Algebra (2IF45)
Consistency • Questions: • How do you understand “consistency” between the deduction system (semantics) and the equational theory? • Answer: • Consistency is two-directional • 1. Everything that I am able to derive equal using the axioms must be bisimilar, namely • if PA ├ t = r then t r • 2. Everything that I can show bisimilar, I have to be able to derive equial using the axioms, namely • if t r then PA ├ t = r soundness completeness Process Algebra (2IF45)
Consistency • Questions: • How do you understand “consistency” between the deduction system (semantics) and the equational theory? • Answer: • Consistency is two-directional • 1. Everything that I am able to derive equal using the axiomsmust be bisimilar, namely • if PA ├ t = r then t r • 2. 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 soundness ground completeness Process Algebra (2IF45)
Prerequisites for soundness of axioms • Questions: • Are we on a safe ground now? Soundness: Everything that I am able to derive equal using the axioms must be bisimilar, namely if PA ├ t = r then t r Process Algebra (2IF45)
Derivation in equational theory • Questions: • What is allowed (can be used) in derivation? • PA ├ t = r • Axioms (as ‘basic’ equalities) • Properties of = such as • reflexivity PA ├ t = t • symmetry if PA ├ t = r then PA ├ r = t • transitivity if PA ├ t = r and PA ├ r = u then PA ├ t = u • Substitution (substituting variables by terms) • e.g. from PA ├ a(x,y) = a(y,x) follows PA ├ a(s(0),0) = a(0, s(0)) • where s(0)/x and 0/y • Context rule Process Algebra (2IF45)
Derivation in equational theory • Questions: • What is allowed (can be used) in derivation? PA ├ t = r Context rule e.g. if PA ├ t1 = r1 and PA ├ t2 = r2 then PA├ s(t1) = s(r1) and also PA├ a(t1 ,t2) = a(r1, r2) … ‘Mapping’ the context rule back to semantics and e.g. if PA ├ t1 r1 and PA ├ t2 r2 then PA├ s(t1) s(r1) and also PA├ a(t1 ,t2) a(r1, r2) … Process Algebra (2IF45)
Prerequisites for soundness ‘Mapping’ the context rule back to semantics and e.g. if t1 r1 and t2 r2 then s(t1) s(r1) and also a(t1 ,t2) a(r1, r2) … a(0,s(0)) s(a(0,0)) Since then s(a(0,s(0))) s(s(a(0,0))) 1 1 congruence 1 1 0 0 a(0,s(0)) s(a(0,0)) 1 1 0 0 Process Algebra (2IF45)
Prerequisites for soundnessCongruence relation • Congruence relation • it is equivalence relation • reflexive • symmetric • transitive • it is preserved by any context C[ _ ] • if t1 r1 then C[t1] C[r1] Examples: Bisimilarity is congruence on the set of all terms Process Algebra (2IF45)
Prerequisites for soundnessCongruence relation complete trace equivalent LTSs {?coin !coffee, ?coin !tea} put in the context “communicate with the User” ?coin ?coin ?coin !coin ?coffee !coffee !tea !coffee !tea coin coin coin coffee coffee NOT complete trace equivalent LTSs {coin coffee} vs. {coin coffee, coin} Process Algebra (2IF45)
Towards ground completeness • Questions: • Is the set of axioms in PA (PA1) a(x,0) = x • (PA2) a(x,s(y)) = s(a(x,y)) • ground complete wrt the derivation rules and ? • Every closed terms that I can show bisimilar, I have to be able to derive equal using the axioms, namely • if t r then PA ├ t = r, for t and r closed terms • What about PA ├ a(t,r) = a(r,t)? Can we derive this equality from the two axioms, for closed terms t and r? Process Algebra (2IF45)
Towards ground completeness • Working with closed terms: • Basic terms • defined in a structural way, such as: • 0 is a basic term in PA • if t is a basic term in PA then s(t) is also a basic term in PA • Thus, in PA basic terms are 0, s(0), s(s(0)), …. • Elimination of ‘other’ operators from the signature • In PA every closed term can be rewritten to a basic term, e.g. • PA ├ a(s(0),a(s(0),0)) = s(s(0)) • the elimination proof goes by structural induction on the structure on closed terms • Any property on closed terms can be proven by structural induction on basic terms only instead on all closed terms Process Algebra (2IF45)
Towards ground completeness • Property1: For any closed term t, PA ├ a(0, t) = t. • Proof: By structural induction on basic terms (knowing the elimination property) • Basic step t 0. Directly from PA1 • Inductive step t s(t’) for some basic term t’. Derive • PA ├ a(0, t) = a(0, s(t’)) = s(a(0,t’)) = s(t’) = t by induction PA2 Process Algebra (2IF45)
Towards ground completeness • Property2: For any closed term t and r, PA ├ a(s(t), r) = a(t, s(r)). • Proof: By structural induction on basic terms (knowing the elimination property) • Basic step r 0. • PA ├ a(s(t), r) = a(s(t), 0) = s(t) by axiom PA1 • PA ├ a(t, s(r)) = a(t, s(0)) = s(a(t, 0)) = s(t) by PA2 and PA1 • Inductive step r s(r’) for some basic term r’. Derive • PA ├ a(s(t), r) = a(s(t), s(r’)) = s( a(s(t), r’) ) = s( a(t, s(r’)) ) • = a( t, s(s(r’)) ) = a(t, s(r)) by induction PA2 PA2 Process Algebra (2IF45)
Towards ground completeness Property3: For any closed term t and r, PA ├ a(t, r) = a(r, t). Proof: Home Work Process Algebra (2IF45)
Process Algebra (2IF45)Basic Process Algebra Dr. Suzana Andova