1. Home
  2. Explore
  3. Computer Science
  4. CTL Temporal Logic

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

CTL Temporal Logic

Computational Tree Logic (CTL)

1. Temporal Logic and Model-Based Truth

Temporal logic extends ordinary propositional logic with temporal operators. These operators allow reasoning about how system properties behave over time.

Examples of temporal questions include:

  • Whether a property is true in the next state.

  • Whether a property will become true at some point in the future.

  • Whether a property remains true globally or at all future points.

  • Whether one property remains true until another property becomes true.

A temporal formula does not have a meaningful truth value independently of a system model. Its truth is evaluated with respect to:

  1. A model of the system.

  2. A particular state or execution path in that model.

  3. The temporal formula being checked.

The notation

M,s⊨φM, s \models \varphiM,s⊨φ

means that formula φ\varphiφ is true in state sss of model MMM.

State Formulas and Path Formulas

Temporal reasoning distinguishes between two types of formulas:

  • State formula: A formula whose truth value is evaluated at a particular state of a model.

  • Path formula: A formula whose truth value is evaluated along a particular execution path.

A path represents one possible sequence of states through which the system may execute. A state may have several possible successors, and therefore several possible paths may begin from that state.

CTL combines path quantifiers with temporal operators so that its formulas are ultimately evaluated at states.


2. Computational Tree Logic

Computational Tree Logic, abbreviated CTL, is a form of branching-time temporal logic.

Linear-Time and Branching-Time Logic

There are two major ways to reason about time in a transition system:

  • Linear-time logic: Considers one execution trace at a time. Time progresses along a single sequence of states.

  • Branching-time logic: Considers all possible execution traces that can branch from a state.

CTL is branching-time logic because it can express statements such as:

  • A property holds on all possible execution paths.

  • A property holds on at least one possible execution path.

Computational Trees

A state-transition system can be unfolded into a tree of possible executions.

For example, suppose a system contains the following transitions:

  • From s0s_0s0​, the system can move to s1s_1s1​ or s2s_2s2​.

  • From s1s_1s1​, the system can remain in s1s_1s1​.

  • From s2s_2s2​, the system can move to s0s_0s0​ or s1s_1s1​.

The state s0s_0s0​ may appear again later in the unfolded tree because there is a path from s2s_2s2​ back to s0s_0s0​. Although the repeated occurrence of s0s_0s0​ has the same state behavior and labeling, it represents the system at a different time step.

If the initial occurrence of s0s_0s0​ is at time t0t_0t0​, then:

  • Its immediate successors occur at time t0+1t_0 + 1t0​+1.

  • States reached after two transitions occur at time t0+2t_0 + 2t0​+2.

The repeated s0s_0s0​ at time t0+2t_0 + 2t0​+2 has the same state properties as the original s0s_0s0​, but it occurs at a different point in the execution.

A computational tree is obtained by expanding a transition system into all possible executions from a state. CTL expresses properties over this branching structure.


3. CTL Path Quantifiers

CTL uses two path quantifiers.

Universal Path Quantifier: AAA

The quantifier AAA means for all paths.

A formula beginning with AAA must hold on every possible execution path beginning at the current state.

Examples:

  • AXφAX\varphiAXφ: On every possible path, φ\varphiφ is true in the next state.

  • AFφAF\varphiAFφ: On every possible path, φ\varphiφ eventually becomes true.

  • AGφAG\varphiAGφ: On every possible path, φ\varphiφ remains true globally.

Existential Path Quantifier: EEE

The quantifier EEE means there exists a path.

A formula beginning with EEE is true if at least one possible execution path satisfies the associated temporal condition.

Examples:

  • EXφEX\varphiEXφ: There is at least one next state in which φ\varphiφ is true.

  • EFφEF\varphiEFφ: There is at least one path along which φ\varphiφ eventually becomes true.

  • EGφEG\varphiEGφ: There is at least one path along which φ\varphiφ remains true globally.

The difference between AAA and EEE is essential:

  • AAA requires a property on every possible behavior.

  • EEE requires a property on at least one possible behavior.


4. Temporal Operators

The basic temporal operators introduced are:

Next: XXX

The operator XXX refers to the next state.

  • XφX\varphiXφ means that φ\varphiφ is true in the next state of a path.

Since the next state may not be unique in a branching system, XXX is generally combined with a path quantifier:

  • AXφAX\varphiAXφ

  • EXφEX\varphiEXφ

Future: FFF

The operator FFF means eventually in the future.

  • FφF\varphiFφ means that φ\varphiφ is true at some state in the future, possibly the current state depending on the formal convention.

In CTL, it appears with a path quantifier:

  • AFφAF\varphiAFφ: φ\varphiφ eventually becomes true on every path.

  • EFφEF\varphiEFφ: φ\varphiφ eventually becomes true on at least one path.

Globally: GGG

The operator GGG means globally or always.

  • GφG\varphiGφ means that φ\varphiφ remains true at every state along a path.

In CTL:

  • AGφAG\varphiAGφ: φ\varphiφ is true at every state on every path.

  • EGφEG\varphiEGφ: There is a path on which φ\varphiφ is true at every state.

Until: UUU

The operator UUU is a binary temporal operator. It requires two formulas.

φ1Uφ2\varphi_1 U \varphi_2φ1​Uφ2​

means that:

  • φ1\varphi_1φ1​ remains true until φ2\varphi_2φ2​ becomes true.

  • φ2\varphi_2φ2​ must eventually become true.

  • Before the state where φ2\varphi_2φ2​ first becomes true, φ1\varphi_1φ1​ must hold at all preceding states.

CTL forms include:

  • A[φ1Uφ2]A[\varphi_1 U \varphi_2]A[φ1​Uφ2​]: On every path, φ1\varphi_1φ1​ remains true until φ2\varphi_2φ2​ becomes true.

  • E[φ1Uφ2]E[\varphi_1 U \varphi_2]E[φ1​Uφ2​]: There exists a path on which φ1\varphi_1φ1​ remains true until φ2\varphi_2φ2​ becomes true.

The brackets are often used to make the scope of the until operator clear.


5. Syntax of CTL

CTL formulas are constructed recursively from constants, atomic propositions, logical operators, path quantifiers, and temporal operators.

Basic CTL Formulas

The following are CTL formulas:

  • ⊤\top⊤, representing true.

  • ⊥\bot⊥, representing false.

  • Any atomic proposition, such as ppp, qqq, or rrr.

If ppp is true in a state, then ppp is true at that state. If it is not true in that state, then ppp is false there.

Boolean Connectives

If φ\varphiφ, φ1\varphi_1φ1​, and φ2\varphi_2φ2​ are CTL formulas, then the following are also CTL formulas:

  • ¬φ\neg\varphi¬φ

  • φ1∧φ2\varphi_1 \land \varphi_2φ1​∧φ2​

  • φ1∨φ2\varphi_1 \lor \varphi_2φ1​∨φ2​

  • φ1⇒φ2\varphi_1 \Rightarrow \varphi_2φ1​⇒φ2​

Other Boolean operators, such as NAND and NOR, can also be expressed or used if included in the logical language.

Temporal CTL Formulas

A temporal operator must be combined with a path quantifier. The standard CTL operators are:

  • AXφAX\varphiAXφ

  • EXφEX\varphiEXφ

  • AFφAF\varphiAFφ

  • EFφEF\varphiEFφ

  • AGφAG\varphiAGφ

  • EGφEG\varphiEGφ

  • A[φ1Uφ2]A[\varphi_1 U \varphi_2]A[φ1​Uφ2​]

  • E[φ1Uφ2]E[\varphi_1 U \varphi_2]E[φ1​Uφ2​]

The path quantifier is what makes the formula a state formula.

Important Syntactic Restriction

In CTL, every temporal operator must be immediately preceded by a path quantifier, either AAA or EEE.

For example:

  • AGpAGpAGp is a valid CTL formula.

  • EFqEFqEFq is a valid CTL formula.

  • A[pUq]A[p U q]A[pUq] is a valid CTL formula.

  • FpFpFp is not a valid CTL formula by itself.

  • E[pUq]E[p U q]E[pUq] is valid, but pUqp U qpUq alone is not a complete CTL formula.

A formula may be a valid temporal formula without being a valid CTL formula. CTL imposes the additional requirement that temporal operators be paired with path quantifiers.


6. CTL Subformulas and Construction

A complex CTL formula is built from smaller formulas called subformulas.

Consider:

AG(p⇒¬EG(¬q))AG\left(p \Rightarrow \neg EG(\neg q)\right)AG(p⇒¬EG(¬q))

This formula can be constructed in stages:

  1. ppp is an atomic proposition and therefore a CTL formula.

  2. qqq is an atomic proposition and therefore a CTL formula.

  3. ¬q\neg q¬q is a CTL formula.

  4. EG(¬q)EG(\neg q)EG(¬q) is a CTL formula.

  5. ¬EG(¬q)\neg EG(\neg q)¬EG(¬q) is a CTL formula.

  6. p⇒¬EG(¬q)p \Rightarrow \neg EG(\neg q)p⇒¬EG(¬q) is a CTL formula.

  7. AG(p⇒¬EG(¬q))AG\left(p \Rightarrow \neg EG(\neg q)\right)AG(p⇒¬EG(¬q)) is a CTL formula.

The subformulas include:

  • ppp

  • qqq

  • ¬q\neg q¬q

  • EG(¬q)EG(\neg q)EG(¬q)

  • ¬EG(¬q)\neg EG(\neg q)¬EG(¬q)

  • p⇒¬EG(¬q)p \Rightarrow \neg EG(\neg q)p⇒¬EG(¬q)

  • AG(p⇒¬EG(¬q))AG\left(p \Rightarrow \neg EG(\neg q)\right)AG(p⇒¬EG(¬q))

The truth value of the complete formula can be evaluated only after the truth values of its subformulas have been determined.

Invalid Temporal-Operator Combinations

Consider:

F(rUq)F(r U q)F(rUq)

This is a temporal expression, but it is not a valid CTL formula because neither FFF nor UUU has the required CTL path quantifier.

A properly quantified version could be:

AF(E[rUq])AF\left(E[r U q]\right)AF(E[rUq])

Here:

  • E[rUq]E[r U q]E[rUq] is valid because UUU is preceded by EEE.

  • AF(E[rUq])AF(E[r U q])AF(E[rUq]) is valid because FFF is preceded by AAA.

Thus, nested temporal operators are allowed, provided each temporal operator is correctly preceded by a path quantifier.


7. Meaning of the Main CTL Operators

7.1 Next-State Operators

AXφAX\varphiAXφ

M,s⊨AXφM,s \models AX\varphiM,s⊨AXφ

if and only if φ\varphiφ holds in every immediate successor of sss.

In other words, every possible next state must satisfy φ\varphiφ.

EXφEX\varphiEXφ

M,s⊨EXφM,s \models EX\varphiM,s⊨EXφ

if and only if at least one immediate successor of sss satisfies φ\varphiφ.

Thus:

  • AXφAX\varphiAXφ requires all next states to satisfy φ\varphiφ.

  • EXφEX\varphiEXφ requires only one next state to satisfy φ\varphiφ.

Suppose state s0s_0s0​ has three successors, s1s_1s1​, s2s_2s2​, and s3s_3s3​:

  • If φ\varphiφ is true in all three states, both AXφAX\varphiAXφ and EXφEX\varphiEXφ are true at s0s_0s0​.

  • If φ\varphiφ is true only in s1s_1s1​, then EXφEX\varphiEXφ is true but AXφAX\varphiAXφ is false.

  • If φ\varphiφ is false in all three states, both formulas are false.


7.2 Globally Operators

AGφAG\varphiAGφ

M,s⊨AGφM,s \models AG\varphiM,s⊨AGφ

if and only if φ\varphiφ is true:

  1. In the current state sss.

  2. In every state reachable along every path beginning at sss.

Therefore, a single reachable state in which φ\varphiφ is false is sufficient to make AGφAG\varphiAGφ false.

EGφEG\varphiEGφ

M,s⊨EGφM,s \models EG\varphiM,s⊨EGφ

if and only if there exists at least one path beginning at sss such that φ\varphiφ is true in every state on that path.

The distinction is:

  • AGφAG\varphiAGφ: Every possible path always satisfies φ\varphiφ.

  • EGφEG\varphiEGφ: At least one possible path always satisfies φ\varphiφ.

A formula may satisfy EGφEG\varphiEGφ but not AGφAG\varphiAGφ when one path preserves φ\varphiφ but another path reaches a state where φ\varphiφ is false.


7.3 Eventually Operators

AFφAF\varphiAFφ

M,s⊨AFφM,s \models AF\varphiM,s⊨AFφ

if and only if every path beginning at sss eventually reaches a state where φ\varphiφ is true.

This expresses a universal liveness property: no matter how the system proceeds, φ\varphiφ must eventually occur.

EFφEF\varphiEFφ

M,s⊨EFφM,s \models EF\varphiM,s⊨EFφ

if and only if there exists at least one path beginning at sss that eventually reaches a state where φ\varphiφ is true.

This expresses the possibility of eventually reaching a state satisfying φ\varphiφ.

The distinction is:

  • AFφAF\varphiAFφ: φ\varphiφ is unavoidable in the future.

  • EFφEF\varphiEFφ: φ\varphiφ is possible in the future.


7.4 Until Operators

A[φ1Uφ2]A[\varphi_1 U \varphi_2]A[φ1​Uφ2​]

M,s⊨A[φ1Uφ2]M,s \models A[\varphi_1 U \varphi_2]M,s⊨A[φ1​Uφ2​]

if and only if, on every path beginning at sss, there exists a position iii such that:

  • φ2\varphi_2φ2​ holds at position iii.

  • φ1\varphi_1φ1​ holds at every earlier position jjj where j<ij < ij<i.

Formally:

∀π beginning at s, ∃i≥0:(M,πi⊨φ2)∧(∀j<i, M,πj⊨φ1)\forall \pi \text{ beginning at } s,\ \exists i \geq 0: \left(M,\pi_i \models \varphi_2\right) \land \left(\forall j<i,\ M,\pi_j \models \varphi_1\right)∀π beginning at s, ∃i≥0:(M,πi​⊨φ2​)∧(∀j<i, M,πj​⊨φ1​)

This means that every possible execution must eventually reach a φ2\varphi_2φ2​ state, while satisfying φ1\varphi_1φ1​ beforehand.

E[φ1Uφ2]E[\varphi_1 U \varphi_2]E[φ1​Uφ2​]

M,s⊨E[φ1Uφ2]M,s \models E[\varphi_1 U \varphi_2]M,s⊨E[φ1​Uφ2​]

if and only if at least one path beginning at sss contains a state satisfying φ2\varphi_2φ2​, with φ1\varphi_1φ1​ true at every preceding state.

Formally:

∃π beginning at s, ∃i≥0:(M,πi⊨φ2)∧(∀j<i, M,πj⊨φ1)\exists \pi \text{ beginning at } s,\ \exists i \geq 0: \left(M,\pi_i \models \varphi_2\right) \land \left(\forall j<i,\ M,\pi_j \models \varphi_1\right)∃π beginning at s, ∃i≥0:(M,πi​⊨φ2​)∧(∀j<i, M,πj​⊨φ1​)

For example, E[pUq]E[p U q]E[pUq] is true at s0s_0s0​ if there is at least one path such as:

s0→s1→s4s_0 \rightarrow s_1 \rightarrow s_4s0​→s1​→s4​

where:

  • ppp is true at s0s_0s0​.

  • ppp is true at s1s_1s1​.

  • qqq is true at s4s_4s4​.

If another path reaches a state where ppp is false before reaching a qqq-state, that does not invalidate E[pUq]E[p U q]E[pUq], because only one satisfying path is required. However, it does invalidate A[pUq]A[p U q]A[pUq], because the universal version requires every path to satisfy the condition.


8. Kripke Structures

The semantics of CTL is defined over a particular type of transition system called a Kripke structure.

A Kripke structure is commonly represented as:

M=(S,R,L)M = (S, R, L)M=(S,R,L)

where:

  • SSS is a finite set of states.

  • RRR is the transition relation.

  • LLL is the labeling function.

State Set: SSS

The set SSS contains all states of the system.

S={s0,s1,s2,…}S = \{s_0, s_1, s_2, \ldots\}S={s0​,s1​,s2​,…}

The state set is finite in the model being considered.

Transition Relation: RRR

The transition relation describes which states can directly follow other states.

R⊆S×SR \subseteq S \times SR⊆S×S

If (s,s′)∈R(s,s') \in R(s,s′)∈R, then the system can transition from state sss to state s′s's′.

A crucial condition is that the transition relation is total or complete:

∀s∈S, ∃s′∈S such that (s,s′)∈R\forall s \in S,\ \exists s' \in S \text{ such that } (s,s') \in R∀s∈S, ∃s′∈S such that (s,s′)∈R

This means that every state must have at least one outgoing transition. A state with no successor is not permitted in the Kripke structures used here.

Self-loops are allowed. For example:

(s1,s1)∈R(s_1,s_1) \in R(s1​,s1​)∈R

means that the system can remain in s1s_1s1​.

Labeling Function: LLL

The labeling function identifies which atomic propositions are true in each state.

If VVV is the set of atomic propositions, then:

L:S→2VL:S\rightarrow 2^VL:S→2V

The notation 2V2^V2V denotes the power set of VVV, meaning the set of all subsets of VVV.

If:

L(s0)={p,q}L(s_0)=\{p,q\}L(s0​)={p,q}

then ppp and qqq are true in s0s_0s0​, while any proposition in VVV that is not listed is false in s0s_0s0​.

A Kripke structure resembles a finite-state machine, but it additionally includes a labeling function and requires every state to have at least one outgoing transition.


9. Example Kripke Structure

Consider a system with states:

S={s0,s1,s2}S=\{s_0,s_1,s_2\}S={s0​,s1​,s2​}

and atomic propositions:

V={a,b,c}V=\{a,b,c\}V={a,b,c}

Suppose the labeling function is:

  • L(s0)={a,b}L(s_0)=\{a,b\}L(s0​)={a,b}

  • L(s1)={c}L(s_1)=\{c\}L(s1​)={c}

  • L(s2)={b,c}L(s_2)=\{b,c\}L(s2​)={b,c}

This means:

  • At s0s_0s0​, aaa and bbb are true.

  • At s1s_1s1​, only ccc is true.

  • At s2s_2s2​, bbb and ccc are true.

Suppose the transitions are:

  • s0s_0s0​ has two outgoing transitions.

  • s1s_1s1​ has a transition to itself.

  • s2s_2s2​ has two outgoing transitions.

Because every state has an outgoing transition, this is a valid Kripke structure.

A system with a state s6s_6s6​ that has no outgoing transition is not a valid Kripke structure under the required completeness condition. Adding a transition from s6s_6s6​ to another state makes the transition relation complete and restores validity.


10. A Larger Kripke-Structure Example

Consider four states:

S={s0,s1,s2,s3}S=\{s_0,s_1,s_2,s_3\}S={s0​,s1​,s2​,s3​}

with atomic propositions:

V={p,q,r}V=\{p,q,r\}V={p,q,r}

Possible transitions include:

  • s0→s1s_0 \rightarrow s_1s0​→s1​

  • s1→s2s_1 \rightarrow s_2s1​→s2​

  • s1→s3s_1 \rightarrow s_3s1​→s3​

  • s2→s3s_2 \rightarrow s_3s2​→s3​

  • s3→s2s_3 \rightarrow s_2s3​→s2​

  • s3→s3s_3 \rightarrow s_3s3​→s3​

Thus, the transition relation contains six transitions.

The labeling function is:

  • L(s0)={p,q,r}L(s_0)=\{p,q,r\}L(s0​)={p,q,r}

  • L(s1)={p,q}L(s_1)=\{p,q\}L(s1​)={p,q}

  • L(s2)={r}L(s_2)=\{r\}L(s2​)={r}

  • L(s3)={q,r}L(s_3)=\{q,r\}L(s3​)={q,r}

For example:

  • M,s0⊨pM,s_0 \models pM,s0​⊨p because p∈L(s0)p \in L(s_0)p∈L(s0​).

  • M,s2⊭pM,s_2 \not\models pM,s2​⊨p because p∉L(s2)p \notin L(s_2)p∈/L(s2​).

  • M,s3⊨q∧rM,s_3 \models q \land rM,s3​⊨q∧r because both qqq and rrr belong to L(s3)L(s_3)L(s3​).

  • M,s2⊭p∧qM,s_2 \not\models p \land qM,s2​⊨p∧q because neither ppp nor qqq is true there.


11. Formal Semantics of CTL

The semantics of CTL defines when a formula is true in a state.

The basic notation is:

M,s⊨φM,s \models \varphiM,s⊨φ

which means that φ\varphiφ holds in state sss of model MMM.

The semantics is defined by structural induction. Each complex formula is evaluated from the truth values of its component subformulas.

Constants

For every state sss:

M,s⊨⊤M,s \models \topM,s⊨⊤

and:

M,s⊭⊥M,s \not\models \botM,s⊨⊥

Therefore:

  • ⊤\top⊤ is true in every state.

  • ⊥\bot⊥ is false in every state.

Atomic Propositions

For an atomic proposition ppp:

M,s⊨pif and only ifp∈L(s)M,s \models p \quad \text{if and only if} \quad p \in L(s)M,s⊨pif and only ifp∈L(s)

If p∉L(s)p \notin L(s)p∈/L(s), then:

M,s⊭pM,s \not\models pM,s⊨p

Negation

M,s⊨¬φif and only ifM,s⊭φM,s \models \neg\varphi \quad \text{if and only if} \quad M,s \not\models \varphiM,s⊨¬φif and only ifM,s⊨φ

Thus, ¬φ\neg\varphi¬φ is true exactly when φ\varphiφ is false in the same state.

Conjunction

M,s⊨φ1∧φ2M,s \models \varphi_1 \land \varphi_2M,s⊨φ1​∧φ2​

if and only if:

M,s⊨φ1andM,s⊨φ2M,s \models \varphi_1 \quad \text{and} \quad M,s \models \varphi_2M,s⊨φ1​andM,s⊨φ2​

Both formulas must hold in the state.

Disjunction

M,s⊨φ1∨φ2M,s \models \varphi_1 \lor \varphi_2M,s⊨φ1​∨φ2​

if and only if at least one of the following is true:

M,s⊨φ1M,s \models \varphi_1M,s⊨φ1​

or:

M,s⊨φ2M,s \models \varphi_2M,s⊨φ2​

Implication

M,s⊨φ1⇒φ2M,s \models \varphi_1 \Rightarrow \varphi_2M,s⊨φ1​⇒φ2​

if and only if:

M,s⊭φ1orM,s⊨φ2M,s \not\models \varphi_1 \quad \text{or} \quad M,s \models \varphi_2M,s⊨φ1​orM,s⊨φ2​

This follows the equivalence:

φ1⇒φ2≡¬φ1∨φ2\varphi_1 \Rightarrow \varphi_2 \equiv \neg\varphi_1 \lor \varphi_2φ1​⇒φ2​≡¬φ1​∨φ2​

12. Formal Semantics of Temporal Operators

Next-State Semantics

For the universal next operator:

M,s⊨AXφM,s \models AX\varphiM,s⊨AXφ

if and only if:

∀s′∈S, (s,s′)∈R⇒M,s′⊨φ\forall s' \in S,\ (s,s') \in R \Rightarrow M,s' \models \varphi∀s′∈S, (s,s′)∈R⇒M,s′⊨φ

Every immediate successor of sss must satisfy φ\varphiφ.

For the existential next operator:

M,s⊨EXφM,s \models EX\varphiM,s⊨EXφ

if and only if:

∃s′∈S:(s,s′)∈R∧M,s′⊨φ\exists s' \in S: (s,s') \in R \land M,s' \models \varphi∃s′∈S:(s,s′)∈R∧M,s′⊨φ

At least one immediate successor must satisfy φ\varphiφ.

Globally Semantics

Let π=s0s1s2…\pi=s_0s_1s_2\ldotsπ=s0​s1​s2​… be a path beginning at sss, where s0=ss_0=ss0​=s.

For the universal globally operator:

M,s⊨AGφM,s \models AG\varphiM,s⊨AGφ

if and only if every path π\piπ beginning at sss satisfies:

∀i≥0, M,si⊨φ\forall i\geq 0,\ M,s_i \models \varphi∀i≥0, M,si​⊨φ

For the existential globally operator:

M,s⊨EGφM,s \models EG\varphiM,s⊨EGφ

if and only if there exists at least one path π\piπ beginning at sss such that:

∀i≥0, M,si⊨φ\forall i\geq 0,\ M,s_i \models \varphi∀i≥0, M,si​⊨φ

Eventually Semantics

For the universal eventually operator:

M,s⊨AFφM,s \models AF\varphiM,s⊨AFφ

if and only if every path π=s0s1s2…\pi=s_0s_1s_2\ldotsπ=s0​s1​s2​… beginning at sss contains some position iii satisfying:

M,si⊨φM,s_i \models \varphiM,si​⊨φ

For the existential eventually operator:

M,s⊨EFφM,s \models EF\varphiM,s⊨EFφ

if and only if at least one path beginning at sss contains some position iii satisfying:

M,si⊨φM,s_i \models \varphiM,si​⊨φ

Until Semantics

For the universal until operator:

M,s⊨A[φ1Uφ2]M,s \models A[\varphi_1 U \varphi_2]M,s⊨A[φ1​Uφ2​]

if and only if every path π=s0s1s2…\pi=s_0s_1s_2\ldotsπ=s0​s1​s2​… beginning at sss contains an index iii such that:

M,si⊨φ2M,s_i \models \varphi_2M,si​⊨φ2​

and:

∀j<i, M,sj⊨φ1\forall j<i,\ M,s_j \models \varphi_1∀j<i, M,sj​⊨φ1​

For the existential until operator:

M,s⊨E[φ1Uφ2]M,s \models E[\varphi_1 U \varphi_2]M,s⊨E[φ1​Uφ2​]

if and only if there exists at least one path beginning at sss containing an index iii such that:

M,si⊨φ2M,s_i \models \varphi_2M,si​⊨φ2​

and:

∀j<i, M,sj⊨φ1\forall j<i,\ M,s_j \models \varphi_1∀j<i, M,sj​⊨φ1​

The universal version fails if even one path violates the required condition. The existential version succeeds as soon as one satisfying path is found.


13. State-Specific Truth Values

A CTL formula can be true in one state and false in another state of the same model.

For example, suppose s1s_1s1​ has only one possible execution path and qqq remains true on every state of that path. Then:

M,s1⊨AGqM,s_1 \models AGqM,s1​⊨AGq

If the system begins at s0s_0s0​ and one of its possible paths eventually reaches a state where qqq is false, then:

M,s0⊭AGqM,s_0 \not\models AGqM,s0​⊨AGq

This does not contradict the fact that AGqAGqAGq may be true at s1s_1s1​. The formula is evaluated relative to the set of paths reachable from the particular state being examined.

Similarly:

  • EGφEG\varphiEGφ may be true at a state if one path preserves φ\varphiφ forever.

  • AGφAG\varphiAGφ may be false at the same state if another path reaches a state where φ\varphiφ is false.

  • AFφAF\varphiAFφ may be false if one path avoids φ\varphiφ forever.

  • EFφEF\varphiEFφ may still be true if another path eventually reaches φ\varphiφ.


14. Atomic Propositions and the State Space

The set of atomic propositions can be used to describe possible system states.

Suppose:

X={p,q,r}X=\{p,q,r\}X={p,q,r}

The power set of XXX is:

2X={∅,{p},{q},{r},{p,q},{p,r},{q,r},{p,q,r}}2^X= \{ \varnothing, \{p\}, \{q\}, \{r\}, \{p,q\}, \{p,r\}, \{q,r\}, \{p,q,r\} \}2X={∅,{p},{q},{r},{p,q},{p,r},{q,r},{p,q,r}}

There are eight subsets because:

∣2X∣=2∣X∣=23=8|2^X|=2^{|X|}=2^3=8∣2X∣=2∣X∣=23=8

Each subset represents one possible combination of truth values:

  • ∅\varnothing∅: none of ppp, qqq, or rrr is true.

  • {p}\{p\}{p}: only ppp is true.

  • {q}\{q\}{q}: only qqq is true.

  • {r}\{r\}{r}: only rrr is true.

  • {p,q}\{p,q\}{p,q}: ppp and qqq are true.

  • {p,r}\{p,r\}{p,r}: ppp and rrr are true.

  • {q,r}\{q,r\}{q,r}: qqq and rrr are true.

  • {p,q,r}\{p,q,r\}{p,q,r}: all three are true.

For nnn atomic propositions, the total number of possible truth-value combinations is:

2n2^n2n

In a digital system, each atomic proposition can represent a binary system variable:

  • True may represent 111, on, or active.

  • False may represent 000, off, or inactive.

Therefore, nnn binary state variables can describe at most 2n2^n2n possible configurations.

Reachable States

Not every theoretically possible configuration must be reachable in an actual system.

The set of reachable states is a subset of the total state space:

Reachable states⊆All possible states\text{Reachable states} \subseteq \text{All possible states}Reachable states⊆All possible states

Consequently:

∣Reachable states∣≤2n|\text{Reachable states}| \leq 2^n∣Reachable states∣≤2n

Some configurations may be impossible because of:

  • Design constraints.

  • Mutually exclusive conditions.

  • Hardware restrictions.

  • Protocol rules.

  • Invalid combinations of control signals.

For example, although three binary variables yield eight possible combinations, the system may permit only five of them. CTL model checking generally focuses on the states and transitions that are actually represented in the system model.


15. Expressing System Properties in CTL

CTL provides a formal way to specify requirements for embedded and digital systems.

Possibility of Reaching a Started-but-Not-Ready State

Suppose:

  • started means that the system has started.

  • ready means that the system is ready for operation.

The property “it is possible to reach a state where the system has started but is not ready” can be expressed as:

EF(started∧¬ready)EF(started \land \neg ready)EF(started∧¬ready)

Interpretation:

  • There exists at least one execution path.

  • At some future state on that path, started is true.

  • At that same state, ready is false.

This can represent situations such as a printer that has been switched on but is not yet ready because initialization or another operation is incomplete.

Every Request Is Eventually Acknowledged

Suppose:

  • request means that a resource has been requested.

  • acknowledged means that the system has acknowledged the request.

The requirement “whenever a request occurs, it is eventually acknowledged on every possible future execution” can be written as:

AG(request⇒AF(acknowledged))AG(request \Rightarrow AF(acknowledged))AG(request⇒AF(acknowledged))

Interpretation:

  1. AGAGAG requires the condition to hold at every reachable state on every path.

  2. If request is true at any state, then:

  3. AF(acknowledged)AF(acknowledged)AF(acknowledged) requires every continuation from that state to eventually reach a state where acknowledged is true.

This is a universal response or liveness property. It rules out executions in which a request is made but never acknowledged.

Other Common Interpretations

CTL can express requirements involving:

  • Safety: Something bad never happens.

  • Liveness: Something good eventually happens.

  • Possibility: A desired situation can occur on at least one path.

  • Necessity: A required situation occurs on all paths.

  • Persistence: A condition remains true indefinitely.

  • Response: One event eventually follows another.

For example:

  • AG¬errorAG\neg errorAG¬error means that an error state is never reached.

  • EFsuccessEF successEFsuccess means that success is reachable on at least one path.

  • AFcompletedAF completedAFcompleted means that completion is unavoidable.

  • EGoperationalEG operationalEGoperational means that there is an execution that remains operational forever.


16. Role of CTL in Embedded-System Verification

An embedded-system design can be represented by a finite transition model:

  • States represent configurations of the system.

  • Transitions represent possible state changes.

  • Labels represent the propositions true in each state.

System requirements are then written as CTL formulas. Verification checks whether the model satisfies those formulas.

The general process is:

  1. Construct a finite-state model of the embedded system.

  2. Label each state with the atomic propositions that hold there.

  3. Define the possible transitions between states.

  4. Write system requirements as CTL formulas.

  5. Evaluate each formula in the model.

  6. Investigate any state or path that violates a requirement.

Thus, CTL connects informal requirements with formal verification. It allows a designer to ask whether required behaviors occur on all executions, whether permitted behaviors are possible, and whether undesirable states can be reached.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent