Linear-Time Temporal Answer Set Programming

In this survey, we present an overview on (Modal) Temporal Logic Programming in view of its application to Knowledge Representation and Declarative Problem Solving. The syntax of this extension of logic programs is the result of combining usual rules with temporal modal operators, as in Linear-time Temporal Logic (LTL). In the paper, we focus on the main recent results of the non-monotonic formalism called Temporal Equilibrium Logic (TEL) that is deﬁned for the full syntax of LTL but involves a model selection criterion based on Equilibrium Logic , a well known logical characterization of Answer Set Programming (ASP). As a result, we obtain a proper extension of the stable models semantics for the general case of temporal formulas in the syntax of LTL. We recall the basic deﬁnitions for TEL and its monotonic basis, the temporal logic of Here-and-There (THT), and study the diﬀerences between ﬁnite and inﬁnite trace length. We also provide further useful results, such as the translation into other formalisms like Quantiﬁed Equilibrium Logic and Second-order LTL, and some techniques for computing temporal stable models based on automata constructions. In the remainder of the paper, we focus on practical aspects, deﬁning a syntactic fragment called (modal) temporal logic programs closer to ASP, and explaining how this has been exploited in the construction of the solver telingo , a temporal extension of the well-known ASP solver clingo that uses its incremental solving capabilities. https://www.cambridge.org/core.


Introduction
The term Temporal Logic Programming 1 was introduced in the late 1980s to refer to an extension of logic programs that incorporates modal temporal operators, usually from Linear-time Temporal Logic or LTL (Kamp 1968;Pnueli 1977). These LTL extensions of logic programming include proposals by Moszkowski (1986), Fujita et al . (1986), Gabbay (1987b), Abadi and Manna (1989), Baudinet (1992) or Orgun and Wadge (1990). However, the initial interest gradually cooled down over time and LTL extensions have neither become a common feature nor had a substantial impact in Prolog. With the appearance of Answer Set Programming or ASP (Lifschitz 2002) and its use as a formalism for practical knowledge representation, the interest in the specification of dynamic systems was renewed. ASP has been commonly used for temporal reasoning and the representation of action theories, following the methodology proposed by Gelfond and Lifschitz (1993). This methodology represents transition systems by adding to all time-dependent predicates an extra integer parameter: the time point T ranging over the finite interval 0, 1, . . . , n−1 where n ∈ N is some fixed length that can be iteratively increased. A major disadvantage of this representation is that it provides neither special language constructs nor specific inference methods for temporal reasoning, as available in LTL. As a result, it is infeasible to represent properties of reactive systems (with infinite runs or traces) such as safety ("Is some particular state reachable?"), liveness ("Does some condition happen infinitely often?"), or to conclude that a given planning problem has no solution at all. Even if we restrict ourselves to finite traces, 2 we cannot exploit in non-temporal ASP the succinctness of LTL expressions for characterizing plans of interest (say, sentences like "never execute A if B ∨ C has held since D", etc) or the interpretation of such expressions by their well-known translations into automata.
In this paper, we focus on the temporal extension of ASP with operators from LTL. Combinations of ASP with other temporal logics are outside the scope of this paper, although an overall comparison is given in Section 7. In particular, we give an overview of the main definitions and results for the (modal) Temporal Logic Programming formalism called Temporal Equilibrium Logic or TEL (Cabalar and Vega 2007). As suggested by its name, it combines LTL with the logical characterization of ASP based on Equilibrium Logic (Pearce 1997). Although TEL was introduced more than a decade ago and a first survey was already presented by , several important advances have taken place since then, providing significant breakthroughs. On the theoretical side, apart from new results on complexity and expressiveness (Bozzelli and Pearce 2015;Balbiani and Diéguez 2016;, the most important feature has arguably been the redefinition of TEL to cope not only with infinite traces, as in its original version, but also with finite traces , following similar steps to the same variation introduced for LTL by De Giacomo and Vardi (2013). On the practical side, finite traces are much better suited to the way in which ASP is used to solve planning problems and have paved the way for the introduction of temporal operators into the 4 F. Aguado et al. Past • for previous S for since T for trigger Future • for next for until for release for while the intended meaning of the previous temporal operators is the following: •ϕ (resp. •ϕ) means that ϕ is true at the previous (resp. next) time point. ϕ ψ means that ϕ is true until ψ is true, while ϕ S ψ can be read as ϕ is true since ψ was true. For ϕ ψ and ϕ T ψ the meaning is not as direct as for the previous operators. ϕ ψ means that ψ is true until both ϕ and ψ become true simultaneously or ψ is true forever. ϕ T ψ means that ψ is true since both ϕ and ψ became true simultaneously or ψ has been true from the beginning.
We also define several common derived operators like the Boolean connectives def = ¬⊥, ¬ϕ def = ϕ → ⊥, ϕ ↔ ψ def = (ϕ → ψ) ∧ (ψ → ϕ), and the following temporal operators: A (temporal) theory is a (possibly infinite) set of temporal formulas. Note that we use solid operators to refer to the past, while future-time operators are denoted by outlined symbols.
Although THT and LTL share the same syntax, they have a different semantics, the former being a weaker logic than the latter. The semantics of LTL relies on the concept of a trace, a (possibly infinite) sequence of states, each of which is a set of atoms. For defining traces, we start by introducing some notation to deal with intervals of integer time points. Given a ∈ N and b ∈ N∪{ω}, we let [a..b] stand for the set {i ∈ N | a ≤ i ≤ b}, [a..b) for {i ∈ N | a ≤ i < b} and (a..b] for {i ∈ N | a < i ≤ b}. In LTL, a trace T of length λ over alphabet A is a sequence T = (T i ) i∈ [0..λ) of sets T i ⊆ A. We sometimes use the notation |T| def = λ to stand for the length of the trace. We say that T is infinite if |T| = ω and finite if |T| ∈ N. To represent a given trace, we write a sequence of sets of atoms concatenated with '·'. For instance, the finite trace {a} · ∅ · {a} · ∅ has length 4 and makes a true at even time points and false at odd ones. For infinite traces, we sometimes use ω-regular expressions like, for instance, in the infinite trace ({a} · ∅) ω where all even positions make a true and all odd positions make it false.
At each state T i in a trace, an atom a can only be true, viz. a ∈ T i , or false, a ∈ T i . The logic THT weakens this truth assignment, following the same intuitions as the (nontemporal) logic of HT. In THT, an atom can have one of three truth-values in each state, namely, false, assumed (or true by default) or proven (or certainly true). Anything proved has to be assumed, but the opposite does not necessarily hold. Following this idea, a state i is represented as a pair of sets of atoms H i , T i with H i ⊆ T i ⊆ A where H i (standing for "here") contains the proven atoms, whereas T i (standing for "there") contains the assumed atoms. On the other hand, false atoms are just the ones not assumed, captured by A \ T i . Accordingly, a Here-and-There trace (for short HTtrace) of length λ over alphabet A is a sequence of pairs ( H i , T i ) i∈ [0..λ) with H i ⊆ T i for any i ∈ [0..λ). For convenience, we usually represent the HT-trace as the pair H, T of traces H = (H i ) i∈[0..λ) and T = (T i ) i∈ [0..λ) . Given M = H, T , we also denote its length Linear-Time Temporal Answer Set Programming 5 as |M| def = |H| = |T| = λ. Note that the two traces H, T must satisfy a kind of order relation, since H i ⊆ T i for each time point i. Formally, we define the ordering H ≤ T between two traces of the same length λ as H i ⊆ T i for each i ∈ [0..λ). Furthermore, we define H < T as both H ≤ T and H = T. Thus, an HT-trace can also be defined as any pair H, T of traces such that H ≤ T. The particular type of HT-traces satisfying H = T are called total.
We proceed by generalizing the extension of HT with temporal operators, called THT , to HT-traces of fixed length in order to integrate finite as well as infinite traces. Given any HT-trace M = H, T , we define the THT satisfaction of formulas as follows.
Definition 1 (THT-satisfaction; Cabalar et al. 2018  In general, these conditions inherit the interpretation of connectives from LTL (with past operators) with just a few differences. A first minor variation is that we allow traces of arbitrary length λ, including both infinite (λ = ω) and finite (λ ∈ N) traces. The most significant difference, however, has to do with the treatment of implication, which is inherited from the intermediate logic of HT. It requires that the implication is satisfied in "both dimensions" H (here) and T (there) of the trace, using H, T (as in the other connectives) but also T, T . Finally, one last difference with respect to LTL is the new connective ϕ ψ which is also a kind of temporally iterated HT implication. Its intuitive reading 4 is "keep doing ϕ while condition ψ holds." In LTL, ϕ ψ would just amount to ¬ψ ϕ, but under HT semantics both formulas have a different meaning, as the latter may provide evidence for ϕ even though the condition ψ does not hold. 6 F. Aguado et al. An HT-trace M is a model of a temporal theory Γ if M, 0 |= ϕ for all ϕ ∈ Γ. We write THT(Γ, λ) to stand for the set of THT-models of length λ of a theory Γ, and define THT(Γ) def = THT(Γ, ω) ∪ λ∈N THT(Γ, λ). That is, THT(Γ) is the whole set of models of Γ of any length. For Γ = {ϕ}, we just write THT(ϕ, λ) and THT(ϕ). We can analogously define LTL (Γ, λ), that is, the set of traces of length λ that satisfy theory Γ, and LTL(Γ), that is, the LTL-models of Γ any length. We omit specifying LTL satisfaction since it coincides with THT when HT-traces are total.
In fact, total models can be forced by adding the following set of excluded middle axioms: (a ∨ ¬a) for each atom a ∈ A in the alphabet.
Proposition 2 Cabalar et al. 2018) Let H, T be an HT-trace and (EM) the theory containing all excluded middle axioms for every atom a ∈ A. Then, H, T is a model of (EM) iff H = T.
Satisfaction of derived operators can be easily deduced, as shown next.
Proposition 3 Cabalar et al. 2018) Let M = H, T be an HT-trace of length λ over A. Given the respective definitions of derived operators, we get the following satisfaction conditions: A formula ϕ is a tautology (or is valid ), written |= ϕ, iff M, k |= ϕ for any HT-trace M and any k ∈ [0..λ). We call the logic induced by the set of all tautologies Temporal logic of Here-and-There (THT for short). Several types of equivalence can be defined in THT. In this sense, it is important to observe that being equivalent is something generally stronger than simply having the same set of models. Two formulas ϕ, ψ are (globally) equivalent, written ϕ ≡ ψ, iff |= ϕ ↔ ψ, that is, M, k |= ϕ ↔ ψ for any HT-trace M of length λ and any k ∈ [0..λ). THT-equivalence satisfies the rule of substitution of equivalents:

Proposition 4 (Substitution of equivalents)
Let γ[ϕ] be a formula with some occurrence of subformula ϕ and γ[ψ] denote the replacement of that occurrence by ψ in γ [ϕ].

7
On the other hand, we say that ϕ, ψ are just initially equivalent, written ϕ ≡ 0 ψ, if they have the same models THT(ϕ) = THT(ψ), that is, M, 0 |= ϕ iff M, 0 |= ψ, for any HT-trace M. Obviously, ϕ ≡ ψ implies ϕ ≡ 0 ψ but not vice versa. For example, note that •a ≡ 0 ⊥, since •a is always false at the initial situation, whereas in the general case •a ≡ ⊥ or, otherwise, we could always replace •a by ⊥ in any context.
One important remark is that the finiteness of a trace H, T only affects the satisfaction of formulas dealing with future-time operators. In particular, if H, T has some finite length λ = n, then, in the semantics for , and in Definition 1, index j ranges over the finite interval {k, . . . , n− 1}. Besides, if λ = n, the satisfaction of • forces k < n, which implies that there does exist a next state k + 1. As a result, the formula • is not always satisfied, since it is false whenever k = n = λ.
Operators I and exclusively depend on the value of time point k, so that the valuation of atoms in H, T is irrelevant to them. As a result, they behave "classically" and satisfy the law of the excluded middle, that is, I∨¬I and ∨¬ are THT tautologies. Besides, operator can only be true in finite traces. This implies that the inclusion of axiom ♦ in any theory forces its models to be finite traces, while including its negation ¬♦ causes the opposite effect, that is, all models of the theory are infinite traces. Several logics stronger than THT can be obtained by the addition of axioms (or the corresponding restriction on sets of traces). For instance, THT ω is defined as THT plus ¬♦ , that is, THT where we exclusively consider infinite HT-traces. 5 THT f , the finitetrace version, corresponds to THT plus ♦ . Linear Temporal Logic for possibly infinite traces, LTL, can be obtained as THT plus (EM), that is, THT with total HT-traces, LTL ω is captured by THT ω plus (EM), that is, infinite and total HT-traces, and finally LTL f can be obtained as THT f plus (EM), that is, LTL on finite traces (De Giacomo and Vardi 2013).
We study more properties and results about THT later on, but we proceed next to define its non-monotonic extension, TEL.

Non-monotonic extension: Temporal Equilibrium logic
Given a set of THT-models, we define the ones in equilibrium as follows.
Definition 2 (Temporal Equilibrium/Stable Model ) Let S be some set of HT-traces.
A total HT-trace T, T ∈ S is a temporal equilibrium model of S iff there is no other The trace T is called a temporal stable model (TS-model) of S.
We further talk about temporal equilibrium or temporal stable models of a theory Γ when S = THT(Γ), respectively. Moreover, we write TEL(Γ, λ) and TEL(Γ) to stand for the temporal equilibrium models of THT(Γ, λ) and THT(Γ) respectively. The corresponding sets of TS-models are denoted as TSM(Γ, λ) and TSM(Γ) respectively. One interesting observation is that, since temporal equilibrium models are total models T, T , due to Proposition 1, we obtain TSM(Γ, λ) ⊆ LTL(Γ, λ) that is, temporal stable models are a subset of LTL-models.

8
F. Aguado et al. Since the ordering relation among traces is only defined for a fixed λ, the following can be easily observed: Proposition 5  The set of temporal equilibrium models of Γ can be partitioned by the trace length λ, that is, ω λ=0 TEL(Γ, λ) = TEL(Γ). TEL is the (non-monotonic) logic induced by temporal equilibrium models. We can also define the variants TEL ω and TEL f by applying the corresponding restriction to infinite and finite traces, respectively.
As an example of non-monotonicity, consider the formula that corresponds to the inertia for loaded , together with the fact loaded , describing the initial state for that fluent. Without entering into too much detail, this formula behaves as the logic program with the rules: loaded (0). loaded (T) :-loaded (T -1) , not unloaded (T ). for any time point T>0. As expected, for some fixed λ, we get a unique temporal stable model of the form {loaded } λ . This entails that loaded is always true, viz. loaded , as there is no reason for unloaded to become true. Note that in the most general case of TEL, we actually get one stable model per each possible λ, including λ = ω. Now, consider formula (1) along with loaded ∧ ••unloaded which amounts to adding the fact unloaded(2). As expected, for each λ, the only temporal stable model now is T = {loaded } · {loaded } · {unloaded } · ∅ α where α can be * or ω. Note that by making ••unloaded true, we are also forcing |T| ≥ 3, that is, there are no temporal stable models (nor even THT-models) of length smaller than three. Thus, by adding the new information ••unloaded some conclusions that could be derived before, such as loaded , are not derivable any more.
As an example emphasizing the behavior of finite traces, take the formula which can be seen as a program rule "a(T+1) :-not a(T)" for any natural number T. As expected, temporal stable models make a false in even states and true in odd ones. However, we cannot take finite traces making a false at the final state λ − 1, since the rule would force •a and this implies the existence of a successor state. As a result, the temporal stable models of this formula have the form (∅ · {a}) + for finite traces in TEL f , or the infinite trace (∅ · {a}) ω in TEL ω . Another interesting example is the temporal formula The corresponding rules "a(T) :-not a(T+1)" and "a(T) :-a(T+1)" have no stable model (Fages 1994) when grounded for all natural numbers T. This is because there is no way to build a finite proof for any a(T), as it depends on infinitely many next states to be evaluated. The same happens in TEL ω , that is, we get no infinite temporal stable model.
However in TEL f , we can use the fact that •a is always false in the last state. Then, (¬•a → a) supports a in that state and therewith (•a → a) inductively supports a everywhere.

9
As an example of a temporal expression not so close to logic programming, consider the formula ♦a, which is normally used in LTL ω to assert that a occurs infinitely often. As discussed by De Giacomo and Vardi (2013), if we assume finite traces, then the formula collapses to ( → a) in LTL f , that is, a is true at the final state (and either true or false everywhere else). The same behavior is obtained in THT ω and THT f , respectively. However, if we move to TEL, a truth minimization is additionally required. As a result, in TEL f , we obtain a unique temporal stable model for each fixed λ ∈ N, in which a is true at the last state, and false everywhere else. Unlike this, TEL ω yields no temporal stable model at all. This is because for any T with an infinite number of a's we can always take some H from which we remove a at some state, and still have an infinite number of a's in H. Thus, for any total THT ω -model T, T of ♦a there always exists some model H, T with strictly smaller H < T. Note that we can still specify infinite traces with an infinite number of occurrences of a, but at the price of removing the truth minimization for that atom. This can be done, for instance, by adding the excluded middle axiom (EM) for atom a. In this way, infinite traces satisfying ♦a ∧ (a ∨ ¬a) are those that contain an infinite number of a's. In fact, if we add the excluded middle axiom for all atoms, TEL collapses into LTL, as stated below.
Proposition 6 Cabalar et al. 2018) Let Γ be a temporal theory over A and (EM) be the set of all excluded middle axioms for all atoms in A.

Relation to ASP
As we have seen in the above examples, there seems to be a connection between temporal formulas over propositional atoms like a and logic programs with atoms for (monadic) predicates, viz. a(T), with an integer argument T representing a time point. This connection is strongly related to Kamp's well-known theorem (Kamp 1968) that allows for translating LTL into Monadic First-Order Logic with a linear order < relation, MFO(<) for short. In this section, we show how Kamp's translation is also applicable to TEL, so that the latter can also be reduced to (Monadic) Quantified Equilibrium Logic, which essentially covers ASP for predicates with one argument. This connection reinforces the adequacy of TEL as a suitable temporal extension of ASP. We begin by revisiting the definition of Quantified Equilibrium Logic or QEL Pearce and Valverde (2008). This logic allows for first-order logic programs in ASP to be partially simplified before grounding. Moreover, its monotonic basis, Quantified Here-and-There (QHT), can be used to check the property of strong equivalence, analogous to HT in the propositional case. The definition of QHT is based on a first-order language denoted by C, F, P , where C, F and P are three disjoint sets representing constants, functions and predicates, respectively. Given a set of constants D, we define: • T (D, F ) as the set of all ground terms that can be built with functions in F and constants in D, and • A(D, P ) as the set of all ground atomic sentences that can be formed with predicates in P and constants in D.

F. Aguado et al.
In its most general version, QHT allows for different domains in the here and there worlds and the interpretation of equality can also be varied in each world. In this paper, though, we use the most common option when applied to ASP, that is, QHT with so-called static domains and decidable equality, dealing with a common universe and a fixed interpretation of equality. In this setting, a QHT-interpretation is a tuple M = (D, σ) , H, T such that: • D is a (possibly infinite) non-empty set of constant names identifying each element in the universe. For simplicity, we use the same name for the constant and the universe element.
Equilibrium models for first-order theories are defined as follows. We now focus on a particular fragment of QHT, called MHT(<), by imposing the following restrictions: .λ) where λ ∈ N or λ = ω and D = {u} ∪ C where u stands for "undefined." 2. We only allow for (unary) functions "+1" and "−1" with the expected meaning: 3. All predicates are unary, except binary predicates = and <, interpreted as: Note that the interpretation for equality requires now that both terms are different from u. We define the abbreviation x ≤ y as x < y∨x = y. Given these restrictions, we can simply represent an MHT(<) interpretation as M = λ, H, T . Moreover, it is easy to see that we can establish a one-to-one mapping between the latter and an HT- When this happens, we say that M and M are corresponding interpretations. We proceed to adapt now Kamp's translation to our setting in the following way.

Definition 5 (Kamp's translation)
Let ϕ be a temporal formula over A. Kamp's translation of ϕ for some time point k ∈ N, denoted by [ϕ] k , is defined as follows: We now prove that, when considering the model correspondence between MHT(<) and THT, Kamp's translation is sound.  The translation of derived operators can be simplified in MHT(<) as follows: As an example, the translation of formula (2), viz. (¬a → •a), for k = 0 amounts to since in MHT(<), x ≥ 0 for any x. For infinite traces, the existence of some y = x + 1 is always guaranteed, and the formula above can be further simplified into which is just a first-order logic representation of the rule 6 "a(X+1) :-not a(X)" in ASP. Similarly, it is not difficult to check that the translation of (1) amounts to: that corresponds in ASP to the rule: loaded (X) :-loaded (X -1) , not unloaded (X), X >0.

Foundations of Temporal Here-and-There
In this section, we explore some of the fundamental properties of THT, the monotonic basis of TEL. The importance of THT with respect to TEL is analogous to the relevance of HT for Equilibrium Logic and ASP. In particular, THT is a suitable framework to study the TEL-equivalence of two alternative representations. In what follows, we prove that THT-equivalence is a necessary and sufficient condition for strong equivalence, we provide several interesting equivalences in THT and we also present an alternative three-valued characterization of this logic. Besides, we explain how THT can be translated to LTL adding auxiliary atoms, something that allows reducing the strong equivalence problem to LTL-satisfiability checking. The section concludes with some results for THT for infinite traces, including properties about inter-definability of operators and an axiomatization.

Strong equivalence
As happens in ASP, given that TEL is a non-monotonic formalism, it may be the case that two different temporal formulas α and β share the same temporal equilibrium models but behave differently when a common context γ is added. For this reason, it is usual Linear-Time Temporal Answer Set Programming 13 to consider the notion of strong equivalence instead. Two temporal formulas α, β are strongly equivalent iff TEL(α ∧ γ) = TEL(β ∧ γ) for any arbitrary temporal formula γ. As expected, the THT-equivalence of α ≡ β is a sufficient condition for strong equivalence, since temporal equilibrium models are the result of a selection among THT-models.
The interest of THT is that equivalence in that logic is also a necessary condition for strong equivalence, as we prove next.

Lemma 1
Let α and β be two LTL-equivalent formulas and let γ be the theory containing a formula β → (a ∨ ¬a) for each atom a ∈ A. Then, the following conditions are equivalent: 1. There exists some H < T such that H, T |= α → β; 2. T is a TS-model of {β} ∪ γ but not a TS-model of {α} ∪ γ.

Proposition 8
If two temporal formulas α and β are strongly equivalent then α ≡ β.

Proof
We prove that if α ≡ β then there is some context theory Γ for which {α}∪Γ and {β}∪Γ have different TS-models. Assume first that α and β have different total models, that is, different LTL-models. Then, take the set Γ = (EM) of excluded middle axioms for every a ∈ A. The LTL-models of {α} ∪ (EM) and {β} ∪ (EM) also differ (since (EM) is a set of LTL tautologies). But by Proposition 1, LTL-models of these theories are exactly their TS-models, and so, they also differ. Suppose now that α and β are LTL-equivalent but still, α ≡ β. Then, there is some THT-countermodel H, T of either (α → β) or (β → α), and given LTL-equivalence of α and β, the countermodel is non-total, H < T. Without loss of generality, assume H, T |= α → β. By Lemma 1, taking the theory Γ consisting of an implication β → (a ∨ ¬a) for each atom a ∈ A, we get that T is TS-model of {β} ∪ Γ but not TS-model of {α} ∪ Γ.
As a consequence of Propositions 7 and 8, we obtain the following characterization: Theorem 2 (Strong Equivalence characterization) Two temporal formulas α and β are strongly equivalent iff α ≡ β.

Some interesting properties of THT
THT-equivalences have a crucial role for deciding how to rewrite a formula without caring about the possible context in which it is included. We analyze next several useful THTequivalences. The following are some De Morgan laws satisfied by negation and other operators:
The next operators distribute over disjunction and conjunction so that: for ⊕ ∈ {∨, ∧} but for implication and temporal operators, only these distributive equivalences are valid: • All these properties are symmetrically satisfied by the past-oriented versions of the operators above. For infinite traces, however, we obtain the additional relation: so both next operators coincide. This equivalence never holds for previous operators, • and •, since there always exists an initial state.
Also, THT satisfies persistence, a characteristic property of HT-based logics.
Proposition 9 (Persistence; Cabalar et al. 2018) Let H, T be an HT-trace of length λ and ϕ be a temporal formula.
As a corollary, we have that H, T |= ¬ϕ iff T |= ϕ in LTL. All THT tautologies are LTL tautologies but not vice versa. However, they coincide for some types of equivalences, as we show next.
Proposition 10 Cabalar et al. 2018) Let ϕ and ψ be temporal formulas without implications (and so, without negations either).
As an example, the usual inductive definition of the until operator from LTL is also valid in THT due to Proposition 10. In fact, by De Morgan laws, LTL satisfies a kind of duality guaranteeing, for instance, that (19) iff and, by Proposition 10 again, this is also a valid equivalence in THT.
If we define all the pairs of dual connectives as follows: ∧/∨, /⊥, / , •/ •, /♦, S/T, •/ •, / , we can extend this to any formula ϕ without implications and define δ(ϕ) as the result of replacing each connective by its dual operator. Then, we get the following corollary of Proposition 10.
Then, THT satisfies: In a similar manner, the temporal symmetry in the system can be exploited in order to switch the temporal direction of operators to conclude, for instance, that (19) iff ). However, this duality has some obvious limitations when we allow for infinite traces. For instance, the past has a beginning I ≡ but the future may have no end ♦ ≡ . If we restrict ourselves to finite traces, we get the following result.
Lemma 2  There exists a mapping on finite HT-traces of the same length λ such that for any Theorem 3 (Temporal Duality Theorem; Cabalar et al. 2018) A temporal formula ϕ is a THT f -tautology iff σ(ϕ) is a THT f -tautology.

Three-valued characterization of THT
As mentioned in Section 2, HT-traces can be seen as three-valued models where each atom can be false, assumed or proven (in a given state). This stems from the fact that the intermediate logic of HT actually corresponds to Gödel's three-valued logic G 3 (Gödel 1932). In particular, the HT-satisfaction of formulas can be replaced by a three-valued function that assigns, to each formula, a value 0, 1, or 2, standing for "false" (it does not hold in T ), "assumed" (it holds in T but not in H) and "proven" (it holds in H, and so, in T , too), respectively. The interest of a multi-valued truth assignment m(k, α) of a formula α at time point k is that THT-equivalence α ≡ β can be reduced to a comparison of truth values such as m(k, α) = m(k, β). This has an important application when introducing an auxiliary atom a to represent α so that we can safely replace α by a provided that we add formulas to guarantee m(k, a) = m(k, α). Following these ideas, we proceed with the following formal definitions. For convenience, the evaluation of implications is captured by the following conditional operation on truth values: imp(x, y) = 2 if x ≤ y; otherwise imp(x, y) = y. Given an HTtrace H, T of length λ, we define its associated truth valuation as a function m(k, ϕ) that assigns a truth value in {0, 1, 2} to formula ϕ at time point k ∈ [0..λ) according to the following rules: The valuation of derived operators can be easily concluded from their definitions: For the restriction to THT f , it suffices to impose the condition λ = ω.

Proposition 11
Let H, T be a HT-trace of length λ, m its associated valuation and k ∈ [0..λ).
Then, we have that As an illustration, consider the HT-trace from Example 1. This trace corresponds to the three-valued assignment The formula ♦b is proven at k = 0, that is, m(0, ♦b) = 2, because m(0, b) = 2 and 2 is the maximum possible value. The formula b is false at k = 0, m(0, b) = 0 because m(1, b) = 0 and 0 is the minimum value. On the other hand, the formula (a ∨ b) is just assumed but not proven at 0. To see why, note that the value m(k, a ∨ b) is the maximum of both disjuncts and that, in our trace, this is equal to 2 for time points k = 0 and k = 2 but is equal to 1 for k = 1. Since (a ∨ b) takes the minimum of all these values for k ≥ 0, we get m(0, (a ∨ b)) = 1.

From THT to LTL
Propositions 1 and 2 tell us that the addition of excluded middle axioms (EM) allows for an easy encoding of LTL into THT. In fact, Proposition 6 even guarantees that the addition of these axioms makes also the non-monotonic formalism of TEL collapse into LTL. An interesting question is whether the other direction is possible, namely, whether THT can be encoded into LTL. In fact, this can be done by adapting the encoding of (non-temporal) HT into classical propositional logic, as presented, for instance, by Pearce et al . (2001).
Given a propositional signature A, let us define a new propositional signature in LTL by A * = A ∪ {a | a ∈ A}. For any temporal formula ϕ, we define its translation ϕ * as follows: We associate with any HT-trace H, T of length λ the trace T * in LTL defined as the sequence of sets of atoms Informally speaking, T * considers a new primed atom a per each a ∈ A in the original signature. In the trace, the primed atom a represents the fact that a occurs at some point in the H components, whereas the original symbol a is used to represent an atom in T. As an HT-trace satisfies 18 F. Aguado et al. signature A * satisfying (21), we can now define its corresponding HT-trace H, T as

Example 2
Take the HT-trace H, T from Example 1. Its corresponding trace is Now, for instance, given the formula: its translation (23) * corresponds to: It is easy to see that T * satisfies (23) * ∧ (22) in LTL.
To conclude this comparison to LTL, we include a brief comment on the complexity of THT. As shown above, LTL-satisfaction of a temporal formula ϕ can be reduced to THT-satisfaction with the simple addition of (EM) axioms. On the other hand, reducing THT-satisfaction of ϕ to LTL-satisfaction consists of adding axiom (21) and applying translation ϕ * , which can be easily proved to be quadratic in the worse case. As a result, LTL-and THT-satisfaction share the same complexity, regardless of the trace length under consideration. In particular, it is well-known that LTL ω -satisfiability is PSpace-complete (Sistla and Clarke 1985). Also, LTL f -satisfiability was also proved to be PSpace-complete by De Giacomo and Vardi (2013). As a result, both THT ω -and THT f -satisfiability have the same complexity, too.

Automata-based checking of strong equivalence
The translation from THT to LTL can be used to reduce strong equivalence of temporal theories to LTL-satisfiability checking. This feature was exploited by the tool abstem (Cabalar and Diéguez 2014) that provides us with several functionalities for temporal theories under TEL ω semantics.
For checking whether two temporal formulas ϕ and ψ are LTL-equivalent, abstem checks the validity of ϕ ↔ ψ, which is reduced to the unsatisfiability of ¬ (ϕ ↔ ψ). This is done by translating ¬ (ϕ ↔ ψ) into a Büchi automaton A by means of the LTL-model checker SPoT (Duret- Lutz et al . 2016). As explained in Section 4, the language accepted by A corresponds to the LTL-models of ¬ (ϕ ↔ ψ). Therefore, if the accepting language of A is empty, it means that ¬ (ϕ ↔ ψ) is not satisfiable and ϕ and ψ are LTL-equivalent. Otherwise, any word accepted by A can be seen as a counterexample of ϕ ↔ ψ.
The method used by Cabalar and Diéguez (2014) to determine whether ϕ and ψ are strongly equivalent consists in checking the validity of both ϕ → ψ and ψ → ϕ in THT. Let us consider, without loss of generality, that we want to check the validity of ϕ → ψ. This is equivalent to checking the satisfiability of in LTL and it can be done by using the procedure explained above. abstem obtains a Büchi automaton A (25) that accepts the LTL-models of (25). If (25) is LTL-satisfiable then abstem filters all the variables of the type a from the accepting language of A (25) (as explained in Section 4). The resulting automaton, denoted by h(A (25) ), captures the TEL-models of ϕ ∧ γ which are not models of ψ ∧ γ, where for every atom a in the signature (assuming a finite alphabet).
With minor modifications, this technique could be adapted to the TEL f case. The only required change is the target automata: for TEL ω we need to use Büchi automata since we are dealing with infinite computations while, in the finite case, we need to use automata on finite words. The rest of the algorithm would remain the same.

Definability of temporal operators in THT
Propositional connectives are not inter-definable in intuitionistic propositional logic (van Dalen 2001). However, when it comes to propositional HT, some inter-definability results can be obtained. For instance, the HT-valid formula (Lukasiewicz 1941) allows us to determine that disjunction in HT can be defined in terms of the remaining propositional connectives. Unfortunately, this is the only definable operator (Balbiani and Diéguez 2016;Aguado et al . 2015). When considering QHT, the equivalence is valid, so existential quantifiers can be reformulated in terms of the remaining connectives as well (Mints 2010). Since THT can be seen as a syntactic subclass of QHT, a similar result could be expected. In fact, Balbiani et al . (2020) have proved that the connectives ♦p can be defined in terms of a -free formula, as stated in the following lemma.
Lemma 3 (Balbiani et al. 2020) The formulas ♦p and are equivalent in THT.
Broadly speaking the equivalence in Lemma 3 captures the three different ways of satisfying ♦p on any THT-model H, T at i ≥ 0: 1. H, T , i |= (p ∨ ¬p) holds, and in this case H, T behaves classically after i; at least for formulas whose only variable is p. In this case ♦p would behave as ¬ ¬p. From this equivalence the following corollary follows.
Lemma 3 and Corollary 3 were proved for infinite traces, but in fact, these equivalences also hold for finite traces THT f , as stated below.

Corollary 4
The equivalences (26) and q p ↔ (p (q ∨ p)) ∧ (26) are valid in THT f . Balbiani et al . (2020) also give a negative answer for the definability of p or p q as a -free formula. To do so, they consider the following THT model: let n ∈ N, we define the THT models H, T n as follows: (1) By using a bisimulation argument, Balbiani et al . (2020) proved the following lemma.
Lemma 4 (Balbiani et al. 2020) Let us consider the THT model defined above. The models H, T n and T, T n satisfy the same -free formulas with at most n connectives at time 0.
This lemma is proved by showing that H, T n and T, T n are bisimilar at time 0 with respect to the temporal language excluding the connective. This means both models cannot be distinguish with respect to the set of -free formulas. As a consequence, let us assume by contradiction that p is definable in terms of afree formula ψ and let us fix n as the number of connectives of ψ. Since H, T n , 0 |= p then H, T n , 0 |= ψ. Since T, T n , 0 |= p then T, T n , 0 |= ψ, which contradicts Lemma 4. As a corollary, if we could define the formula p q in terms of a -free formula, we could also define p, since the latter is equivalent to p ⊥.
If we remove condition (4) from the model H, T n we obtain a finite model with λ = n + 2 satisfying Lemma 4. Therefore, we can reformulate the previous discussion in terms of THT f .
Another interesting observation regarding expressiveness of operators is the presence of the newly introduced temporal operator ϕ ψ read as "repeat ϕ while ψ." Another interesting observation regarding expressiveness of operators is the presence of the newly introduced temporal operator ϕ ψ, read as "repeat ϕ while ψ." This operator is not usual in LTL because, in that logic, it can be easily defined in terms of or :

Proposition 12
In LTL, we have the following equivalences: In THT, however, these equivalences do not hold. Unlike and , operator has an implicational nature. As a consequence, there is no clear way to represent in terms of the other operators: we conjecture that this may be, in fact, a fundamental operator in THT. The following equivalences describe these three operators, , and , by an inductive unfolding.

Proposition 13
In THT, we have the following equivalences: The first two equivalences are well-known from LTL and also preserved in THT. The third equivalence shows that the operator is formed by a repeated application of implications. This is even clearer in the following expansion.

Proposition 14
The formula (α β) is THT-equivalent to the (possibly infinite) conjunction of rules To see how this expression works, consider the formula (w f ), where w means "pouring water" and f means "fire." Notice that, for i = 0, the rule body becomes an empty conjunction ( ) and so this expands to → • 0 w which is just equivalent to fact w. For instance, for i ∈ [0, 3] we get the rules: That is, we start pouring water at situation 0 and, if we have fire, we keep pouring water at 1 and check fire again, and so on. As we can see, the effect of each f test is placed at the next situation. Thus, the reading of (w f ) is like a procedural program "do pour-water while fire". If we want to move the test to the same situation of its effect, we 22 F. Aguado et al. would write instead (f → w) f whose reading would be "while fire do pour-water" and whose expansion becomes: The expansion of (w f ) as a set of rules reveals its behavior from a logic programming point of view. For instance, a theory only containing the formula (w f ) has a unique temporal stable model (per each length λ > 0) in which w is only true at the initial state, whereas f is always false, since there is no additional evidence about fire. In LTL, the formula (w f ) is equivalent to (¬f w), that is, w ∨ (w (w ∧ ¬f )). In our formalism, however, this last formula produces temporal stable models with arbitrary prefix sequences of w, and even the case in which w holds in all the states of the trace. In other words, water may be poured arbitrarily many times, even though fire is false all over the trace.

Axiomatization of THT ω
The axiomatic system of the future fragment of THT ω (Balbiani and Diéguez 2016) is obtained by combining the axioms of intuitionistic modal logic K (Simpson 1994) (IK), the Hosoi Axiom (Hosoi 1966) and the future LTL ω axiomatization of Goldblatt (1992). Such an axiomatic system is described below.

•p
Due to the intuitionistic basis of THT ω all the axioms need to be duplicated in order to cope with the potential non-definability of modal operators (Simpson 1994). It should be also noticed that the induction axiom is replaced by the corresponding inference rule. These inference rules can be derived from the axioms and vice versa. The corresponding proof of soundness and completeness is achieved by adapting Goldblatt's proof for classical LTL ω (Goldblatt 1992) to the here-and-there case: soundness is proved by checking that all axioms are valid in THT ω and that the inference rules preserve validity. The proof of completeness relies on variations of well-known methods for proving completeness: a canonical model construction for bi-relational models (Simpson 1994), filtration and unwinding (Balbiani and Diéguez 2016).
From the axiomatic point of view, the main difference between THT ω and THT f relies on Axiom (3a), which guarantees that every time instant has a successor. From the point of view of the completeness proof, this axiom makes possible the unwinding of the filtrated model by Balbiani and Diéguez (2016). Since Axiom (3a) is not valid in THT f because it fails at the end of the trace, this unwinding may not be directly applied to obtain a sound and complete axiomatization of THT f .

From TEL to automata
The relation between traditional temporal logics and automata is well-known and has been thoroughly studied in the literature (Demri et al . 2016). For infinite traces, LTL ω unsatisfiability can be reduced to checking the emptiness of a language with a given automaton that accepts infinite words. For this, we can use, for instance, the well-known translation of Gerth et al . (1995) mapping a temporal formula ϕ into a Büchi automaton (Büchi 1962) that accepts the ω-regular language corresponding to the (infinite trace) models of ϕ. When we jump to finite traces, the type of automata required is simpler, as they just need to cover languages with words of finite length. Thus, in the works by Zhu et al . (2019) and De Giacomo and Vardi (2013), translations from LTL f into different types of automata such as Non-deterministic finite automata (NFA) and Alternating Automata on Words or AFW (Chandra et al . 1981) have been proposed.
The use of automata for deciding THT-satisfiability can naturally follow the same steps, provided that the translation from Section 3.4 allows us to reduce the problem to standard LTL-satisfiability, regardless of the trace length. This fact was used by Cabalar and Diéguez (2014) to decide strong equivalence of two temporal formulas α and β in TEL ω as follows. By Theorem 2, strong equivalence amounts to THT ω -equivalence, that is, checking the validity of ϕ := α ↔ β in THT ω . But then, by Theorem 4, this amounts to checking the unsatisfiability of (21) ∧ ¬(ϕ * ) in LTL ω and the latter is then done by the 24 F. Aguado et al. standard Büchi-automata construction method. Similar steps can be followed for THT f , replacing Büchi-automata for LTL ω by NFA or AFW for LTL f .
The use of automata for a non-monotonic temporal formalism like TEL becomes a more involved process, since temporal equilibrium models are obtained by a model selection (or minimization) process. The complexity of TEL ω , for instance, suggests that there is no efficient method to reduce TEL ω -to LTL ω -satisfiability.
Theorem 5 (Bozzelli and Pearce 2015) The problem of deciding whether a temporal formula has some (infinite) temporal equilibrium model in TEL ω is ExpSpace-complete.
A possible way of overcoming this difficulty is to observe that Definition 2 (of temporal equilibrium models) involves a kind of quantification. That is, we must find a total HTmodel T, T of some formula such that there is no smaller H < T such that H, T is also a model of the formula. This quantification seems to have a second-order nature, as it has to do with different configurations of the truth of propositions. In fact, in the non-temporal case, equilibrium models of a formula have been captured using Quantified Boolean Formulas (Pearce et al . 2001) and subsequently generalized by using a syntactic operator SM[·] (Ferraris et al . 2007). This gives a second-order formula that uses the translation from Section 3.4 and quantifies over primed propositions. This approach opens the natural possibility of capturing TEL through Quantified LTL (Sistla 1983), an extension of LTL in which we can use second-order quantifiers over propositions, and define a temporal version of the SM[·] operator as a QLTL formula. The advantage of having a quantified temporal formula SM[ϕ] capturing the TS-models of ϕ is that there exist several methods for reducing that formula to an automaton, as we see below. Given that our interest is focused on finite automata, in the rest of this section, we assume that the alphabet A is finite.

TS-models in terms of QLTL: the SM operator
We start by recalling the syntax and semantics of Quantified Linear-Time Temporal Logic or QLTL (Sistla 1983;Sistla et al . 1987;Demri et al . 2016). The syntax of QLTL extends the one of temporal formulas by quantifiers on propositional variables, that is, formulas of the type ∃a ϕ and ∀a ϕ are added.
Interpreting the additional formulas requires the concept of a variant trace.
Definition 6 (X-variant trace; French and Reynolds 2002) Given two traces T and T of length λ and X ⊆ A, we say that T is an With this, the semantics for QLTL is obtained from that of LTL by extending its satisfaction relation with the cases of quantified formulas as follows: It is known that QLTL ω is as expressive as Büchi automata (Sistla et al . 1987), and so, more expressive than LTL ω . For instance, the indicative "even states" property (Wolper Linear-Time Temporal Answer Set Programming 25 1983) can be expressed by the quantified temporal formula ∃q (¬q ∧ (q ↔ •¬q)) ∧ (q → p). We also recall that a quantified temporal formula is in prenex normal form if it is of the form Q 1 x 1 , Q 2 x 2 · · · Q n x n ϕ where each Q i ∈ {∃, ∀} and each x i is a propositional variable occurring in the quantifier-free formula ϕ. An alternation in a quantified prefix is a sequence of ∃y∀x or ∀x∃y occurring in a prefix. Given a quantified temporal formula ϕ in prenex normal form, the alternation depth of ϕ is k if the prefix associated with ϕ contains k alternations. Also, given a quantified temporal formula ϕ, we denote by free(ϕ) the number of propositional variables occurring in ϕ which are not quantified.
The complexity of the satisfiability problem in QLTL turns to be non-elementary (Sistla et al . 1987). However, for the case of formulas in prenex normal form with alternation depth k the following result has been obtained.
Theorem 6 (Sistla 1983) The QLTL satisfiability problem of a quantified temporal formula ϕ in prenex normal form with alternation depth k is k-  Now, in order to encode TS-models of a temporal formula ϕ using a quantified temporal formula, we use translation ϕ * from Section 3.4 and define the following notation. Let a and a stand for the tuples a 1 , . . . , a n and a 1 , . . . , a n of n atoms, respectively. We define the following expressions: Note that, whenever a coincides with the original propositional signature A, a ≤ a amounts to axiom (21) and is used to guarantee that atoms in trace H are also included in trace T. Expression a < a further forces H < T as stated by the following proposition.

Proposition 15
Let T * be a trace over signature A * = A ∪ {a | a ∈ A} and let H and T be such that Also, let a be a tuple containing all propositional variables on A and let a be of the same length as a. Then, we have: We can now define the temporal version of the SM operator by Ferraris et al . (2007): Let ϕ be a temporal formula over signature A and let a be a tuple with all propositions in A. Then, we define the QLTL expression: The fact that SM[ϕ] captures the TS-models of ϕ is established by the following theorem.

Theorem 7
A trace T is a TS-model of a temporal formula ϕ iff T is a QLTL-model of SM[ϕ].

F. Aguado et al.
Note that a simple analysis of SM[ϕ] allows us to match the upper bound complexity of the satisfiability problem of TEL obtained by Cabalar and Demri (2011).

Corollary 5
The satisfiability problem of TEL ω is at most ExpSpace-complete.

Proof
Note that SM[ϕ] can be rewritten into ∀a (ϕ ∧ (a < a → ¬ϕ * )) by applying the De Morgan laws and pushing ϕ, whose variables are free, inside of the scope of the second-order quantifiers. Since checking whether the previous formula is satisfiable iff ∃a ∀a (ϕ ∧ (a < a → ¬ϕ * )) is satisfiable (De Giacomo and Perelli 2021), we can apply Theorem 6 to obtain such ExpSpace-complete upper bound.
Note that for finite traces this amounts to a characterization in terms of weak QLTL.
Example 3 (Example 2 continued ) Consider again formula ϕ = (¬b → a) in (23). As mentioned, formula a ≤ a amounts to axiom (21) for all atoms in the signature which, in this case, corresponds to formula (22). Now a < a is stronger, as it requires not only H ≤ T but also H = T. In this case, we obtain the expression: whereas ϕ * corresponds to (24), as illustrated above. So, as a result, SM[ϕ] is finally unfolded into: The LTL-models of (¬b → a) are traces T where each state satisfies T i = ∅. Take any T where there is some T i including atom b. Then, we can extend T to T * for signature {a, b, a , b } repeating the truth of a and b with respect to a and b in all states, except in state T * i where we just leave b false. It is not difficult to see that this extended interpretation T * satisfies a < a ∧ ϕ * and so, T cannot be a model of SM [ϕ]. Therefore, T must make b false at all states and the only remaining model for SM [ϕ] is the trace T where T i = {a} for all states, which coincides with the only TS-model of ϕ.

From QLTL to automata
Once the TS-models of ϕ are captured by a quantified temporal formula, there are several possibilities to obtain the corresponding automaton. For instance, Cabalar and Demri (2011) used the following approach 8 in the case of TEL ω : First, we build a Büchi automaton A 1 that yields the LTL ω -models of ϕ as usual. Then, we build a second automaton, A 2 , corresponding to the temporal formula a < a ∧ϕ * for the extended signature A * . On this last construction, we perform a filter operation to obtain the new automaton h(A 2 ) that removes the primed atoms from the signature. In other words, h(A 2 ) captures the models of the quantified temporal formula ∃a (a < a ∧ ϕ * ) and, in terms of THT, this corresponds to the T traces for which there exists some H < T. The final step is using the operations of complement and intersection of Büchi automata to obtain A 1 ∩ h(A 2 ) that naturally corresponds to the formula (27) of the SM operator. This method was implemented later on in the tool abstem (Cabalar and Diéguez 2014) that allows for both computing TS-models and checking strong equivalence of temporal formulas in TEL ω .
In what follows, we present an analogous method for TEL f yet by reducing SM formulas to automata over finite words. More precisely, we consider two different types of finite automata A, namely, NFAs and AFWs.
A NFA is a structure (Σ, Q, Q 0 , δ, F ) where 1. Σ is the alphabet, 2. Q is a set of states, 3. Q 0 ⊆ Q is a set of initial states, 4. δ : Q × Σ → 2 Q is a transition function and 5. F ⊆ Q is a set of final states.
A run of a NFA for an input word w = (X 0 . . . X n−1 ) of length n > 0 is a finite sequence of states q 0 , . . . , q n such that q 0 ∈ Q 0 and δ(q i , X i ) = q i+1 for all 0 ≤ i < n. The run is said to be accepting if q n ∈ F . By L(A) we denote the set of runs accepted by A. The following theorem shows the relation between LTL f and NFAs.
Theorem 8 (Zhu et al. 2017;Camacho et al. 2018) A given temporal formula ϕ over A can be translated into a NFA A ϕ such that the set of LTL f -models of ϕ corresponds to L(A ϕ ).
Note that the alphabet of A ϕ consists of 2 A , which amounts to the set of interpretations over A.
To give an example of how the corresponding algorithm works, let us consider the formula ϕ = (¬a → •a) in (2). In LTL f , ϕ is equivalent to (a ∨ •a), which means that every LTL f -model of this formula satisfies a at a state i or i + 1, for all 0 ≤ i < λ.
The set of LTL f -models of ϕ is captured by the NFA in Figure 1. We see that every run in which a is false in two consecutive states is disregarded. On the other hand, an AFW is a structure (Σ, Q, q 0 , δ, F ) where: 1. Σ is the alphabet, 2. Q is a set of states, 3. q 0 ∈ Q is the initial state, 28 F. Aguado et al. 4. δ : Q × Σ → B + (Q) is a transition function, where B + (Q) is built from the elements of Q, conjunction, disjunction, and ⊥, 5. F ⊆ Q is a set of final states.
Given an input word w = (X 0 . . . X n−1 ) of length n > 0, a run of an AFW is a tree labeled by states of the AFW such that 1. the root is labeled by q 0 , 2. if a tree node z at level i is labeled by a state q and δ(q, X i ) = Θ then either Θ = or some P ⊆ Q satisfies Θ and z has a child for each element in P , and 3. the run is accepting if all leaves at depth n are labeled by states in F . Thus, a branch in an accepting run has to hit the transition or hit an accepting state after reading all the input word w.
The correspondence between LTL f and AFW is stated in the following theorem

Theorem 9 (De Giacomo and Vardi 2013)
A temporal formula ϕ can be translated into an AFW A ϕ = (2 A∪{last} , Q, q ϕ , δ, ∅), where 1. last corresponds a fresh atom indicating the last state of the trace, 2. Q corresponds to the negation-closed closure of ϕ due to Fischer and Ladner (1979), 3. q ϕ is the initial state, which corresponds to the state labeled with the formula ϕ, ⊥ otherwise (d) δ(q ¬ϕ , X) = δ(q ϕ , X), where δ(q ϕ , X) is obtained from δ(q ϕ , X) by switching ∧ and ∨, by switching and ⊥ and, in addition, by negating subformulas in X.
Moreover, as in the case of NFAs, L(A ϕ ) corresponds to the set of LTL f -models of ϕ.
As above, the formula (¬a → •a) ≡ (a ∨ •a) can be translated into the AFW of  node type, labeled as "∀" and splitting some incoming edge into a (possibly empty) set of outgoing, unlabeled edges. As in the NFA, if multiple outgoing edges from a state share the same label X, they are understood as an existential constraint on paths (a run must follow at least one of them). As also happens in a NFA, when there is no outgoing edge for some label X, it is understood as a transition to ⊥ (the "empty" existential constraint), that is, no accepting path can be built using X. As it can be imagined, the new ∀-nodes represent the dual, universal constraints on paths: a run reaching ∀ must follow all the outgoing edges. Analogously, when the ∀-node has no outgoing edges (the "empty" universal constraint ) the run is trivially accepted. Figure 3 shows an accepting run of the AFW of Figure 2 with the input ∅·{a}·{a, last}. For sake of clarity, we have labeled each tree edge with the input symbol X i that fires the transition and, when applicable, we also show the ∀ constraints that are reached along the run. As we can see, since X 0 = ∅ satisfies ¬a ∧ ¬last, it splits the run into two branches, but both of them eventually reach the empty ∀ (i.e. the accepting transition).
To illustrate a non-accepting run, suppose we take the input ∅ · {a} · {last} instead, so that the last interpretation X 2 does not satisfy atom a now. Figure 4 shows the corresponding run obtained from the AFW in Figure 2. As before, X 0 = ∅ splits the run but, this time, the path followed by the top branch is not accepted since no outgoing edge from q (a∨•a) has a formula satisfied by X 2 = {last}. This implicitly means The rest of this section is devoted to show how Theorem 8 and 9 can be used to obtain the following result.

Theorem 10
A temporal formula ϕ can be translated into an AFW/NFA A ϕ such that L(A ϕ ) corresponds to the set of TEL f -models of ϕ.  Our construction relies on several intermediate automata transformations corresponding to the ones by Cabalar and Demri (2011). Each of them accepts the model of one specific part of the SM expression. The involved automata and their correspondence with SM[ϕ] are depicted in (29).
The computation of the final automaton A 1 ∩ h(A 2 ) accepting the TEL f -models of ϕ is done in a compositional manner, analogous to the translation of QLTL or Weak Monadic Second Order Theory of one Successor into NFA/AFW Henriksen et al . 1995). The two initial automata A 1 and A 2 are computed by using Lemma 9 or 8, depending on whether we are interested in computing an NFA or an AFW. Note that the formulas recognized by A 1 and A 2 are temporal formulas, which justifies the application of these lemmas. h(A 2 ) is obtained from A 2 by projecting the atoms of the type a . In language-theoretic terms, a projection operation h(L(A)) is defined as follows.
h(L(A)) def = {w | ∃ w s.t. w is identical to w except for all atoms of the type a }.
Since h(L(A)) = L(h(A)) (Cabalar and Demri 2011), the projection can be applied directly over A 2 and, broadly speaking, the resulting automaton accepts all LTL f -models T for which there exists a trace H satisfying H < T. h(A 2 ) is obtained by complementing h(A 2 ); it accepts all traces T that are either no LTL f -models of ϕ or for which exists no trace H satisfying H < T. Automata complementation is the usual way to obtain automata accepting the LTL f models of negated formulas. Finally, A 1 ∩h(A 2 ) is obtained by intersecting A 1 and h(A 2 ). This operation is equivalent to selecting all traces T being LTL f -models of ϕ for which there is no trace H < T satisfying H, T , 0 |= ϕ. In this case, T, T is an equilibrium model of ϕ.
If we analyze ϕ = (¬a → •a) in TEL f , a is false at the initial state since it cannot be provable. Since ¬a → •a is satisfied in the initial state, a is true at time point 1, so the rule ¬a → •a cannot be applied to prove a at time point 2 and the cycle starts again.
Hence, TEL f -models of ϕ are of the form ∅ · {a} · ∅ · {a} · · · . They are captured by the NFA in Figure 5, whose accepting runs correspond to sequences of this type. Fig. 5. NFA accepting the TEL f -models of (¬a → •a).

(Modal) temporal logic programs
In the previous section, we have seen a first method to compute TS-models and check TEL-satisfiability, relying first on a quantified LTL expression, and then, deriving the construction of different types of automata: Büchi for TEL ω and NFA or AFW for TEL f . Automata-based techniques are interesting for the analysis of the set of traces (TS-models) induced by a given temporal formula. This is useful, for instance, to check several types of equivalence between two different temporal representations, or to check the existence of a solution for a given planning problem. However, in many practical applications, rather than exploring all possibilities, our interest is more focused on the generation of one, or a few TS-models that encode solutions to a given temporal problem. This is, in fact, the usual model-based problem solving orientation of ASP, where stable models encode solutions to a particular problem, encoded by the rules in the logic program. In this way, if we want to solve a temporal diagnosis scenario, we are interested in finding at least one TS-model that explains the observations. Similarly, for a given planning problem, we look for some plan that reaches the goal in a finite number of steps.
In this section, we show how the generation of TS-models can be done using ASP technology by considering temporal theories with a syntax closer to logic programming. As we see next, both TEL ω and TEL f can be reduced to a normal form that we call (modal) temporal logic programs. This normal form is useful for ASP-based computation. For the finite case, there are two translations of this normal form into ASP. One allows any temporal formula and provides a translation for a given trace length. The other translation imposes some restrictions on the formula but allows for incremental solving. There are tools supporting these translations, most notably telingo  for the incremental approach.
We provide a generic normal form for temporal programs and a translation for temporal formulas into this normal form. Both the finite and the infinite case are special cases of this normal form.

Definition 7 (Temporal literal, rule, and program)
Given alphabet A, we define the set of temporal literals as {a, ¬a, •a, ¬•a | a ∈ A}.
A temporal rule is either: where B = b 1 ∧ · · · ∧ b n with n ≥ 0, A = a 1 ∨ · · · ∨ a m with m ≥ 0 and the b i and a j are temporal literals for dynamic rules and regular literals {a, ¬a | a ∈ A} for initial and 32 F. Aguado et al.
final rules, and p and q are atoms. We call temporal logic program to a set of temporal rules.
We normally allow some straightforward extensions of this form. For instance, an alwaysrule has the form (B → A) and stands for the conjunction (B → A)∧ • (B → A) of an initial and a dynamic rule, respectively (therefore, B and A only contain regular literals). Moreover, an extended dynamic rule allows body literals b i to be the atomic formulas I or (since they can be encoded as auxiliary atoms). When we allow this last extension, final rules can be reduced to constraints (empty head) of the form ( → (B → ⊥)).
Theorem 11 (Normal form; Cabalar et al. 2018) Every temporal formula ϕ can be converted into a temporal program being THT fequivalent to ϕ and into one being THT ω -equivalent to ϕ, in both cases, modulo auxiliary atoms.
Moreover, the reduction by Cabalar et al . (2018) further guarantees the following property.

Corollary 6
For finite traces λ ∈ N, every temporal formula can be converted into a THT f -equivalent temporal logic program P consisting of initial, dynamic, and final rules only.
We denote these three sets of rules as I (P ), D(P ) and F (P ), respectively.
In what follows, we introduce a more general reduction from temporal formulas to temporal logic programs that is applicable to both finite and infinite traces. It uses an extended alphabet A + ⊇ A that additionally contains a new atom ϕ (a.k.a. label) for each formula ϕ in the original language over A along with the label ¬♦ . This label represents the value of the formula ¬♦ , which means that it can be used to restrict ourselves to finite traces by including the formula (¬ ¬♦ ). For convenience, we use ϕ def = ϕ if ϕ is , ⊥ or an atom a ∈ A. For any non-atomic formula μ over A, we define the translation df given in Tables 1 and 2, and call df the definition of μ. Note that the translation of the next operator • includes the label ¬♦ . This ensures that if the formula (¬ ¬♦ ) is included and therefore only finite traces are considered, then •ϕ cannot be satisfied in the final state.

33
These definitions of temporal formulas are not yet in normal form, but they contain some double implications that can easily be transformed into the format of temporal logic programs by simple, non-modal transformations in the propositional logic of HT. This translation of the definition into normal form was presented by Cabalar et al . (2018) for the finite case and by  for the infinite case. We denote the resulting set of formulas in normal form by df . Given a theory Γ, we define sub(Γ) as the set of all subformulas of all formulas in Γ.
Definition 8 Cabalar et al. 2018) We define the translation σ as the following temporal logic program: Theorem 12 Cabalar et al. 2018) For any theory Γ over A, This correspondence between models of Γ and σ(Γ) is, in fact, one-to-one, since the satisfaction of each label γ is equivalent to the satisfaction of its associated formula γ. The next result shows that the computation of σ(Γ) has a polynomial complexity on the size of Γ.
As an example, consider the theory Γ 1 = (¬p → q p). Its translation σ(Γ 1 ) can be determined using Table 3 The interest of temporal logic programs is that, as suggested by their name, they have a syntax closer to logic programming. This suggests that, at least for finite traces as in TEL f , computing TS-models can be delegated to an ASP solver in some way. In the rest of the section, we explain two different methods to achieve this goal.

Bounded translation of temporal programs over finite traces to ASP
A first way to encode a temporal program P into standard ASP is by assuming that we know the (finite) trace length λ beforehand. In that case, we can compute all models in TEL(P, λ) by a simple translation of P into a regular program. For this, we let A k = {a k | a ∈ A} be a time stamped copy of alphabet A for each time point k ∈ [0..λ).
Definition 9 (Bounded translation; Cabalar et al. 2018) We define the translation τ of a temporal literal at time point k as: We define the translation at time point k of any (non-fulfillment) rule r as those in Definition 7 as: We define the translation of a temporal program P bounded by finite length λ as: where I (P ), D(P ) and F (P ) are the initial, dynamic and final rules in P .
Note that the translation of temporal rules is similar in just considering the implication B → A in Definition 7; their difference manifests itself in their instantiation in τ λ (P ).
As an example, let program P be the set of temporal rules: This program has a single finite temporal stable model of length 2, viz. {a}·{b}. Applying translation τ for some bound λ to our temporal program P in (52) yields regular logic programs of the following form.
Theorem 14  Let P be a temporal program over A. Let T = (T i ) i∈[0..λ) be a trace of finite length λ over A and X a set of atoms over i∈ [0..λ) Then, T is a temporal stable model of P iff X is a stable model of τ λ (P ).
Applied to our example, this result confirms that the temporal stable model {a} · {b} of P corresponds to the stable model {a 0 , b 1 } of τ 2 (P ). Using this translation we have implemented a system, tel 9 , that takes a propositional theory Γ of arbitrary temporal formulas and a bound λ and returns the regular logic program τ λ (P ), where P is the intermediate normal form of Γ left implicit. The resulting program τ λ (P ) can then be solved by any off-the-shelf ASP system. For illustration, consider the representation of our example temporal program in (52) in tel's input language.

Pointwise translation of temporal programs over finite traces to ASP
The bounded translation τ λ (P ) allows us to compute all models in TEL(P, λ) for a fixed bound λ. However, in many practical problems (as in planning, for instance), λ is unknown beforehand and the crucial task consists in finding a representation of TEL(P, k) that is easily obtained from that of TEL(P, k-1). In ASP, this can be accomplished via incremental solving techniques that rely upon the composition of logic program modules (Oikarinen and Janhunen 2006). The idea is then to associate the knowledge at each time point with a module and to successively add modules corresponding to increasing time points (while leaving all previous modules unchanged). A stable model obtained after k compositions then corresponds to a TEL f -model of length k. This technique of modular computation, however, is only applicable when modules are compositional (positive loops cannot be formed across modules), something that cannot always be guaranteed for arbitrary temporal programs. Still, Cabalar et al . (2018) identified a quite general syntactic fragment 10 that implies compositionality. We say that a temporal rule as in Definition 7 is present-centered, whenever all the literals a 1 , . . . , a m in its head A are regular. Accordingly, a set of such rules is a present-centered temporal program. In fact, such programs are sufficient to capture common action languages. For illustration, we show how to encode action language BC (Lee et al . 2013) into present-centered temporal programs in TEL f in Section 6.
Following these ideas, we provide next a "point-wise" variant of our translation that allows for defining one module per time point and is compositional for the case of presentcentered temporal programs. We begin with some definitions. A module P is a triple (P, I, O) consisting of a logic program P over alphabet A P and sets I and O of input and output atoms such that where H(P ) gives all atoms occurring in rule heads in P . Whenever clear from context, we associate P with (P, I, O). In our setting, a set X of atoms is a stable model of P, if X is a stable model of logic program P . 11 Two modules P 1 and P 2 are compositional, if O 1 ∩O 2 = ∅ and O 1 ∩C = ∅ or O 2 ∩C = ∅ for every strongly connected component C of the positive dependency graph of the logic program P 1 ∪ P 2 . In other words, all rules defining an atom must belong to the same module, and no positive recursion is allowed among modules. Whenever P 1 and P 2 are compositional, their join is defined as the module 36 F. Aguado et al.
. The module theorem (Oikarinen and Janhunen 2006) ensures that compatible stable models of P 1 and P 2 can be combined to one of P 1 P 2 , and vice versa.
For literals and rules, the point-wise translation τ * coincides with τ up to final rules.
Definition 10 (Point-wise translation: Temporal rules; Cabalar et al. 2018) We define the translation of a final rule r as in Definition 7 at time point k as for a new atom q / ∈ A and of an initial or dynamic rule r as τ * k (r) def = τ k (r).
The new atoms q k+1 in (53) are used to deactivate instances of final rules. This allows us to implement operator by using ¬q k+1 and therefore to enable the actual final rule unless q k+1 is derivable. The idea is then to make sure that at each horizon k the atom q k+1 is false, while q 1 , . . . , q k are true. In this way, only τ * k (r) is potentially applicable, while all rules τ * i (r) are disabled at earlier time points i ∈ [1..k). Translation τ * is then used to define modules for each time point as follows.
Definition 11 (Point-wise translation: Modules) Let P be a present-centered temporal program over A. We define the module P k corresponding to P at time point k as: Each module P k defines what holds at time point k. The underlying present-centeredness warrants that modules only incorporate atoms from previous time points, as reflected by A k−1 in the input of P k . The exception consists of auxiliary atoms like q k+1 that belong to the input of each P k for k > 0 but only get defined in the next module P k+1 . This corresponds to the aforementioned idea that q k+1 is false when P k is the final module, and is set permanently to true once the horizon is incremented by adding P k+1 . Note that atoms like q k+1 only occur negatively in rule bodies in P k and hence cannot invalidate the modularity condition. This technique allows us to capture the transience of final rules. The point-wise translation of our present-centered example program P from (52) yields the following modules.

Theorem 15
Let P be a present-centered temporal program over A. Let T = (T i ) i∈[0..λ) be a trace of finite length λ over A and X a set of atoms over 0≤i<λ A i such that a ∈ T i iff a i ∈ X for i ∈ [0..λ). Then, we have that T is a temporal stable model of P iff X ∪{q i | i ∈ [0..λ)} is a stable model of i∈[0..λ) P i .
As with Theorem 14, this result confirms that the temporal stable model {a} · {b} of P corresponds to the stable model {a 0 , b 1 , q 1 } of P 0 P 1 .
As one might expect, not any temporal theory is reducible to a present-centered temporal program. Hence, computing models via incremental solving imposes some limitations on the possible combinations of temporal operators. Fortunately, Cabalar et al . (2018) identified again a quite natural and expressive syntactic fragment that is always reducible to present-centered programs. We say that a temporal formula is a past-future rule if it consists of rules as those in Definition 7 where B and A are just temporal formulas with the following restrictions: B and A contain no implications other than negations (α → ⊥), B contains no future operators, and A contains no past operators. An example of a past-future rule is, for instance, capturing the sentence: "If we make two shots with a gun that was never loaded, then it will eventually fail." Then, we have the following result.
Theorem 16 (Past-future reduction) Every past-future rule r can be converted into a present-centered temporal program that is TEL f -equivalent to r.
This past-future form is aligned with the orientation by Gabbay (1987a) where past operators in the body (or antecedent) are used to declaratively check the recorded story, whereas future operators in the head (or consequent) are employed to provide imperative commands to be executed afterwards, as a result of firing the rule.
We have implemented a second system, telingo 12 , that deals with present-centered temporal programs that are expressible in the full (non-ground) input language of clingo extended with temporal operators. In addition, telingo offers several syntactic extensions to facilitate temporal modeling: first, next operators can be used in singular heads and, second, arbitrary temporal formulas can be used in integrity constraints. All syntactic extensions beyond the normal form of Theorem 11 are compiled away by means of the translation used in its proof. The resulting present-centered temporal programs are then processed according the point-wise translation.
To facilitate the use of operators • and •, telingo allows us to express them by adding leading or trailing quotes to the predicate names of atoms, respectively. For instance, the temporal literals •p(a) and •q(b) can be expressed by 'p(a) and q'(b), respectively.
For another example, consider the representation of the sentence "A robot cannot lift a box unless its capacity exceeds the box's weight plus that of all held objects": The distinction between different types of temporal rules is done in telingo via clingo's #program directives (Gebser et al . 2019), which allow us to partition programs into subprograms. More precisely, each rule in telingo's input language is associated 38 F. Aguado et al. Table 4. Two alternative telingo encodings for the temporal program in (52) # program initial . a.
b :-'a. : with a temporal rule r of form (b 1 ∧ · · · ∧ b n → a 1 ∨ · · · ∨ a m ) as in Definition 7 and interpreted as r, • r, or ( → r) depending on whether it occurs in the scope of a program declaration headed by initial, dynamic, or final, respectively. Additionally, telingo offers always for gathering rules preceded by (thus dropping • from dynamic rules). A rule outside any such declaration is regarded to be in the scope of initial. This allows us to represent the temporal program in (52) in the two alternative ways shown in Table 4. As mentioned, telingo allows us to use nested temporal formulas in integrity constraints as well as in negated form in place of temporal literals within rules. This is accomplished by encapsulating temporal formulas like ϕ in expressions of the form '&tel { ϕ }'. To this end, the full spectrum of temporal operators is at our disposal. They are expressed by operators built from < and > depending on whether they refer to the past or the future, respectively. So, </1, <?/2, and <*/2 stand for •, S, and T, and >/1, >?/2, >*/2 for •, , . Accordingly, <*/1, <?/1, <:/1 represent , , •, and analogously their future counterparts. I and are are represented by &initial and &final. This is complemented by Boolean connectives &, |,~, etc. For example, the integrity constraint 13 'shoot ∧ unloaded ∧ • shoot → ⊥' can be expressed as follows.
To conclude this section, we provide a larger example of telingo encoding (a more detailed description of the system was presented by ). Listing 1 contains an exemplary telingo encoding of the Fox, Goose and Beans Puzzle available at https://github.com/potassco/telingo/tree/master/examples/river-crossing.

Once upon a time a farmer went to a market and purchased a fox, a goose, and a bag of beans.
On his way home, the farmer came to the bank of a river and rented a boat. But crossing the river by boat, the farmer could carry only himself and a single one of his purchases: the fox, the goose, or the bag of beans. If left unattended together, the fox would eat the goose, or the goose would eat the beans. The farmer's challenge was to carry himself and his purchases to the far bank of the river, leaving each purchase intact. How did he do it? (https://en.wikipedia.org/wiki/Fox,_goose_and_bag_of_beans_puzzle) In Listing 1, lines 3-5 and 9-10 provide facts holding in all and the initial states, respectively; this is indicated by the program directives headed by always and initial. The dynamic rules in lines 14-22 describe the transition function. The farmer moves Listing 1. telingo encoding for the Fox, Goose and Beans Puzzle at each time step (Line 14), and may take an item or not (Line 15). Line 17 describes the effect of action move/1, Line 18 its precondition, and Line 20 the law of inertia. The second part of the always rules give state constraints in Line 24 and 25. The final rule in Line 29 gives the goal condition. All in all, we obtain two shortest plans consisting of eight states in about 20 ms. Restricted to the move predicate, telingo reports the following solutions: This example was also used by Cabalar and Diéguez (2011) to illustrate the working of stelp, a tool for temporal ASP with TEL ω . We note that stelp and telingo differ syntactically in describing transitions by using next or previous operators, respectively. Since telingo extends clingo's input language, it offers a richer input language, as witnessed by the cardinality constraints in Line 15 in Listing 1. Finally, stelp uses a model checker and outputs an automaton capturing all infinite traces while telingo returns finite traces corresponding to plans.

TEL f and the action language BC
Present-centered temporal programs over finite traces are sufficient to capture common action languages. We show this by providing a translation from action descriptions in action language BC (Lee et al . 2013) into present-centered temporal logic programs in TEL f . To this end, we need the following definitions describing the major concepts of BC. An action signature in BC includes two finite set of symbols, the set F of fluent constants and the set A of action constants.
where each a i is an atom for 0 ≤ i ≤ n. A dynamic law is an expression of the form a 0 after a 1 , . . . , a m ifcons a m+1 , . . . , a n with n ≥ m ≥ 0, where a 0 is an atom containing a regular fluent constant, each of a 1 , . . . , a m is an atom or an action constant, and a m+1 , . . . , a n are atoms. Note that statically determined fluent constants are not allowed in the heads of dynamic laws, but only in the heads of static laws (hence the term "statically determined"). An action description in BC consists of a finite set of static and dynamic laws. The semantics of action descriptions in BC is given by a translation into a sequence of logic programs with nested expressions. More precisely, given an action description D, a sequence of logic programs with nested expressions (N i (D)) i≥0 is defined as follows. For l ≥ 0, the signature of each program N l (D) is given by The logic program N l (D) contains • for each static law from D of form (55) and for all 0 ≤ i ≤ l, the rule i : a 0 ← i : a 1 ∧ · · · ∧ i : a m ∧ ¬¬(i : a m+1 ) ∧ · · · ∧ ¬¬(i : a n ), • for each dynamic law from D of the form (56) and for all 0 ≤ i < l, the rule (i + 1) : a 0 ← i : a 1 ∧ · · · ∧ i : a m ∧ ¬¬((i + 1) : a m+1 ) ∧ · · · ∧ ¬¬((i + 1) : a n ), We now provide a translation from the nested logic programs defining the semantics of BC into present-centered temporal logic programs. For any action description D in BC, we define the temporal logic program P (D) consisting of • for each static law from D of form (55), the rules a 1 ∧ · · · ∧ a m → a 0 ∨ ¬a m+1 ∨ · · · ∨ ¬a n and • (a 1 ∧ · · · ∧ a m → a 0 ∨ ¬a m+1 ∨ · · · ∨ ¬a n ), • for each dynamic law from D of form (56), the rule • (•a 1 ∧ · · · ∧ •am → a 0 ∨ ¬a m+1 ∨ · · · ∨ ¬a n ), • the formula a ∨ ¬a for every atom a containing a regular fluent constant, • the formulas a ∨ ¬a and • (a ∨ ¬a) for every action constant a, • for every fluent constant f , where v 1 , . . . , v k are all elements of the domain of f , the rules • • for every fluent constant f and every pair of distinct elements v, w of its domain, the rules With this, we get the following result.
Theorem 17 (Relation between stable models of N l (D) and P (D)) Let D be an action description in BC over action signature A, F, V , consisting of actions A, fluents F and values V.

42
F. Aguado et al. Then, we have the following: 1. If (X i ) i∈ [0..l) is a temporal stable model of P (D) of length l > 0, then is a temporal stable model of P (D). This provides us with an alternative characterization of the transition system corresponding to an action description in BC.

Corollary 7
Let D be an action description in BC and P (D) the logic program defined as above. Then, 1. for every stable model (X i ) i∈[0..1) of P (D) of length one, the set of atoms that belong to X 0 is a state of the transition system T (D) and 2. for every stable model (X i ) i∈ [0..2) of P (D) of length two, the transition system T (D) includes the transition s 0 , α, s 1 , where (a) s i is the set of atoms a such that a belongs to X i for i ∈ {0, 1} and (b) α is the set of action constants that belong to X 0 . Lee et al . (2013) showed that paths of length l in the transition system described by an action description D correspond to the stable models of N l (D). Using Theorem 17, we can also characterize these paths in terms of temporal stable models.
Corollary 8 (Translation from BC into TEL f ) Let D be an action description in BC and P (D) the logic program defined as above. A temporal trace (X i ) i∈ [0..l) is a temporal stable model of P (D) iff the sequence (s i ) i∈ [0..l) where s i is the set of atoms in X i is a path in the transition system corresponding to D.

Related work
Covering the vast literature that falls in the intersection of temporal reasoning and logic programming is too ambitious for the purpose of the current survey (focused on extending ASP with modal, LTL operators) and would surely require a more extensive document. In this section, we overview those approaches that show a closer connection to the kind of temporal logic programs considered in the paper. We divide this related work into two categories: (1) extending the language with modal operators based on linear traces and (2) using logic programming for temporal reasoning.

Extending the syntax with linear modalities
As mentioned in the introduction, the first use of the term "Temporal Logic Programming" (Abadi and Manna 1989) dates back to the late 1980s, appearing soon after the introduction of modal extensions of Prolog (Fariñas del Cerro 1986;Bieber et al . 1988). Several Logic Programming (LP) languages dealing with LTL operators were proposed (Moszkowski 1986;Fujita et al . 1986;Gabbay 1987b;Abadi and Manna 1989;Orgun and Wadge 1990;Baudinet 1992). The latter, a formalism called TEMPLOG, is perhaps a prominent case from a logical point of view. It provides a logical semantics in terms of a least LTL-model, in the spirit of the well-known least Herbrand model for positive 14 logic programs (van Emden and Kowalski 1976). (Cabalar et al . 2015, Theorem 5) proved that TEMPLOG is actually subsumed by TEL, that is, the latter can be used as a generalization of the former for an arbitrary temporal syntax that includes default negation. However, although TEL provides a common underlying semantics to TEMPLOG and our temporal programs (which are the basis of telingo), these two languages understand the (modal) temporal logic programming paradigm in a substantially different way, analogous to the differences between Prolog and ASP. In particular, TEM-PLOG understands rules in a top-down fashion where the head is considered a goal and the body is seen as a method (list of subgoals) to achieve the goal. As a result, (futuretime) LTL operators are used to represent temporal relations affecting the achievement of these subgoals. As an example, one possible TEMPLOG rule could look like ( printorder ← ack , •(print, ♦finished) ), meaning that, at any moment, a printorder is fulfilled by immediately sending an acknowledgment ack , then starting the printer print and eventually sending a finished message. This TEMPLOG rule naturally corresponds to the TEL implication and has indeed the same semantics in TEL. However, it does not fit into the past-future syntactic fragment used in telingo, since the printorder in the head is in the relative past of the conditions required in the body, talking about future satisfaction of print or finished . Following the ASP bottom-up understanding of rules, which is closer to causal laws in action languages, this same example would be represented instead as the past-future formula: (printorder → ack ∧ •(print ∧ ♦finished )), which can be reduced afterwards to a present-centered logic program. To sum up, TEL is rich enough to cover both bottom-up and top-down readings of program rules, but for its use for temporal ASP, it suffices with a syntactic fragment where past is checked in the bodies and future is used in the head. One last LTL-based LP extension was the preliminary definition of temporal answer sets provided by Cabalar (1999). The main difference of that approach with respect to TEL is that the former relied on a different three-valued semantics that was not a proper extension of Equilibrium Logic, losing some of the interesting properties that the latter has shown as a logical foundation of ASP.
Apart from these LP extensions strictly based on LTL, there exist other approaches that introduced other temporal modalities in LP or in ASP and relied on linear-time interpretations or traces. The most relevant and closely related approach is the one by Giordano et al . (2013), where a different definition of temporal answer set is provided.

44
F. Aguado et al. In this case, rather than LTL, the temporal approach used as a basis was Dynamic Linear Temporal Logic or DLTL (Henriksen and Thiagarajan 1999), a linear-time variant of the well-known Dynamic Logic (Harel et al . 2000). Besides, that definition of temporal answer sets was only applicable to a syntactic fragment of DLTL (also called there "temporal logic programs") since the semantics relied on a temporal extension of the classical (syntactic) reduct transformation (Gelfond and Lifschitz 1988). In order to facilitate a formal comparison,  introduced a proper extension of TEL that covers the full syntax of DLTL. The main result in that paper proved that, in fact, this extension of TEL for DLTL subsumes the semantics by Giordano et al . (2013) and, in fact, provides its generalization for DLTL arbitrary formulas, without depending on syntactic transformations.
Thanks to the incorporation of regular expressions, dynamic modalities are very interesting for the specification of control rules describing steps that are required to be followed by any solution to a temporal problem. Differently from DLTL, another (perhaps more direct) approach to introducing dynamic logic modalities on top of a linear-time semantics is the so-called Linear Dynamic Logic or LDL (De Giacomo and Vardi 2013). Both DLTL and LDL are more expressive than LTL, while satisfiability in the three logics share the same PSpace complexity. However, DLTL uses regular expressions as modifiers of the until and release operators, whereas the syntax of LDL is closer to the usual in dynamic logic, where modalities include the standard necessity [ρ]ϕ and possibility ρ ϕ constructs, where ρ is a regular expression. Besides, DLTL regular expressions are built on a separate signature (a set of atomic actions) and do not accept the test construct ϕ? from dynamic logic. LTL operators can be encoded both in LDL and DLTL, although the encodings for the latter require an explicit use of the (finite) set of atomic actions. One more advantage of LDL is that a finite trace variant LDL f has also been proposed and that both LDL and LDL f properly generalize LTL and LTL f respectively. All these reasons make LDL a more promising candidate to incorporate dynamic operators in ASP. As a result, Bosser et al . (2018) followed analogous steps to TEL with respect to LTL and introduced a non-monotonic extension of LDL called Linear Dynamic Equilibrium Logic (DEL). Moreover, a first implementation of LDL operators in telingo has been recently presented by , even though they are only allowed in integrity constraints. Although this restriction will be lifted in the future, it already supports an agreeable modeling methodology for dynamic domains separating action and control theories. The idea is to model the actual action theory with temporal rules, fixing static and dynamic laws, while the control theory, enforcing certain (sub)trajectories, is expressed by integrity constraints using dynamic formulas. This is similar to the pairing of action theories in situation calculus and Golog programs (Levesque et al . 1997).
Other modal temporal extensions of LP that rely on linear time have been recently introduced for stream reasoning, that is, reactive reasoning over time-varying data sequences. An approach closely related to TEL is LARS (Beck et al . 2015) that deals with time windows or intervals and combines modal LTL operators and ♦ with metric and time-point based connectives. Although LARS' semantics is also based on discrete linear-time, an important difference is that its traces are organized in intervals of time points called streams. An informal discussion comparing TEL and LARS was done by Beck et al . (2016) although a formal connection to the corresponding metric extension of TEL ) remains to be explored. As proved by Kamp (1968), the use of discrete time in LTL is not a limitation because any Dedekind complete ordering structure can be used as a timeline, and this includes natural numbers N or integer numbers Z but also real R numbers 15 . However, when metric operators come into play, the choice of dense time actually leads to a richer expressiveness, usually at the price of undecidability for an arbitrary syntax. For this reason, the most common approach for dense metric extensions is to identify syntactic fragments that keep amenable computational properties, like the case of the so-called bounded universal Horn formulas (Brzoska 1995) for positive programs. A more general fragment extending LP with metric modalities is DatalogMTL, a temporal metric extension of Datalog presented by Wa lega et al . (2019) and with applications to stream reasoning. Recently, this approach has been extended to programs with negation (Wa lega et al . 2020) but forbidding the use of ♦, or S in rule heads. This fragment is decidable and keeps favorable computational properties for the case of an integer timeline, although it jumps to undecidability for dense time, even if considering the rational numbers. Again, a formal connection to the metric extension of TEL  remains to be studied.
The combination of temporal modalities and non-monotonic reasoning is not exclusive to logic programming approaches and was also explored inside the area of Reasoning about Actions and Change. An early approach using LTL is, for instance, the Past Temporal Logic for Actions or PTLA (Mendez et al . 1996), an action language incorporating past LTL operators in the conditions of action laws. These action descriptions were then translated into logic programs under the ASP semantics using a similar transformation as the one presented in Section 5.1. Several authors have explored the formalization of action and change using Dynamic Logic (Baldoni et al . 1997;Schwind 1997;Castilho et al . 1999) or DLTL (Giordano et al . 2001), though only the first one relies on a logic programming paradigm.
Another prominent AI field for reasoning about dynamic systems where temporal logic has played an important role is Planning. In this area, the system behavior is specified in terms of some planning-specific language like STRIPS or PDDL, with a carefully limited syntax that avoids the need for an explicit representation of the (non-monotonic) law of inertia. This limited syntax restricts the specification of dynamic systems to a less expressive language than temporal ASP with telingo, where defaults, induction or aggregates can be freely combined with temporal operators, but has the advantage of allowing the design and implementation of efficient planning algorithms. Rather than in the description of the transition system, the introduction of temporal formulas in planning has been traditionally related to a richer specification of the goal, so that it not only provides a condition about the final state to be reached, but is also extended with temporal formulas (Bacchus and Kabanza 2000;Pistore and Traverso 2001;Bertoli et al . 2001;Kvarnström et al . 2008) imposing constraints on the sequence of actions that form the plan, something that can be used to improve the efficiency of the planning algorithm. This strategy can also be extrapolated to temporal ASP, although the effect of temporal constraints in telingo has a different impact on efficiency, given that the algorithm is based on incremental solving. A different strategy for temporal ASP closer to classical planning algorithms was explored in the prototype presented by . In 46 F. Aguado et al. this case, a classical graph search algorithm was implemented and multi-shot ASP solving was used to compute successor states during search. This has the advantage of being able to explore the whole state space and deciding whether a given planning problem has no solution, something impossible by the incremental horizon strategy followed in telingo. However, this planning based prototype had a rather limited syntax and did not allow the use of temporal expressions to incorporate temporal goals.
Other AI areas where temporal logic has been successfully applied are, for instance, Multi Agent Systems (MAS) and Ontologies. In the case of MAS, a prominent example is the system Concurrent MetateM (Fisher 1994), a language using LTL operators that exploits Gabbay's separation theorem (Gabbay 1987a) asserting that LTL descriptions can be reduced to a set of implications with the form "past → future." Note that we also exploited this past-future form in telingo and our Theorem 16. The main difference between MetateM and temporal ASP, however, is that the former relies on monotonic LTL, so it does not allow for closed world reasoning, defaults or induction. On the other hand, MetateM incorporates high level constructs for agents specification and message passing that are not present in telingo.
Finally, in the case of LTL in Ontologies, the combination of Description Logics (Baader et al . 2003) with temporal patterns is an important field of knowledge representation that has been widely studied in the literature (see, for instance, the surveys by Artale and Franconi (2000), Artale and Franconi (2005) and Lutz et al . (2008)). However, as happened in the MAS case, the result of these combinations are also monotonic. Combining ontological reasoning and logic programming has also been extensively studied, with the ASP extension called Hybrid Knowledge Bases (de Bruijn et al . 2010) being perhaps the closest one to our approach, as it is based on Quantified Equilibrium Logic. In a preliminary work, Cabalar and Schaub (2019) presented a combination of hybrid knowledge bases with the temporal ontology framework ALC-LTL by Baader et al . (2008). This allowed the use of temporal ontological axioms in temporal logic programs, but no implementation has been made so far.

Using logic programming for temporal reasoning
A second line of related approaches are those that perform temporal reasoning using logic programming (especially Datalog or ASP) as a reasoning engine. In this case, the idea is not necessarily to extend the logic programming syntax with temporal modalities, but to use logic programming as a tool for query answering or model checking with respect to some standard, monotonic temporal logic (most frequently, LTL). If we use Datalog or ASP, the main inconvenience appears when trying to reason about traces of infinite length, since these formalisms historically required a finite domain to allow for a previous grounding of the logic program. For instance, the use of functions was usually forbidden (or limited) to keep a finite Herbrand universe. This limitation was overcome by the early proposal by Chomicki and Imielinski (1988) consisting in the extension of Datalog with a unary successor function, to be used inside a fixed parameter in predicates. This approach, called Datalog 1S , allows for reasoning about infinite traces while keeping decidability. Moreover, it was proved (Baudinet et al . 1993) to be equally expressive to TEMPLOG, although both languages treat time in a different way: TEMPLOG uses intensional, temporal modalities, whereas Datalog 1S uses an extensional approach, representing time points as explicit parameters. Later on, this formalism was extended to so-called Datalog nS (Chomicki and Imielinski 1993) and used as a reasoning system for answering temporal queries expressed in past LTL. A similar approach to Datalog 1S , based on the introduction of a successor unary function, was adopted by Eiter andŠimkus (2009) for the more general case of ASP. Other extensions of Datalog that have been used as reasoning engines for temporal logics are Datalog LITE (Gottlob et al . 2002) or inf -Datalog (Guessarian et al . 2003). Notice that all these cases are variants of Datalog used to perform model checking for temporal logics such as LTL, CTL or μ-calculus, but are not modal temporal extensions of Datalog.
Another extensional alternative is, rather than using a successor function, to treat time points directly as integer numbers, relying on Constraint Logic Programming (CLP) to solve the integer constraints imposed by temporal expressions. This was the approach adopted by Brzoska (1991), who emulated the operational behavior of TEMPLOG using a CLP translation where each predicate received an additional integer argument, representing time. One more extensional temporal approach based on CLP is, for instance, the Temporal Annotated CLP formalism (Frühwirth 1996). In this case, predicates can be annotated with expressions such as "at T ", "th I" or "in I", respectively meaning "at time point T ", "throughout interval I" and "in interval I", respectively. Finally, an early approach using CLP for translating temporal formulas was introduced by Hrycej (1988), but in this case, rather than treating time points as integers, the constraint solver used qualitative constraints for Allen's Interval Calculus (Allen 1983).
A prominent application of ASP for temporal reasoning is the use of ASP solvers to perform bounded model checking of temporal formulas. The technique of bounded model checking (BMC) was introduced by Biere et al . (1999) as a variant of model checking that looks for countermodels of a temporal formula, but only for traces up to some bounded length k ∈ N. The original approach translated the LTL formula into a propositional theory and then used a SAT solver as a backend. Heljanko and Niemelä (2003) proved that an ASP solver could be used instead of SAT, providing a more compact translation of LTL formulas while keeping an efficient implementation. A similar approach was later followed by Giordano et al . 2012; to implement BMC for action theories and temporal answer sets. Again, although the use of ASP for BMC is clearly in the intersection of temporal logics and logic programming, it does not necessarily represent a temporal extension of the latter. Note, for instance, that the tool by Heljanko and Niemelä (2003) provides a model checker whose input language are temporal formulas with the standard monotonic semantics of LTL.
Finally, one more application of ASP for temporal reasoning is its use for encoding Qualitative (Spatio-)Temporal Calculi (Li 2012;Brenton et al . 2016). In this case, the target temporal formalism is not a modal temporal logic, but some calculus for a set of qualitative relations like, for instance, the aforementioned Allen's Interval Calculus. For this reason, the relation to the approach studied in the current survey is weaker while, once again, ASP is used as a reasoning engine for encoding the temporal calculi.

Conclusion
We have provided a wide overview of the main definitions and recent results for the formalism of TEL, a combination of Equilibrium Logic (a logical characterization of ASP) 48 F. Aguado et al. with Linear-Time Temporal Logic. After more than a decade of study, the knowledge about TEL has achieved a high degree of maturity, both at a fundamental level and also at an incipient practical application. An important breakthrough for the latter has been the introduction of a finite trace variant, TEL f , more aligned with the usual problem solving orientation followed in ASP. This has opened the possibility of introducing temporal operators in ASP solving with the construction of the tool telingo, a temporal extension of clingo that exploits the incremental solving capabilities of the latter. Moreover, the definition of TEL f has also provided a methodology for the study of other extensions, like the introduction of dynamic logic operators  or, more recently, the definition of temporal metric constructions ) that are planned to be further developed and combined with other features inside the software packages of potassco.org.
This survey has been focused on the LTL extension of ASP where many interesting lines remain to be explored yet. For instance, we still miss an axiomatization that covers the finite trace variant of the monotonic basis, THT f , or a general axiomatization that is applicable to THT, that is, regardless of the trace length. Also, properties related to inter-definability of operators need to be further explored for the finite trace case. Related to this, Aguado et al . (2020) proposed the introduction of an explicit negation operator that allows for inter-definability of temporal operators like until and release using De Morgan laws. The connection of TEL f to finite automata is also a topic of active current research. Automata construction techniques may become crucial in the future both for formal verification of dynamic systems specified with telingo but also for exploiting temporal expressions in a more compact way during computation, rather than making a full unfolding into regular ASP programs. Another important line of future study is how to exploit temporal constructions for grounding: right now, telingo does not recognize temporal information at that stage. A first study about temporal grounding was provided by , but it focused on infinite traces, making these results not extrapolatable to the case of telingo, where the hypothesis of finite traces can be exploited more efficiently.
In a broader picture, we are facing a true rebirth of (Modal) Temporal Logic Programming, which is becoming a thrilling area with an intense research both on foundations and in practical implementation. As we have seen in Section 7, there exist several temporal extensions of ASP and Datalog with applications to planning and problem solving on dynamic domains, temporal Knowledge Representation and, more recently, stream reasoning. It seems clear that practical applications may require a richer language than the LTL syntax, as happens with some of the ASP extensions introducing metric constructs or path expressions from dynamic logic. One advantage of the approach we have presented is its characterization in terms of Equilibrium Logic, allowing for an easy adaptation to other modal temporal logics (first extend the modal logic with HT and then add the equilibrium models condition). However, there exist many alternative temporal approaches and choosing which one is the most suited (in terms of expressiveness, complexity and ease of use) for a dynamic problem at hand may turn out to be a challenging question in the future.