Abstract 1 Introduction 2 Preliminaries 3 Higher-Order Recursive Timed Automata 4 Tail Recursion 5 Upper Bounds for Model-Checking 6 Matching Lower Bounds 7 Conclusion References Appendix A Additional Material

Higher-Order Timed Automata and Tail Recursion

Florian Bruse ORCID TUM School of Computation, Information and Technology, Technical University of Munich, Munich, Germany
Abstract

Timed Automata (TA) are a popular formalism to model systems in dense linear time. However, due to their finite state-space, they can only model systems with a finitary logical behavior. There are extensions to e.g., timed pushdown systems and timed recursive state machines. Higher-Order Recursion Schemes (HORS) are another popular model for infinite-state, non-regular systems, naturally stratified by their type-theoretic order. We recently introduced Real-Time Recursion schemes as an approximation of HORS to real-time systems.

This paper updates Real-Time Recursion Schemes into Higher-Order Timed Automata, a formalism that defines a tree-shaped timed automaton, which is more suitable to model actual systems. We show that the model-checking problem against the timed version of the modal mu-calculus exhibits the expected complexity bounds, i.e., an increase by one exponential towards the untimed version. We also show that, in the presence of tail recursion, half an exponential can be recovered, mirroring similar gains in the untimed setting. We also give a matching lower bound for the special case of order-1 HORTA. We conjecture that this can be generalized for all orders.

Keywords and phrases:
Timed Automata, Higher-Order Recursion Schemes, Tree Automata, Tail Recursion
Copyright and License:
[Uncaptioned image] © Florian Bruse; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation → Timed and hybrid models
; Theory of computation → Tree languages ; Theory of computation → Automata over infinite objects
Editors:
Thierry Vidal and Przemysław Andrzej Wałęga

1 Introduction

Verification of real-time systems plays an ever important role, as more and more aspects of life become computerized. Often, systems are required to not only respond to certain input eventually, but within specific time bounds. For example, electronic stability control or anti-lock braking systems need to respond within fractions of a second.

Timed Automata (TA) [5] are a popular tool to model real-time systems [1, 16]. TA model time not in a discrete fashion, as used in e.g., CTL or the modal μ-calculus, but rather in a dense linear fashion. The well-known region abstraction allows us to recover finiteness by re-discretization of said dense linear time, which yields decidability (and PSPACE-completeness) of e.g., the model-checking problem for the temporal version of CTL, TCTL [5]. A less well-known real-time logic used in conjunction with timed automata is the timed μ-calculus (Tμ) [17], for which model-checking is EXPTIME-complete.

There are several attempts to generalize the notion of timed automata beyond a finite state space, for example timed recursive state machines [7], recursive timed automata [22], or timed pushdown automata [8, 13]. Recently, we proposed Real-Time Recursion Schemes [3], an extension of the notion of timed automata to Higher-Order Recursion Schemes (HORS). HORS are a well-studied framework in the context of infinite-state verification [14, 18]. A HORS is a higher-order grammar that generates a tree, e.g., the syntax tree of a functional program. The question of HORS model-checking is to decide whether a given alternating parity tree-automaton (APT) accepts the tree generated by the HORS. This is known to be decidable for order-k HORS in k-EXPTIME [20, 19]. We showed in [3] that mixing HORS and real-time systems had the typical effect of increasing the complexity of the model-checking problem by one exponential as compared to the untimed base problem.

This paper extends the idea of Real-Time Recursion Schemes into a proper recursive grammar for timed automata called Higher-Order Timed Automata (HORTA), which makes the problem more natural and rather intuitive to handle. We show that the model-checking problem remains in (k+1)-EXPTIME for the updated problem, which asks whether the timed transition system defined by a HORTA satisfies a given formula of the timed μ-calculus.

Moreover, we connect the new formalism to existing research in the area of tail recursion. Higher-order model-checking problems like the HORS model-checking problem often have high theoretical complexities, and passing to tail-recursive fragments can shave off half an exponential, not only for recursion schemes [9], but also for model-checking problems where the logic is higher-order [12, 11]. We confirm that these findings also hold for HORTA and the timed μ-calculus, i.e., that the model-checking problem becomes easier by half an exponential in the tail-recursive setting. We establish a matching lower bound which, for space considerations, is given for the order-1-case only.

The paper is structured as follows: in Sect. 2, we introduce APT, TA, the timed μ-calculus, HORS, and existing results regarding tail recursion. In Sect. 3 we define HORTA, in Sect. 4 we define the tail-recursive fragment of the HORTA model-checking problem. In Sect. 5, we establish upper bounds for the model-checking problem, and give a matching lower bound for the order-1 case in Sect. 6. We conclude in Sect. 7. Most proofs have been omitted due to space considerations.

2 Preliminaries

2.1 Trees and Automata

A tree is a finite, left-closed set T⊆ℕ∗, i.e., for all v⁢i∈T, we have v∈T and, moreover, v⁢i−1∈T if i>0. A tree alphabet is a finite, nonempty set Σ and a function 𝑎𝑟:Σ→ℕ indicating the arity of each symbol. We write Σi for the set of symbols of arity i in Σ. A Σ-tree is a pair (T,l) of a tree T and a labeling function l:T↦Σ, such that each v∈T has exactly 𝑎𝑟⁢(l⁢(v)) successors. We often identify a tree with its labeling function.

Let S be a set. ℬ+⁢(S) is the set of positive Boolean expressions over S, derived from the grammar φ≔s∣⊥∣⊤∣φ∨φ∣φ∧φ with s∈S.

An alternating parity tree-automaton (APT) is a 𝒫=(Q,Σ,δ,qI,Λ) where Q is a finite, nonempty set of states, Σ is a tree alphabet containing a special nullary symbol ω, δ=⋃i≤nδi is the transition function with δi:Q×Σi→ℬ+⁢(Qi) and n being the maximal arity that occurs in Σ. We write δ⁢(q,l⁢(v)) for δi⁢(q,l⁢(v)) if 𝑎𝑟⁢(l⁢(v))=i. Finally, qI∈Q is the starting state and Λ:Q→ℕ is the priority function. The size of an APT is the number of its states.

A run of an APT 𝒫 on some Σ-tree T (for matching Σ) is a parity game G⁢(𝒫,T) between ∃ and ∀, called the acceptance game. It has positions from T×(Q∪⋃i≤nℬ+⁢(Qi)) where n is the maximal arity in Σ. Its starting position is (ϵ,qI). In a position of the form (v,q), the unique successor is (v,δ⁢(q,l⁢(v))). Positions of the forms (v,φ1∨φ2) and (v,φ1∧φ2) have two successors, namely (v,φ1) and (v,φ2). A position of the form (v,(q0,…,qi−1)) has i successors (v⁢0,q0),…,(v⁢i−1,qi−1), a position of the form (v,⊤) or (v,⊥) has no successors. Positions of the forms (v,⊤) and (v,φ1∧φ2) and (v,(q0,…,qi−1)) belong to ∀, all other positions belong to ∃. Finally, the priorities of the game are Ω⁢(v,q)=Λ⁢(q); for all other positions we have Ω⁢(v,φ)=1. 𝒫 accepts a tree T if ∃ wins G⁢(𝒫,T). In the following, we assume APT to have designated states q⊤,q⊥ from which all, resp. no trees are accepted.

2.2 Higher-Order Recursion Schemes

Instead of the classical definition of Higher-Order Recursion Schemes (HORS, cf. e.g., [18]), we use a version going back to Damm [14] and re-introduced by Walukiewicz and Salvati [21], using the λ⁢Y-calculus as syntax.

Types and Terms.

The set of types is defined inductively via τ⩴∙∣τ→τ where ∙ is the type of trees, ∙⁣→⁣∙ is the type of functions that consume a tree and yield a tree, etc. We write τi→∙ for the type τ→⋯⁢τ→∙ with i many copies of τ. The order of a type is defined via 𝑜𝑟𝑑⁢(∙)=0 and 𝑜𝑟𝑑⁢(τ1→τ2)=max⁡{1+𝑜𝑟𝑑⁢(τ1),𝑜𝑟𝑑⁢(τ2)}.

Let Σ be a tree alphabet. Each a∈Σ of arity i is a tree constructor of type ∙i⁣→⁣∙. Let ℒ be a set of typed λ variables, ℱ be a set of typed Y variables. Lower case letters a,b,… denote tree constructors, lower case letters x,y,… denote λ variables, upper case letters F,G,… denote Y variables. If necessary, (x:τ), (F:τ) indicates the type of a variable.

Given Σ,ℒ,ℱ, the set of λ⁢Y terms is defined inductively: a tree constructor of type ∙i⁣→⁣∙ is a term of type ∙i⁣→⁣∙, a lambda variable x:τ and a Y variable F:τ are terms of type τ. Given x:τ1 and a term t of type τ2, λ(x:τ).t is a term of type τ1→τ2. Given terms t1,t2 of type τ2→τ1 and τ2, resp., (t1⁢t2) is a term of type τ1. If F:τ is a Y variable and t is a term of type τ, then Y(F:τ).t is a term of type τ.

t⁢[t′/x] denotes capture-avoiding substitution of t′ for all free occurrences of x in t, and similarly for t⁢[t′/F], assuming that the types match. Each variable may also be bound at most once in a term. Hence, for closed terms there is a function 𝑡𝑒𝑟𝑚 that maps each Y variable F to 𝑡𝑒𝑟𝑚⁢(F), defined as t if the unique binding of F is Y⁢F.t. The order of a term is that of the highest order of any of its subterms, its size the number of its distinct subterms.

Semantics.

Besides α-conversion, i.e., variable renaming, the λ⁢Y calculus has β-reduction and δ-reduction. β-reduction →β reduces ((λx.t)t′), where x and t′ have the same type, to t⁢[t′/x]. δ-reduction →δ reduces Y⁢F.t to t and F to 𝑡𝑒𝑟𝑚⁢(F). The reflexive transitive closure of →β⁣∪⁣→δ is →β⁢δ∗. Since both β-reduction and δ-reduction maintain the type of a term, so does →β⁢δ∗, and this relation is confluent. A closed term of type ∙ is in weak head normal form if it is of the form a⁢t0⁢⋯⁢tj. Not every λ⁢Y term reduces to a head normal form.

Let Σ be a tree signature and let ω be a new nullary symbol, i.e, of type ∙. We define the Böhm tree 𝐵𝑇⁢(t) of a closed term of type ∙ as follows: If t does not reduce via →β⁢δ∗ to a weak head normal form, then 𝐵𝑇⁢(t)=ω, i.e., the tree has just one node. Otherwise, let a⁢t0⁢⋯⁢tj be a weak head normal form of t. The root of 𝐵𝑇⁢(t) is labeled by a, and its successors are, in order, the roots of 𝐵𝑇⁢(t0),…,𝐵𝑇⁢(tj). Due to confluence, this definition is sound.

The HORS model-checking problem (defined via λ⁢Y terms) is the following: Given a closed term t of type ∙ over Σ and an APT 𝒜 with alphabet Σ∪{ω:∙}, does 𝒜 accept 𝐵𝑇⁢(t)? For terms of order k≥0, this is known to be a k-EXPTIME complete problem [20].

2.3 Timed Automata

Let 𝒳={x,y,…} be a set of ℝ≥0-valued variables, called clocks. 𝐶𝐶⁢(𝒳) is the set of clock constraints over 𝒳, defined as conjunctive formulas over ⊤ and x⊕c for x∈𝒳 and c∈ℕ, where ⊕∈{≤,<,>,≥}. Clock constraints are denoted by χ,χ′ etc.

A clock evaluation is a mapping η:𝒳→ℝ≥0; it satisfies a clock constraint as follows: (i) η⊧⊤ always, (ii) η⊧x⊕c iff η⁢(x)⊕c and (iii) η⊧φ1∧φ2 iff η⊧φ1 and η⊧φ2. For a clock evaluation η and d∈ℝ≥0, we write η+d for the clock evaluation defined via (η+d)⁢(x)=η⁢(x)+d for all x∈𝒳. For R⊆𝒳, η|R is the clock evaluation defined via η|R⁢(x)=η⁢(x) if x∉R and η|R⁢(x)=0 if x∈R.

Let 𝑃𝑟𝑜𝑝 be a finite set of propositions. A timed automaton over clocks in 𝒳 and with propositions in 𝑃𝑟𝑜𝑝 is an 𝒜=(L,𝒳,ℓ0,ι,Δ,λ) where (i) L is the set of locations of the timed automaton, including the initial location ℓ0, (ii) 𝒳 is a finite set of clocks, (iii) ι:L→𝐶𝐶⁢(𝒳) assigns a clock constraint called an invariant to each location, (iv) Δ⊆L×𝐶𝐶⁢(𝒳)×2𝒳×L is a finite set of transitions; we write ℓ⁢→g,Rℓ′ for (ℓ,g,R,ℓ′)∈δ. In such a transition, g is the guard and R are the resets of the transition. Finally, (v) λ:L→2𝑃𝑟𝑜𝑝 labels each location with the propositions valid there. The index m⁢(𝒜) of a timed automaton 𝒜 is the largest constant that occurs in its guards or invariants. Its size is defined as

|𝒜|=|Δ|⋅(2⋅log⁡(|L|)+|𝒳|2⋅log⁡m⁢(𝒜))+|L|⋅(log⁡|𝒳|2⋅log⁡m⁢(𝒜))+|L|⋅|𝑃𝑟𝑜𝑝|.

due to the coding of the constants in clock constraints in binary. A TA defines a timed Transition System (tTS), to be defined in more general fashion in Sect. 3.

2.4 The Timed 𝝁-Calculus

We define the timed modal μ-calculus (Tμ) following [17]. Let 𝒳 be a set of clocks and let 𝒴 disjoint from 𝒳 be a set of specification clocks. Let 𝑃𝑟𝑜𝑝 be a set of propositions and let 𝒱 be a set of fixpoint variables. A formula of Tμ is one derived from the following grammar:

φ⩴p⁢∣X∣⁢χ⁢∣¬φ∣⁢φ∨φ⁢∣φ∧φ∣⁢φ⊳φ⁢∣φ⊟φ∣⁢z.φ∣μ⁢X.φ∣ν⁢X.φ

where p∈𝑃𝑟𝑜𝑝,X∈𝒱,χ∈𝐶𝐶⁢(𝒳∪𝒴) and z∈𝒴. Moreover, every variable X must be bound exactly once and occur under an even number of negations in μ⁢X.φ or ν⁢X.φ, a standard convention for the modal μ-calculus. This induces, for each Tμ formula φ, a function 𝑓𝑝 where 𝑓𝑝⁢(X) is the unique ψ with μ⁢X.ψ or ν⁢X.ψ a subformula of φ. Moreover, we assume w.l.o.g. that every Tμ formula is guarded in the sense that, on the path from μ⁢X.ψ or ν⁢X.ψ to X in the syntax tree of the formula, there is an instance of ⊳ or ⊟. Analogously to the ordinary μ-calculus [10], every Tμ formula can be converted into an equivalent guarded one, potentially at the cost of exponential blowup111This blowup can be avoided at the cost of extra complexity, so we decide to simply stipulate guardedness for the sake of simplicity..

z.φ resets the specification clock z to 0. Hence, patterns like z.…⁢z=4⁢… serve to test for elapsed time. The intuition for φ1⊳φ2 is that of a temporal next operator: it is satisfied if φ2 is true after a sequence of a delay, a discrete transition, and another delay, and φ1 is true all the way before. The operator ⊟ is the dual of it, i.e., a temporal next with universal quantification over delays and transitions.

Let 𝒯=(𝒮,→,s0,λ) be a tTS, let α:𝒱→2𝒮 be a variable assignment. The semantics ⟦φ⟧𝒯α of a Tμ formula φ is defined inductively via

⟦p⟧𝒯α ={s∈𝒮∣p∈λ⁢(s)} ⟦X⟧𝒯α =α⁢(X)
⟦χ⟧𝒯α ={s∈𝒮∣s⊧χ} ⟦z.ψ⟧𝒯α ={s∈𝒮∣s|{z}∈⟦ψ⟧𝒯α}
⟦ψ1∨ψ2⟧𝒯α =⟦ψ1⟧𝒯α∪⟦ψ2⟧𝒯α ⟦ψ1∧ψ2⟧𝒯α =⟦ψ1⟧𝒯α∩⟦ψ2⟧𝒯α
⟦¬ψ⟧𝒯α =𝒮∖⟦ψ⟧𝒯α ⟦ψ1⊟ψ2⟧𝒯α =⟦¬(¬ψ1⊟¬ψ2)⟧𝒯α

with

⟦μX.ψ⟧𝒯α =⋂{𝒮′⊆𝒮∣⟦ψ⟧𝒯α⁢[X↦𝒮′]⊆𝒮′}
⟦νX.ψ⟧𝒯α =⋃{𝒮′⊆𝒮∣⟦ψ⟧𝒯α⁢[X↦𝒮′]⊇𝒮′}

and where ⟦ψ1⊳ψ2⟧𝒯α is defined as

{s∣ ex. s′∈𝒮,d,d′∈ℝ≥0 s.t. s+d→s′ and s′+d′∈⟦ψ2⟧𝒯α, and s+d′′∈⟦ψ1⟧𝒯α f.a. 0≤d′′≤d and s′+d′′′∈⟦ψ1∨ψ2⟧𝒯α f.a. 0≤d′′′≤d′}.

Here, the temporal next relation ⊳ is defined as the composition of a delay, a discrete transition, and another delay. The clause that all states after the discrete transition need to satisfy ψ1∨ψ2 is standard to cope with the fact that there might not be a smallest delay that makes ψ2 true. Standard patterns in temporal logic, e.g., 𝙴(p𝚄[3,4]q), which says that there is a path on which p holds until q holds, and that q holds after time elapsed between 3 and 4 time units, can be expressed as e.g., z.μ⁢X.(q∧3≤z∧z≤4)∨p⊳X.

The model-checking problem for Tμ is then to decide, given a timed automaton and a Tμ formula φ, whether 𝒯⊧φ where 𝒯 is the tTS defined by the timed automaton.

Proposition 1 ([2]).

The model-checking problem for Tμ is EXPTIME-complete.

2.5 Tail Recursion

Bounded-Alternation Parity Automata.

Let Σ be partitioned into Σ𝗋𝖾∪Σ𝗎𝗋. Let 𝒫=(Q,Σ,δ,qI,Λ) be an APT such that Q is partitioned into sets {q⊤,q⊥}∪Q𝗎𝗋,Q1,…,Qm for some m. Let q∈Qj for some 1≤j≤m and let a∈Σ2. We say that 𝒜 is branching at q and a if δ⁢(q,a)=(q1,q⊤)∨(q⊤,q2) with q1,q2∈Qj∪{q⊤,q⊥} or δ⁢(q,a)=(q1,q2) with q2∈Qj∪{q⊤,q⊥} and q1∈Qj−1∪⋯∪Q1∪{q⊤,q⊥}. It is universal at q and a if δ⁢(q,a)=(q1,q2) with both q1,q2∈Qj∪{q⊤,q⊥}, or δ⁢(q,a)=(q1,q⊤)∨(q⊤,q2) with q1∈Qj−1∪⋯∪Q1∪{q⊤,q⊥} and q2∈Qj∪{q⊤,q⊥}.

𝒫 is called a bounded-alternation APT (baAPT) if it satisfies the following conditions:

  1. 1.

    Q is partitioned into sets {q⊤,q⊥},Q𝗎𝗋,Q1,…,Qm as per above.

  2. 2.

    For each 1≤i≤m, each Qi is labeled as either branching or universal. Q𝗎𝗋 is not labeled.

  3. 3.

    If Qi is branching, then for each q∈Qi and for each a∈Σ𝗋𝖾, 𝒜 is branching at q and a. If Qi is universal, then for each q∈Qi and for each a∈Σ𝗋𝖾, 𝒜 is universal at q and a.

  4. 4.

    For each q∈Q and a∈Σ𝗎𝗋i, we have that δ⁢(q,a)∈ℬ+⁢(Q𝗎𝗋i).

  5. 5.

    For each q∈Q𝗎𝗋 and a∈Σ𝗋𝖾i, we have that δ⁢(q,a)∈ℬ+⁢((Q∖Q𝗎𝗋)i).

The intuition here is as follows: The acceptance problem of a baAPT in which each state is branching or in which each state is universal can be reduced to a one-player game. The acceptance problem for such a baAPT with empty set Q𝗎𝗋 is a bounded-alternation game. For general baAPT, the reduction to a bounded-alternation game is still possible if offending states are in a set of lower index and there is an a priori bound on the number of times a play passes through states in Q𝗎𝗋. The definition of tail-recursive HORS below yields this bound.

Tail-Recursion for 𝝀⁢𝒀 Terms.

Let t be a term of the λ⁢Y calculus over Σ𝗋𝖾∪Σ𝗎𝗋, ℒ and ℱ. It is called tail-recursive if it satisfies the following conditions:

  1. 1.

    For all subterms of t of the form t1⁢t2, the operand-side subterm t2 has no free ℱ variables.

  2. 2.

    For all subterms of the form a⁢t0⁢⋯⁢tj with a∈Σ𝗎𝗋, none of the ti has free ℱ variables.

Note that there are no restrictions w.r.t. variables in ℒ.

Definition 2.

Let Σ be partitioned into Σ𝗋𝖾∪Σ𝗎𝗋. Let t be a closed tail-recursive term of type ∙ in the λ⁢Y calculus over Σ, and let 𝒫 be a baAPT. The problem of tail-recursive HORS model checking is to decide whether 𝒫 accepts 𝐵𝑇⁢(t).

Proposition 3 ([9]).

The problem of tail-recursive HORS model checking (i.e., against a baAPT) for terms of order k>0 is complete for (k−1)-EXPSPACE.

3 Higher-Order Recursive Timed Automata

Timed automata define tTS, where each state is a pair of a location and a clock evaluation, the former which defines the propositonal labeling of the state. Transitions in tTS are either delay transitions that let time flow but keep the location component, or discrete transitions that keep time fixed, change the location, and reset clocks as indicated by the transition. The first kind of transition respects location invariants, while the second kind respects guards.

The idea for recursively defined tTS is that locations are not a fixed, finite set, but are the nodes of a tree generated by a λ⁢Y term. The propositional labeling is derived from the labeling of the respective node, i.e., the tree constructor in question. Moreover, we define HORS for tTS in such a way that a tree constructor also carries information on the location invariant associated to it, and the guards and resets of its successors.

Definition 4.

Let 𝒳 be a finite set of clocks and let 𝑃𝑟𝑜𝑝 be a finite set of propositions. A timed tree alphabet (over 𝒳 and 𝑃𝑟𝑜𝑝) is a finite, nonempty set Σ together with functions 𝑎𝑟,λ,ι,𝑡𝑟𝑛𝑠 of domain Σ where, for each a∈Σ,

  1. 1.

    𝑎𝑟⁢(a)∈ℕ indicates the arity of the symbol (as for standard tree alphabets),

  2. 2.

    λ⁢(a)⊆𝑃𝑟𝑜𝑝 indicates the propositional labeling of a node labeled by the symbol,

  3. 3.

    ι⁢(a)∈𝐶𝐶⁢(𝒳) indicates the invariant of a node labeled by the symbol, and

  4. 4.

    𝑡𝑟𝑛𝑠⁢(a)∈(𝐶𝐶⁢(𝒳)×2𝒳)i where i=𝑎𝑟⁢(a) indicates the guards and resets on the edges to the i many successors of a node labeled by the symbol.

We write 𝑡𝑟𝑛𝑠i⁢(a) to denote the ith element of the tuple 𝑡𝑟𝑛𝑠⁢(a).

Of course, a timed tree alphabet is a tree alphabet by ignoring the extra functions. A tree labeled by such a timed alphabet gives rise to a tTS as follows.

Definition 5.

Let Σ be a timed tree alphabet over 𝒳 and 𝑃𝑟𝑜𝑝 and let (T,l) be a Σ-tree. The tTS defined by (T,l) is 𝒯T=(𝒮,→,s0,λ) where

  • ■

    𝒮={(v,η)∣η⊧ι⁢(l⁢(v))}, where v∈T and η:𝒳→ℝ≥0,

  • ■

    the initial state is (ϵ,η0) with η0⁢(x)=0 f.a. x∈𝒳,

  • ■

    delay transitions keep the tree node but let time flow: for any (v,η)∈𝒮 and d∈ℝ≥0 we have a transition (v,η)⁢→d(v,η+d) if η+d′⊧ι⁢(l⁢(v)) for all 0≤d′≤d.

  • ■

    discrete transitions are derived from 𝑡𝑟𝑛𝑠⁢(l⁢(v)): for all (v,η)∈𝒮,i<𝑎𝑟⁢(l⁢v), we have (v,η)⁢→(v⁢i,η|R) if 𝑡𝑟𝑛𝑠i⁢(l⁢(v))=(χ,R) and η⊧χ and η|R⊧ι⁢(l⁢(v⁢i)),

  • ■

    the propositional labeling λ feeds through the labeling of a tree node, i.e., λ⁢(v,η)=λ⁢(l⁢(v)),

  • ■

    all states are labeled by the clock constraints that hold there, i.e., (v,η)⊧χ iff η⊧χ.

Note that 𝒯T is generally not a tree due to additivity of time: there are uncountably many paths from (v,η) to (v,η+d) for any d>0 s.t. the location invariant is satisfied. Other than this, the transition system is a tree though.

A λ⁢Y term t over a timed alphabet is called a Higher-Order Recursive Timed Automaton (HORTA). It generates a tTS 𝒯t via the tree generated from the term. Its order is that of the order of the underlying λ⁢Y term. The index m⁢(t) of a HORTA is the largest constant that occurs in its guards or invariants, its arity 𝑎𝑟⁢(t) is the maximal arity of a symbol in its tre alphabet. The size of a HORTA is ‖t‖=|t|⋅|Σ|⋅(|𝑃𝑟𝑜𝑝|+|𝒳|2⋅m⁢(𝒜)⋅𝑎𝑟⁢(t)) where |t| defines the size of the underlying λ⁢Y term.

The HORTA model-checking problem is then the following:

given: a HORTA t and a formula φ of the timed μ-calculus
decide: does 𝒯t⊧φ hold?

An example can be found in the appendix.

4 Tail Recursion

Let 𝒳 be a set of clocks, 𝒴 be a set of specification clocks and 𝑃𝑟𝑜𝑝 be a set of atomic propositions with psf∈𝑃𝑟𝑜𝑝 a designated proposition. This proposition takes the role of a tree constructor from Σ𝗎𝗋 for tail-recursive terms, i.e., it signals tree nodes s.t. its subtrees are defined using terms without free Y variables. Hence, given a HORTA, this designated proposition psf partitions its tree alphabet Σ into Σ𝗎𝗋={a∣psf∈λ⁢(a)} and Σ𝗋𝖾={a∣psf∉λ⁢(a)}. A HORTA is tail recursive if it is tail recursive as a HORS using this partition.

Now let 𝒱=𝒱1𝖻𝗋∪𝒱1𝗎𝗇∪⋯∪𝒱m𝖻𝗋∪𝒱m𝗎𝗇∪𝒱𝗎𝗋 be the set of fixpoint variables, partitioned into 2⁢m+1 different sets. Each such variable plays the same role as a state in a baAPT, including being either branching, universal, or unrestricted, an being partitioned into different sets. Hence, the the annotations mark the variables as branching, universal, or unrestricted (superscript), and fix the respective set of the partition (subscript).

A Tμ formula has bounded-alternation if it can be derived from ψm𝖻𝗋 or ψm𝗎𝗇 in the following grammar:

ψ𝗌𝖿 =t​t⁢∣f​f∣⁢p⁢∣¬p∣⁢χ⁢∣¬χ∣⁢ψ𝗌𝖿∨ψ𝗌𝖿⁢∣ψ𝗌𝖿∧ψ𝗌𝖿∣⁢psf∧ψ𝗎𝗋
ψm𝖻𝗋 =ψ𝗌𝖿⁢∣Xm𝖻𝗋∣⁢¬ψm−1⁢∣ψm𝖻𝗋∨ψm𝖻𝗋∣⁢ψm−1∧ψm𝖻𝗋⁢∣ψm−1⊳ψm𝖻𝗋∣⁢μ⁢Xm𝖻𝗋.ψm𝖻𝗋∣ν⁢Xm𝖻𝗋.ψm𝖻𝗋
ψm𝗎𝗇 =ψ𝗌𝖿⁢∣Xm𝗎𝗇∣⁢¬ψm−1⁢∣ψm−1∨ψm𝗎𝗇∣⁢ψm𝗎𝗇∧ψm𝗎𝗇⁢∣ψm−1⊟ψm𝗎𝗇∣⁢μ⁢Xm𝗎𝗇.ψm𝗎𝗇∣ν⁢Xm𝗎𝗇.ψm𝗎𝗇
⋮ ⋮
ψ1𝖻𝗋 =ψ𝗌𝖿⁢∣X1𝖻𝗋∣⁢ψ1𝖻𝗋∨ψ1𝖻𝗋⁢∣ψ𝗌𝖿∧ψ1𝖻𝗋∣⁢ψ𝗌𝖿⊳ψ1⁢m𝖻𝗋∣μ⁢Xm𝖻𝗋.ψm𝖻𝗋∣ν⁢Xm𝖻𝗋.ψm𝖻𝗋⁢x
ψ1𝗎𝗇 =ψ𝗌𝖿⁢∣X1𝗎𝗇∣⁢ψ𝗌𝖿∨ψ1𝗎𝗇⁢∣ψ1𝗎𝗇∧ψ1𝗎𝗇∣⁢ψ𝗌𝖿⊟ψ1𝗎𝗇∣μ⁢X1𝗎𝗇.ψ1𝖻𝗋∣ν⁢X1𝗎𝗇.ψ1𝖻𝗋
ψ𝗎𝗋 =ψ𝗌𝖿⁢∣ψ𝗎𝗋∨ψ𝗎𝗋∣⁢ψ𝗎𝗋∧ψ𝗎𝗋⁢∣ψ𝗌𝖿⊳ψ𝗌𝖿∣⁢ψ𝗌𝖿⊟ψ𝗌𝖿
∣μX𝗎𝗋.ψ𝗎𝗋∣νX𝗎𝗋.ψ𝗎𝗋∣(¬psf∧ψm)

where Xi𝖻𝗋,Xi𝗎𝗇 are in the respective sets of variables for all i, and so is X𝗎𝗋. A term ψi can denote both ψi𝗎𝗇 and ψi𝖻𝗋.

We give some intuition for this definition of bounded-alternation Tμ-formulas. A key point for tail-recursive behavior is limited boolean alternation, i.e. between ∨ and ∧. The reason for that is that space-bounded algorithms need bounded boolean alternation, for (fully) alternating space is exponential time. baAPT achieve this by (partially) limiting the acceptance game to a game that is played by one player only, either ∃ or ∀, with the other player only making token moves without associated freedom of decision. This is then captured in the intuition for bounded-alternation Tμ formulas in a syntactic way.

However, a better intuition is that a formula is alternation-free if it either does not contain ∧ and ⊟, or if it does not contain ∨ and ⊳, and no negations. An example of this is μ⁢X.p∨(t​t⊳X), or μ⁢X.p∧(t​t⊟X). Note that the polarity of the fixpoint does not matter here.

Limited alternation is then allowed by stratifying these formulas (via the indices in e.g., ψm𝖻𝗋,…,ψ1𝖻𝗋) and allowing one-time use of forbidden operators at the price of dropping to a lower level in the hierarchy. Of course, formulas that contain no recursive definitions at all, e.g., those in ψ𝗌𝖿 are also safe. Hence, we obtain e.g.,

μX.(t​t⊳x)∨(¬p∧(q∨νZ.p∧(t​t⊟Z))).

Since bounded-alternation formulas are to be evaluated over tTS defined by tail-recursive λ⁢Y terms, there is an additional ingredient: In tail-recursive λ⁢Y terms, subterms in operand position cannot contain free Y variables, whence the tree generated by such a subterm is completely independent of the rest of the term (excluding arguments of its own, of course). Moreover, we use special alphabet symbols (those in Σ𝗎𝗋) to signal that a term appears e.g., in operand position, or that it contains no free Y variables. Since the tree defined by such a term is independent of the rest of the tree, and since this can only repeat a polynomial amount of times (due to passing to a strict subterm), a model-checking procedure can solve the problem for the tree generated by the subterm first, and then return to the model-checking problem for the overall tree. Since this is such an independent subproblem, it is not harmful to “reset” the amount of boolean alternation possible in a Tμ formula/a baAPT. This is what happens in formulas of the form ψ𝗎𝗋, which have nontrivial semantics only in states where psf is true (and, hence a tree constructor from Σ𝗎𝗋 was read, whence we are in such an independent subproblem). Note that it is not important that this generates a polynomial bound on the number of “alternation resets” in a run of a baAPT/the evaluation of a bounded-alternation Tμ formula. In general, there is no such bound. However, the model-checking problem will always only generate a polynomial stack of open subproblems due to alternation resets, and that suffices to yield the complexity bound.

The example in the appendix contains a simple example of a pair of a tail-recursive HORTA and a bounded-alternation Tμ formula.

5 Upper Bounds for Model-Checking

The goal of this section is to establish upper bounds for model checking of the trees generated by HORTA (tail recursive or not) against Tμ formulas. For the rest of the section, fix a tree alphabet Σ, a λ⁢Y term t and a Tμ formula φ. Assume w.l.o.g. that φ is in negation normal form, i.e., that negations appear only in front of propositions or clock constraints.

5.1 The Region Abstraction

The region abstraction is a classical result (see e.g., [4] or [6], Def. 9.42), that maps the infinite transition system defined by a TA onto a finite transition system. While we work with tTS defined by HORTA, the key point is the same: the region abstraction uses an equivalence relation ≃m, for m∈ℕ, on clock evaluations. Let 𝒳 be a set of clocks, specification or otherwise. Then ≃m is defined as follows: η≃mη′ iff

for all x∈𝒳: η⁢(x)>m⁢ and ⁢η′⁢(x)>m
or ⁢⌊η⁢(x)⌋=⌊η′⁢(x)⌋⁢ and ⁢𝑓𝑟𝑎𝑐⁢(η⁢(x))=0⇔𝑓𝑟𝑎𝑐⁢(η′⁢(x))=0
and for all y∈𝒳⁢ with ⁢η⁢(y)≤m⁢ and ⁢η′⁢(y)≤m:
𝑓𝑟𝑎𝑐⁢(η⁢(x))≤𝑓𝑟𝑎𝑐⁢(η⁢(y))⇔𝑓𝑟𝑎𝑐⁢(η′⁢(x))≤𝑓𝑟𝑎𝑐⁢(η′⁢(y)).

𝑓𝑟𝑎𝑐⁢(r) is the fractional part of a real number. Clock evaluations are equivalent if, for each clock, (i) either both clocks have a value greater than m, or (ii) they compare in the same way with respect to all integers ≤m. Moreover, the passage of time makes equivalent evaluations reach the next integral value first for the same clock. ≃m is an equivalence relation for any m; an equivalence class in ≃m is called a region. The equivalence class of η under ≃m is [η]m (or just [η] when m is clear). We define the notion of a successor region:

Definition 6.

Let ≃m denote the region equivalence w.r.t. m. For each region [η]m, the unique successor region is

  • ■

    𝑠𝑢𝑐⁢([η]m)=[η]m if η⁢(x)>m for all x∈𝒳,

  • ■

    𝑠𝑢𝑐⁢([η]m)=[η′]m iff there is d∈ℝ≥0 such that η+d=η′, and η+d′∈[η]m∪[η′]m for all 0<d′<d, and [η]m≠[η′]m.

The second term defines the successor region of [η] to be the first region that is entered if time passes from any η′′∈[η], and the first term makes the successor region well-defined in regions where all clocks have values greater than m. We call this region the maximal region.

5.2 The Untiming Construction

Let 𝒳 be a set of clocks, let 𝒴 be a set of specification clocks. Let 𝒯t=(𝒮,→,s0,λ) be the tTS generated by the HORTA t. Note that 𝒮⊆{(v,η)∣v∈T,η⊧ι⁢(l⁢v)}.

Let 𝑃𝑟𝑜𝑝,Ξ be the propositions, resp. clock constraints mentioned by φ, and let 𝒴 be the specification clocks that φ mentions. Define an (untimed) μ-calculus formula φ^ via

p^ =p X^ =X
χ^ =χ ¬φ′^ =¬φ′^
φ1∨φ2^ =φ1^∨φ2^ φ1∧φ2^ =φ1^∧φ2^
φ1⊳φ2^ =μZ.(φ1^∧◇DZ)∨(◇T(μZ′.(φ1^∧◇DZ′)∨(φ1^∨φ2^))) z.φ′^ =◇z⁢φ′^
φ1⊟φ⁢2^ =νZ.(φ1^∧□DZ)∧(□T(νZ′.(φ1^∧□DZ′)∧(φ1^∨φ2^)))
μ⁢X.φ′^ =μ⁢X.φ′^ ν⁢X.φ′^ =ν⁢X.φ′^

where the Z,Z′ for the ⊳ and ⊟ are fresh for each subformula. The semantics of the untimed modal operators are standard: ⟦◇Dψ⟧𝒯α={s∣ ex. s′∈⟦ψ⟧𝒯α s.t. s→Ds′} and similarly for □D and the other modalities. Note that this definition is for untimed transition systems.

Let m be that largest integer in any location invariant or guard in t or a clock constraint in φ. Let [η] denote [η]m from now on. Define a new (untimed) transition system with transitions {D,T}∪{z∣z∈𝒴} and propositions in 𝑃𝑟𝑜𝑝∪Ξ via 𝒯Tu=(𝒮u,→u,s0′,λ′) via

  • ■

    𝒮u={(v,[η])∣(v,η)∈𝒮},

  • ■

    →u={(v,[η])⁢→D(v,𝑠𝑢𝑐⁢(η))∣𝑠𝑢𝑐⁢(η)⊧ι⁢(l⁢(v))}∪{(v,[η])⁢→T(v⁢i,[η′])∣(v,η)⁢→(v⁢i,η′)}∪{(v,[η])⁢→z(v,[η]|z)⁢∣η|z⊧ι⁢(l⁢(v))},

  • ■

    s0′=(ϵ,[η0]),

  • ■

    λ′⁢((v,[η]))=λ⁢(v,η)=λ⁢(v)∪{χ∈Ξ∣η⊧χ}.

Finally, given a variable assignment α:𝒱→2𝒮, define α^:𝒱→2𝒮′ via α^⁢(X)={(v,[η])∣(v,η)∈α⁢(X)}.

Proposition 7 ([2]).

For all subformulas ψ of φ, for all (v,η)∈𝒮, and for all variable assignments α we have (v,η)∈⟦ψ⟧𝒯α iff (v,[η])∈⟦ψ^⟧𝒯Tuα^.

Technically the proof in [2] is only for tTS defined via TA, not via HORTA. However, finiteness is not a crucial ingredient of the proof, and the region graph construction is very robust.

5.3 The Reduction

We have seen before that, on the region graph, the formula φ^ captures the semantics of φ. We define an APT 𝒫φ alongside the logic of φ^, but based on the syntax of φ itself. The reason for that is in the details of the translation of ⊳ and ⊟, where we have to make sure that the regions are visited one by one, but must also avoid excessive pointless delays. The states of 𝒫φ will be the product of the set of subformulas of φ and the set of regions in the region graph, plus some extra copies in some places. Transitions will follow the logic of subformulas in the first component, and pass through the regions as need be at formulas with real-time semantics, e.g., ⊳,⊟.

As a preparation, let Σ be the tree alphabet used in t. Define Σ′=Σ∪{aaux∣a∈Σ} where all the new tree constructors are unary. Let m be the integer used for the region graph. The longest sequence of delay transitions that can be taken before reaching the maximal region is less than k′=|𝒳∪𝒴|⋅3⋅m. Let k be the length of the longest path in the syntax tree of φ that contains no formulas of the form ψ1⊳ψ2 or ψ1⊟ψ2, including passing through fixpoint variables. This number exists due to guardedness. Write 𝐤 for 2⋅k′+k.

Obtain a λ⁢Y term t^ from t by replacing each occurrence of a tree constructor a by aaux𝐤⁢a. i.e., by prepending it by a sequence of 𝐤 many copies of aaux. These tree constructors give the yet-to-be-defined automaton enough space to (i) explicitly simulate delay transitions in the region graph by transitions reading aaux in the tree, and (ii) allow easy handling of the logic of subformulas by transitions without advancing in the tree proper.

Let 𝒫φ=(Q,Σ′,δ,qI,Λ) with the individual components defined as follows:

  • ■

    Q=𝑠𝑢𝑏(φ)×ℝ≥0/≃m×{0,1,2} and qI=(φ,[η0],0)

  • ■

    Λ is defined inductively via the alternation index of a subformula of φ. Let 𝑎𝑖⁢(ψ) be defined inductively for formulas of the form μ⁢X.ψ′ and ν⁢x.ψ′ as follows:

    • –

      For formulas of the form ψ=μ⁢x.ψ′ set 𝑎𝑖⁢(ψ) to the smallest even integer that is at least as big as 𝑎𝑖⁢(ψ′′) for all subformulas ψ′′ of ψ, but at least 0.

    • –

      For formulas of the form ψ=μ⁢x.ψ′ set 𝑎𝑖⁢(ψ) to the smallest odd integer that is at least as big as 𝑎𝑖⁢(ψ′′) for all subformulas ψ′′ of ψ, but at least 1.

    Fo other ψ′, set 𝑎𝑖⁢(ψ) to 𝑎𝑖⁢(ψ′) where ψ′ is the first subformula of the form μ⁢X.ψ′ or ν⁢X.ψ′ on the path to the root in the syntax tree of φ. Then Λ⁢((ψ,[η],i))=𝑎𝑖⁢(ψ).

Finally, δ is defined (for the non-modalities) as follows:

δ⁢((p,[η],0),aaux) =⊤ if ⁢p∈λ⁢(a);⊥ ow.
δ⁢((¬p,[η],0),aaux) =⊥ if ⁢p∈λ⁢(a);⊤ ow.
δ⁢((χ,[η],0),aaux) =⊤ if ⁢η⊧χ;⊥ ow.
δ⁢((¬χ,[η],0),aaux) =⊥ if ⁢η⊧̸χ;⊤ ow.
δ⁢((ψ1∨ψ2,[η],0),aaux) =(ψ1,[η],0)∨(ψ2,[η],0)
δ⁢((ψ1∧ψ2,[η],0),aaux) =(ψ1,[η],0)∧(ψ2,[η],0)
δ((μX.ψ,[η],0),aaux) =(ψ,[η],0)
δ((νX.ψ,[η],0),aaux) =(ψ⁢[η],0)
δ⁢((X,[η],0),aaux) =(𝑓𝑝⁢(X),[η],0)
δ((z.ψ,[η],0),aaux) =(ψ,[η|{z}],0)⁢ if ⁢η|{z}⊧ι⁢(a)

The intuition here is that the acceptance game simply follows the logic of the subformula in question. The transitions for ⊳ are

δ⁢((ψ1⊳ψ2,[η],0),aaux) =(ψ1,[η],0)∧(ψ1⊳ψ2,[η],1)⁢ if ⁢𝑠𝑢𝑐⁢([η]m)⊧̸ι⁢(a)⁢ or ⁢[η]⁢ is max.
δ⁢((ψ1⊳ψ2,[η],0),aaux) =(ψ1,[η],0)∧((ψ1⊳ψ2,[η],1)∨(ψ1⊳ψ2,𝑠𝑢𝑐⁢([η]),0))
 if ⁢𝑠𝑢𝑐⁢([η]m)⊧ι⁢(a)⁢ and ⁢[η]⁢ is not max.
δ⁢((ψ1⊳ψ2,[η],1),aaux) =(ψ1⊳ψ2,[η],1)
δ⁢((ψ1⊳ψ2,[η],1),a) =⋁j∈{0,…,𝑎𝑟(a),𝑡𝑟𝑛𝑠j(a)=(χ,R),η⊧χ(q⊤i,(ψ1⊳ψ2,[η|R],2),q⊤𝑎𝑟⁢(a)−i−1)
δ((ψ1⊳ψ2,[η],2),aaux =⊥ if ⁢η⊧̸ι⁢(a)
δ⁢((ψ1⊳ψ2,[η],2),aaux) =(ψ2,[η],0)⁢ if ⁢η⊧ι⁢(a)⁢ and ⁢𝑠𝑢𝑐⁢([η]m)⊧̸ι⁢(a)⁢ or ⁢[η]⁢ is max.
δ⁢((ψ1⊳ψ2,[η],2),aaux) =(ψ1,[η],2)∧((ψ2,[η],0)∨(ψ1⊳ψ2,𝑠𝑢𝑐⁢([η]),2))
 if ⁢η⊧ι⁢(a)⁢ and ⁢𝑠𝑢𝑐⁢([η]m)⊧ι⁢(a)⁢ and ⁢[η]⁢ is not max.

We omit the clauses for ψ1⊟ψ2 as they are dual to those for ψ1⊳ψ2. The logic of a temporal next follows three phases: a delay, a discrete transition, and then another delay. First, if the last component of the state is 0, ∃ advances to successor regions of she so desires, and if this is possible. Then, if the last component is 1, the sequence of aaux is consumed and an actual transition happens at a, with an immediate check for satisfaction of the location invariant. Then, ∃ can delay further if she so desires. After she is done with this, the APT tracks ψ2.

Lemma 8.

Let 𝒯t^ be the tree generated by t^. Then 𝒫φ accepts 𝒯t^ iff (ϵ,η0)∈⟦φ⟧𝒯t.

It is immediate that t^ is tail-recursive if t is. Moreover, one can show that 𝒫φ is a baAPT if φ has bounded alternation.

Theorem 9.

The model-checking problem for order-k HORTA against Tμ formulas is in (k+1)-EXPTIME. For tail-recursive order-k-HORTA and bounded-alternation formulas, the problem is in k-EXPSPACE.

Proof.

Note that 𝒫φ is exponential in the input, since it contains the region graph in its state space. Since the model-checking problem for order-k HORS is k-EXPTIME-complete [20], we obtain the result. For the tail-recursive case, we obtain the claim via Prop. 3. ◀

6 Matching Lower Bounds

We now show that the model-checking problem for bounded-alternation Tμ formulas against trees generated by order-1 HORTA is EXPSPACE-hard, via a reduction from the corridor tiling problem (see below). The general case of k-EXPSPACE-hardness for model-checking order-k HORTA is left for a future publication. The proof uses an idea from [12, 11].

6.1 Tiling Problems

A tiling system is a 𝒦=(K,H,V,kI,t□,tF) where K is a finite set of tiles, H,V⊆K×K are the horizontal and vertical matching relations, and kI,k□,kF are the initial, blank and final tiles. The corridor tiling problem consumes as input a tiling system 𝒦 and some n∈ℕ encoded unarily. It asks whether there is a sequence ρ0,…,ρm−1, where each of the ρi is a K-word of length 2n that satisfies the following:

  • ■

    ρ0=kI⁢k□⁢⋯⁢k□,

  • ■

    for each 0≤i≤m−1, and 0≤j<2n−1, we have (ρi⁢(j),ρi⁢(j+1))∈H,

  • ■

    for each 0≤i≤m−2 and 0≤j≤2n−1, we have (ρi⁢(j),ρi+1⁢(j))∈V, and

  • ■

    ρm−1⁢(0)=kF,

where ρi⁢(j) denotes the jth tile in ρi. We call the ith word in this solution the ith row.

Proposition 10 ([23, 15]).

The corridor tiling problem is EXPSPACE-hard.

6.2 Encoding Rows

Let 𝒦=(K,H,V,kI,k□,kF) be a tiling system, and assume that K is ordered, e.g., via K={k0,…,km−1} for m=|K|. W.l.o.g. let kI=k0,k□=k1. A row candidate is a K-word of length 2n. Such a row candidate is a row if it satisfies the horizontal matching. Row candidates are also lexicographically ordered. Given a row candidate ρ, we obtain the lexicographically next one ρ′ by setting ρ′⁢(j)=ρ⁢(j) if there is j<j′<2n s.t. ρ⁢(j)≠km−1, and if ρ⁢(j)=ki and ρ⁢(j′)=km−1 for all j<j′<2n, then ρ′⁢(j)=ki+1(modm).

We now encode rows and row candidates into trees generated by λ⁢Y terms over a timed tree alphabet (i.e., HORTA), and, for each k∈K, define a Tμ formula that checks whether a given tile in a the row encoded by such a tree is k. These formulas are mutually recursive, but the recursion is guarded by the designated proposition psf (cf. Sec. 4). The HORTA has one clock x. A node v in the underlying tree encodes a row ρ if, for each 0≤i<2n, (v,x↦i)∈⟦ψk⟧𝒯T iff k=ρ⁢(i). Here, 𝒯T is the tTS defined by the HORTA.

Let 𝑃𝑟𝑜𝑝={pI,p□,psf} and let Σ={an⁢x⁢t1,ar⁢w2,bI1,b□1} with arities indicated by superscripts. Let 𝑡𝑟𝑛𝑠0⁢(bI)=𝑡𝑟𝑛𝑠0⁢(b□)=(z=1,{z}). Set λ−1⁢(pI)={bI} and λ−1⁢(p□)={b□} and λ−1⁢(psf)={an⁢x⁢t}, where psf is the designated proposition from the definition of tail recursion/bounded alternation. We write ⊳iψ for z.t​t⊳(z=i∧ψ), and ⊟iψ for z.t​t⊟(z=i∧ψ). Consider the λ⁢Y terms

init =bI(YF.b□F) next⁢t =an⁢x⁢t(YF.ar⁢wFt).

The first one defines a tree with bI as the root and then an infinite sequence of b□ after that. The other consumes a tree and returns a tree that contains an⁢x⁢t as the root, and then below it an infinite leftward sequence of ar⁢w that each contain t as their right son. All rows and row candidates we work with are obtained from init via repeated application of next.

Now consider the mutually recursive Tμ formulas

ψk0 =pI∨(⊳0(psf∧ψkm−1∧⊳0μX.¬psf∧ψkm−1∧(x=2n−1∨⊳1X)))
∨(⊳0(psf∧ψk0∧⊳0μX.¬psf∧(x≤2n−1∧¬ψkm−1∨⊳1X)))
ψk1 =p□∨(⊳0(psf∧ψk0∧⊳0μX.¬psf∧ψkm−1∧(x=2n−1∨⊳1X)))
∨(⊳1(psf∧ψk0∧⊳0μX.¬psf∧(x≤2n−1∧¬ψkm−1∨⊳1X)))
ψki+2 =(⊳0(psf∧ψki+1∧⊳0μX.¬psf∧ψkm−1∧(x=2n−1∨⊳1X)))
∨(⊳0(psf∧ψki+2∧⊳0μX.¬psf∧(x≤2n−1∧¬ψkm−1∨⊳1X))).

The idea is that encoding a tile is signaled by a proposition (only for kI,k□), or it holds due to the recursive characterization of the lexicographic successor, applied recursively until the propositional base case is reached. This is done by traversing along ar⁢w (used to let time elapse in increments of 1) or an⁢x⁢t (from next⁢t to t). Given a row candidate ρ, let 𝚗𝚎𝚡𝚝i⁢(ρ) be the lexicographically ith successor of ρ modulo 2n.

Lemma 11.

The tree generated by init encodes the initial row. Given a tree that encodes a row candidate ρ, the tree generated by nexti⁢t encodes 𝚗𝚎𝚡𝚝i⁢(ρ).

6.3 The Reduction

Extend Σ by {av1,ah1} and 𝑃𝑟𝑜𝑝 by {ph,pv} with λ−1⁢(pv)={av},λ−1⁢(ph)={ah}. Now consider the λ⁢Y terms

horiz⁢t =ah(YF.ar⁢wFt)
vert⁢t⁢t′ =(YF.av(av(Ftt′))(ar⁢wt(ar⁢w(t′t′)))

and the Tμ formulas

ψhoriz =⊳0(ph∧(⋀(k,k′)∉HνX.(ψk→¬ψk′)∧((x=2n−1∨⊳1(¬psf∧X)))))
ψvert =⋀(k,k′)∉VνX.(⊳0ψk→¬⊳0(¬psf∧⊳0¬psf∧ψk′)
∧((x=2n−1∨⊳0(pv∧⊳1¬psf∧X))))
Lemma 12.

ψhoriz holds on the tree generated by horiz⁢t iff t encodes a row, i.e., if the row candidate it encodes satisfies horizontal matching. ψvert holds on the tree generated by vert⁢t⁢t′ iff the rows encoded by t and t′ match vertically.

Finally, extend 𝑃𝑟𝑜𝑝 by {p∨,p∧,pf} and Σ by {a∨2,a∧2,af1} with λ−1⁢(p∨)={a∨} and λ−1⁢(p∧)={a∧} and λ−1⁢(pf)={af}. Consider the λ⁢Y terms

check⁢t⁢t′ =a∧⁢(horiz⁢t′)⁢(vert⁢t⁢t′)
exists⁢t⁢t′ =Y⁢F.a∨⁢(a∧⁢(check⁢t⁢t′)⁢(G⁢t′))⁢(F⁢t⁢(next⁢t′))
tiling =(YG.λt.a∨(aft)(existstinit))init

and the Tμ formulas

ψfinal =ψk1
ψchk =⊟0((ph∧ψhoriz)∨(pv∧ψvert))
ψsrch =μ⁢Xsrch.⊳0(pf∧ψfinal)
(p∨∧μ⁢Y.⊳0(p∧∧(⊟0(p∧∧ψcheck∨(p∨∧X)))∨(p∨∧Y)))
Lemma 13.

ψfinal holds on the tree generated by final⁢t iff t encodes a final row. ψcheck holds on the tree generated by check⁢t⁢t′ if (i) t encodes a row and (ii) t and t′ match vertically.

Finally, ψsrch holds on the tree generated by tiling iff 𝒦 has a solution.

It is not hard to show that tiling is tail recursive, but not obvious that ψsrch has bounded alternation.

Lemma 14.

The λ⁢Y term tiling is tail recursive. The Tμ fomula ψsrch is bounded-alternation and of polynomial size in 𝒦.

This yields the following theorem.

Theorem 15.

The model-checking problem of tail-recursive HORTA against bounded-alternation Tμ formulas is EXPSPACE-hard.

Proof.

By Prop. 10, the corridor tiling problem is EXPSPACE-hard. By Lem. 13, an instance of the corridor tiling problem has a solution iff ψsrch holds on the tree generated by tiling. Since by Lem. 14, the former is bounded-alternation and the latter is tail-recursive, and both are of polynomial size in 𝒦, this constitutes a polynomial-time reduction. ◀

7 Conclusion

We have refined the notion of Real-Time Recursion Schemes [3] into that of HORTA, and established matching upper bounds for the model-checking problem. We have also shown that the model-checking problem for HORTA becomes easier by half an exponential in the tail-recursive setting. The lower bound has been established for the order-1 case, but we conjecture that it can be extended to all orders. The corridor tiling problem needs to be replaced by an exponential version [15], and the encoding of a row needs to be lifted from a tree to a function that consumes a tree, and returns a tree etc., see e.g., [3, 9].

References

  • [1] Yasmina Abdeddaïm, Eugene Asarin, and Oded Maler. Scheduling with timed automata. Theor. Comput. Sci., 354(2):272–300, 2006. doi:10.1016/J.TCS.2005.11.018.
  • [2] Luca Aceto and François Laroussinie. Is your model checker on time? on the complexity of model checking for timed modal logics. J. Log. Algebraic Methods Program., 52-53:7–51, 2002. doi:10.1016/S1567-8326(02)00022-X.
  • [3] Eric Alsmann and Florian Bruse. Real-time higher-order recursion schemes. In Pietro Sala, Michael Sioutis, and Fusheng Wang, editors, 31st International Symposium on Temporal Representation and Reasoning, TIME 2024, October 28-30, 2024, Montpellier, France, volume 318 of LIPIcs, pages 16:1–16:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.TIME.2024.16.
  • [4] Rajeev Alur, Costas Courcoubetis, and David L. Dill. Model-checking in dense real-time. Information and Computation, 104(1):2–34, 1993. doi:10.1006/inco.1993.1024.
  • [5] Rajeev Alur and David L. Dill. Automata for modeling real-time systems. In Mike Paterson, editor, Automata, Languages and Programming, 17th International Colloquium, ICALP90, Warwick University, England, UK, July 16-20, 1990, Proceedings, volume 443 of Lecture Notes in Computer Science, pages 322–335. Springer, 1990. doi:10.1007/BFB0032042.
  • [6] C. Baier and J.-P. Katoen. Principles of model checking. MIT Press, 2008.
  • [7] Massimo Benerecetti, Stefano Minopoli, and Adriano Peron. Analysis of timed recursive state machines. In 2010 17th International Symposium on Temporal Representation and Reasoning, pages 61–68, 2010. doi:10.1109/TIME.2010.10.
  • [8] Ahmed Bouajjani, Rachid Echahed, and Riadh Robbana. On the automatic verification of systems with continuous variables and unbounded discrete data structures. In Hybrid Systems II, pages 64–85, Berlin, Heidelberg, 1995. Springer-Verlag.
  • [9] Florian Bruse. Space-efficient model-checking of higher-order recursion schemes. In Shankaranarayanan Krishna, Sriram Sankaranarayanan, and Ashutosh Trivedi, editors, Verification, Model Checking, and Abstract Interpretation - 26th International Conference, VMCAI 2025, Denver, CO, USA, January 20-21, 2025, Proceedings, Part I, volume 15529 of Lecture Notes in Computer Science, pages 29–51. Springer, 2025. doi:10.1007/978-3-031-82700-6_2.
  • [10] Florian Bruse, Oliver Friedmann, and Martin Lange. On guarded transformation in the modal μ-calculus. Log. J. IGPL, 23(2):194–216, 2015. doi:10.1093/JIGPAL/JZU030.
  • [11] Florian Bruse and Martin Lange. The tail-recursive fragment of timed recursive CTL. Inf. Comput., 294:105084, 2023. doi:10.1016/J.IC.2023.105084.
  • [12] Florian Bruse, Martin Lange, and Étienne Lozes. Space-efficient fragments of higher-order fixpoint logic. In Matthew Hague and Igor Potapov, editors, Reachability Problems - 11th International Workshop, RP 2017, London, UK, September 7-9, 2017, Proceedings, volume 10506 of Lecture Notes in Computer Science, pages 26–41. Springer, 2017. doi:10.1007/978-3-319-67089-8_3.
  • [13] Lorenzo Clemente and Slawomir Lasota. Timed pushdown automata revisited. In 30th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2015, Kyoto, Japan, July 6-10, 2015, pages 738–749. IEEE Computer Society, 2015. doi:10.1109/LICS.2015.73.
  • [14] Werner Damm. The IO- and oi-hierarchies. Theor. Comput. Sci., 20:95–207, 1982. doi:10.1016/0304-3975(82)90009-3.
  • [15] Stéphane Demri, Valentin Goranko, and Martin Lange. Temporal Logics in Computer Science: Finite-State Systems. Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, 2016. doi:10.1017/CBO9781139236119.
  • [16] Martijn Hendriks and Marcel Verhoef. Timed automata based analysis of embedded system architectures. In Proceedings 20th IEEE International Parallel & Distributed Processing Symposium, pages 8–pp. IEEE, 2006.
  • [17] Thomas A. Henzinger, Xavier Nicollin, Joseph Sifakis, and Sergio Yovine. Symbolic model checking for real-time systems. Inf. Comput., 111(2):193–244, 1994. doi:10.1006/INCO.1994.1045.
  • [18] Teodor Knapik, Damian Niwinski, and Pawel Urzyczyn. Higher-order pushdown trees are easy. In Mogens Nielsen and Uffe Engberg, editors, Foundations of Software Science and Computation Structures, 5th International Conference, FOSSACS 2002. Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2002 Grenoble, France, April 8-12, 2002, Proceedings, volume 2303 of Lecture Notes in Computer Science, pages 205–222. Springer, 2002. doi:10.1007/3-540-45931-6_15.
  • [19] Naoki Kobayashi and C.-H. Luke Ong. A type system equivalent to the modal mu-calculus model checking of higher-order recursion schemes. In Proceedings of the 24th Annual IEEE Symposium on Logic in Computer Science, LICS 2009, 11-14 August 2009, Los Angeles, CA, USA, pages 179–188. IEEE Computer Society, 2009. doi:10.1109/LICS.2009.29.
  • [20] C.-H. Luke Ong. On model-checking trees generated by higher-order recursion schemes. In 21th IEEE Symposium on Logic in Computer Science (LICS 2006), 12-15 August 2006, Seattle, WA, USA, Proceedings, pages 81–90. IEEE Computer Society, 2006. doi:10.1109/LICS.2006.38.
  • [21] Sylvain Salvati and Igor Walukiewicz. Krivine machines and higher-order schemes. Information and Compututation, 239:340–355, 2014. doi:10.1016/J.IC.2014.07.012.
  • [22] Ashutosh Trivedi and Dominik Wojtczak. Recursive timed automata. In Ahmed Bouajjani and Wei-Ngan Chin, editors, Automated Technology for Verification and Analysis - 8th International Symposium, ATVA 2010, Singapore, September 21-24, 2010. Proceedings, volume 6252 of Lecture Notes in Computer Science, pages 306–324. Springer, 2010. doi:10.1007/978-3-642-15643-4_23.
  • [23] P. van Emde Boas. The convenience of tilings. In A. Sorbi, editor, Complexity, Logic, and Recursion Theory, volume 187 of Lecture notes in pure and applied mathematics, pages 331–363. Marcel Dekker, Inc., 1997.

Appendix A Additional Material

A.1 An example of a HORTA

Consider the example of a delivery truck that waits at a station to leave for its deliveries. It can either leave, or stay at the station, for example because the driver’s mandatory break is not over. Every time the option is presented and the truck stays, however, it is loaded with an additional parcel that will need to be delivered during the next tour of the truck. Waiting at the station takes between 1 and 2 time units, and the driver has to wait for at least 5 minutes. Delivering each parcel will take between 2 or 3 minutes. We ask: is it possible to complete the mandatory waiting time of 5 minutes, but end up with a tour that can be completed in 10 minutes or less?

We model this as follows: Let {stat2,par1,end0} be a tree alphabet with arities as indicated. Add a unique proposition pend with λ⁢(pend)={end}.

Consider the λ⁢Y term t=(YF.λx.statx(F(parx)))end. Note that this term is tail recursive. It defines an infinite tree of the following form, which encodes the different ways waiting and delivering can play out:

We now convert the λ⁢Y term t into a HORTA by setting ι⁢(stat)=x≤2, ι⁢(par)=x≤3 and 𝑡𝑟𝑛𝑠0⁢(stat)=(z≥5,{z}), 𝑡𝑟𝑛𝑠1⁢(stat)=(x≥1,{x}),𝑡𝑟𝑛𝑠0⁢(par)=(x≥2,{x}).

The intuition here is that clock x is used to measure waiting times at the station and delivery times of the individual parcels, while clock z is used to measure the break, and the overall delivery time.

We can visualize the tree like this:

Here, location invariants are drawn next to the nodes, and pairs of transition guards and resets drawn next to the edges. The proposition pend appears next to the final nodes.

A Tμ formula that verifies the property above is μ⁢X.(p∧z≤10)∨(t​t⊳X). Note that the dependence between the waiting times and the overall delivery time cannot be incorporated into a finite-state TA due to the strictly nonregular behavior of loading additional parcels. Also note that this formula has bounded boolean alternation. Since the term that gives riseto the HORTA above is also tail recursive, a problem like this can be verified more efficiently, since the

In a real-time recursion scheme (cf. [3]), such a situation could also be modeled, but less naturally. Such a real-time recursion scheme generated trees where the tree constructors are simply annotated by plain intervals, which roughly signals how much time it takes to process such a constructor. No connection to individual clocks is made by the tree. Instead, the tree generated by such a real-time scheme is to be verified against a pair of a TA and an APT, with some synchronization between the two. This means that a significant part of the behavior of the system that is being modeled must be added to this automaton, and great care must be taken to synchronize the APT and he TA. Conversely, in a HORTA, the system being modeled manifests itself almost exclusively in the (recursive) TA, as can be seen above. The formulas that specify the desired property can then be comparatively simple. In the case above, a simple reachability property suffices.