linear time logic
play

Linear-Time Logic Hao Zheng Department of Computer Science and - PowerPoint PPT Presentation

Linear-Time Logic Hao Zheng Department of Computer Science and Engineering University of South Florida Tampa, FL 33620 Email: zheng@cse.usf.edu Phone: (813)974-4757 Fax: (813)974-5456 Hao Zheng (CSE, USF) Comp Sys Verification 1 / 41


  1. Linear-Time Logic Hao Zheng Department of Computer Science and Engineering University of South Florida Tampa, FL 33620 Email: zheng@cse.usf.edu Phone: (813)974-4757 Fax: (813)974-5456 Hao Zheng (CSE, USF) Comp Sys Verification 1 / 41

  2. Overview Linear Time Logic: Syntax & Semantics (Section 5.1.1 - 5.1.3) 1 Linear Time Logic: Equivalences (Section 5.1.4) 2 Linear Time Logic: Additional Operators (Section 5.1.5) 3 Linear Time Logic: Specifying Fairness (Section 5.1.6) 4 Automata-Based LTL Model Checking 5 Hao Zheng (CSE, USF) Comp Sys Verification 2 / 41

  3. LT Properties • An LT property is a set of infinite traces over AP . • Specifying such sets explicitly is often inconvenient. • Mutual exclusion is specified over AP = { c 1 , c 2 } by P mutex = set of infinite words A 0 A 1 A 2 . . . with { c 1 , c 2 } �⊆ A i for all i ≥ 0 • Starvation freedom is specified over AP = { c 1 , w 1 , c 2 , w 2 } by P nostarve = set of infinite words A 0 A 1 A 2 . . . such that: � ∞ � � ∞ � � ∞ � � ∞ � ∃ j. w 1 ∈ A j ⇒ ∃ j. c 1 ∈ A j ∧ ∃ j. w 2 ∈ A j ⇒ ∃ j. c 2 ∈ A j Such properties can be specified succinctly using linear temporal logic . Hao Zheng (CSE, USF) Comp Sys Verification 3 / 41

  4. Contents Linear Time Logic: Syntax & Semantics (Section 5.1.1 - 5.1.3) 1 Linear Time Logic: Equivalences (Section 5.1.4) 2 Linear Time Logic: Additional Operators (Section 5.1.5) 3 Linear Time Logic: Specifying Fairness (Section 5.1.6) 4 Automata-Based LTL Model Checking 5 Hao Zheng (CSE, USF) Comp Sys Verification 4 / 41

  5. 5.1.1 Linear Temporal Logic (LTL): Syntax • Linear temporal logic is a logic for describing LT properties. • An extension of propositional logic with temporal modalities. • Modal logic over infinite sequences [Pnueli 1977]. • Propositional logic: • a ∈ AP atomic proposition • ¬ φ and φ ∧ ψ negation and conjunction • Temporal operators: • � φ neXt state fulfills φ • φ U ψ φ holds Until a ψ -state is reached • Syntax of LTL over AP ϕ ::= true | a | ϕ ∧ ϕ | ¬ ϕ | � ϕ | ϕ U ϕ where a ∈ AP is an atomic proposition. Hao Zheng (CSE, USF) Comp Sys Verification 5 / 41

  6. LTL Derived Operators φ ∨ ψ ≡ ¬ ( ¬ φ ∧ ¬ ψ ) φ → ψ ≡ ¬ φ ∨ ψ φ ↔ ψ ≡ ( φ → ψ ) ∧ ( ψ → φ ) φ ⊕ ψ ≡ ( φ ∧ ¬ ψ ) ∨ ( ¬ φ ∧ ψ ) true ≡ φ ∨ ¬ φ false ≡ ¬ true ♦ φ ≡ true U φ “eventually in the future” ≡ ¬ ♦ ¬ φ � φ “globally true” Precedence order: • The unary operators bind stronger than the binary ones. • ¬ and � bind equally strong. • U takes precedence over ∧ , ∨ , and → . Hao Zheng (CSE, USF) Comp Sys Verification 6 / 41

  7. LTL Intuitive Semantics arbitrary arbitrary arbitrary arbitrary a ... a (atomic prop.) arbitrary arbitrary arbitrary arbitrary a ... � a (next step) arbitrary a ∧ ¬ b a ∧ ¬ b a ∧ ¬ b b ... a U b (until) arbitrary ¬ a ¬ a ¬ a a ... ♦ a (eventually) a a a a a ... � a (globally) Hao Zheng (CSE, USF) Comp Sys Verification 7 / 41

  8. LTL Intuitive Semantics arbitrary arbitrary arbitrary arbitrary a ... a (atomic prop.) arbitrary arbitrary arbitrary arbitrary a Let σ = A 0 A 1 A 2 . . . ∈ (2 AP ) ω . ... � a (next step) σ | = a iff a ∈ A 0 ( i.e., A 0 | = a ) arbitrary a ∧ ¬ b a ∧ ¬ b a ∧ ¬ b b ... a U b (until) arbitrary ¬ a ¬ a ¬ a a ... ♦ a (eventually) a a a a a ... � a (globally) Hao Zheng (CSE, USF) Comp Sys Verification 7 / 41

  9. LTL Intuitive Semantics arbitrary arbitrary arbitrary arbitrary a ... a (atomic prop.) arbitrary arbitrary arbitrary arbitrary a ... � a (next step) Let σ = A 0 A 1 A 2 . . . ∈ (2 AP ) ω . arbitrary a ∧ ¬ b a ∧ ¬ b a ∧ ¬ b b ... a U b (until) σ | = � a iff A 1 | = a arbitrary ¬ a ¬ a ¬ a a ... ♦ a (eventually) a a a a a ... � a (globally) Hao Zheng (CSE, USF) Comp Sys Verification 7 / 41

  10. LTL Intuitive Semantics arbitrary arbitrary arbitrary arbitrary a ... a (atomic prop.) arbitrary arbitrary arbitrary arbitrary a ... � a (next step) arbitrary a ∧ ¬ b a ∧ ¬ b a ∧ ¬ b b ... a U b (until) Let σ = A 0 A 1 A 2 . . . ∈ (2 AP ) ω . arbitrary ¬ a ¬ a ¬ a a ... ♦ a (eventually) σ | = a U b iff ∃ j ≥ 0 . A j | = b and ∀ 0 ≤ i < j. A i | = a a a a a a ... � a (globally) Hao Zheng (CSE, USF) Comp Sys Verification 7 / 41

  11. LTL Intuitive Semantics arbitrary arbitrary arbitrary arbitrary a ... a (atomic prop.) arbitrary arbitrary arbitrary arbitrary a ... � a (next step) arbitrary a ∧ ¬ b a ∧ ¬ b a ∧ ¬ b b ... a U b (until) arbitrary ¬ a ¬ a ¬ a a ... ♦ a (eventually) Let σ = A 0 A 1 A 2 . . . ∈ (2 AP ) ω . a a a a a ... � a (globally) σ | = ♦ a iff ∃ i ≥ 0 . A i | = a Hao Zheng (CSE, USF) Comp Sys Verification 7 / 41

  12. LTL Intuitive Semantics arbitrary arbitrary arbitrary arbitrary a ... a (atomic prop.) arbitrary arbitrary arbitrary arbitrary a ... � a (next step) arbitrary a ∧ ¬ b a ∧ ¬ b a ∧ ¬ b b ... a U b (until) Let σ = A 0 A 1 A 2 . . . ∈ (2 AP ) ω . arbitrary ¬ a ¬ a ¬ a a ... ♦ a (eventually) σ | ∀ i ≥ 0 . A i | = � a iff = a a a a a a ... � a (globally) Hao Zheng (CSE, USF) Comp Sys Verification 7 / 41

  13. New Temporal Modalities ♦ and � Let σ = A 0 A 1 A 2 . . . ∈ (2 AP ) ω . � ♦ ϕ “infinitely often” ϕ . . . . . . . . . σ | = � ♦ ϕ iff ∀ i ≥ 0 ∃ j ≥ i. A j | = ϕ Hao Zheng (CSE, USF) Comp Sys Verification 8 / 41

  14. New Temporal Modalities ♦ and � Let σ = A 0 A 1 A 2 . . . ∈ (2 AP ) ω . ♦ � ϕ “eventually forever” ϕ . . . σ | = ♦ � ϕ iff ∃ i ≥ 0 ∀ j ≥ i. A j | = ϕ Hao Zheng (CSE, USF) Comp Sys Verification 9 / 41

  15. Traffic Light Properties • Once red, the light cannot become green immediately � ( red → ¬ � green ) • The light becomes green eventually: ♦ green • The light becomes green infinitely often: � ♦ green • Once red, the light becomes green eventually: � ( red → ♦ green ) • Once red, the light always becomes green eventually after being yellow for some time in-between: � ( red → � ( red U ( yellow ∧ � ( yellow U green )))) Note these properties assume European traffic light which goes red, red/yellow, green, yellow, repeat. Hao Zheng (CSE, USF) Comp Sys Verification 10 / 41

  16. LTL General Semantics (5.1.2) Let σ = A 0 A 1 A 2 . . . ∈ (2 AP ) ω . σ | = true | = iff a ∈ A 0 ( i.e., A 0 | = a ) σ a | ϕ 1 ∧ ϕ 2 σ | = ϕ 1 and σ | σ = iff = ϕ 2 σ | = ¬ ϕ iff σ �| = ϕ | = � ϕ iff σ [1 .. ] = A 1 A 2 A 3 . . . | = ϕ σ σ | = ϕ 1 U ϕ 2 iff ∃ j ≥ 0 . σ [ j.. ] | = ϕ 2 and σ [ i.. ] | = ϕ 1 , 0 ≤ i < j where σ [ i.. ] = A i A i +1 A i +2 . . . is suffix of σ from index i on. Hao Zheng (CSE, USF) Comp Sys Verification 11 / 41

  17. General Semantics of � , ♦ , �♦ and ♦� Let σ = A 0 A 1 A 2 . . . ∈ (2 AP ) ω . σ | = ♦ ϕ iff ∃ j ≥ 0 . σ [ j.. ] | = ϕ σ | = � ϕ iff ∀ j ≥ 0 . σ [ j.. ] | = ϕ σ | = iff ∀ j ≥ 0 . ∃ i ≥ j. σ [ i . . . ] | = ϕ �♦ ϕ | = iff ∃ j ≥ 0 . ∀ i ≥ j. σ [ i . . . ] | = ϕ σ ♦� ϕ where σ [ i.. ] = A i A i +1 A i +2 . . . is suffix of σ from index i on. Hao Zheng (CSE, USF) Comp Sys Verification 12 / 41

  18. Definition 5.6 Semantics Over Words The LT-property induced by LTL formula ϕ over AP is: � � 2 AP � ω � Words ( ϕ ) = σ ∈ | σ | = ϕ , where | = is the smallest satisfaction relation. Hao Zheng (CSE, USF) Comp Sys Verification 13 / 41

  19. Definition 5.7 Semantics Over Paths and States Let TS = ( S, Act , → , I, AP , L ) be a transition system without terminal states, and let ϕ be an LTL-formula over AP . • For infinite path fragment π of TS : π | = ϕ iff trace ( π ) | = ϕ • For state s ∈ S : s | = ϕ iff ∀ π ∈ Paths ( s ) . π | = ϕ • TS satisfies ϕ , denoted TS | = ϕ , iff Traces ( TS ) ⊆ Words ( ϕ ) Hao Zheng (CSE, USF) Comp Sys Verification 14 / 41

  20. Semantics for Transition Systems TS | = ϕ iff (* transition system semantics *) Traces ( TS ) ⊆ Words ( ϕ ) (* definition of | iff = for LT-properties *) TS | = Words ( ϕ ) iff (* Definition of Words ( ϕ ) *) π | = ϕ for all π ∈ Paths ( TS ) iff (* semantics of | = for states *) s 0 | = ϕ for all s 0 ∈ I . Hao Zheng (CSE, USF) Comp Sys Verification 15 / 41

  21. LTL Examples s 1 s 2 s 3 { a , b } { a , b } { a } TS | = � a ? Hao Zheng (CSE, USF) Comp Sys Verification 16 / 41

  22. LTL Examples s 1 s 3 s 2 { a , b } { a , b } { a } TS | = � a TS | = � ( a ∧ b ) ? Hao Zheng (CSE, USF) Comp Sys Verification 16 / 41

  23. LTL Examples s 1 s 2 s 3 { a , b } { a , b } { a } TS | = � a TS �| = � ( a ∧ b ) TS | = � ( ¬ b → � ( a ∧ ¬ b )) ? Hao Zheng (CSE, USF) Comp Sys Verification 16 / 41

  24. LTL Examples s 1 s 2 s 3 { a , b } { a , b } { a } TS | = � a TS �| = � ( a ∧ b ) TS | = � ( ¬ b → � ( a ∧ ¬ b )) Hao Zheng (CSE, USF) Comp Sys Verification 16 / 41

  25. LTL Examples s 1 s 2 s 3 { a , b } { a , b } { a } TS | = � a TS �| = � ( a ∧ b ) TS | = � ( ¬ b → � ( a ∧ ¬ b )) TS | = b U ( a ∧ ¬ b ) ? Hao Zheng (CSE, USF) Comp Sys Verification 16 / 41

Recommend


More recommend