Professional Documents
Culture Documents
Lecture 4 SE Formal SMV Temporal Logic Sep 2022ksk
Lecture 4 SE Formal SMV Temporal Logic Sep 2022ksk
Methods
1 Objectives
2 Reference Books
3 Review
5 Semantics of LTL
Course Objective 3
Course Objective
Course Contents
Finite models and model-checking - Modeling using finite mod-
els, reachability algorithms, Specification logics - LTL on finite
words; automata theoretic model checking algorithms, the SMV
tool, Description Logic, Dataflow analysis of programs with-
out recursion, Handling recursion: pushdown models, reacha-
bility (using games!), dataflow analysis, Symbolic methods for
reachability: Boolean Decision Diagrams, operations on BDDs,
the tools SMV, CTL and CTL model-checking symbolically;
mu-calculus, Software verification: The Floyd-Hoare method
for verifying code, Invariant verification using automatic theo-
rem provers, Satisfiability solvers (SAT solvers); bounded model
checking and testing. Abstraction based model checking, miscel-
laneous topics, Decidable logics and overview of available theo-
rem provers, Predicate abstraction and abstract interpretation,
Handling heaps, Concurrency.
Today’s Objective 5
Today’s Objective
1 □(try_to_send → ⃝delivered)
Next ⃝, until U and eventually ♢ 15
1 □(try_to_send → ⃝delivered)
2 □(try_to_send → try_to_sendUdelivered)
Next ⃝, until U and eventually ♢ 16
1 □(try_to_send → ⃝delivered)
2 □(try_to_send → try_to_sendUdelivered)
3 □(try_to_send → ♢delivered)
neXt Operator 17
neXt Operator
Finally or Eventually
sad ⇒ ♢happy
send ⇒ ♢receive
Some Examples: Safety Properties 19
Safety Properties
G(¬(train_arriving ∧ bar_up))
OR
□(¬(train_arriving ∧ bar_up))
Some Examples: Safety Properties 20
Safety Properties
G(¬(train_arriving ∧ bar_up))
OR
□(¬(train_arriving ∧ bar_up))
Safety Properties
G(¬(train_arriving ∧ bar_up))
OR
□(¬(train_arriving ∧ bar_up))
3
□¬((x = 0) ∧ ⃝ ⃝ ⃝(y = z/x))
Some Examples: Liveness Properties 22
Liveness Properties
G(input → Foutput)
OR
□(input → ♢output)
Some Examples: Liveness Properties 23
Liveness Properties
G(input → Foutput)
OR
□(input → ♢output)
2
♢(x > 5)
Some Examples: Liveness Properties 24
Liveness Properties
G(input → Foutput)
OR
□(input → ♢output)
2
♢(x > 5)
3
□(start ⇒ ♢terminate)
Some Examples: Liveness Properties 25
Liveness Properties
G(input → Foutput)
OR
□(input → ♢output)
2
♢(x > 5)
3
□(start ⇒ ♢terminate)
4
□(trying ⇒ ♢Critical)
Some Examples: Fairness 26
Fairness Properties
GFsend
Strong Fairness Properties 27
GFsend → GFrecv
OR
□♢send → □♢recv
2
□♢ready ⇒ □♢run
Equivalences in LTL Temporal Operators 28
Equivalences in LTL
¬□φ ≡ ♢¬φ
♢ ≡ ⊤U φ
U and ⃝ Representation
1 ♢ distributes over ∨
♢(φ ∨ ψ) ≡ ♢φ ∨ ♢ψ
2 □ distributes over ∧
□(φ ∧ ψ) ≡ □φ ∧ ♢ψ
Negated Normal Form 30
¬ ⃝ φ ≡ ⃝¬φ
π = s0 → s1 → · · · → st → st+1 → . . .
φ = Fdone
LTL Formal Semantics II 39
Example
φ = Fdone
LTL Formal Semantics 40
π, si |= a if f a ∈ L(si )
π, si |= ¬φ if f π, si ̸|= φ
π, si |= φ ∧ ψ if f π, si |= φ and π, si |= ψ
π, si |= Xφ if f π, si+1 |= φ
π, si |= Fφ if f f or some j ≥ i : π, sj |= φ
π, si |= Gφ if f f or all j ≥ i : π, sj |= φ
π, si |= φUψ if f f or some j ≥ i : (π, sj |= ψ and
f or all k s.t. i ≤ k < j :πsk |= φ)
Example: Semantics of LTL 41
start s1 s2 s3 start
AP = {a, b}
e.g. T S |= □a (or T S |= Ga) : all states are labeled with a
T hus, si |= □a f or i = 1, 2, 3
s1 |= ⃝(a ∧ b) since s2 |= a ∧ b and s2 is the only successor of s1
s2 ̸|= ⃝(a ∧ b) ands3 ̸|= (a ∧ b)
as s3 ∈ P ost(s2 ), s3 ∈ P ost(s3 ) and s3 ̸|= a ∧ b
TS ̸|= ⃝(a ∧ b) as s3 is an initial state f or which s3 ̸|= ⃝(a ∧ b)
Another Example 42
Another Example
start s1 s2 s3 start
Note
(s1 s2 )∗ sw
3 satisf ies b ∪ (a ∧ ¬b)
Practical properties in LTL 43
Reachability
• simple reachability ♢ψ
• conditional reachability φ∪ψ
Safety
• invariant □φ
Liveness □(φ ⇒ ♢ψ) and others
Fairness □♢φ and others
Length of a Formula 44
Length of a Formula
Example
1 For instance, the length of the formula true and a ∈ AP is 0
2 Formulae ⃝a ∨ b and a ∨ ¬b have length 2, and
3 (⃝a) ∪ (a ∧ ¬b) has length 4.
Semantics over words 45
W ords(φ) = {σ ∈ (2AP )ω |σ |= φ}
NOTE
Note that in the definition of the semantics of LTL-formulae the
word fragment σ[j . . . ] cannot be replaced with Aj .
LTL Semantics for infinite words over 2AP I 47
σ |= true
σ |= a if f a ∈ A0 (i.e.A0 |= a)
σ |= φ1 ∧ φ2 if f σ |= φ1 and σ |= φ2
σ |= ¬φ if f σ ̸|= φ
σ |= ⃝φ if f σ[1..] = A1 A2 A3 . . . |= φ
σ |= φ1 ∪ φ2 if f ∃j ⩾ 0 σ[j..] |= φ2 and σ[i..] |= φ1 , f or all 0 ⩽ i < j
LTL Semantics for infinite words over 2AP II 48
σ |= ψ if f ∃j ≥ 0 : σ[j..] |= ψ
σ |= Gψ if f ∀j ≥ 0 : σ[j..] |= ψ
σ |= GF ψ if f ∀j ≥ 0∃i ≥ j : σ[i..] |= ψ
σ |= F Gψ if f ∃j ≥ 0∀i ≥ j : σ[i..] |= ψ
Semantics over paths, states, and transition systems 49
π |= φ if f trace(π) |= φ
s |= φ if f ∀π ∈ P aths(s) |= φ
σ |= ♢φ if f ∃j ⩾ 0 : σ[j..] |= φ
σ |= □φ if f ∀j ⩾ 0 : σ[j..] |= φ
Semantics of Negation
Semantics of Negation
T S ̸|= φ ̸≡ T S |= ¬φ
T S |= ¬φ ⇒ T S ̸|= φ
Note that
Semantics of Negation
π1 |= φ and π2 |= ¬φ
References 54