In
model checking
In computer science, model checking or property checking is a method for checking whether a finite-state model of a system meets a given specification (also known as correctness). This is typically associated with hardware or software system ...
, a branch of
computer science
Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includin ...
, linear time properties are used to describe requirements of a model of a
computer system
A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations ( computation) automatically. Modern digital electronic computers can perform generic sets of operations known as programs. These prog ...
. Example properties include "the vending machine does not dispense a drink until money has been entered" (a
safety property) or "the computer program eventually terminates" (a
liveness property Properties of an execution of a computer program —particularly for concurrent and distributed systems— have long been formulated by giving ''safety properties'' ("bad things don't happen") and ''liveness properties'' ("good things do happen").
...
). Fairness properties can be used to rule out unrealistic paths of a model. For instance, in a model of two traffic lights, the liveness property "both traffic lights are green infinitely often" may only be true under the unconditional fairness constraint "each traffic light changes colour infinitely often" (to exclude the case where one traffic light is "infinitely faster" than the other).
Formally, a linear time property is an
ω-language over the
power set
In mathematics, the power set (or powerset) of a set is the set of all subsets of , including the empty set and itself. In axiomatic set theory (as developed, for example, in the ZFC axioms), the existence of the power set of any set is ...
of "atomic propositions". That is, the property contains sequences of sets of propositions, each sequence known as a "word". Every property can be rewritten as "''P'' and ''Q'' both occur" for some safety property ''P'' and liveness property ''Q''. An invariant for a system is something that is true or false for a particular state. Invariant properties describe an invariant that every reachable state of a model must satisfy, while persistence properties are of the form "eventually forever some invariant holds".
Temporal logic In logic, temporal logic is any system of rules and symbolism for representing, and reasoning about, propositions qualified in terms of time (for example, "I am ''always'' hungry", "I will ''eventually'' be hungry", or "I will be hungry ''until'' I ...
s such as
linear temporal logic In logic, linear temporal logic or linear-time temporal logic (LTL) is a modal temporal logic with modalities referring to time. In LTL, one can encode formulae about the future of paths, e.g., a condition will eventually be true, a condition will ...
describe types of linear time properties using formulae.
This article is about
propositional linear-time properties and cannot handle predicates about program states, so it cannot define a property like: ''the current value of y determines the number of times that x toggles between 0 and 1 before termination.'' The more general formalism used in
Safety and liveness properties can handle this.
Definition
Let ''AP'' be a set of atomic propositions. A word over
(the
power set
In mathematics, the power set (or powerset) of a set is the set of all subsets of , including the empty set and itself. In axiomatic set theory (as developed, for example, in the ZFC axioms), the existence of the power set of any set is ...
of ''AP'') is an infinite sequence of sets of propositions, such as
(for the atomic propositions
). A linear time (LT) property over ''AP'' is a subset of
i.e. a set of words. An example of an LT property over the set
is "the set of words that contain ''a'' infinitely often". The word ''w'' is in this set, because ''a'' is contained in
, which occurs infinitely often. A word not in this set is
, as ''a'' only occurs once (in the first set).
An LT property is an
ω-language over the alphabet
(and vice versa).
We denote by ''pref''(''w'') the finite prefixes of ''w'' (i.e.
in the above case). The closure of an LT property ''P'' is:
:
Applications

Using the theory of
finite-state machine
A finite-state machine (FSM) or finite-state automaton (FSA, plural: ''automata''), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number ...
s, a program or computer system can be modelled by a
Kripke structure. LT properties then describe restrictions on the traces (outputs) of a Kripke structure. For instance, if two
traffic light
Traffic lights, traffic signals, or stoplights – known also as robots in South Africa are signalling devices positioned at road intersections, pedestrian crossings, and other locations in order to control flows of traffic.
Traffic light ...
s at an intersection are represented by a Kripke structure then the atomic propositions may be the possible colours of each light and it may be desirable that the traces satisfy the LT property "the traffic lights cannot both be green at the same time" (to avoid car collisions).
If every trace of the Kripke structure ''TS'' is a trace of ''TS'' then every LT property that ''TS'' satisfies is satisfied by ''TS''. This is useful in model checking to allow abstraction: if a simplified model of the system satisfies an LT property then the actual model of the system will satisfy it as well.
Classification of linear time properties
Safety properties
A
safety property is informally of the form "a bad thing does not happen". For instance, if a system models an
automated teller machine
An automated teller machine (ATM) or cash machine (in British English) is an electronic telecommunications device that enables customers of financial institutions to perform financial transactions, such as cash withdrawals, deposits, f ...
(ATM) then such a property is "money should not be dispensed unless a PIN has been entered". Formally, a safety property is an LT property such that any word that violates the property has a "bad prefix", for which no word with that prefix satisfies the property. That is,
:
In the ATM example, a ''minimal'' bad prefix is a finite set of steps carried out in which money is dispensed in the last step and a PIN is not entered at any step. To verify a safety property, it is sufficient to consider only the finite traces of a Kripke structure and check whether any such trace is a bad prefix.
An LT property ''P'' is a safety property if and only if
.
Invariant properties
An invariant property is a type of safety property in which the condition only refers to the current state. For instance, the ATM example is not an invariant because we cannot tell whether the property is violated by seeing that the current state is "dispense money", only by seeing that the current state is "dispense money" and no previous state was "read PIN". An example of an invariant is the traffic light condition "the traffic lights cannot both be green at the same time" above. Another is "the variable ''x'' is never negative", in a model of a computer program.
Formally, an invariant is of the form:
:
for some
propositional logic
Propositional calculus is a branch of logic. It is also called propositional logic, statement logic, sentential calculus, sentential logic, or sometimes zeroth-order logic. It deals with propositions (which can be true or false) and relations ...
formula
.
A Kripke structure satisfies an invariant if and only if every reachable state satisfies the invariant, which can be checked by a
breadth-first search
Breadth-first search (BFS) is an algorithm for searching a tree data structure for a node that satisfies a given property. It starts at the tree root and explores all nodes at the present depth prior to moving on to the nodes at the next d ...
or
depth-first search
Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible alo ...
. Safety properties can be verified inductively using invariants.
Liveness properties
A
liveness property Properties of an execution of a computer program —particularly for concurrent and distributed systems— have long been formulated by giving ''safety properties'' ("bad things don't happen") and ''liveness properties'' ("good things do happen").
...
is informally of the form "something good eventually happens". Formally, ''P'' is a liveness property if
i.e. any finite string can be continued to a valid trace. An example of a liveness property is the previous LT property "the set of words that contain ''a'' infinitely often". No finite prefix of a word can prove that the word does not satisfy this property, as the word could continue on to have infinitely many ''a''s.
In terms of computer programs, useful liveness properties include "the program eventually terminates" and, in
concurrent computing
Concurrent computing is a form of computing in which several computations are executed '' concurrently''—during overlapping time periods—instead of ''sequentially—''with one completing before the next starts.
This is a property of a sys ...
, "every
process must eventually be served".
Persistence properties
A persistence property is a liveness property of the form "eventually forever
". That is, a property of the form:
:
Relation between safety and liveness properties
No LT property other than
(the set of all words over
) is both a safety and a liveness property. Though not every property is a safety property or a liveness property (consider "''a'' occurs exactly once"), every property is the intersection of a safety and a liveness property.
In
topology
In mathematics, topology (from the Greek words , and ) is concerned with the properties of a geometric object that are preserved under continuous deformations, such as stretching, twisting, crumpling, and bending; that is, without closing ho ...
, the set of all words
can be equipped with the
metric:
:
Then a safety property is a
closed set
In geometry, topology, and related branches of mathematics, a closed set is a set whose complement is an open set. In a topological space, a closed set can be defined as a set which contains all its limit points. In a complete metric spac ...
and a liveness property is a
dense set
In topology and related areas of mathematics, a subset ''A'' of a topological space ''X'' is said to be dense in ''X'' if every point of ''X'' either belongs to ''A'' or else is arbitrarily "close" to a member of ''A'' — for instance, the ...
.
Fairness properties
Fairness properties are
precondition
In computer programming, a precondition is a condition or predicate that must always be true just prior to the execution of some section of code or before an operation in a formal specification.
If a precondition is violated, the effect of th ...
s imposed on a system to rule out unrealistic traces. Unconditional fairness is of the form "every process gets its turn infinitely often". Strong fairness is of the form "every process gets its turn infinitely often if it is enabled infinitely often". Weak fairness is of the form "every process gets its turn infinitely often if it is continuously enabled from a particular point".
In some systems, a fairness constraint is defined by a set of states, and a "fair path" is one that passes through some state in the fairness constraint infinitely often. If there are multiple fairness constraints, then a fair path must pass infinitely often through one state per constraint. A program "fairly satisfies" an LT property ''P'' with respect to a set of fairness conditions if for every path, either the path fails a fairness condition or it satisfies ''P''. That is, the property ''P'' is satisfied for all fair paths.
A fairness property is realizable for a Kripke structure if every reachable state has a fair path starting from that state. So long as a set of fairness conditions are realizable, they are irrelevant to safety properties.
Temporal logic
Temporal logic In logic, temporal logic is any system of rules and symbolism for representing, and reasoning about, propositions qualified in terms of time (for example, "I am ''always'' hungry", "I will ''eventually'' be hungry", or "I will be hungry ''until'' I ...
s such as
computation tree logic (CTL) can be used to specify some LT properties. All
linear temporal logic In logic, linear temporal logic or linear-time temporal logic (LTL) is a modal temporal logic with modalities referring to time. In LTL, one can encode formulae about the future of paths, e.g., a condition will eventually be true, a condition will ...
(LTL) formulae are LT properties. By a counting argument, we see that any logic in which each formula is a finite string cannot represent all LT properties, as there must be countably many formulae but there are uncountably many LT properties.
Notes
References
*
*
*
*
*
*
Further reading
*
* {{cite journal , last=Pnueli , first=Amir , author-link=Amir Pnueli , year=1986 , title=Applications of temporal logic to the specification and verification of reactive systems: A survey of current trends , journal=Current Trends in Concurrency , pages=510–584
Model checking