ArticleslgStudy

computer science

Linear temporal logic

Linear temporal logic is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Linear temporal logic rather than just read about it. In short: 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 be true until another fact becomes true, etc.

Key takeaways

  • Linear temporal logic belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Linear temporal logic to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Linear temporal logic from memory before moving on to harder problems.

Reference excerpt

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 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). In terms of expressive power, LTL is a fragment of first-order logic. LTL was first proposed for the formal verification of computer programs by Amir Pnueli in 1977.

Syntax LTL is built up from the 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 p ∈ AP then p is an LTL formula; if ψ and φ are LTL formulas then ¬ψ, φ ∨ ψ, X ψ, and φ U ψ are LTL formulas. 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 The context-free grammar of LTL is as follows: φ ::= ⊤ | ⊥ | p | (¬ φ) | ( φ ∧ φ) | ( φ ∨ φ) | ( φ → φ) | (X φ) | (G φ) | (F φ) | ( φ U φ) | ( φ W φ) | ( φ R φ) | ( φ M φ)

Semantics 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 ⊨ ¬ψ if w ⊭ ψ w ⊨ φ ∨ ψ if w ⊨ φ or w ⊨ ψ w ⊨ X ψ if w1 ⊨ ψ (in the next time step ψ must be true) w ⊨ φ U ψ if there exists i ≥ 0 such that wi ⊨ ψ and for all 0 ≤ k < i, wk ⊨ φ (φ must remain true until ψ becomes true) We say an ω-word w satisfies an LTL formula ψ when w ⊨ ψ. The ω-language L(ψ) defined by ψ is {w | w ⊨ ψ}, which is the set of ω-words that satisfy ψ. A formula ψ is satisfiable if there exist an ω-word w such that w ⊨ ψ. A formula ψ is valid if for each ω-word w over alphabet 2AP, we have w ⊨ ψ. The additional logical operators are defined as follows:

φ ∧ ψ ≡ ¬(¬φ ∨ ¬ψ) φ → ψ ≡ ¬φ ∨ ψ φ ↔ ψ ≡ (φ → ψ) ∧ ( ψ → φ) true ≡ p ∨ ¬p, where p ∈ AP false ≡ ¬true The additional temporal operators R, F, and G are defined as follows:

ψ R φ ≡ ¬(¬ψ U ¬φ) ( φ remains true until and including once ψ becomes true. If ψ never becomes true, φ must remain true forever. ψ releases φ.) F ψ ≡ true U ψ (eventually ψ becomes true) G ψ ≡ false R ψ ≡ ¬F ¬ψ (ψ always remains true)

Weak until and strong release 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). It is sometimes useful since both U and R can be defined in terms of the weak until:

ψ W φ ≡ (ψ U φ) ∨ G ψ ≡ ψ U (φ ∨ G ψ) ≡ φ R (φ ∨ ψ) ψ U φ ≡ Fφ ∧ (ψ W φ) ψ R φ ≡ φ W (φ ∧ ψ) 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.

ψ M φ ≡ ¬(¬ψ W ¬φ) ≡ (ψ R φ) ∧ F ψ ≡ ψ R (φ ∧ F ψ) ≡ φ U (ψ ∧ φ) The semantics for the temporal operators are pictorially presented as follows.

Equivalences Let φ, ψ, and ρ be LTL formulas. The following tables list some of the useful equivalences that extend standard equivalences among the usual logical operators.

Negation normal form All the formulas of LTL can be transformed into negation normal form, where

all negations appear only in front of the atomic propositions, only the 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 logics LTL can be shown to be equivalent to the monadic first-order logic of order, FO[<]—a result known as Kamp's theorem— or equivalently to star-free languages. 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 problems 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.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Linear temporal logic

Start with the simplest possible case. Write down what Linear temporal logic claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Linear temporal logic before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Linear temporal logic ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Linear temporal logic

In research
Linear temporal logic appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Linear temporal logic in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Linear temporal logic is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer-related introductions in 1977, Temporal logic, so understanding it makes those chapters shorter.
In everyday life
Look for Linear temporal logic outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Linear temporal logic” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Linear temporal logic in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Linear temporal logic means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Linear temporal logic out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Linear temporal logic in simple terms?

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 be true until another fact becomes true, etc.

Why does Linear temporal logic matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Linear temporal logic?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Linear temporal logic.

Tags

  • Computer-related introductions in 1977
  • Temporal logic

Keep exploring