Probbilistic Model Checking Michelms Term 2011 Dr. Dve Prker Deprtment of Computer Science University of Oxford
Long-run properties Lst lecture: regulr sfety properties e.g. messge filure never occurs e.g. n lrm is only ever triggered by n error bd prefixes represented by regulr lnguge property lwys refuted by finite trce/pth Liveness properties e.g. "for every request, n cknowledge eventully follows no finite prefix refutes the property ny finite prefix cn be extended to stisfying trce Firness ssumptions e.g. every process tht is enbled infinitely often is scheduled infinitely often Need properties of infinite pths 2
Overview ω-regulr expressions nd ω-regulr lnguges Nondeterministic Büchi utomt (NBA) Deterministic Büchi utomt (DBA) Deterministic Rbin utomt (DRA) Deterministic ω-utomt nd DTMCs 3
ω-regulr expressions Regulr expressions E over lphbet Σ re given by: E ::= ɛ α E + E E.E E* (where α Σ) An ω-regulr expression tkes the form: G = E 1.(F 1 ) ω + E 2.(F 2 ) ω + + E n.(f n ) ω where E i nd F i re regulr expressions with ɛ L(F i ) The lnguge L(G) Σ ω of n ω-regulr expression G is L(E 1 ).L(F 1 ) ω L(E 2 ).L(F 2 ) ω + + L(E n ).L(F n ) ω where L(E) is the lnguge of regulr expression E nd L(E) ω = { w ω w L(E) } Exmple: (α+β+γ)*(β+γ) ω for Σ = { α, β, γ } 4
ω-regulr lnguges/properties A lnguge L Σ ω over lphbet Σ is n ω-regulr lnguge if nd only if: L = L(G) for some ω-regulr expression G ω-regulr lnguges re: closed under intersection closed under complementtion P (2 AP ) ω is n ω-regulr property if P is n ω-regulr lnguge over 2 AP (where AP is the set of tomic propositions for some model) pth ω stisfies P if trce(ω) P NB: ny regulr sfety property is n ω-regulr property 5
Exmples A messge is sent successfully infinitely often (( succ)*.succ) ω Every time the process tries to send messge, it eventully succeeds in sending it (( try)* + try.( succ)*.succ) ω 1 {fil} 0.5 s {try} 0.01 2 s 0 s 1 0.98 0.5 s 3 0.01 {succ} 1 6
Büchi utomt A nondeterministic Büchi utomton (NBA) is tuple A = (Q, Σ, δ, Q 0, F) where: Q is finite set of sttes Σ is n lphbet δ : Q Σ 2 Q is trnsition function Q 0 Q is set of initil sttes F Q is set of ccept sttes i.e. just like nondeterministic finite utomton (NFA) The difference is the ccepting condition 7
Lnguge of n NBA Consider Büchi utomton A = (Q, Σ, δ, Q 0, F) A run of A on n infinite word α 1 α 2 is: n infinite sequence of utomt sttes q 0 q 1 such tht: q 0 Q 0 nd q i+1 δ(q i, α i+1 ) for ll i 0 An ccepting run is run with q i F for infinitely mny i The lnguge L(A) of A is the set of ll infinite words on which there exists n ccepting run of A 8
Exmple Infinitely often q 0 q 1 9
Exmple As in the lst lecture, we use utomt to represent lnguges of the form L (2 AP ) ω So, if AP = {,b}, then: is ctully: q 0 q 1 q 0 q 1, {b} {}, {,b}, {b} {}, {,b} 10
Properties of Büchi utomt ω-regulr lnguges L(A) is n ω-regulr lnguge for ny NBA A ny ω-regulr lnguge cn be represented by n NBA ω-regulr expressions like for finite utomt, cn construct n NBA from n rbitrry ω-regulr expression E 1.(F 1 ) ω + + E n.(f n ) ω i.e. there re opertions on NBAs to: construct NBA ccepting L ω for regulr lnguge L construct NBA from NFA for (regulr) E nd NBA for (ω-regulr) F construct NBA ccepting union L(A 1 ) L(A 2 ) for NBA A 1 nd A 2 11
Büchi utomt nd LTL LTL formule ψ ::= true ψ ψ ψ X ψ ψ U ψ where AP is n tomic proposition Cn convert ny LTL formul ψ into n NBA A over 2 AP i.e. ω ψ trce(ω) L(A) for ny pth ω LTL-to-NBA trnsltion (see e.g. [VW94], [DGV99]) construct generlized NBA (multiple sets of ccept sttes) bsed on decomposition of LTL formul into subformule cn convert GNBA into n equivlent NBA vrious optimistions to the bsic techniques developed not covered here; see e.g. section 5.2 of [BK08] 12
Büchi utomt nd LTL GF ( infinitely often ) q 0 q 1 G( F b) ( b lwys eventully follows ) b q 0 q 1 b b b 13
Deterministic Büchi utomt Like for finite utomt A NBA is deterministic if: Q 0 =1 δ(q, α) 1 for ll q Q nd α Σ i.e. one initil stte nd no nondeterministic successors A deterministic Büchi utomton (DBA) is totl if: δ(q, α) = 1 for ll q Q nd α Σ i.e. unique successor sttes But, NBA cn not lwys be determinised i.e. NBA re strictly more expressive thn DBA 14
NBA nd DBA NBA nd DBA for the LTL formul G b GF NBA: b q 0 q 1 b b b DBA: b q 0 q 1 b b b 15
No DBA possible Consider the ω-regulr expression (α+β)*α ω over Σ={α,β} i.e. words contining only finitely mny instnces of β there is no deterministic Büchi utomt ccepting this In prticulr, tke α = {} nd β =, i.e. Σ=2 AP, AP={} (α+β)*α ω represents the LTL formul FG FG is represented by the following NBA: q 0 q 1 q 2 true But there is no DBA for FG true 16
Deterministic Rbin utomt A deterministic Rbin utomton (DRA) is tuple A = (Q, Σ, δ, q 0, Acc) where: Q is finite set of sttes Σ is n lphbet δ : Q Σ Q is trnsition function q 0 Q is n initil stte Acc 2 Q 2 Q is n cceptnce condition The cceptnce condition is set of pirs of stte sets Acc = { (L i, K i ) 1 i k } 17
Deterministic Rbin utomt A run of word on DRA is ccepting iff: for some pir (L i, K i ), the sttes in L i re visited finitely often nd (some of) the sttes in K i re visited infinitely often or in LTL: Hence: deterministic Büchi utomton is specil cse of deterministic Rbin utomton where Acc = { (, {F}) } 18
FG NBA for FG (no DBA exists) q 0 q 1 q 2 true true DRA for FG q 0 q 1 where cceptnce condition is Acc = { ({q 0 },{q 1 }) } 19
Exmple - DRA Another exmple of DRA (over lphbet 2 {,b} ) q 0 b q 1 b where cceptnce condition is Acc = { ({q 1 },{q 0 }) } In LTL: G( F( b)) FG 20
Properties of DRA Any ω-regulr lnguge cn represented by DRA (nd L(A) is n ω-regulr lnguge for ny DRA A) i.e. DRA nd NBA re eqully expressive (but NBA my be more compct) nd DRA re strictly more expressive thn DBA Any NBA cn be converted to n equivlent DRA [Sf88] size of the resulting DRA is 2 O(nlogn) 21
Deterministic ω-utomt nd DTMCs Let A be DBA or DRA over the lphbet 2 AP i.e. L(A) (2 AP ) ω identifies set of pths in DTMC Let Prob D (s, A) denote the corresponding probbility from stte s in discrete-time Mrkov chin D i.e. Prob D (s, A) = Pr D s { ω Pth(s) trce(ω) L(A) } Like for finite utomt (i.e. DFA), we cn evlute Prob D (s, A) by constructing product of D nd A which records the stte of both the DTMC nd the utomton 22
Product DTMC for DBA For DTMC D = (S, s init, P, L) nd (totl) DBA A = (Q, Σ, δ, q 0, F) The product DTMC D A is: the DTMC (S Q, (s init,q init ), P, L ) where: q init = δ(q 0,L(s init )) L (s,q) = { ccept } if q F nd L (s,q) = otherwise Since A is deterministic unique mppings between pths of D, A nd D A probbilities of pths re preserved 23
Product DTMC for DBA For DTMC D nd DBA A Prob D (s, A) = Prob D A ((s,q s ), GF ccept) where q s = δ(q 0,L(s)) Hence: Prob D (s, A) = Prob D A ((s,q s ), F T GFccept ) where T GFccept = union of D A BSCCs T with T St(ccept) Reduces to computing BSCCs nd rechbility probbilities 24
Compute Prob(s 0, GF ) Exmple property cn be represented s DBA 0.6 0.3 {b} 0.1 0.5 s 0 s 1 s 2 s 3 s 4 s 5 {} 0.2 1 1 0.3 0.9 0.1 {} {} 1 q 0 q 1 Result: 1 25
Exmple 2 Compute Prob(s 0, G b GF ) property cn be represented s DBA 0.6 0.3 0.1 0.5 s 0 s 1 s 2 0.2 1 {b} 0.3 0.9 0.1 {} 1 b q 0 q 1 b b s 3 s 4 s 5 {} 1 {} b Result: 0.75 26
Product DTMC for DRA For DTMC D = (S, s init, P, L) nd (totl) DRA A = (Q, Σ, δ, q 0, Acc) where Acc = { (L i, K i ) 1 i k } The product DTMC D A is: the DTMC (S Q, (s init,q init ), P, L ) where: q init = δ(q 0,L(s init )) l i L (s,q) if q L i nd k i L (s,q) if q K i (i.e. stte sets of cceptnce condition used s lbels) (sme product s for DBA, except for stte lbelling) 27
Product DTMC for DRA For DTMC D nd DRA A Prob D (s, A) = Prob D A ((s,q s ), 1 i k (FG l i GF k i ) where q s = δ(q 0,L(s)) Hence: Prob D (s, A) = Prob D A ((s,q s ), F T Acc ) where T Acc is the union of ll ccepting BSCCs in D A n ccepting BSCC T of D A is such tht, for some 1 i k: q l i for ll (s,q) T nd q k i for some (s,q) T i.e. T (S L i ) = nd T (S K i ) Reduces to computing BSCCs nd rechbility probbilities 28
Compute Prob(s 0, FG ) Exmple 3 property cn be represented s DRA 0.6 0.3 {b} 0.1 0.5 s 0 s 1 s 2 0.2 0.3 s 3 s 4 s 5 {} 1 1 0.9 0.1 {} {} 1 q 0 q 1 Acc = { ({q 0 },{q 1 }) } Result: 0.125 29
Exmple 4 Compute Prob(s 0, G(b F( b )) FG b) property cn be represented s DRA 0.6 0.3 0.1 0.5 s 0 s 1 s 2 0.2 1 {b} 0.3 0.9 0.1 {} s 3 s 4 s 5 1 q 0 b b b q 1 Acc = { ({q 1 },{q 0 }) } b {} 1 {} Result: 1 30
Summing up ω-regulr expressions nd ω-regulr lnguges lnguges of infinite words: E 1.(F 1 ) ω + E 2.(F 2 ) ω + + E n.(f n ) ω Nondeterministic Büchi utomt (NBA) ccepting runs visit stte in F infinitely often cn represent ny ω-regulr lnguge by n NBA cn trnslte ny LTL formul into equivlent NBA Deterministic Büchi utomt (DBA) strictly less expressive thn NBA (e.g. no NBA for FG ) Deterministic Rbin utomt (DRA) generlised cceptnce condition: { (L i, K i ) 1 i k } s expressive s NBA; cn convert ny NBA to DRA Deterministic ω-utomt nd DTMCs product DTMC + BSCC computtion + rechbility 31