Lecture 9: LTL nd Büchi Automt 1
LTL Property Ptterns Quite often the requirements of system follow some simple ptterns. Sometimes we wnt to specify tht property should only hold in certin context, clled the scope of property. Typicl scopes re: Glol: The property should hold on the whole pth (i.e. on ll suffixes of run). Before R: The property should hold efore the first ppernce of R (i.e. on ll suffixes efore the first suffix stisfying R). After Q: The property should hold fter the first ppernce of Q. 2
Between Q nd R: The property should hold in ll sequences in which the first suffix stisfies Q nd the lst one stisfies R. After Q until R: As efore, ut lso includes the sequences in which Q ppers, ut is never followed y n R. Note: In the following ptterns, scopes re interpreted in wy tht lwys includes the suffix t which the event triggering the scope hppens, ut excludes the suffix t which the event ending the scope hppens. 3
Scopes Glol Before R R R After Q Q Q Between Q nd R Q Q R Q R Q After Q until R Q Q R Q 4
LTL Property Ptterns: Asence Asence ptterns specify tht P is flse within the scope: Glol Before R After Q Between Q nd R After Q until R ( ( ( ( G P (F R) ( P U R) G(Q G P) G((Q R F R) ( P U R)) ( G((Q R) ( P W R)) 5
LTL Property Ptterns: Existence Existence ptterns specify tht P ecomes true within the scope: Glol Before R After Q Between Q nd R After Q until R ( ( ( ( F P R W (P R) (G Q) (F(Q F P)) G((Q R) ( R W (P R))) ( G((Q R) ( R U (P R))) 6
LTL Property Ptterns The property ptterns re useful to mke specifying esier: If desired property flls into one of those ptterns, the pttern cn e instntited for pproprite P, Q, nd R. The ptterns (nd the definition of scopes) from the previous slides were tken from: http://ptterns.projects.cis.ksu.edu/, where you cn find mny more of them (lso for other temporl logics). There re lso other ptterns ville expressing: Universlity: P is true (dul of sence) Precedence: S precedes P Response: S responds to P Etc., etc. 7
Reltions etween Temporl nd Logicl Opertors X(φ 1 φ 2 ) X φ 1 X φ 2 X(φ 1 φ 2 ) X φ 1 X φ 2 X φ X φ F(φ 1 φ 2 ) F φ 1 F φ 2 F φ G φ G(φ 1 φ 2 ) G φ 1 G φ 2 G φ F φ (φ 1 φ 2 ) U ψ (φ 1 U ψ) (φ 2 U ψ) φ U (ψ 1 ψ 2 ) (φ U ψ 1 ) (φ U ψ 2 ) 8
Idempotence nd Recursion Lws F φ F F φ G φ G G φ φ U ψ φ U (φ U ψ) F φ φ X F φ G φ φ X G φ φ U ψ ψ (φ X(φ U ψ)) φ W ψ ψ (φ X(φ W ψ)) φ R ψ (φ ψ) (ψ X(φ R ψ)) 9
LTL Model Checking We now turn to the question how to check whether given Kripke structure stisfies given formul. In the context of temporl logics, this is clled model checking (i.e. checking whether ll runs re models of the given formul). Like in the cse of sfety properties, we follow n utomt-theoretic pproch: 1. We introduce new clss of utomt tht cn express LTL properties. 2. We show how to trnslte properties into these utomt. 3. We check whether the intersection of the system nd the utomton for the negtion of the property is empty. Literture: Clrke, Grumerg, Peled: Model Checking, MIT Press, 1999 10
Büchi Automt: Definition A Büchi utomton is tuple such tht B = Σ, S, S 0,, F Σ S S 0 Q S Σ S F S is finite lphet, is finite set of sttes, re the initil sttes, is the trnsition reltion, nd re the ccepting sttes. So fr, Büchi utomt look exctly like finite utomt. However, they operte on infinite words, nd they hve different cceptnce condition (see next slide). 11
Büchi Automt: Acceptnce nd Lnguge Let B = Σ, S, S 0,, F e Büchi utomton. A run of B on n infinite word σ Σ ω is n infinite sequence of sttes ρ S ω such tht ρ(0) S 0, nd (ρ(i), σ(i), ρ(i + 1)) for ll i 0. We cll run ρ ccepting iff for infinitely mny indices i it holds tht ρ(i) F (i.e. ρ infinitely often visits ccepting sttes). A word σ Σ ω is ccepted y B iff there is n ccepting run on σ in B. The lnguge of B, denoted L(B) Σ ω is defined s the set of infinite words over Σ ccepted y B. 12
Büchi Automt: Exmples infinitely often q0 q1, infinitely often q0 q1 13
Opertions on Büchi Automt Like finite utomt, the lnguges ccepted y Büchi utomt re closed under oolen opertions. We will exmine the following opertions: Intersection of Büchi utomt B 1 nd B 2 : construct B with L(B) = L(B 1 ) L(B 2 ) Union of Büchi utomt B 1 nd B 2 : construct B with L(B) = L(B 1 ) L(B 2 ) Complementtion of Büchi utomton B 1 : construct B with L(B) = Σ \ L(B 1 ) Emptiness check: given B, check if L(B) = 14
Intersection of Büchi utomt The construction of the intersection utomton works little differently from the finite-stte cse. We need to check whether oth sets of ccepting sttes occur infinitely often. Ide: We crete two copies of the intersected stte spce. In the first copy, we check for occurrence of the first cceptnce set. In the second copy, we check for occurrence of the second cceptnce set. We jump ck nd forth etween the copies whenever we find n ccepting stte. Let B 1 = Σ, S 1, S 0 1, 1, F 1, B 2 = Σ, S 2, S 0 2, 2, F 2. We define the intersection utomton (or: product utomton) to e B = Σ, S, S 0,, F, where S = S 1 S 2 {1, 2}, S 0 = S 0 1 S0 2 {1}, F = F 1 S 2 {1} s defined on the next slide 15
( s, t, 1,, s, t, 1 ) iff (s,, s ) 1, (t,, t ) 2, s / F 1 ( s, t, 1,, s, t, 2 ) iff (s,, s ) 1, (t,, t ) 2, s F 1 ( s, t, 2,, s, t, 2 ) iff (s,, s ) 1, (t,, t ) 2, t / F 2 ( s, t, 2,, s, t, 1 ) iff (s,, s ) 1, (t,, t ) 2, t F 2 16
Intersection: Exmple s0 s1 t0 t1 B1 B2 s0,t0,1 B1 x B2 s1,t1,2 s0,t0,2 s1,t1,1 17
Union nd Complement Union: Juxtpose oth utomt (like in the finite cse) Complement: Complicted! The complement construction, when pplied to Büchi utomton with n sttes, results in n utomton with O(n!) sttes. We will skip it in this course. Detils on Complementtion: see e.g. W. Thoms, Automt on Infinite Ojects, Chpter 4 in Hndook of Theoreticl Computer Science, or I. Wlukiewicz, Lecture notes on Automt nd Logic, Chpter 3, www.lri.fr/perso/ igw/ppers/igw-eefss01.ps 18
Emptiness check Oservtion: L(B) iff there is n ccepting stte s F tht is rechle from n initil stte nd rechle from itself (the ltter with non-empty pth). s0......... s s... This condition cn e checked with n lgorithm tht tkes liner time in the size of the Büchi utomton. (We will see how lter.) 19
Note on determinism In the cse of finite utomt, we could convert ech non-deterministic utomton into lnguge-equivlent deterministic utomton. This is not the cse with Büchi utomt. In other words, non-deterministic Büchi utomt re strictly more expressive thn deterministic Büchi utomt., Eventully, only will occur. s0 s1 Not expressile y deterministic Büchi utomton! 20
Generlised Büchi Automt A vrint of the model re so-clled generlised Büchi utomt. They differ from (norml) Büchi utomt only in the cceptnce condition, which is set of cceptnce sets, i.e. F 2 S In generlised Büchi utomton, run ρ is ccepting iff, for F = {F 1,..., F n } nd ech index 1 i n, we hve tht ρ visits infinitely mny sttes from F i. Generlised Büchi utomt cn e trnslted ck into Büchi utomt. (Tke the n-fold intersection of the utomton with itself, with cceptnce sets F 1 through F n.) 21