# 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 eat something"). It is sometimes also used to refer to tense logic, a modal logic-based system of temporal logic introduced by Arthur Prior in the late 1950s, with important contributions by Hans Kamp. It has been further developed by computer scientists, notably Amir Pnueli, and logicians.
Temporal logic has found an important application in formal verification, where it is used to state requirements of hardware or software systems. For instance, one may wish to say that whenever a request is made, access to a resource is eventually granted, but it is never granted to two requestors simultaneously. Such a statement can conveniently be expressed in a temporal logic.

## Motivation

Consider the statement "I am hungry". Though its meaning is constant in time, the statement's truth value can vary in time. Sometimes it is true, and sometimes false, but never simultaneously true and false. In a temporal logic, a statement can have a truth value that varies in time—in contrast with an atemporal logic, which applies only to statements whose truth values are constant in time. This treatment of truth-value over time differentiates temporal logic from computational verb logic.
Temporal logic always has the ability to reason about a timeline. So-called "linear-time" logics are restricted to this type of reasoning. Branching-time logics, however, can reason about multiple timelines. This permits in particular treatment of environments that may act unpredictably. To continue the example, in a branching-time logic we may state that "there is a possibility that I will stay hungry forever", and that "there is a possibility that eventually I am no longer hungry". If we do not know whether or not I will ever be fed, these statements can both be true.

## History

Although Aristotle's logic is almost entirely concerned with the theory of the categorical syllogism, there are passages in his work that are now seen as anticipations of temporal logic, and may imply an early, partially developed form of first-order temporal modal bivalent logic. Aristotle was particularly concerned with the problem of future contingents, where he could not accept that the principle of bivalence applies to statements about future events, i.e. that we can presently decide if a statement about a future event is true or false, such as "there will be a sea battle tomorrow".
There was little development for millennia, Charles Sanders Peirce noted in the 19th century:
   Time has usually been considered by logicians to be what is called 'extralogical' matter. I have never shared this opinion. But I have thought that logic had not yet reached the state of development at which the introduction of temporal modifications of its forms would not result in great confusion; and I am much of that way of thinking yet.
Surprisingly for Peirce, the first system of temporal logic was constructed, as far as we know, in the first half of 20th century. Although Arthur Prior is widely known as a founder of temporal logic, the first formalization of such logic was provided in 1947 by Polish logician, Jerzy Łoś. In his work Podstawy Analizy Metodologicznej Kanonów Milla (The Foundations of a Methodological Analysis of Mill’s Methods) he presented a formalization of Mill's canons. In Łoś' approach, emphasis was placed on the time factor. Thus, to reach his goal, he had to create a logic that could provide means for formalization of temporal functions. The logic could be seen as a byproduct of Łoś' main aim, albeit it was the first positional logic that, as a framework, was used later for Łoś' inventions in epistemic logic. The logic itself has syntax very different than Prior's tense logic, which uses modal operators. The language of Łoś' logic rather uses a realization operator, specific to positional logic, which binds the expression with the specific context in which its truth-value is considered. In Łoś' work this considered context was only temporal, thus expressions were bound with specific moments or intervals of time.
In the following years, research of temporal logic by Arthur Prior began. He was concerned with the philosophical implications of free will and predestination. According to his wife, he first considered formalizing temporal logic in 1953. Results of his research were first presented at the conference in Wellington in 1954. The system Prior presented, was similar syntactically to Łoś' logic, although not until 1955 did he explicitly refer to Łoś' work, in the last section of Appendix 1 in Prior’s Formal Logic.
Prior gave lectures on the topic at the University of Oxford in 1955–6, and in 1957 published a book, Time and Modality, in which he introduced a propositional modal logic with two temporal connectives (modal operators), F and P, corresponding to "sometime in the future" and "sometime in the past". In this early work, Prior considered time to be linear. In 1958 however, he received a letter from Saul Kripke, who pointed out that this assumption is perhaps unwarranted. In a development that foreshadowed a similar one in computer science, Prior took this under advisement, and developed two theories of branching time, which he called "Ockhamist" and "Peircean". Between 1958 and 1965 Prior also corresponded with Charles Leonard Hamblin, and a number of early developments in the field can be traced to this correspondence, for example Hamblin implications. Prior published his most mature work on the topic, the book Past, Present, and Future in 1967. He died two years later.
Along with tense logic, Prior constructed a few systems of positional logic, which inherited their main ideas from Łoś. Work in positional temporal logics was continued by Nicholas Rescher in the 60s and 70s. In such works as Note on Chronological Logic (1966), On the Logic of Chronological Propositions (1968), Topological Logic (1968), and Temporal Logic (1971) he researched connections between Łoś' and Prior's systems. Moreover, he proved that Prior's tense operators could be defined using a realization operator in specific positional logics. Rescher, in his work, also created more general systems of positional logics. Although the first ones were constructed for purely temporal uses, he proposed the term topological logics for logics that were meant to contain a realization operator but had no specific temporal axioms—like the clock axiom.
The binary temporal operators Since and Until were introduced by Hans Kamp in his 1968 Ph.D. thesis, which also contains an important result relating temporal logic to first-order logic—a result now known as Kamp's theorem.
Two early contenders in formal verifications were linear temporal logic, a linear-time logic by Amir Pnueli, and computation tree logic (CTL), a branching-time logic by Mordechai Ben-Ari, Zohar Manna and Amir Pnueli. An almost equivalent formalism to CTL was suggested around the same time by E. M. Clarke and E. A. Emerson. The fact that the second logic can be decided more efficiently than the first does not reflect on branching- and linear-time logics in general, as has sometimes been argued. Rather, Emerson and Lei show that any linear-time logic can be extended to a branching-time logic that can be decided with the same complexity.

## Łoś's positional logic

Łoś’s logic was published as his 1947 master’s thesis Podstawy Analizy Metodologicznej Kanonów Milla (The Foundations of a Methodological Analysis of Mill’s Methods). His philosophical and formal concepts could be seen as continuations of those of the Lviv–Warsaw School of Logic, as his supervisor was Jerzy Słupecki, disciple of Jan Łukasiewicz. The paper was not translated into English until 1977, although Henryk Hiż presented in 1951 a brief, but informative, review in the Journal of Symbolic Logic. This review contained core concepts of Łoś’s work and was enough to popularize his results among the logical community. The main aim of this work was to present Mill's canons in the framework of formal logic. To achieve this goal the author researched the importance of temporal functions in the structure of Mill's concept. Having that, he provided his axiomatic system of logic that would fit as a framework for Mill's canons along with their temporal aspects.

### Syntax

The language of the logic first published in Podstawy Analizy Metodologicznej Kanonów Milla (The Foundations of a Methodological Analysis of Mill’s Methods) consisted of:
* first-order logic operators ‘¬’, ‘∧’, ‘∨’, ‘→’, ‘≡’, ‘∀’ and ‘∃’
* realization operator U
* functional symbol δ
* propositional variables p$_1$,p$_2$,p$_3$,...
* variables denoting time moments t$_1$,t$_2$,t$_3$,...
* variables denoting time intervals n$_1$,n$_2$,n$_3$,...
The set of terms (denoted by S) is constructed as follows:
* variables denoting time moments or intervals are terms
* if $\tau \in S$ and $\epsilon$ is a time interval variable, then $\delta (\tau ,\epsilon )\in S$
The set of formulas (denoted by For) is constructed as follows:
* all first-order logic formulas are valid
* if $\tau \in S$ and $\phi$ is a propositional variable, then $U_{\tau }(\phi )\in For$
* if $\phi \in For$, then $\neg \phi \in For$
* if $\phi ,\psi \in For$ and $\circ \in \{\wedge ,\vee ,\rightarrow ,\equiv \}$, then $\phi \circ \psi \in For$
* if $\phi \in For$ and $Q\in \{\forall ,\exists \}$ and υ is a propositional, moment or interval variable, then $Q_{\upsilon }\phi \in For$

### Original Axiomatic System

* $U_{t_{1}}\neg p_{1}\equiv \neg U_{t_{1}}p_{1}$
* $U_{t_{1}}(p_{1}\rightarrow p_{2})\rightarrow (U_{t_{1}}p_{1}\rightarrow U_{t_{1}}p_{2})$
* $U_{t_{1}}((p_{1}\rightarrow p_{2})\rightarrow ((p_{2}\rightarrow p_{3})\rightarrow (p_{1}\rightarrow p_{3})))$
* $U_{t_{1}}(p_{1}\rightarrow (\neg p_{1}\rightarrow p_{2}))$
* $U_{t_{1}}((\neg p_{1}\rightarrow p_{1})\rightarrow p_{1})$
* $\forall _{t_{1}}U_{t_{1}}p_{1}\rightarrow p_{1}$
* $\forall _{t_{1}}\forall _{n_{1}}\exists _{t_{2}}\forall _{p_{1}}(U_{\delta (t_{1},n_{1})}p_{1}\equiv U_{t_{2}}p_{1})$
* $\forall _{t_{1}}\forall _{n_{1}}\exists _{t_{2}}\forall _{p_{1}}(U_{\delta (t_{2},n_{1})}p_{1}\equiv U_{t_{1}}p_{1})$
* $\forall _{t_{1}}\exists _{p_{1}}\forall _{t_{2}}(U_{t_{2}}p_{1}\equiv \forall _{p_{2}}(U_{t_{1}}p_{2}\equiv U_{t_{2}}p_{2}))$

## Prior's tense logic (TL)

The sentential tense logic introduced in Time and Modality has four (non-truth-functional) modal operators (in addition to all usual truth-functional operators in first-order propositional logic).
* P: "It was the case that..." (P stands for "past")
* F: "It will be the case that..." (F stands for "future")
* G: "It always will be the case that..."
* H: "It always was the case that..."
These can be combined if we let π be an infinite path:
* $\pi \vDash FG\phi$: "At a certain point, $\phi$ is true at all future states of the path"
* $\pi \vDash GF\phi$: "$\phi$ is true at infinitely many states on the path"
From P and F one can define G and H, and vice versa:
    ${\begin{aligned}F&\equiv \lnot G\lnot \\P&\equiv \lnot H\lnot \end{aligned}}$

### Syntax and semantics

A minimal syntax for TL is specified with the following BNF grammar:
    $\phi ::=a\;|\;\bot \;|\;\lnot \phi \;|\;\phi \lor \phi \;|\;G\phi \;|\;H\phi$
where a is some atomic formula.
Kripke models are used to evaluate the truth of sentences in TL. A pair (T, <) of a set T and a binary relation < on T (called "precedence") is called a frame. A model is given by triple (T, <, V) of a frame and a function V called a valuation that assigns to each pair (a, u) of an atomic formula and a time value some truth value. The notion "ϕ is true in a model U=(T, <, V) at time u" is abbreviated U⊨ϕ[u]. With this notation,
| Statement | ... is true just when |
| U⊨a[u] | V(a,u)=true |
| U⊨¬ϕ[u] | not U⊨ϕ[u] |
| U⊨(ϕ∧ψ)[u] | U⊨ϕ[u] and U⊨ψ[u] |
| U⊨(ϕ∨ψ)[u] | U⊨ϕ[u] or U⊨ψ[u] |
| U⊨(ϕ→ψ)[u] | U⊨ψ[u] if U⊨ϕ[u] |
| U⊨Gϕ[u] | U⊨ϕ[v] for all v with u<v |
| U⊨Hϕ[u] | U⊨ϕ[v] for all v with v<u |
Given a class F of frames, a sentence ϕ of TL is
* valid with respect to F if for every model U=(T,<,V) with (T,<) in F and for every u in T, U⊨ϕ[u]
* satisfiable with respect to F if there is a model U=(T,<,V) with (T,<) in F such that for some u in T, U⊨ϕ[u]
* a consequence of a sentence ψ with respect to F if for every model U=(T,<,V) with (T,<) in F and for every u in T, if U⊨ψ[u], then U⊨ϕ[u]
Many sentences are only valid for a limited class of frames. It is common to restrict the class of frames to those with a relation < that is transitive, antisymmetric, reflexive, trichotomic, irreflexive, total, dense, or some combination of these.

### A minimal axiomatic logic

Burgess outlines a logic that makes no assumptions on the relation <, but allows for meaningful deductions, based on the following axiom schema:
* A where A is a tautology of first-order logic
* G(A→B)→(GA→GB)
* H(A→B)→(HA→HB)
* A→GPA
* A→HFA
with the following rules of deduction:
* given A→B and A, deduce B (modus ponens)
* given a tautology A, infer GA
* given a tautology A, infer HA
One can derive the following rules:
* Becker's rule: given A→B, deduce TA→TB where T is a tense, any sequence made of G, H, F, and P.
* Mirroring: given a theorem A, deduce its mirror statement A$^§$, which is obtained by replacing G by H (and so F by P) and vice versa.
* Duality: given a theorem A, deduce its dual statement A*, which is obtained by interchanging ∧ with ∨, G with F, and H with P.

### Translation to predicate logic

Burgess gives a Meredith translation from statements in TL into statements in first-order logic with one free variable x$_0$ (representing the present moment). This translation M is defined recursively as follows:
    ${\begin{aligned}&M(a)&&=a^{*}x_{0}\\&M(\lnot \phi )&&=\lnot M(\phi )\\&M(\phi \land \psi )&&=M(\phi )\land M(\psi )\\&M({\mathsf {G}}\phi )&&=\forall x_{1}(x_{0}<x_{1}\rightarrow M(A^{+}))\\&M({\mathsf {H}}\phi )&&=\forall x_{1}(x_{1}<x_{0}\rightarrow M(A^{+}))\end{aligned}}$
where $A^{+}$ is the sentence A with all variable indices incremented by 1 and $a^{*}$ is a one-place predicate defined by $x\mapsto V(a,x)$.

## Temporal operators

Temporal logic has two kinds of operators: logical operators and modal operators. Logical operators are usual truth-functional operators ($\neg ,\lor ,\land ,\rightarrow$). The modal operators used in linear temporal logic and computation tree logic are defined as follows.
| Textual | Symbolic | Definition | Explanation |
| Binary operators ||||
| φ U ψ | $\phi ~{\mathcal {U}}~\psi$ | $(B\,{\mathcal {U}}\,C)(\phi )=\ (\exists i:C(\phi _{i})\land (\forall j<i:B(\phi _{j})))$ | Until: ψ holds at the current or a future position, and φ has to hold until that position. At that position φ does not have to hold any more. |
| φ R ψ | $\phi ~{\mathcal {R}}~\psi$ | $(B\,{\mathcal {R}}\,C)(\phi )=\ (\forall i:C(\phi _{i})\lor (\exists j<i:B(\phi _{j})))$ | Release: φ releases ψ if ψ is true up until and including the first position in which φ is true (or forever if such a position does not exist). |
| Unary operators ||||
| N φ | $\bigcirc \phi$ | ${\mathcal {N}}B(\phi _{i})=B(\phi _{i+1})$ | Next: φ has to hold at the next state. (X is used synonymously.) |
| F φ | $\Diamond \phi$ | ${\mathcal {F}}B(\phi )=(true\,{\mathcal {U}}\,B)(\phi )$ | Future: φ eventually has to hold (somewhere on the subsequent path). |
| G φ | $\Box \phi$ | ${\mathcal {G}}B(\phi )=\neg {\mathcal {F}}\neg B(\phi )$ | Globally: φ has to hold on the entire subsequent path. |
| A φ | $\forall \phi$ | $({\mathcal {A}}B)(\psi )=\ (\forall \phi :\phi _{0}=\psi \to B(\phi ))$ | All: φ has to hold on all paths starting from the current state. |
| E φ | $\exists \phi$ | $({\mathcal {E}}B)(\psi )=\ (\exists \phi :\phi _{0}=\psi \land B(\phi ))$ | Exists: there exists at least one path starting from the current state where φ holds. |
Alternate symbols:
* operator R is sometimes denoted by V
* The operator W is the weak until operator: $f\mathbf {W} g$ is equivalent to $f\mathbf {U} g\lor \mathbf {G} f$
Unary operators are well-formed formulas whenever B(φ) is well-formed. Binary operators are well-formed formulas whenever B(φ) and C(φ) are well-formed.
In some logics, some operators cannot be expressed. For example, N operator cannot be expressed in temporal logic of actions.

## Temporal logics

Temporal logics include:
* Some systems of positional logic
* Linear temporal logic (LTL) temporal logic without branching timelines
* Computation tree logic (CTL) temporal logic with branching timelines
* Interval temporal logic (ITL)
* Temporal logic of actions (TLA)
* Signal temporal logic (STL)
* Timestamp temporal logic (TTL)
* Property specification language (PSL)
* CTL*, which generalizes LTL and CTL
* Hennessy–Milner logic (HML)
* Modal μ-calculus, which includes as a subset HML and CTL*
* Metric temporal logic (MTL)
* Metric interval temporal logic (MITL)
* Timed propositional temporal logic (TPTL)
* Truncated Linear Temporal Logic (TLTL)
* Hyper temporal logic (HyperLTL)
A variation, closely related to temporal or chronological or tense logics, are modal logics based upon "topology", "place", or "spatial position".