Verification Lecture 12 Martin Zimmermann
Plan for today LTL FairnessinLTL LTL Model Checking
Review: Syntax modal logic over infinite sequences[pnueli 1977] Propositional logic a AP ϕandϕ ψ Temporal operators ϕ ϕuψ atomicproposition negationandconjunction nextstatefulfillsϕ ϕholdsuntilaψ-stateisreached linear temporal logic is a logic for describing LT properties
Review: Intuitive semantics atomic prop. a a arbitrary arbitrary arbitrary arbitrary... arbitrary a arbitrary arbitrary arbitrary nextstep a... a b a b a b b arbitrary until aub... a a a a arbitrary eventually a... always a a a a a a...
Semantics over words TheLT-propertyinducedbyLTLformulaφoverAPis: Words(φ) = {σ (2 AP ) ω σ φ},where isthesmallestrelationsatisfying: σ true σ a iff a A 0 (i.e.,a 0 a) σ φ 1 φ 2 iff σ φ 1 andσ φ 2 σ φ iff σ / φ σ φ iff σ[1..] =A 1 A 2 A 3... φ σ φ 1 Uφ 2 iff j 0. σ[j..] φ 2 and σ[i..] φ 1, 0 i<j forσ= A 0A 1A 2... wehaveσ[i..]= A i A i+1 A i+2... isthesuffixofσ fromindexion
Semantics over paths and states LetTS =(S,Act,,I,AP,L)beatransitionsystemwithoutterminal states,andletφbeanltl-formulaoverap. ForinfinitepathfragmentπofTS: Forstates S: π φ iff trace(π) φ s φ iff ( π Paths(s). π φ) TSsatisfiesφ,denotedTS φ,iftraces(ts) Words(φ)
Semantics for transition systems TS φ iff (* transition system semantics*) Traces(TS) Words(φ) iff (* definition of for LT-properties*) TS Words(φ) iff (* Definition of Words(φ)*) π φforallπ Paths(TS) iff (* semanticsof forstates*) s 0 φforalls 0 I.
Example s 1 s 2 s 3 {a,b} {a,b} {a}
Semantics of negation Forpaths,itholdsπ φifandonlyifπ/ φsince: Words( φ) =(2 AP ) ω Words(φ). But: TS/ φandts φarenotequivalentingeneral Itholds: TS φ impliests/ φ.notalwaysthereverse! Note that: TS/ φ iff Traces(TS)/ Words(φ) iff Traces(TS) Words(φ)/= iff Traces(TS) Words( φ)/=. TSneithersatisfiesφnor φifthereare pathsπ 1 andπ 2 intssuchthatπ 1 φandπ 2 φ
Example s 1 s 0 s 2 {a} AtransitionsystemforwhichTS / aandts / a
Semanticsof,, and σ φ iff j 0. σ[j..] φ σ φ iff j 0. σ[j..] φ σ φ iff j 0. i j.σ[i...] φ σ φ iff j 0. i j. σ[i...] φ
Equivalence LTLformulasϕ,ψareequivalent,denotedϕ ψ,if: Words(ϕ) =Words(ψ)
Duality and idempotence laws Duality: ϕ ϕ ϕ ϕ ϕ ϕ Idempotency: ϕ ϕ ϕ ϕ ϕu(ϕuψ) ϕuψ (ϕuψ)uψ ϕuψ
Absorption and distributive laws Absorption: ϕ ϕ ϕ ϕ Distribution: (ϕuψ) (ϕ ψ) (ϕ ψ) ( ϕ)u( ψ) ϕ ψ ϕ ψ but...: (ϕuψ) / ( ϕ)u( ψ) (ϕ ψ) / ϕ ψ (ϕ ψ) / ϕ ψ
Distributive laws (a b) / a b and (a b) / a b {b} {a} {a} TS / (a b)andts ( a) ( b) TS / ( a) ( b)andts (a b)
Expansion laws Expansion: ϕuψ ϕ ϕ ψ (ϕ (ϕuψ)) ϕ ϕ ϕ ϕ
Expansion for until P U =Words(φUψ)satisfies: P U = Words(ψ) {A 0 A 1 A 2... Words(φ) A 1 A 2... P U } and is the smallest LT-property P such that: Words(ψ) {A 0 A 1 A 2... Words(φ) A 1 A 2... P} P ( )
Proof: Words(φ U ψ) is the smallest LT-prop. satisfying(*) LetPbeanyLT-propertythatsatisfies(*).Weshowthat Words(φUψ) P. LetB 0 B 1 B 2... Words(φUψ). Thenthereexistsak 0such thatb i B i+1 B i+2... Words(φ)forevery0 i<kand B k B k+1 B k+2... Words(ψ). Wederive B k B k+1 B k+2... P becauseb k B k+1 B k+2... Words(ψ)andWords(ψ) P. B k 1 B k B k+1 B k+2... P becauseifa 0 A 1 A 2... Words(φ)andA 1 A 2... PthenA 0 A 1 A 2... P. B k 2 B k 1 B k B k+1 B k+2... P,analogously... B 0 B 1 B 2... P.
Weak until Theweak-until(or:unless)operator: φwψ def = (φuψ) φ asopposedtountil,φwψdoesnotrequireaψ-statetobe reached Until U andweakuntil W aredual: (φuψ) (φ ψ)w( φ ψ) (φwψ) (φ ψ)u( φ ψ) Until and weak until are equally expressive: ψ ψwfalseandφuψ (φwψ) ψ Untilandweakuntilsatisfythesameexpansionlaw butuntilisthesmallest,andweakuntilthelargestsolution!
Expansion for weak until P W =Words(φWψ)satisfies: P W = Words(ψ) {A 0 A 1 A 2... Words(φ) A 1 A 2... P W } and is the greatest LT-property P such that: Words(ψ) {A 0 A 1 A 2... Words(φ) A 1 A 2... P} P ( )
Proof: Words(φ W ψ) is the greatest LT-prop. satisfying(**) LetPbeanyLT-propertythatsatisfies(**).Weshowthat P Words(φWψ). LetB 0 B 1 B 2.../ Words(φWψ). Thenthereexistsak 0such thatb i B i+1 B i+2... φ ψforevery0 i<kand B k B k+1 B k+2... φ ψ. Wederive B k B k+1 B k+2... / P becauseb k B k+1 B k+2... / Words(ψ)and B k B k+1 B k+2... / Words(φ)and B k 1 B k B k+1 B k+2... / P becauseb k B k+1 B k+2... / PandB k 1 B k B k+1 B k+2... / Words(ψ) B k 2 B k 1 B k B k+1 B k+2... / P,analogously... B 0 B 1 B 2... / P.
(Weak-until) positive normal form Canonical form for LTL-formulas negationsonlyoccuradjacenttoatomicpropositions disjunctiveandconjunctivenormalformisaspecialcaseofpnf foreachltl-operator,adualoperatorisneeded e.g., (φuψ) ((φ ψ)u( φ ψ)) (φ ψ) thatis: (φuψ) (φ ψ)w( φ ψ) Fora AP,thesetofLTLformulasinPNFisgivenby: φ = true false a a φ 1 φ 2 φ 1 φ 2 φ φ 1 Uφ 2 φ 1 Wφ 2 and arealsopermitted: φ φwfalseand φ =trueuφ
(Weak until) PNF is always possible For each LTL-formula there exists an equivalent LTL-formula in PNF Transformations: true false false true φ φ (φ ψ) φ ψ (φ ψ) φ ψ φ φ (φuψ) (φ ψ)w( φ ψ) (φwψ) (ϕ ψ)u( ϕ ψ) φ φ φ φ but an exponential growth in size is possible
Example ConsidertheLTL-formula ((aub) c) ThisformulaisnotinPNF,butcanbetransformedintoPNFas follows: ((aub) c) ((aub) c) ( (aub) c) ((a b)w( a b) c) can the exponential growth in size be avoided?
The release operator Thereleaseoperator:φRψ def = ( φu ψ) ψalwaysholds,arequirementthatisreleasedassoonasφ holds Until U andrelease R aredual: φuψ φrψ ( φr ψ) ( φu ψ) Until and release are equally expressive: ψ falserψandφuψ ( φr ψ) Release satisfies the expansion law: φrψ ψ (φ (φrψ))
Semantics of release σ φrψ iff (*definitionof R *) j 0. (σ[j..] ψ i <j.σ[i..] φ) iff (* semantics of negation*) j 0.(σ[j..]/ ψ i <j.σ[i..]/ φ) iff (*dualityof and *) iff iff iff j 0. (σ[j..]/ ψ i <j.σ[i..]/ φ) j 0.( (σ[j..]/ ψ) i <j.σ[i..]/ φ) j 0.(σ[j..] ψ i <j.σ[i..] φ) (*demorgan slaw*) (* semantics of negation*) j 0.σ[j..] ψ or i 0.(σ[i..] φ k i. σ[k..] ψ)
Positive normal form(revisited) Fora AP,LTLformulasinPNFaregivenby: φ = true false a a φ 1 φ 2 φ 1 φ 2 φ φ 1 Uφ 2 φ 1 R φ 2
PNFinlinearsize For any LTL-formula φ there exists an equivalent LTL-formula ψ in PNF with ψ = O( φ ) Transformations: true false false true φ φ (φ ψ) φ ψ (φ ψ) φ ψ φ φ (φuψ) φr ψ (φrψ) φu ψ φ φ φ φ