Template:Short description In logic, linear temporal logic or linear-time temporal logic<ref>Logic in Computer Science: Modelling and Reasoning about Systems: page 175</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> (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 be true until another fact becomes true, etc. It is a fragment of the more complex CTL*, which additionally allows branching time and quantifiers. LTL is sometimes called propositional temporal logic (PTL).<ref name="Gabbay2003">Template:Cite book</ref> In terms of expressive power, LTL is a fragment of first-order logic.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>Template:Cite thesis</ref>
LTL was first proposed for the formal verification of computer programs by Amir Pnueli in 1977.<ref>Amir Pnueli, The temporal logic of programs. Proceedings of the 18th Annual Symposium on Foundations of Computer Science (FOCS), 1977, 46–57. {{#invoke:doi|main}}</ref>
SyntaxEdit
LTL is built up from a finite set of propositional variables AP, the logical operators ¬ and ∨, and the temporal modal operators X (some literature uses O or N) and U. Formally, the set of LTL formulas over AP is inductively defined as follows:
- if Template:Math then p is an LTL formula;
- if Template:Mvar and Template:Mvar are LTL formulas then Template:Math, and Template:Math are LTL formulas.<ref>Sec. 5.1 of Christel Baier and Joost-Pieter Katoen, Principles of Model Checking, MIT Press {{#invoke:citation/CS1|citation
|CitationClass=web }}</ref>
X is read as next and U is read as until. Other than these fundamental operators, there are additional logical and temporal operators defined in terms of the fundamental operators, in order to write LTL formulas succinctly. The additional logical operators are ∧, →, ↔, true, and false. Following are the additional temporal operators.
- G for always (globally)
- F for finally
- R for release
- W for weak until
- M for mighty release
SemanticsEdit
An LTL formula can be satisfied by an infinite sequence of truth valuations of variables in AP. These sequences can be viewed as a word on a path of a Kripke structure (an ω-word over alphabet 2AP). Let w = a0,a1,a2,... be such an ω-word. Let w(i) = ai. Let wi = ai,ai+1,..., which is a suffix of w. Formally, the satisfaction relation ⊨ between a word and an LTL formula is defined as follows:
- w ⊨ p if p ∈ w(0)
- w ⊨ ¬Template:Var if w ⊭ Template:Var
- w ⊨ Template:Var ∨ Template:Var if w ⊨ Template:Var or w ⊨ Template:Var
- Template:Math if w1 ⊨ Template:Var (in the next time step Template:Var must be true)
- Template:Math if there exists i ≥ 0 such that wi ⊨ Template:Var and for all 0 ≤ k < i, wk ⊨ Template:Var (Template:Var must remain true until Template:Var becomes true)
We say an ω-word w satisfies an LTL formula Template:Var when w ⊨ Template:Var. The ω-language L(Template:Var) defined by Template:Var is {w | w ⊨ Template:Var}, which is the set of ω-words that satisfy Template:Var. A formula Template:Var is satisfiable if there exist an ω-word w such that w ⊨ Template:Var. A formula Template:Var is valid if for each ω-word w over alphabet 2AP, we have w ⊨ Template:Var.
The additional logical operators are defined as follows:
- Template:Var ∧ Template:Var ≡ ¬(¬Template:Var ∨ ¬Template:Var)
- Template:Var → Template:Var ≡ ¬Template:Var ∨ Template:Var
- Template:Var ↔ Template:Var ≡ (Template:Var → Template:Var) ∧ ( Template:Var → Template:Var)
- true ≡ p ∨ ¬p, where p ∈ AP
- false ≡ ¬true
The additional temporal operators R, F, and G are defined as follows:
- Template:Var R Template:Var ≡ ¬(¬Template:Var U ¬Template:Var) ( Template:Var remains true until and including once Template:Var becomes true. If Template:Var never becomes true, Template:Var must remain true forever. Template:Var releases Template:Var.)
- Template:Math (eventually Template:Var becomes true)
- G Template:Var ≡ false R Template:Var ≡ ¬F ¬Template:Var (Template:Var always remains true)
Weak until and strong releaseEdit
Some authors also define a weak until binary operator, denoted W, with semantics similar to that of the until operator but the stop condition is not required to occur (similar to release).<ref>Sec. 5.1.5 "Weak Until, Release, and Positive Normal Form" of Principles of Model Checking.</ref> It is sometimes useful since both U and R can be defined in terms of the weak until:
The strong release binary operator, denoted M, is the dual of weak until. It is defined similar to the until operator, so that the release condition has to hold at some point. Therefore, it is stronger than the release operator.
The semantics for the temporal operators are pictorially presented as follows.
Textual | Symbolic | Explanation | Diagram |
---|---|---|---|
Unary operators: | |||
X φ | <math>\bigcirc \varphi</math> | neXt: φ has to hold at the next state. | LTL next operator |
F φ | <math>\Diamond \varphi</math> | Finally: φ eventually has to hold (somewhere on the subsequent path). | LTL eventually operator |
G φ | <math>\Box \varphi</math> | Globally: φ has to hold on the entire subsequent path. | LTL always operator |
Binary operators: | |||
ψ U φ | <math>\psi\;\mathcal{U}\,\varphi</math> | Until: ψ has to hold at least until φ becomes true, which must hold at the current or a future position. | LTL until operator |
ψ R φ | <math>\psi\;\mathcal{R}\,\varphi</math> | Release: φ has to be true until and including the point where ψ first becomes true; if ψ never becomes true, φ must remain true forever. | LTL release operator (which stops) |
ψ W φ | <math>\psi\;\mathcal{W}\,\varphi</math> | Weak until: ψ has to hold at least until φ; if φ never becomes true, ψ must remain true forever. | LTL weak until operator (which stops) |
ψ M φ | <math>\psi\;\mathcal{M}\,\varphi</math> | Strong release: φ has to be true until and including the point where ψ first becomes true, which must hold at the current or a future position. | LTL strong release operator |
EquivalencesEdit
Let φ, ψ, and ρ be LTL formulas. The following tables list some of the useful equivalences that extend standard equivalences among the usual logical operators.
Distributivity | ||
---|---|---|
X (φ ∨ ψ) ≡ (X φ) ∨ (X ψ) | X (φ ∧ ψ) ≡ (X φ) ∧ (X ψ) | X (φ U ψ)≡ (X φ) U (X ψ) |
F (φ ∨ ψ) ≡ (F φ) ∨ (F ψ) | G (φ ∧ ψ) ≡ (G φ) ∧ (G ψ) | |
ρ U (φ ∨ ψ) ≡ (ρ U φ) ∨ (ρ U ψ) | (φ ∧ ψ) U ρ ≡ (φ U ρ) ∧ (ψ U ρ) |
Negation propagation | |||
---|---|---|---|
X is self-dual | F and G are dual | U and R are dual | W and M are dual |
¬X φ ≡ X ¬φ | ¬F φ ≡ G ¬φ | ¬ (φ U ψ) ≡ (¬φ R ¬ψ) | ¬ (φ W ψ) ≡ (¬φ M ¬ψ) |
¬G φ ≡ F ¬φ | ¬ (φ R ψ) ≡ (¬φ U ¬ψ) | ¬ (φ M ψ) ≡ (¬φ W ¬ψ) |
Special temporal properties | ||
---|---|---|
F φ ≡ F F φ | G φ ≡ G G φ | φ U ψ ≡ φ U (φ U ψ) |
φ U ψ ≡ ψ ∨ ( φ ∧ X(φ U ψ) ) | φ W ψ ≡ ψ ∨ ( φ ∧ X(φ W ψ) ) | φ R ψ ≡ ψ ∧ (φ ∨ X(φ R ψ) ) |
G φ ≡ φ ∧ X(G φ) | F φ ≡ φ ∨ X(F φ) |
Negation normal formEdit
All the formulas of LTL can be transformed into negation normal form, where
- all negations appear only in front of the atomic propositions,
- only other logical operators true, false, ∧, and ∨ can appear, and
- only the temporal operators X, U, and R can appear.
Using the above equivalences for negation propagation, it is possible to derive the normal form. This normal form allows R, true, false, and ∧ to appear in the formula, which are not fundamental operators of LTL. Note that the transformation to the negation normal form does not blow up the length of the formula. This normal form is useful in translation from an LTL formula to a Büchi automaton.
Relations with other logicsEdit
LTL can be shown to be equivalent to the monadic first-order logic of order, FO[<]—a result known as Kamp's theorem—<ref>Template:Cite book</ref> or equivalently to star-free languages.<ref>Template:Cite book preprint</ref>
Computation tree logic (CTL) and linear temporal logic (LTL) are both a subset of CTL*, but are incomparable. For example,
- No formula in CTL can define the language that is defined by the LTL formula F(G p).
- No formula in LTL can define the language that is defined by the CTL formulas AG( p → (EXq ∧ EX¬q) ) or AG(EF(p)).
Computational problemsEdit
Model checking and satisfiability against an LTL formula are PSPACE-complete problems. LTL synthesis and the problem of verification of games against an LTL winning condition is 2EXPTIME-complete.<ref> A. Pnueli and R. Rosner. "On the synthesis of a reactive module" In Proceedings of the 16th ACM SIGPLAN-SIGACT Symposium on Principles of programming languages (POPL '89). Association for Computing Machinery, New York, NY, USA, 179–190. https://doi.org/10.1145/75277.75293</ref>
ApplicationsEdit
- Automata-theoretic linear temporal logic model checking
- LTL formulas are commonly used to express constraints, specifications, or processes that a system should follow. The field of model checking aims to formally verify whether a system meets a given specification. In the case of automata-theoretic model checking, both the system of interest and a specification are expressed as separate finite-state machines, or automata, and then compared to evaluate whether the system is guaranteed to have the specified property. In computer science, this type of model checking is often used to verify that an algorithm is structured correctly.
- To check LTL specifications on infinite system runs, a common technique is to obtain a Büchi automaton that is equivalent to the model (accepts an ω-word precisely if it is the model) and another one that is equivalent to the negation of the property (accepts an ω-word precisely it satisfies the negated property) (cf. Linear temporal logic to Büchi automaton). In this case, if there is an overlap in the set of ω-words accepted by the two automata, it implies that the model accepts some behaviors which violate the desired property. If there is no overlap, there are no property-violating behaviors which are accepted by the model. Formally, the intersection of the two non-deterministic Büchi automata is empty if and only if the model satisfies the specified property.<ref>Moshe Y. Vardi. An Automata-Theoretic Approach to Linear Temporal Logic. Proceedings of the 8th Banff Higher Order Workshop (Banff'94). Lecture Notes in Computer Science, vol. 1043, pp. 238–266, Springer-Verlag, 1996. Template:ISBN.</ref>
- Expressing important properties in formal verification
- There are two main types of properties that can be expressed using linear temporal logic: safety properties usually state that something bad never happens (G¬ϕ), while liveness properties state that something good keeps happening (GFψ or G(ϕ →Fψ)).<ref>Bowen Alpern, Fred B. Schneider, Defining Liveness, Information Processing Letters, Volume 21, Issue 4, 1985, Pages 181-185, ISSN 0020-0190, https://doi.org/10.1016/0020-0190(85)90056-0</ref> For example, a safety property may require that an autonomous rover never drives over a cliff, or that a software product never allows a successful login with an incorrect password. A liveness property may require that the rover always continues to collect data samples, or that a software product repeatedly sends telemetry data.
- More generally, safety properties are those for which every counterexample has a finite prefix such that, however it is extended to an infinite path, it is still a counterexample. For liveness properties, on the other hand, every finite path can be extended to an infinite path that satisfies the formula.
- Specification language
- One of the applications of linear temporal logic is the specification of preferences in the Planning Domain Definition Language for the purpose of preference-based planning.Template:Citation needed
ExtensionsEdit
Parametric linear temporal logic extends LTL with variables on the until-modality.<ref>Template:Cite book</ref>
See alsoEdit
ReferencesEdit
External linksEdit
- A presentation of LTL
- Linear-Time Temporal Logic and Büchi Automata
- LTL Teaching slides of professor Alessandro Artale at the Free University of Bozen-Bolzano
- LTL to Buchi translation algorithms a genealogy, from the website of Spot a library for model checking.