Sei sulla pagina 1di 66

Computational Tree Logic

Model Checking
Computation Tree Logic
[Baier & Katoen, Chapter 6.1–6.3]

Joost-Pieter Katoen and Tim Quatmann

Software Modeling and Verification Group

RWTH Aachen, SoSe 2022

Joost-Pieter Katoen and Tim Quatmann Lecture #10 1/53


Computational Tree Logic

Overview

1 Branching-Time Logic

2 CTL Syntax

3 CTL Semantics

4 CTL Equivalence

5 Expressiveness of LTL versus CTL


∗ +
6 CTL and CTL

7 Summary

Joost-Pieter Katoen and Tim Quatmann Lecture #10 2/53


Computational Tree Logic Branching-Time Logic

Overview

1 Branching-Time Logic

2 CTL Syntax

3 CTL Semantics

4 CTL Equivalence

5 Expressiveness of LTL versus CTL


∗ +
6 CTL and CTL

7 Summary

Joost-Pieter Katoen and Tim Quatmann Lecture #10 3/53


Computational Tree Logic Branching-Time Logic

Linear Time Versus Branching Time

Joost-Pieter Katoen and Tim Quatmann Lecture #10 4/53


Computational Tree Logic Branching-Time Logic

Linear Time Versus Branching Time

▶ Linear Temporal Logic (LTL) is interpreted over infinite sequences


ÍÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ñ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ï
traces
▶ Traces are obtained from paths in a transition system.

Joost-Pieter Katoen and Tim Quatmann Lecture #10 5/53


Computational Tree Logic Branching-Time Logic

Linear Time Versus Branching Time

▶ Linear Temporal Logic (LTL) is interpreted over infinite sequences


ÍÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ñ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ï
traces
▶ Traces are obtained from paths in a transition system.

▶ Computation Tree Logic (CTL) is interpreted over infinite trees


ÍÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò ÑÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò ÒÏ
computation trees
▶ Computation trees are infinite trees whose nodes are labelled with
sets of propositions
▶ They are obtained by unfolding a transition system

▶ Such trees keep track of branching between several traces

Joost-Pieter Katoen and Tim Quatmann Lecture #10 5/53


Computational Tree Logic Branching-Time Logic

Unfolding a Transition System

Joost-Pieter Katoen and Tim Quatmann Lecture #10 6/53


Computational Tree Logic Branching-Time Logic

Linear Time Versus Branching Time

Joost-Pieter Katoen and Tim Quatmann Lecture #10 7/53


Computational Tree Logic CTL Syntax

Overview

1 Branching-Time Logic

2 CTL Syntax

3 CTL Semantics

4 CTL Equivalence

5 Expressiveness of LTL versus CTL


∗ +
6 CTL and CTL

7 Summary

Joost-Pieter Katoen and Tim Quatmann Lecture #10 8/53


Computational Tree Logic CTL Syntax

Computation Tree Logic

Edmund M. Clarke, Jr. E. Allen Emerson


(1945–2020) (1954–)

Joost-Pieter Katoen and Tim Quatmann Lecture #10 9/53


Computational Tree Logic CTL Syntax

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 .
»

Example CTL State-formulas


▶ ∀□∃◯ a
▶ ∃(∀□a) U b

Joost-Pieter Katoen and Tim Quatmann Lecture #10 10/53


Computational Tree Logic CTL Syntax

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 ϕ

Joost-Pieter Katoen and Tim Quatmann Lecture #10 10/53


Computational Tree Logic CTL Syntax

Derived CTL Operators

potentially Φ: ∃◇ Φ = ∃(true U Φ)
inevitably Φ: ∀◇ Φ = ∀(true U Φ)

Joost-Pieter Katoen and Tim Quatmann Lecture #10 11/53


Computational Tree Logic CTL Syntax

Derived CTL Operators

potentially Φ: ∃◇ Φ = ∃(true U Φ)
inevitably Φ: ∀◇ Φ = ∀(true U Φ)

potentially always Φ: ∃□Φ ∶= ¬∀◇ ¬Φ


invariantly Φ: ∀□ Φ = ¬∃◇ ¬Φ

Joost-Pieter Katoen and Tim Quatmann Lecture #10 11/53


Computational Tree Logic CTL Syntax

Derived CTL Operators

potentially Φ: ∃◇ Φ = ∃(true U Φ)
inevitably Φ: ∀◇ Φ = ∀(true U Φ)

potentially always Φ: ∃□Φ ∶= ¬∀◇ ¬Φ


invariantly Φ: ∀□ Φ = ¬∃◇ ¬Φ

weak until: ∃(Φ W Ψ) = ¬∀((Φ ∧ ¬Ψ) U (¬Φ ∧ ¬Ψ))


∀(Φ W Ψ) = ¬∃((Φ ∧ ¬Ψ) U (¬Φ ∧ ¬Ψ))

Joost-Pieter Katoen and Tim Quatmann Lecture #10 11/53


Computational Tree Logic CTL Syntax

Derived CTL Operators

potentially Φ: ∃◇ Φ = ∃(true U Φ)
inevitably Φ: ∀◇ Φ = ∀(true U Φ)

potentially always Φ: ∃□Φ ∶= ¬∀◇ ¬Φ


invariantly Φ: ∀□ Φ = ¬∃◇ ¬Φ

weak until: ∃(Φ W Ψ) = ¬∀((Φ ∧ ¬Ψ) U (¬Φ ∧ ¬Ψ))


∀(Φ W Ψ) = ¬∃((Φ ∧ ¬Ψ) U (¬Φ ∧ ¬Ψ))

The Boolean connectives are derived as usual

Joost-Pieter Katoen and Tim Quatmann Lecture #10 11/53


Computational Tree Logic CTL Syntax

Intuitive CTL Semantics

Joost-Pieter Katoen and Tim Quatmann Lecture #10 12/53


Computational Tree Logic CTL Syntax

Intuitive CTL Semantics

Joost-Pieter Katoen and Tim Quatmann Lecture #10 13/53


Computational Tree Logic CTL Syntax

Example CTL Formulas


▶ Mutual Exclusion over AP = {crit1 , crit2 }

▶ Starvation Freedom over AP = {req, resp}

▶ “A reset is always possible” over AP = {start}

Joost-Pieter Katoen and Tim Quatmann Lecture #10 14/53


Computational Tree Logic CTL Semantics

Overview

1 Branching-Time Logic

2 CTL Syntax

3 CTL Semantics

4 CTL Equivalence

5 Expressiveness of LTL versus CTL


∗ +
6 CTL and CTL

7 Summary

Joost-Pieter Katoen and Tim Quatmann Lecture #10 15/53


Computational Tree Logic CTL Semantics

CTL Semantics

Define a satisfaction relation for CTL-formulas over AP for a given


transition system TS without terminal states.
Two parts:

▶ Interpretation of state-formulas over states of TS

▶ Interpretation of path-formulas over paths of TS

Joost-Pieter Katoen and Tim Quatmann Lecture #10 16/53


Computational Tree Logic CTL Semantics

CTL Semantics (1)


Notation
TS, s ⊧ Φ if and only if state-formula Φ holds in state s of transition
system TS. As TS is known from the context we simply write s ⊧ Φ.

Definition: Satisfaction relation for CTL state-formulas


The satisfaction relation ⊧ is defined for CTL state-formulas by:

s⊧a iff a ∈ L(s)


s ⊧ ¬Φ iff not (s ⊧ Φ)
s⊧Φ ∧ Ψ iff (s ⊧ Φ) and (s ⊧ Ψ)

Joost-Pieter Katoen and Tim Quatmann Lecture #10 17/53


Computational Tree Logic CTL Semantics

CTL Semantics (1)


Notation
TS, s ⊧ Φ if and only if state-formula Φ holds in state s of transition
system TS. As TS is known from the context we simply write s ⊧ Φ.

Definition: Satisfaction relation for CTL state-formulas


The satisfaction relation ⊧ is defined for CTL state-formulas by:

s⊧a iff a ∈ L(s)


s ⊧ ¬Φ iff not (s ⊧ Φ)
s⊧Φ ∧ Ψ iff (s ⊧ Φ) and (s ⊧ Ψ)
s ⊧ ∃ϕ iff there exists π ∈ Paths(s). π ⊧ ϕ
s ⊧ ∀ϕ iff for all π ∈ Paths(s). π ⊧ ϕ

where the semantics of CTL path-formulas is defined on the next slide.

Joost-Pieter Katoen and Tim Quatmann Lecture #10 17/53


Computational Tree Logic CTL Semantics

CTL Semantics (2)

Definition: satisfaction relation for CTL path-formulas


Given path π and CTL path-formula ϕ, the satisfaction relation ⊧ where
π ⊧ ϕ if and only if path π satisfies ϕ is defined as follows:

π ⊧ ◯Φ iff π[1] ⊧ Φ
π ⊧ ΦUΨ iff (∃ j ≥ 0. π[j] ⊧ Ψ and (∀ 0 ≤ i < j. π[i] ⊧ Φ))

where π[i] denotes the state si in the path π = s0 s1 s2 . . ..

Joost-Pieter Katoen and Tim Quatmann Lecture #10 18/53


Computational Tree Logic CTL Semantics

Transition System Semantics

▶ For CTL-state-formula Φ, the satisfaction set Sat(Φ) is defined by:

Sat(Φ) = { s ∈ S ∣ s ⊧ Φ }

▶ TS satisfies CTL-formula Φ iff Φ holds in all its initial states:

TS ⊧ Φ if and only if ∀s0 ∈ I. s0 ⊧ Φ

/ Φ is not equivalent to TS ⊧ ¬Φ
▶ Point of attention: TS ⊧
/ ∃□Φ

because of several initial states, e.g., s0 ⊧ ∃□Φ and s0 ⊧

Joost-Pieter Katoen and Tim Quatmann Lecture #10 19/53


Computational Tree Logic CTL Semantics

Semantics of ◯ -Operator

s ⊧ ∃◯ Φ iff ∃π = s s1 s2 . . . ∈ Paths(s). π ⊧ ◯ Φ, that is: s1 ⊧ Φ

Joost-Pieter Katoen and Tim Quatmann Lecture #10 20/53


Computational Tree Logic CTL Semantics

Semantics of ◯ -Operator

s ⊧ ∃◯ Φ iff ∃π = s s1 s2 . . . ∈ Paths(s). π ⊧ ◯ Φ, that is: s1 ⊧ Φ

s ⊧ ∀◯ Φ iff ∀π = s s1 s2 . . . ∈ Paths(s). π ⊧ ◯ Φ, that is: s1 ⊧ Φ

Joost-Pieter Katoen and Tim Quatmann Lecture #10 20/53


Computational Tree Logic CTL Semantics

Example

Joost-Pieter Katoen and Tim Quatmann Lecture #10 21/53


Computational Tree Logic CTL Semantics

Example

Joost-Pieter Katoen and Tim Quatmann Lecture #10 21/53


Computational Tree Logic CTL Semantics

Infinitely Often

s ⊧ ∀□∀◇ Φ iff ∀π ∈ Paths(s) a Φ-state is visited infinitely often.

For Φ = a ∈ AP we get

s ⊧ ∀□∀◇ a iff s ⊧□◇a


ÍÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò ÒÑÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ï ÍÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ñ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò ÒÏ
CTL LTL

Joost-Pieter Katoen and Tim Quatmann Lecture #10 22/53


Computational Tree Logic CTL Semantics

Example

(1) Does TS ⊧ ∃◯∀□¬a?

(2) Does TS ⊧ ∀□∃◯ ¬a?

Joost-Pieter Katoen and Tim Quatmann Lecture #10 23/53


Computational Tree Logic CTL Equivalence

Overview

1 Branching-Time Logic

2 CTL Syntax

3 CTL Semantics

4 CTL Equivalence

5 Expressiveness of LTL versus CTL


∗ +
6 CTL and CTL

7 Summary

Joost-Pieter Katoen and Tim Quatmann Lecture #10 24/53


Computational Tree Logic CTL Equivalence

CTL Equivalence

Definition: CTL equivalence


CTL-formulas Φ and Ψ (both over AP) are equivalent:

Φ ≡CTL Ψ if and only if Sat(Φ) = Sat(Ψ) for any TS (over AP)

If it is clear from the context that we deal with CTL-formulas, we simply


write Φ ≡ Ψ.

Equivalently,

Φ ≡Ψ iff ( ∀TS . TS ⊧ Φ iff TS ⊧ Ψ )

Joost-Pieter Katoen and Tim Quatmann Lecture #10 25/53


Computational Tree Logic CTL Equivalence

Duality

∀◯ Φ ≡ ¬∃◯ ¬Φ

∃◯ Φ ≡ ¬∀◯ ¬Φ

∀◇ Φ ≡ ¬∃□¬Φ

∃◇ Φ ≡ ¬∀□¬Φ

∀(Φ U Ψ) ≡ ¬∃((Φ ∧ ¬Ψ) W (¬Φ ∧ ¬Ψ))

Joost-Pieter Katoen and Tim Quatmann Lecture #10 26/53


Computational Tree Logic CTL Equivalence

Distributive Laws

∀□(Φ ∧ Ψ) ≡ ∀□Φ ∧ ∀□Ψ

∃◇ (Φ ∨ Ψ) ≡ ∃◇ Φ ∨ ∃◇ Ψ

But: ∀◇ (Φ ∨ Ψ) ≡
/ ∀◇ Φ ∨ ∀◇ Ψ

Joost-Pieter Katoen and Tim Quatmann Lecture #10 27/53


Computational Tree Logic CTL Equivalence

Distributive Laws

∀□(Φ ∧ Ψ) ≡ ∀□Φ ∧ ∀□Ψ

∃◇ (Φ ∨ Ψ) ≡ ∃◇ Φ ∨ ∃◇ Ψ

But: ∀◇ (Φ ∨ Ψ) ≡
/ ∀◇ Φ ∨ ∀◇ Ψ

∃□(Φ ∧ Ψ) ≡
/ ∃□Φ ∧ ∃□Ψ

Joost-Pieter Katoen and Tim Quatmann Lecture #10 27/53


Computational Tree Logic CTL Equivalence

Duality ◯ and □ — Correct or Wrong?

Joost-Pieter Katoen and Tim Quatmann Lecture #10 28/53


Computational Tree Logic CTL Equivalence

Duality ◯ and □ — Correct or Wrong?

Joost-Pieter Katoen and Tim Quatmann Lecture #10 28/53


Computational Tree Logic CTL Equivalence

Duality ◯ and □ — Correct or Wrong?

Joost-Pieter Katoen and Tim Quatmann Lecture #10 28/53


Computational Tree Logic CTL Equivalence

Expansion Laws
Recall in LTL: ϕ U ψ ≡ ψ ∨ (ϕ ∧ ◯ (ϕ U ψ))

Joost-Pieter Katoen and Tim Quatmann Lecture #10 29/53


Computational Tree Logic CTL Equivalence

Expansion Laws
Recall in LTL: ϕ U ψ ≡ ψ ∨ (ϕ ∧ ◯ (ϕ U ψ))

CTL expansion laws


For any CTL-formula Φ and Ψ:

∀(Φ U Ψ) ≡ Ψ ∨ (Φ ∧ ∀◯ ∀(Φ U Ψ))


∀◇ Φ ≡ Φ ∨ ∀◯ ∀◇ Φ
∀□Φ ≡ Φ ∧ ∀◯ ∀□Φ

∃(Φ U Ψ) ≡ Ψ ∨ (Φ ∧ ∃◯ ∃(Φ U Ψ))


∃◇ Φ ≡ Φ ∨ ∃◯ ∃◇ Φ
∃□Φ ≡ Φ ∧ ∃◯ ∃□Φ

Joost-Pieter Katoen and Tim Quatmann Lecture #10 29/53


Computational Tree Logic Expressiveness of LTL versus CTL

Overview

1 Branching-Time Logic

2 CTL Syntax

3 CTL Semantics

4 CTL Equivalence

5 Expressiveness of LTL versus CTL


∗ +
6 CTL and CTL

7 Summary

Joost-Pieter Katoen and Tim Quatmann Lecture #10 30/53


Computational Tree Logic Expressiveness of LTL versus CTL

Equivalence of CTL and LTL Formulas


Definition: equivalence of LTL and CTL formulas
CTL-formula Φ and LTL-formula ϕ (both over AP) are equivalent,
denoted Φ ≡ ϕ, if for any transition system TS (over AP):

TS ⊧ Φ if and only if TS ⊧ ϕ.

Examples
▶ “Next a”: ∀◯ a ≡ ◯ a
▶ “Eventually a”: ∀◇ a ≡ ◇a
▶ “Infinitely often a”: ∀□∀◇ a ≡ □ ◇ a

What about e.g. ∀◇ (a ∧ ∀◯ a) ≡ . . . ?

Joost-Pieter Katoen and Tim Quatmann Lecture #10 31/53


Computational Tree Logic Expressiveness of LTL versus CTL

LTL and CTL are Incomparable

▶ Some LTL-formulas cannot be expressed in CTL, e.g.,


▶ ◇□ a
▶ ◇ (a ∧ ◯ a)
There does not exist an equivalent CTL formula

▶ Some CTL-formulas cannot be expressed in LTL, e.g.,


▶ ∀◇∀□a
▶ ∀◇ (a ∧ ∀◯ a), and
▶ ∀□∃◇ a
There does not exist an equivalent LTL formula

How to prove this formally?

Joost-Pieter Katoen and Tim Quatmann Lecture #10 32/53


Computational Tree Logic Expressiveness of LTL versus CTL

From CTL to LTL

[Clarke & Draghicescu]

Let Φ be a CTL-formula, and ϕ the LTL-formula obtained by eliminating


all path quantifiers in Φ. Then:

either Φ ≡ ϕ or there is no LTL-formula equivalent to Φ.

Examples
▶ ∀◯ a ↦
▶ ∀◇ (a ∧ ∀◯ a) ↦
▶ ∀□∀◇ a ↦
▶ ∀□∃◇ a ↦

Joost-Pieter Katoen and Tim Quatmann Lecture #10 33/53


Computational Tree Logic Expressiveness of LTL versus CTL

From CTL To LTL (1)

CTL-formula ∀◇(a ∧ ∀◯ a) cannot be expressed in LTL.

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

From CTL To LTL (2)

∀◇∀□a cannot be expressed in LTL.

Proof.
We show that: ∀◇∀□a is not equivalent to ◇□ a.

s0 ⊧ ◇ □ a but s0 ⊧ / ∀◇ ∀□a
ÍÒÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò ÑÒ Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ò Ï
path s0ω violates it

Joost-Pieter Katoen and Tim Quatmann Lecture #10 35/53


Computational Tree Logic Expressiveness of LTL versus CTL

From CTL To LTL (3)

The CTL-formula ∀□∃◇a cannot be expressed in LTL.

Proof.
▶ This is shown by contraposition: assume ϕ ≡ ∀□∃◇a; let TS:

▶ TS ⊧ ∀□∃◇a, and thus—by assumption—TS ⊧ ϕ


▶ Remove state t. Then: Paths(TS′ ) ⊆ Paths(TS), thus TS′ ⊧ ϕ
ω
/ ∀□∃◇a as path s ⊧
▶ But TS′ ⊧ / □∃◇a

Joost-Pieter Katoen and Tim Quatmann Lecture #10 36/53


Computational Tree Logic Expressiveness of LTL versus CTL

From LTL To CTL

The LTL-formula ◇□ a cannot be expressed in CTL.

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 ⊧ Φ

Joost-Pieter Katoen and Tim Quatmann Lecture #10 37/53


Computational Tree Logic Expressiveness of LTL versus CTL

Proof

Joost-Pieter Katoen and Tim Quatmann Lecture #10 38/53


Computational Tree Logic Expressiveness of LTL versus CTL

LTL Versus CTL

Joost-Pieter Katoen and Tim Quatmann Lecture #10 39/53


∗ +
Computational Tree Logic CTL and CTL

Overview

1 Branching-Time Logic

2 CTL Syntax

3 CTL Semantics

4 CTL Equivalence

5 Expressiveness of LTL versus CTL


∗ +
6 CTL and CTL

7 Summary

Joost-Pieter Katoen and Tim Quatmann Lecture #10 40/53


∗ +
Computational Tree Logic CTL and CTL


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.

Joost-Pieter Katoen and Tim Quatmann Lecture #10 41/53


∗ +
Computational Tree Logic CTL and 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)

Joost-Pieter Katoen and Tim Quatmann Lecture #10 42/53


∗ +
Computational Tree Logic CTL and 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)

π⊧Φ iff π[0] ⊧ Φ


π ⊧ ϕ1 ∧ ϕ2 iff π ⊧ ϕ1 and π ⊧ ϕ2
π ⊧ ¬ϕ iff /ϕ
π⊧
π ⊧ ◯ϕ iff π[1..] ⊧ ϕ
π ⊧ ϕ1 U ϕ2 iff ∃ j ≥ 0. (π[j..] ⊧ ϕ2 ∧ (∀ 0 ≤ i < j. π[i..] ⊧ ϕ1 ))
Joost-Pieter Katoen and Tim Quatmann Lecture #10 42/53
∗ +
Computational Tree Logic CTL and CTL


CTL Transition System Semantics

▶ For CTL∗ -state-formula Φ, the satisfaction set Sat(Φ) is defined by:

Sat(Φ) = { s ∈ S ∣ s ⊧ Φ }

▶ TS satisfies CTL∗ -formula Φ iff Φ holds in all its initial states:

TS ⊧ Φ if and only if ∀s0 ∈ I. s0 ⊧ Φ

This is exactly as for CTL

Joost-Pieter Katoen and Tim Quatmann Lecture #10 43/53


∗ +
Computational Tree Logic CTL and CTL

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:

TS ⊧LTL ϕ if and only if TS ⊧CTL∗ ∀ϕ

Joost-Pieter Katoen and Tim Quatmann Lecture #10 44/53


∗ +
Computational Tree Logic CTL and CTL


CTL Is More Expressive Than LTL And CTL

The CTL -formula over AP = { a, b }:


Φ = (∀◇ □ a) ∨ (∀□∃◇b)

can neither be expressed in LTL nor in CTL.

Joost-Pieter Katoen and Tim Quatmann Lecture #10 45/53


∗ +
Computational Tree Logic CTL and CTL


Relating LTL, CTL, and CTL

Joost-Pieter Katoen and Tim Quatmann Lecture #10 46/53


∗ +
Computational Tree Logic CTL and CTL

Boolean Combinations of Path Formulas

+
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.

Joost-Pieter Katoen and Tim Quatmann Lecture #10 47/53


∗ +
Computational Tree Logic CTL and CTL

Adding Boolean combinations of path formulae to CTL


does not change its expressiveness
+
but CTL formulae can be much shorter than their equivalent in CTL

Joost-Pieter Katoen and Tim Quatmann Lecture #10 48/53


∗ +
Computational Tree Logic CTL and CTL

+
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:

∃(¬(Φ1 U Φ2 )) ≡ ∃( (Φ1 ∧ ¬Φ2 ) U (¬Φ1 ∧ ¬Φ2 ) ) ∨ ∃□¬Φ2


∃(◯ Φ1 ∧ ◯ Φ2 ) ≡ ∃◯ (Φ1 ∧ Φ2 )
∃(◯ Φ ∧ (Φ1 U Φ2 )) ≡ (Φ2 ∧ ∃◯ Φ) ∨ (Φ1 ∧ ∃◯ (Φ ∧ ∃(Φ1 U Φ2 )))
∃((Φ1 U Φ2 ) ∧ (Ψ1 U Ψ2 )) ≡ ∃((Φ1 ∧ Ψ1 ) U (Φ2 ∧ ∃(Ψ1 U Ψ2 ))) ∨
∃((Φ1 ∧ Ψ1 ) U (Ψ2 ∧ ∃(Φ1 U Φ2 )))

Joost-Pieter Katoen and Tim Quatmann Lecture #10 49/53


∗ +
Computational Tree Logic CTL and CTL

+
From CTL To CTL

Joost-Pieter Katoen and Tim Quatmann Lecture #10 50/53


Computational Tree Logic Summary

Overview

1 Branching-Time Logic

2 CTL Syntax

3 CTL Semantics

4 CTL Equivalence

5 Expressiveness of LTL versus CTL


∗ +
6 CTL and CTL

7 Summary

Joost-Pieter Katoen and Tim Quatmann Lecture #10 51/53


Computational Tree Logic Summary

Summary
▶ Computation tree logic (CTL) is a logic interpreted over infinite trees

▶ Path quantifiers in CTL alternate with temporal modalities

▶ CTL and LTL have an incomparable expressive power

▶ A CTL-formula Φ is equivalent to:


▶ the LTL-formula obtained by removing all path quantifiers from Φ, or
▶ there is no equivalent LTL-formula

▶ Boolean combinations of path formulas do not raise CTL’s expressive


power

▶ CTL∗ is strictly more expressive than LTL and CTL


Joost-Pieter Katoen and Tim Quatmann Lecture #10 52/53
Computational Tree Logic Summary

Next Lecture

Monday May 23, 10:30

No exercise class this Wednesday


No lecture this Thursday

Joost-Pieter Katoen and Tim Quatmann Lecture #10 53/53

Potrebbero piacerti anche