Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Model Checking
Computation Tree Logic
[Baier & Katoen, Chapter 6.1–6.3]
Overview
1 Branching-Time Logic
2 CTL Syntax
3 CTL Semantics
4 CTL Equivalence
7 Summary
Overview
1 Branching-Time Logic
2 CTL Syntax
3 CTL Semantics
4 CTL Equivalence
7 Summary
Overview
1 Branching-Time Logic
2 CTL Syntax
3 CTL Semantics
4 CTL Equivalence
7 Summary
CTL Syntax
Definition: Syntax Computation Tree Logic
▶ CTL state-formulas with a ∈ AP obey the grammar:
» » »» » »
Φ ∶∶= true »»»» a »»»» Φ1 ∧ Φ2 »» ¬Φ »»» ∃ϕ »»» ∀ϕ
»» »» »»
» »
▶ and ϕ is a path-formula formed by the grammar:
»
ϕ ∶∶= ◯ Φ »»»» Φ1 U Φ2 .
»
CTL Syntax
Definition: Syntax Computation Tree Logic
▶ CTL state-formulas with a ∈ AP obey the grammar:
» » »» » »
Φ ∶∶= true »»»» a »»»» Φ1 ∧ Φ2 »» ¬Φ »»» ∃ϕ »»» ∀ϕ
»» »» »»
» »
▶ and ϕ is a path-formula formed by the grammar:
»
ϕ ∶∶= ◯ Φ »»»» Φ1 U Φ2 .
»
Intuition
▶ s ⊧ ∀ϕ if all paths starting in s fulfill ϕ
▶ s ⊧ ∃ϕ if some path starting in s fulfill ϕ
potentially Φ: ∃◇ Φ = ∃(true U Φ)
inevitably Φ: ∀◇ Φ = ∀(true U Φ)
potentially Φ: ∃◇ Φ = ∃(true U Φ)
inevitably Φ: ∀◇ Φ = ∀(true U Φ)
potentially Φ: ∃◇ Φ = ∃(true U Φ)
inevitably Φ: ∀◇ Φ = ∀(true U Φ)
potentially Φ: ∃◇ Φ = ∃(true U Φ)
inevitably Φ: ∀◇ Φ = ∀(true U Φ)
Overview
1 Branching-Time Logic
2 CTL Syntax
3 CTL Semantics
4 CTL Equivalence
7 Summary
CTL Semantics
π ⊧ ◯Φ iff π[1] ⊧ Φ
π ⊧ ΦUΨ iff (∃ j ≥ 0. π[j] ⊧ Ψ and (∀ 0 ≤ i < j. π[i] ⊧ Φ))
Sat(Φ) = { s ∈ S ∣ s ⊧ Φ }
/ Φ is not equivalent to TS ⊧ ¬Φ
▶ Point of attention: TS ⊧
/ ∃□Φ
′
because of several initial states, e.g., s0 ⊧ ∃□Φ and s0 ⊧
Semantics of ◯ -Operator
Semantics of ◯ -Operator
Example
Example
Infinitely Often
For Φ = a ∈ AP we get
Example
Overview
1 Branching-Time Logic
2 CTL Syntax
3 CTL Semantics
4 CTL Equivalence
7 Summary
CTL Equivalence
Equivalently,
Duality
∀◯ Φ ≡ ¬∃◯ ¬Φ
∃◯ Φ ≡ ¬∀◯ ¬Φ
∀◇ Φ ≡ ¬∃□¬Φ
∃◇ Φ ≡ ¬∀□¬Φ
Distributive Laws
∃◇ (Φ ∨ Ψ) ≡ ∃◇ Φ ∨ ∃◇ Ψ
But: ∀◇ (Φ ∨ Ψ) ≡
/ ∀◇ Φ ∨ ∀◇ Ψ
Distributive Laws
∃◇ (Φ ∨ Ψ) ≡ ∃◇ Φ ∨ ∃◇ Ψ
But: ∀◇ (Φ ∨ Ψ) ≡
/ ∀◇ Φ ∨ ∀◇ Ψ
∃□(Φ ∧ Ψ) ≡
/ ∃□Φ ∧ ∃□Ψ
Expansion Laws
Recall in LTL: ϕ U ψ ≡ ψ ∨ (ϕ ∧ ◯ (ϕ U ψ))
Expansion Laws
Recall in LTL: ϕ U ψ ≡ ψ ∨ (ϕ ∧ ◯ (ϕ U ψ))
Overview
1 Branching-Time Logic
2 CTL Syntax
3 CTL Semantics
4 CTL Equivalence
7 Summary
TS ⊧ Φ if and only if TS ⊧ ϕ.
Examples
▶ “Next a”: ∀◯ a ≡ ◯ a
▶ “Eventually a”: ∀◇ a ≡ ◇a
▶ “Infinitely often a”: ∀□∀◇ a ≡ □ ◇ a
Examples
▶ ∀◯ a ↦
▶ ∀◇ (a ∧ ∀◯ a) ↦
▶ ∀□∀◇ a ↦
▶ ∀□∃◇ a ↦
Proof.
We show that ∀◇(a ∧ ∀◯ a) /
≡ ◇ (a ∧ ◯ a) .
ÍÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò ÑÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ï ÍÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ñ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ï
CTL-formula Φ Φ with path-quantifiers removed
s0 ⊧ ◇ (a ∧ ◯ a) but s0 ⊧ / ∀◇ (a ∧ ∀◯ a) .
ÍÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò ÒÑÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ï
path s0 s1 (s2 )ω violates it
Joost-Pieter Katoen and Tim Quatmann Lecture #10 34/53
Computational Tree Logic Expressiveness of LTL versus CTL
Proof.
We show that: ∀◇∀□a is not equivalent to ◇□ a.
s0 ⊧ ◇ □ a but s0 ⊧ / ∀◇ ∀□a
ÍÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò ÑÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ï
path s0ω violates it
Proof.
▶ This is shown by contraposition: assume ϕ ≡ ∀□∃◇a; let TS:
Proof.
′
Provide two series of transition systems TSn and TSn for n = 0, 1, 2, . . .
(see next slide) such that:
/ ◇□a and TSn ⊧ ◇□ a (*), and
′
▶ TSn ⊧
▶ For any CTL-formula Φ with ∣Φ∣ ≤ n ∶ TSn ⊧ Φ iff TS′n ⊧ Φ (**)
proof by induction on n (omitted here)
Proof by contraposition.
Assume there is a CTL-formula Φ ≡ ◇□a with ∣Φ∣ = n for some n
/ Φ and TSn ⊧ Φ
′
▶ by (*), it follows TSn ⊧
▶ but this contradicts (**): TSn ⊧ Φ if and only if TS′n ⊧ Φ
Proof
Overview
1 Branching-Time Logic
2 CTL Syntax
3 CTL Semantics
4 CTL Equivalence
7 Summary
∗
Syntax of CTL
∗
Definition: Syntax CTL
▶ CTL∗ state-formulas with a ∈ AP obey the grammar:
» » »» »»
Φ ∶∶= true »»»» a »»»» Φ1 ∧ Φ2 »»
»» ¬Φ »» ∃ϕ
»»
» »
▶ and ϕ is a CTL∗ path-formula formed by the grammar:
» »» » »»
ϕ ∶∶= Φ »»»» ϕ1 ∧ ϕ2 »» ¬ϕ »»» ◯ ϕ
»» »»
»» ϕ1 U ϕ2
»»
»
∗
where Φ is a CTL state-formula, and ϕ, ϕ1 and ϕ2 are
path-formulas.
∗
in CTL : ∀ϕ = ¬∃¬ϕ. This does not hold in CTL.
∗
CTL Semantics
s ⊧ true
s⊧a iff a ∈ L(s)
s⊧Φ∧Ψ iff (s ⊧ Φ) and (s ⊧ Ψ)
s ⊧ ¬Φ iff not s ⊧ Φ
s ⊧ ∃ϕ iff π ⊧ ϕ for some π ∈ Paths(s)
∗
CTL Semantics
s ⊧ true
s⊧a iff a ∈ L(s)
s⊧Φ∧Ψ iff (s ⊧ Φ) and (s ⊧ Ψ)
s ⊧ ¬Φ iff not s ⊧ Φ
s ⊧ ∃ϕ iff π ⊧ ϕ for some π ∈ Paths(s)
∗
CTL Transition System Semantics
Sat(Φ) = { s ∈ S ∣ s ⊧ Φ }
Embedding LTL
For LTL formula ϕ and TS without terminal states (both over AP) and for
each s ∈ S:
s ⊧ ϕ if and only if s ⊧ ∀ϕ
ÍÒÒ Ò Ò Ò Ò Ò Ò ÒÑÒ Ò Ò Ò Ò Ò Ò Ò Ï ÍÒÒ ∗Ò Ò Ò Ò Ò Ò Ò Ò Ò ÒÑÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ï
LTL semantics CTL semantics
In particular:
∗
CTL Is More Expressive Than LTL And CTL
Φ = (∀◇ □ a) ∨ (∀□∃◇b)
∗
Relating LTL, CTL, and CTL
+
Definition: Syntax CTL
▶ CTL+ state-formulas with a ∈ AP obey the grammar:
» » »» » »
Φ ∶∶= true »»»» a »»»» Φ1 ∧ Φ2 »» ¬Φ »»» ∃ϕ »»» ∀ϕ
»» »» »»
» »
▶ and ϕ is a CTL+ path-formula formed by the grammar:
»» » »»
ϕ ∶∶= ϕ1 ∧ ϕ2 »» ¬ϕ »»» ◯ Φ »» Φ1 U Φ2
»» »» »»
+
where Φ, Φ1 and Φ2 are CTL state-formulas and ϕ1 and ϕ2 are
+
CTL path-formulas.
+
CTL Is As Expressive As CTL
For example:
∃(◇a ∧ ◇b) ≡ ∃◇ (a ∧ ∃◇ b) ∧ ∃◇ (b ∧ ∃◇ a)
ÍÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò+Ò Ò ÒÑÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò ÒÏ ÍÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò ÑÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò ÒÏ
CTL formula CTL formula
+
Rules for transforming CTL formulas into equivalent CTL ones:
+
From CTL To CTL
Overview
1 Branching-Time Logic
2 CTL Syntax
3 CTL Semantics
4 CTL Equivalence
7 Summary
Summary
▶ Computation tree logic (CTL) is a logic interpreted over infinite trees
Next Lecture