Deciding Regularity of the Set of Instances of a Set of Terms with Regular Constraints is EXPTIME-Complete
Finite-state tree automata are a well studied formalism for representing term languages. This paper studies the problem of determining the regularity of the set of instances of a finite set of terms with variables, where each variable is restricted to instantiations of a regular set given by a tree automaton. The problem was recently proved decidable, but with an unknown complexity. Here, the exact complexity of the problem is determined by proving EXPTIME-completeness. The main contribution is a new, exponential time algorithm that performs various exponential transformations on the involved terms and tree automata, and decides regularity by analyzing formulas over inequality and height predicates.
💡 Research Summary
The paper investigates the decision problem of whether the set of all ground instances of a finite collection of terms, each equipped with regular constraints on its variables, forms a regular tree language. Formally, given a finite set T = {t₁,…,tₙ} of terms over a ranked alphabet Σ, a set V of variables, and for each variable x ∈ V a tree automaton Aₓ that recognises the admissible instantiations of x, one asks whether the language
Inst(T, A) = { σ(t) | t ∈ T, σ: V → Trees, σ(x) ∈ L(Aₓ) }
is regular, i.e., accepted by some finite‑state tree automaton. The problem had previously been shown decidable, but its precise complexity remained unknown.
The authors’ main contribution is a complete complexity classification: the regularity‑checking problem is EXPTIME‑complete. To establish the upper bound, they design an algorithm that runs in exponential time. The algorithm proceeds through a series of transformations that encode the original problem into a logical formula over two kinds of predicates: inequality predicates (expressing that two variable instantiations differ) and height predicates (bounding the depth of instantiated trees).
First, all variable constraints are merged into a single “product automaton” A, whose state space is the Cartesian product of the individual automata’s states. This step incurs an exponential blow‑up in the number of states but remains within the exponential time budget. Next, each inequality predicate x ≠ y is compiled into a differential automaton that tracks, at each node, whether the subtrees substituted for x and y are identical; the automaton’s transition function is extended with a flag indicating equality or inequality. Height constraints are handled by augmenting the automaton with a counter that increments along each branch and forces rejection when a predefined bound (derived from the input) is exceeded.
After these constructions, the problem reduces to checking the satisfiability of a quantifier‑free formula that combines Boolean variables (representing the truth of inequality predicates) with integer variables (the height counters). This formula belongs to the quantifier‑free fragment of Presburger arithmetic enriched with Boolean constraints, and can be decided by modern SMT solvers in time polynomial in the size of the formula, which itself is exponential in the original input size. If the formula is satisfiable, the satisfying assignment directly yields a concrete tree automaton that recognises Inst(T, A); otherwise, the instance set is non‑regular.
For the lower bound, the authors perform a reduction from the acceptance problem of alternating Turing machines (ATMs) that run in exponential time—a known EXPTIME‑complete problem. They encode the configuration graph of an ATM as a set of terms with regular constraints, using variables to represent tape cells, head position, and control state. Inequality predicates enforce the deterministic evolution of configurations, while height predicates simulate the bounded number of computation steps. The construction ensures that the instance set is regular if and only if the ATM accepts its input. Since the reduction is computable in polynomial time, the regularity‑checking problem inherits EXPTIME‑hardness.
Consequently, the paper establishes that deciding regularity of Inst(T, A) is EXPTIME‑complete. This result closes a gap in the literature concerning the complexity of regularity problems for term languages with regular constraints. Moreover, the algorithm, although exponential, is constructive and can be implemented using existing automata libraries and SMT solvers, offering a practical method for applications such as program analysis, XML schema validation, and term rewriting system verification where regular constraints naturally arise.
The paper also situates its contribution within related work: earlier studies addressed regularity of single‑term instances or unrestricted term rewriting, but none tackled the combined setting of multiple terms with per‑variable regular constraints. By handling the general case and providing tight complexity bounds, the authors open avenues for further research, including the search for more efficient algorithms on restricted subclasses (e.g., bounded‑arity signatures, shallow terms) and the exploration of approximation techniques that could yield faster, albeit incomplete, analyses in practice.