Computational tree logic
From Free net encyclopedia
Computational tree logic (CTL) is a temporal logic. It is often used to express properties of a system in the context of formal verification or model checking.
It uses atomic propositions as its building blocks to make statements about the states of a system. CTL then combines theses propositions into formulas using logical operators and temporal operators.
Contents |
Operators
Logical operators
The logical operators are the usual ones: <math>\neg,\or,\and,\rightarrow</math> and <math>\leftrightarrow</math>. 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:
- N <math>\phi</math> - Next: <math>\phi</math> has to hold at the next state (this operator is sometimes noted X instead of N).
- G <math>\phi</math> - Globally: <math>\phi</math> has to hold on the entire subsequent path.
- F <math>\phi</math> - Finally: <math>\phi</math> eventually has to hold (somewhere on the subsequent path).
- A <math>\phi</math> - All: <math>\phi</math> has to hold on all paths starting from the current state.
- E <math>\phi</math> - Exists: there exists at least one path starting from the current state where <math>\phi</math> holds.
- <math>\phi</math> U <math>\psi</math> - Until: <math>\phi</math> has to hold until at some position <math>\psi</math> holds. This implies that <math>\psi</math> will be verified in the future.
- <math>\phi</math> W <math>\psi</math> - Weak until: <math>\phi</math> has to hold until <math>\psi</math> holds. The difference with U is that there is no guarantee that <math>\psi</math> will ever be verified. The W operator is sometimes called "unless".
State and Path formulas
CTL formulas can be divisioned into state formulas and path formulas. Path formulas's true value depend on a path of evaluation (for example, "on this path, always p"). All other formulas are state formulas (for example, "from this state, on all paths, p").
Examples
Let P mean "I like chocolate" and Q mean "It's warm outside".
AG.P
- I will like chocolate now on, no matter what happens.
EF.P
- It's possible I may like chocolate some day, at least for one day.
AF.EG.P
- 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).
EG.AF.P
- This is a critical time in my life. Depending on what happens next (E), it's possible that for the rest of time (G), there will always be some time in the future (AF) when I will like chocolate. However, if the wrong thing happens next, then all bets are off and there's no guarantee about whether I'll ever like chocolate.
A(PUQ)
- 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.
E((EX.P)U(AG.Q))
- 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
Computational tree logic (CTL) is a subset of CTL* as well as of the modal mu calculus.
See also