Bisimultion, Gmes & Hennessy Milner logi Leture 1 of Modelli Mtemtii dei Proessi Conorrenti Pweł Soboiński Univeristy of Southmpton, UK Bisimultion, Gmes & Hennessy Milner logi p.1/32
Clssil lnguge theory Is onerned primrily with lnguges, eg. finite utomt regulr lnguges; pushdown utomt ontext-free lnguges; turing mhines reursively enumerble lnguges; This is fine when we think of n utomton/tm s sequentil proess whih hs no intertions with the outside world during its omputtion. However, utomt whih ept the sme lnguges n behve very differently to n outside observer. Bisimultion, Gmes & Hennessy Milner logi p.2/32
The fmous offee mhine exmple Inserire soldi Cffè s s s Bevnd l gusto di tè l limone t t We will disuss the observtions one n mke bout suh systems. Bisimultion, Gmes & Hennessy Milner logi p.3/32
Lbelled trnsition systems A lbelled trnsition system (LTS) L is triple S,A,T where: S is set of sttes; A is set of tions; T S A S is the trnsition reltion. We will normlly write p p for (p,,p ) T. Lbelled trnsition systems generlise both utomt nd trees. They re entrl bstrtion of onurreny theory. Bisimultion, Gmes & Hennessy Milner logi p.4/32
Tre preorder Given stte p of n LTS L, the word σ = α 1 α 2...α k A is tre of p when trnsitions p α 1 α p 2 α 1 k...pk 1 p We will use p σ p s shorthnd. Suppose tht L 1 nd L 2 re LTSs. The tre preorder tr S 1 S 2 is defined s follows: p tr q σ A. p σ p q. q σ q Observtion 1. tr is reflexive nd trnsitive. Bisimultion, Gmes & Hennessy Milner logi p.5/32
Tre equivlene Tre equivlene is defined tr = tr tr, ie p tr q def = p tr q q tr p It is immedite tht when L 1 = L 2, tr is n equivlene reltion on the sttes of n LTS But tres re not enough: tre equivlene is very orse, sine the offee mhines hve the sme tres. s s s t tr t Bisimultion, Gmes & Hennessy Milner logi p.6/32
Simultion Suppose tht L 1 nd L 2 re LTSs. A reltion R S L1 S L2 is lled simultion whenever: if prq nd p p then there exists q suh tht q q nd p Rq. Observtion 2. The empty reltion is simultion nd rbitrry unions of simultions re simultions. Similrity s S 1 S 2 is defined s the lrgest simultion. Equivlently, p s q iff there exists simultion R suh tht (p,q) R. Observtion 3. Similrity is reflexive nd trnsitive. Observtion 4. Simultion equivlene s def = s s. Bisimultion, Gmes & Hennessy Milner logi p.7/32
Simultion exmple 1 Simultion is more sensitive to brnhing (ie non-determinism) thn tres: s p 1 s s p 2 s q 1 q 2 q 3 t s t 1 t 1 2 t 2 Bisimultion, Gmes & Hennessy Milner logi p.8/32
Simultion exmple 2 But it is not entirely stisftory. p p q 1 q q 2 b b r 1 r 2 r 1 r 2 r 1 Bisimultion, Gmes & Hennessy Milner logi p.9/32
Bisimultion Suppose tht L 1 nd L 2 re LTSs. A reltion R S L1 S L2 is lled bisimultion whenever: (i) if prq nd p p then there exists q suh tht q q nd p Rq ; (ii) if qrp nd q q then there exists p suh tht p p nd p Rq. Lemm 5. R is bisimultion iff R nd R op re simultions. Bisimultion, Gmes & Hennessy Milner logi p.10/32
Properties of bisimultions Lemm 6. is bisimultion. Proof. Vously true. Lemm 7. If {R i } i I re fmily of bisimultions then i I R i is bisimultion. Proof. Let R = i I R i. Suppose prq then there exists k suh tht pr k q. In prtiulr, qr k p nd so qrp, thus R is symmetri. If p p then there exists q suh tht q q nd p R k q. But p R k q implies p Rq. Corollry 8. There exists lrgest bisimultion. It is lled bisimilrity. If L 1 = L 2 then bisimilrity is n equivlene reltion. Bisimultion, Gmes & Hennessy Milner logi p.11/32
Exmples of bisimultions, 1 p q 1 q 2 q 3 q 4 q 5.. Lemm 9. p q 1. Proof. R = { (p,q i ) i N } is bisimultion. Bisimultion, Gmes & Hennessy Milner logi p.12/32
Exmples of bisimultions, 2 p p 1 p 2 q q 1 p b p 1 q 3 q q 2 b b b b q 1 q 4 Bisimultion, Gmes & Hennessy Milner logi p.13/32
Resoning bout bisimilrity To show tht sttes p, q re bisimilr it suffies to find bisimulion R whih reltes p nd q; It is less ler how to show tht p nd q re not bisimilr, one n: enumerte ll the reltions whih ontin (p, q) nd show tht none of them re bisimultions; enumerte ll the bisimultion nd show tht none of them ontin (p, q); borrow some tehiniques from gme theory... Bisimultion, Gmes & Hennessy Milner logi p.14/32
Bisimultion gme, 1 We re given two LTSs L 1, L 2. The onfigurtion is pir of sttes (p,q), p L 1, q L 2. The bisimultion gme hs two plyers: P nd R. A round of the gme proeeds s follows: (i) R hooses either p or q; (ii) ssuming it hose p, it next hooses trnsition p p ; (iii) P must hoose trnsition with the sme lbel in the other LTS, ie ssuming R hose p, it must find trnsition q q ; (iv) the round is repeted, repling (p,q) with (p,q ). Bisimultion, Gmes & Hennessy Milner logi p.15/32
Bisimultion gme, 2 Rules: An infinite gme is win for P. R wins iff the gme gets into round where P nnot respond with trnsition in step (iii). Observtion 10. For eh onfigurtion (p,q), either P or R hs winning strtegy. Theorem 11. p q iff P hs winning strtegy. (p q iff R hs winning strtegy.) Bisimultion, Gmes & Hennessy Milner logi p.16/32
P hs winning strtegy p q Let GE def = { (p,q) P hs winning strtegy }. Suppose tht (p,q) GE nd p p. Suppose tht there does not exist trnsition q q suh tht (p,q ) GE. Then R n hoose the trnsition p p nd P nnot respond in wy whih keeps him in winnble position. But this ontrdits the ft tht tht P hs winning strtegy for the gme strting with (p,q). Thus GE is bisimultion. Bisimultion, Gmes & Hennessy Milner logi p.17/32
p q P hs winning strtegy Bisimultions re winning strtegies: If p q then there exists bisimultion R suh tht (p,q) R. Whtever move R mkes, P n lwys mke move suh tht the result is in R. Clerly, this is winning strtegy for P. Bisimultion, Gmes & Hennessy Milner logi p.18/32
Exmples of non bisimilr sttes Bisimilrity is brnhing-sensitive. p p b q 1 q q 2 b r 1 r 2 r 1 r 2 Bisimultion, Gmes & Hennessy Milner logi p.19/32
Similrity nd bisimilrity Theorem 12. nd in generl the inlusion is strit. Proof. Any bisimultion nd its opposite re lerly simultions. On the other hnd, the following exmple shows tht bisimilrity is finer thn simultion equivlene. p p b q 1 q q 2 b r 1 r 2 r 1 r 2 r 1 Bisimultion, Gmes & Hennessy Milner logi p.20/32
Rep: equivlenes s tr Bisimilrity is the finest (=equtes less) equivlene we hve onsidered. Clim 13. Bisimilrity is the finest resonble equivlene, where resonble mens tht we n observe only the behviour nd not the stte-spe. We will give lnguge, the so-lled Hennessy Milner logi, whih desribes observtions/experiments on LTSs. Bisimultion, Gmes & Hennessy Milner logi p.21/32
Hennessy Milner logi Suppose tht A is set of tions. Let L ::= []L L L L L L L Given n LTS we define the semntis by struturl indution over the formul ϕ: q [A]ϕ if for ll q suh tht q q we hve q ϕ; q A ϕ if there exists q suh tht q q nd q ϕ; q ϕ if it is not the se tht q ϕ; q ϕ 1 ϕ 2 if q ϕ 1 or q ϕ 2 ; q ϕ 1 ϕ 2 if q ϕ 1 nd q ϕ 2 ; q lwys; q never; Bisimultion, Gmes & Hennessy Milner logi p.22/32
HM logi exmple formuls n perform trnsition lbelled with ; [] nnot perform trnsition lbelled with ; [b] n perform trnsition lbelled with to stte from whih there re no b lbelled trnsitions. ([b] )? Bisimultion, Gmes & Hennessy Milner logi p.23/32
Bsi properties of HM logi Lemm 14 ( De Morgn lws for HM logi). [] = ; = [] ; = ( ); = ( ); = ; =. In prtiulr, to get the full logi it suffies to onsider just the subsets {,,, } or {[],,, } or {, [],,,, }. Bisimultion, Gmes & Hennessy Milner logi p.24/32
Distinguishing formuls p p b q 1 q q 2 b r 1 r 2 r 1 r 2 ( b ) ( b ) p p b q 1 q q 2 b r 1 r 2 r 1 r 2 r 1 ( b ) ( b ) Bisimultion, Gmes & Hennessy Milner logi p.25/32
Logil equivlene Definition 15. The logil preorder L is reltion on the sttes of n LTS defined s follows: p < L q iff ϕ. p ϕ q ϕ It is lerly reflexive nd trnsitive. Definition 16. Logil equivlene is L def = L L. It is n equivlene reltion. Observtion 17. Atully, for HM, L = L = L. This is onsequene of hving negtion. Proof. Suppose p L q nd q ϕ. If p ϕ then p ϕ, hene q ϕ hene q ϕ, ontrdition. Hene p ϕ. Bisimultion, Gmes & Hennessy Milner logi p.26/32
Hennessy Milner & Bisimultion Definition 18. An LTS is sid to hve finite imge when from ny stte, the number of sttes rehble is finite. Theorem 19 (Hennessy Milner). Let L be n LTS with finite imge. Then L =. To prove this, we need to show: Soundness ( L ): If two sttes stisfy the sme formuls then they re bisimilr. Completeness ( L ): If two sttes re bisimilr then they stisfy the sme formuls. Remrk 20. Completeness holds in generl. The finite imge ssumption is needed only for soundness. Bisimultion, Gmes & Hennessy Milner logi p.27/32
Soundness L (Soundness) It suffies to show tht L is bisimultion. We will rely on imge finiteness. Suppose tht p L q nd p p. Then p nd so q thus there is t lest one q suh tht q q. The set of ll suh q is lso finite by the extr ssumption let this set be {q 1,...,q k }. Suppose tht for ll q i we hve tht p L q i. Then ϕ i suh tht p ϕ i nd q i ϕ i. Thus while p i k ϕ i we must hve q i k ϕ i, ontrdition. Hene there exists q i suh tht q q i nd p L q i. Bisimultion, Gmes & Hennessy Milner logi p.28/32
Completeness 1 L (Completeness) We will show this p < L q by struturl indution on formuls. Bse: p then q. Also, p then q. Indution: Modlities ( nd []): If p ϕ then p p nd p ϕ. By ssumption, there exists q suh tht q q nd p q. By indutive hypothesis q ϕ nd so q ϕ. If p []ϕ then whenever p p then p ϕ. First, notie tht p q implies tht if q q then there exists p suh tht p p with p q. Sine p ϕ, lso q ϕ. Hene q []ϕ. Bisimultion, Gmes & Hennessy Milner logi p.29/32
Completeness 2 Propositionl onnetives ( nd ): if p ϕ 1 ϕ 2 then p ϕ 1 or p ϕ 2. If it is the first then by the indutive hypothesis q ϕ 1, if the seond then q ϕ 2 ; thus q ϕ 1 ϕ 2. if p ϕ 2 ϕ 2 is similr. Note tht ompleteness does not need the finite imge ssumption thus bisimilr sttes lwys stisfy the sme formuls. In the proof, we used the ft tht {, [],,,, } is enough for ll of HM logi. Bisimultion, Gmes & Hennessy Milner logi p.30/32
Imge finiteness The theorem breks down without this ssumption: p 1....... } k...... times p 2....... } k...... times Esy to hek, using the bisimultion gme, tht p 1 p 2. Solution: Introdue infinite onjuntion to the logi. Bisimultion, Gmes & Hennessy Milner logi p.31/32
Sublogis of HM L tr ::= L tr Theorem 21. Logil preorder on L tr oinides with the tre preorder. L s ::= L s L s L s Theorem 22. Logil preorder on L s oniides with the simultion preorder. Bisimultion, Gmes & Hennessy Milner logi p.32/32