Computation tree logic explained

Computation tree logic (CTL) is a branching-time logic, meaning that its model of time is a tree-like structure in which the future is not determined; there are different paths in the future, any one of which might be an actual path that is realized. It is used in formal verification of software or hardware artifacts, typically by software applications known as model checkers, which determine if a given artifact possesses safety or liveness properties. For example, CTL can specify that when some initial condition is satisfied (e.g., all program variables are positive or no cars on a highway straddle two lanes), then all possible executions of a program avoid some undesirable condition (e.g., dividing a number by zero or two cars colliding on a highway). In this example, the safety property could be verified by a model checker that explores all possible transitions out of program states satisfying the initial condition and ensures that all such executions satisfy the property. Computation tree logic belongs to a class of temporal logics that includes linear temporal logic (LTL). Although there are properties expressible only in CTL and properties expressible only in LTL, all properties expressible in either logic can also be expressed in CTL*.

History

CTL was first proposed by Edmund M. Clarke and E. Allen Emerson in 1981, who used it to synthesize so-called synchronisation skeletons, i.e abstractions of concurrent programs.

Since the introduction of CTL, there has been debate about the relative merits of CTL and LTL. Because CTL is more computationally efficient to model check, it has become more common in industrial use, and many of the most successful model-checking tools use CTL as a specification language.[1]

Syntax of CTL

The language of well-formed formulas for CTL is generated by the following grammar:

\begin{align} \phi&::=\bot\mid\top\midp\mid(\neg\phi)\mid(\phi\land\phi)\mid(\phi\lor\phi)\mid(\phi\phi)\mid(\phi\Leftrightarrow\phi)\\ &\midAX\phi\midEX\phi\midAF\phi\midEF\phi\midAG\phi\midEG\phi\midA[\phiU\phi]\midE[\phiU\phi] \end{align}

where

p

ranges over a set of atomic formulas. It is not necessary to use all connectives  - for example,

\{\neg,\land,AX,AU,EU\}

comprises a complete set of connectives, and the others can be defined using them.

A

means 'along All paths' (inevitably)

E

means 'along at least (there Exists) one path' (possibly)

For example, the following is a well-formed CTL formula:

EF(EGpAFr)

The following is not a well-formed CTL formula:

EF(rUq)

The problem with this string is that

U

can occur only when paired with an

A

or an

E

.

CTL uses atomic propositions as its building blocks to make statements about the states of a system. These propositions are then combined into formulas using logical operators and temporal operators.

Operators

Logical operators

The logical operators are the usual ones: ¬, ∨, ∧, ⇒ and ⇔. Along with these operators CTL formulas can also make use of the boolean constants true and false.

Temporal operators

The temporal operators are the following:

In CTL*, the temporal operators can be freely mixed. In CTL, operators must always be grouped in pairs: one path operator followed by a state operator. See the examples below. CTL* is strictly more expressive than CTL.

Minimal set of operators

In CTL there are minimal sets of operators. All CTL formulas can be transformed to use only those operators. This is useful in model checking. One minimal set of operators is: .

Some of the transformations used for temporal operators are:

E[true'''U'''(''φ'')] (because Fφ

[true'''U'''(''φ'')])

¬EXφ)

¬EFφ)

¬ E[true'''U'''(¬''φ'')]

A[true'''U'''''φ'']

¬EGφ)

Semantics of CTL

Definition

CTL formulae are interpreted over transition systems. A transition system is a triple

l{M}=(S,{ → },L)

, where

S

is a set of states,

{}\subseteqS x S

is a transition relation, assumed to be serial, i.e. every state has at least one successor, and

L

is a labelling function, assigning propositional letters to states. Let

l{M}=(S, →,L)

be such a transition model, with

s\inS

, and

\phi\inF

, where

F

is the set of well-formed formulas over the language of

l{M}

.

(l{M},s\models\phi)

is defined recursively on

\phi

:

((l{M},s)\models\top)\land((l{M},s)\not\models\bot)

((l{M},s)\modelsp)\Leftrightarrow(p\inL(s))

((l{M},s)\models\neg\phi)\Leftrightarrow((l{M},s)\not\models\phi)

((l{M},s)\models\phi1\land\phi2)\Leftrightarrow(((l{M},s)\models\phi1)\land((l{M},s)\models\phi2))

((l{M},s)\models\phi1\lor\phi2)\Leftrightarrow(((l{M},s)\models\phi1)\lor((l{M},s)\models\phi2))

((l{M},s)\models\phi1\phi2)\Leftrightarrow(((l{M},s)\not\models\phi1)\lor((l{M},s)\models\phi2))

((l{M},s)\models\phi1\Leftrightarrow\phi2)\Leftrightarrow((((l{M},s)\models\phi1)\land((l{M},s)\models\phi2))\lor(\neg((l{M},s)\models\phi1)\land\neg((l{M},s)\models\phi2)))

((l{M},s)\modelsAX\phi)\Leftrightarrow(\forall\langless1\rangle((l{M},s1)\models\phi))

((l{M},s)\modelsEX\phi)\Leftrightarrow(\exists\langless1\rangle((l{M},s1)\models\phi))

((l{M},s)\modelsAG\phi)\Leftrightarrow(\forall\langles1s2\ldots\rangle(s=s1)\foralli((l{M},si)\models\phi))

((l{M},s)\modelsEG\phi)\Leftrightarrow(\exists\langles1s2\ldots\rangle(s=s1)\foralli((l{M},si)\models\phi))

((l{M},s)\modelsAF\phi)\Leftrightarrow(\forall\langles1s2\ldots\rangle(s=s1)\existsi((l{M},si)\models\phi))

((l{M},s)\modelsEF\phi)\Leftrightarrow(\exists\langles1s2\ldots\rangle(s=s1)\existsi((l{M},si)\models\phi))

((l{M},s)\modelsA[\phi1U\phi2])\Leftrightarrow(\forall\langles1s2\ldots\rangle(s=s1)\existsi(((l{M},si)\models\phi2)\land(\forall(j<i)(l{M},sj)\models\phi1)))

((l{M},s)\modelsE[\phi1U\phi2])\Leftrightarrow(\exists\langles1s2\ldots\rangle(s=s1)\existsi(((l{M},si)\models\phi2)\land(\forall(j<i)(l{M},sj)\models\phi1)))

Characterisation of CTL

Rules 10 - 15 above refer to computation paths in models and are what ultimately characterise the "Computation Tree";they are assertions about the nature of the infinitely deep computation tree rooted at the given state

s

.

Semantic equivalences

The formulae

\phi

and

\psi

are said to be semantically equivalent if any state in any model that satisfies one also satisfies the other.This is denoted

\phi\equiv\psi

It can be seen that

A

and

E

are duals, being universal and existential computation path quantifiers respectively:

\negA\Phi\equivE\neg\Phi

.

Furthermore, so are

G

and

F

.

Hence an instance of De Morgan's laws can be formulated in CTL:

\negAF\phi\equivEG\neg\phi

\negEF\phi\equivAG\neg\phi

\negAX\phi\equivEX\neg\phi

It can be shown using such identities that a subset of the CTL temporal connectives is adequate if it contains

EU

, at least one of

\{AX,EX\}

and at least one of

\{EG,AF,AU\}

and the boolean connectives.

The important equivalences below are called the expansion laws; they allow unfolding the verification of a CTL connective towards its successors in time.

AG\phi\equiv\phi\landAXAG\phi

EG\phi\equiv\phi\landEXEG\phi

AF\phi\equiv\phi\lorAXAF\phi

EF\phi\equiv\phi\lorEXEF\phi

A[\phiU\psi]\equiv\psi\lor(\phi\landAXA[\phiU\psi])

E[\phiU\psi]\equiv\psi\lor(\phi\landEXE[\phiU\psi])

Examples

Let "P" mean "I like chocolate" and Q mean "It's warm outside."

"I will like chocolate from now on, no matter what happens."

"It's possible I may like chocolate some day, at least for one day."

"It's always possible (AF) that I will suddenly start liking chocolate for the rest of time." (Note: not just the rest of my life, since my life is finite, while G is infinite).

"Depending on what happens in the future (E), it's possible that for the rest of time (G), I'll be guaranteed at least one (AF) chocolate-liking day still ahead of me. However, if something ever goes wrong, then all bets are off and there's no guarantee about whether I'll ever like chocolate."

The two following examples show the difference between CTL and CTL*, as they allow for the until operator to not be qualified with any path operator (A or E):

"From now until it's warm outside, I will like chocolate every single day. Once it's warm outside, all bets are off as to whether I'll like chocolate anymore. Oh, and it's guaranteed to be warm outside eventually, even if only for a single day."

"It's possible that: there will eventually come a time when it will be warm forever (AG.Q) and that before that time there will always be some way to get me to like chocolate the next day (EX.P)."

Relations with other logics

Computation tree logic (CTL) is a subset of CTL* as well as of the modal μ calculus. CTL is also a fragment of Alur, Henzinger and Kupferman's alternating-time temporal logic (ATL).

Computation tree logic (CTL) and linear temporal logic (LTL) are both a subset of CTL*. CTL and LTL are not equivalent and they have a common subset, which is a proper subset of both CTL and LTL.

Extensions

CTL has been extended with second-order quantification

\existsp

and

\forallp

to quantified computational tree logic (QCTL).[2] There are two semantics:

A reduction from the model-checking problem of QCTL with the structure semantics, to TQBF (true quantified Boolean formulae) has been proposed, in order to take advantage of the QBF solvers.[3]

See also

References

External links

Notes and References

  1. Book: Vardi . Moshe Y. . 2001 . Branching vs. Linear Time: Final Showdown . Tools and Algorithms for the Construction and Analysis of Systems . Lecture Notes in Computer Science . 2031 . Springer, Berlin . 122 . 10.1007/3-540-45319-9_1 . 978-3-540-41865-8 . https://link.springer.com/content/pdf/10.1007/3-540-45319-9_1.pdf.
  2. David. Amélie. Laroussinie. Francois. Markey. Nicolas. 2016. Desharnais. Josée. Jagadeesan. Radha. On the Expressiveness of QCTL. 27th International Conference on Concurrency Theory (CONCUR 2016). Leibniz International Proceedings in Informatics (LIPIcs). Dagstuhl, Germany. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik. 59. 28:1–28:15. 10.4230/LIPIcs.CONCUR.2016.28. free . 978-3-95977-017-0.
  3. Hossain. Akash. Laroussinie. François. 2019. Gamper. Johann. Pinchinat. Sophie. Sciavicco. Guido. From Quantified CTL to QBF. 26th International Symposium on Temporal Representation and Reasoning (TIME 2019). Leibniz International Proceedings in Informatics (LIPIcs). Dagstuhl, Germany. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik. 147. 11:1–11:20. 10.4230/LIPIcs.TIME.2019.11. free . 978-3-95977-127-6. 195345645 .