Temporal logic

In temporal logic, one considers assertions that hold on sequences of states that are reached during the execution of the system. Temporal logic is an extension of prediate logic which includes, in addition to the basic logic operations that apply to the properties of a given state, such as and, or, not, imply, also operators that relate to the sequences of future states over time. In the following, φ is a property that may hold for a given state. The temporal operators are the following:

Example LTS with state assertions A, B and C: example

These operators can be used to express some other interesting time-related properties, such as

Example: Readers-Writers with an arbiter: reader writerarbiter

There are two types of temporal logics: Linear time (LTL) and branching time (CTL)

Table 1: Some temporal connectives in CTL

EX φ true in current state if formula φ is true in at least one of the next states
EF φ true in current state if there exists some state in some path beginning in current state that satisfies the formula φ
EG φ true in current state if every state in some path beginning in current state satisfies the formula φ
AX φ true in current state if formula φ is true in every one of the next states
AF φ true in current state if there exists some state in every path beginning in current state that satisfies the formula φ
AG φ true in current state if every state in every path beginning in current state satisfies the formula φ

sdf

Distinction of safeness and liveness properties - temporal logic - Büchi and Muller automata

A safeness property looks back in time. Such a property is described as follows: "Any finite execution sequence that is generated by the system will have such and such property" - for instance, conform with a given state transition diagram. On may say: "Whatever happens is good"

A liveness property looks forward in time. Such a property is normally described as follows: "If the system is in state X, eventually some property will hold", or "If the system enters state X infinitely often, then some state Y will also be entered infinitely often". On may say: "Something good will eventually happen"

In proving properties of programs, one considers so-called partial correctness (meaing that the results are correct if the program terminates), which is a safeness property, and termination, which is a liveness property.

The always operator of temporal logic is not really very interesting, since it describes safeness properties, as do state diagrams. The eventually operator is the interesting part of temporal logic because it allows to talk about liveness properties, such as eventual progress or termination, and fairness among choices.

Note that a liveness property can not be falsified by a finite execution history. Suppose the assertion <> P is to be checked on a finite sequence s, and P is false for all states encountered, this does not mean that <> P is not satisfied because P may become true at some later time. Eventually means it will be true at some time in the future, but we do not know when. Therefore a liveness assertion may be false only for infinite sequences - for instance, if <> P is false for all states of the infinite sequence. Therefore one considers normally infinite execution sequences when one talks about liveness.

There are alternative ways to talk about liveness properties for infinite execution sequences, using extension to state-transition diagrams - instead of temporal logic:


Created: September 2, 2014, updated Sept. 22, 2015