Papers
Topics
Authors
Recent
Search
2000 character limit reached

SpanTL: Tree Counting Complexity

Updated 8 July 2026
  • SpanTL is a counting complexity class that involves enumerating distinct valid output trees produced by alternating Turing machines.
  • It generalizes SpanL by harnessing tree outputs and modular reduction techniques to capture witness structures in database repair and query answering.
  • Every function in SpanTL admits a fully polynomial randomized approximation scheme (FPRAS) via a reduction to nondeterministic finite tree automata.

SpanTL\mathsf{SpanTL} is a counting complexity class introduced to capture functions that count distinct valid output trees of a restricted alternating machine model, and to provide a modular approximation-theoretic framework for combined-complexity operational consistent query answering under primary keys. Its defining feature is that the counted objects are not accepting computations and not output strings, but rooted labeled trees extracted from accepting computations of an alternating Turing machine with output. In the formulation used for operational CQA, SpanTL\mathsf{SpanTL} is broad enough to contain the numerator-counting problems associated with operational repairs and complete repairing sequences, yet sufficiently constrained to admit a fully polynomial randomized approximation scheme (FPRAS) for every function in the class (Calautti et al., 16 Aug 2025).

1. Origin and intended role

SpanTL\mathsf{SpanTL} was introduced in the study of uniform operational consistent query answering in combined complexity, where the query is part of the input. The motivating quantity is the repair relative frequency

RF(D,Σ,Q,cˉ)  =  {DORepDcˉQ(D)}ORepD,\mathsf{RF}(D,\Sigma,Q,\bar c) \;=\; \frac{|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|}{|ORep{D}{}|},

for a database DD, a set Σ\Sigma of primary keys, a conjunctive query Q(xˉ)Q(\bar x), and a tuple cˉ\bar c. In this setting, the denominator ORepD|ORep{D}{}| is already known to be polynomial-time computable, so the technical bottleneck is the numerator

{DORepDcˉQ(D)}.|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|.

The auxiliary counting problem isolating this numerator is denoted SpanTL\mathsf{SpanTL}0, with input SpanTL\mathsf{SpanTL}1 from SpanTL\mathsf{SpanTL}2, a generalized hypertree decomposition of width SpanTL\mathsf{SpanTL}3, and SpanTL\mathsf{SpanTL}4 (Calautti et al., 16 Aug 2025).

The immediate candidate approximable class would have been SpanTL\mathsf{SpanTL}5, since the paper recalls the theorem that every function in SpanTL\mathsf{SpanTL}6 admits an FPRAS. However, the target counting problem is unlikely to lie in SpanTL\mathsf{SpanTL}7. The paper proves that, unless SpanTL\mathsf{SpanTL}8, for each SpanTL\mathsf{SpanTL}9,

SpanTL\mathsf{SpanTL}0

The underlying reason is that for SpanTL\mathsf{SpanTL}1, the decision version SpanTL\mathsf{SpanTL}2 lies in SpanTL\mathsf{SpanTL}3, whereas the decision version of SpanTL\mathsf{SpanTL}4 is SpanTL\mathsf{SpanTL}5-hard. SpanTL\mathsf{SpanTL}6 is therefore introduced to fill an expressive gap between SpanTL\mathsf{SpanTL}7 and the structured database counting problems arising from bounded generalized hypertree decompositions.

At a high level, the class is the tree analogue of SpanTL\mathsf{SpanTL}8. In SpanTL\mathsf{SpanTL}9, one counts distinct output strings of a nondeterministic logspace machine with output. In RF(D,Σ,Q,cˉ)  =  {DORepDcˉQ(D)}ORepD,\mathsf{RF}(D,\Sigma,Q,\bar c) \;=\; \frac{|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|}{|ORep{D}{}|},0, the outputs are rooted labeled trees produced by an alternating machine with output. This tree-valued notion of output is what allows the class to encode witness structures aligned with decomposition trees and operational repair processes.

2. Formal definition via alternating Turing machines with output

The machine model underlying RF(D,Σ,Q,cˉ)  =  {DORepDcˉQ(D)}ORepD,\mathsf{RF}(D,\Sigma,Q,\bar c) \;=\; \frac{|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|}{|ORep{D}{}|},1 is the alternating Turing machine with output (ATO), defined as

RF(D,Σ,Q,cˉ)  =  {DORepDcˉQ(D)}ORepD,\mathsf{RF}(D,\Sigma,Q,\bar c) \;=\; \frac{|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|}{|ORep{D}{}|},2

where RF(D,Σ,Q,cˉ)  =  {DORepDcˉQ(D)}ORepD,\mathsf{RF}(D,\Sigma,Q,\bar c) \;=\; \frac{|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|}{|ORep{D}{}|},3 is the state set, RF(D,Σ,Q,cˉ)  =  {DORepDcˉQ(D)}ORepD,\mathsf{RF}(D,\Sigma,Q,\bar c) \;=\; \frac{|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|}{|ORep{D}{}|},4 is the alphabet including RF(D,Σ,Q,cˉ)  =  {DORepDcˉQ(D)}ORepD,\mathsf{RF}(D,\Sigma,Q,\bar c) \;=\; \frac{|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|}{|ORep{D}{}|},5 and RF(D,Σ,Q,cˉ)  =  {DORepDcˉQ(D)}ORepD,\mathsf{RF}(D,\Sigma,Q,\bar c) \;=\; \frac{|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|}{|ORep{D}{}|},6, RF(D,Σ,Q,cˉ)  =  {DORepDcˉQ(D)}ORepD,\mathsf{RF}(D,\Sigma,Q,\bar c) \;=\; \frac{|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|}{|ORep{D}{}|},7 is the initial state, RF(D,Σ,Q,cˉ)  =  {DORepDcˉQ(D)}ORepD,\mathsf{RF}(D,\Sigma,Q,\bar c) \;=\; \frac{|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|}{|ORep{D}{}|},8 are accepting and rejecting states, RF(D,Σ,Q,cˉ)  =  {DORepDcˉQ(D)}ORepD,\mathsf{RF}(D,\Sigma,Q,\bar c) \;=\; \frac{|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|}{|ORep{D}{}|},9 partition the non-halting states into existential and universal states, DD0 are the labeling states including the initial state, and

DD1

is the transition function (Calautti et al., 16 Aug 2025).

The ATO has a read-only input tape, a read-write work tape, and a write-only one-way labeling tape. The unusual component is the labeling tape together with the set DD2 of labeling states. Whenever the machine enters a labeling configuration, the current content of the labeling tape is used to create a fresh node in an output tree, after which the labeling tape is reset for future labels. Because the initial state is labeling, every output tree has a root.

A computation of an ATO on input DD3 is a finite rooted tree of configurations. Existential configurations choose one successor; universal configurations branch to all successors. A computation is accepting iff all leaves are accepting configurations. If DD4 is such a computation, its output is the node-labeled rooted tree DD5 defined by taking DD6 to be the nodes of DD7 labeled by labeling configurations, connecting DD8 to DD9 when Σ\Sigma0 reaches Σ\Sigma1 through a labeled-free path, and letting Σ\Sigma2 be the string on the labeling tape at that labeling configuration. A tree Σ\Sigma3 is a valid output precisely when it comes from an accepting computation.

Given an ATO Σ\Sigma4, the associated counting function is

Σ\Sigma5

with

Σ\Sigma6

The class itself is then defined by

Σ\Sigma7

The term “span” has the same sense as in Σ\Sigma8: the count is over distinct accepted outputs, not over accepting computations.

3. Resource restrictions and structural properties

The restriction to well-behaved ATOs is the formal mechanism that keeps the class within an approximable regime. An ATO Σ\Sigma9 is well-behaved if there is a polynomial Q(xˉ)Q(\bar x)0 and an integer Q(xˉ)Q(\bar x)1 such that, for every input Q(xˉ)Q(\bar x)2 and every computation Q(xˉ)Q(\bar x)3 of Q(xˉ)Q(\bar x)4 on Q(xˉ)Q(\bar x)5, the following hold: Q(xˉ)Q(\bar x)6 the working-tape and labeling-tape contents satisfy Q(xˉ)Q(\bar x)7 for every configuration Q(xˉ)Q(\bar x)8 occurring in Q(xˉ)Q(\bar x)9, and for every labeled-free path cˉ\bar c0 of cˉ\bar c1,

cˉ\bar c2

These conditions combine polynomial-size computations, logarithmic work and labeling space, and a constant bound on the number of universal configurations along any labeled-free path (Calautti et al., 16 Aug 2025).

The comparison with cˉ\bar c3 is explicit. The paper proves

cˉ\bar c4

The inclusion is immediate from the observation that a nondeterministic logspace machine with output can be viewed as an ATO using only existential states, and that a string output can be regarded as a path-shaped tree output. The paper also establishes that, unless cˉ\bar c5,

cˉ\bar c6

The strictness claim is witnessed by natural problems later shown to lie in cˉ\bar c7 whose decision versions are cˉ\bar c8-hard, and therefore cannot lie in cˉ\bar c9 unless ORepD|ORep{D}{}|0.

A further structural fact is robustness under preprocessing: ORepD|ORep{D}{}|1 Formally, if ORepD|ORep{D}{}|2 and there is a logspace-computable mapping ORepD|ORep{D}{}|3 such that ORepD|ORep{D}{}|4 for all ORepD|ORep{D}{}|5, then ORepD|ORep{D}{}|6. This closure is used in the operational CQA application, where instances are first put into a convenient normal form by a logspace transformation.

The class is not presented as a standard counting class such as ORepD|ORep{D}{}|7, and the development does not focus on completeness theory. Its role is instead that of a tailored approximable counting class with nontrivial structural content: containment of ORepD|ORep{D}{}|8, strictness unless ORepD|ORep{D}{}|9, closure under logspace reductions, and class-wide FPRAS-approximability.

4. Approximation via reduction to finite tree automata

The central algorithmic theorem states that

{DORepDcˉQ(D)}.|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|.0

The paper uses the standard multiplicative notion: for {DORepDcˉQ(D)}.|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|.1, an FPRAS is a randomized algorithm {DORepDcˉQ(D)}.|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|.2 taking {DORepDcˉQ(D)}.|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|.3, running in time polynomial in {DORepDcˉQ(D)}.|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|.4, {DORepDcˉQ(D)}.|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|.5, and {DORepDcˉQ(D)}.|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|.6, and satisfying

{DORepDcˉQ(D)}.|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|.7

The proof is entirely automata-theoretic (Calautti et al., 16 Aug 2025).

The relevant automata problem is {DORepDcˉQ(D)}.|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|.8: given a nondeterministic finite tree automaton {DORepDcˉQ(D)}.|\{D' \in ORep{D}{} \mid \bar c \in Q(D')\}|.9 and SpanTL\mathsf{SpanTL}00, output

SpanTL\mathsf{SpanTL}01

where SpanTL\mathsf{SpanTL}02 is the set of accepted trees of size SpanTL\mathsf{SpanTL}03. The paper recalls that SpanTL\mathsf{SpanTL}04 admits an FPRAS. The key reduction proposition then states that for every SpanTL\mathsf{SpanTL}05 and every input SpanTL\mathsf{SpanTL}06, one can construct in polynomial time in SpanTL\mathsf{SpanTL}07 an NFTA SpanTL\mathsf{SpanTL}08 and a string SpanTL\mathsf{SpanTL}09 such that

SpanTL\mathsf{SpanTL}10

The construction proceeds through the computation DAG of a well-behaved ATO on a fixed input SpanTL\mathsf{SpanTL}11. Because the machine uses logarithmic working and labeling space and has polynomial-size computations, the number of reachable configurations is polynomial in SpanTL\mathsf{SpanTL}12, and thus the computation DAG is polynomial-sized. The procedure SpanTL\mathsf{SpanTL}13 traverses this DAG and creates NFTA states corresponding to labeling configurations. Its recursive subprocedure SpanTL\mathsf{SpanTL}14 computes, for each configuration SpanTL\mathsf{SpanTL}15, either a singleton tuple SpanTL\mathsf{SpanTL}16 if SpanTL\mathsf{SpanTL}17 is labeling, or a set of tuples of NFTA states representing the possible sets of next labeling configurations reachable via labeled-free paths.

Existential and universal branching are treated differently. At an existential configuration, the construction takes a union of possibilities. At a universal configuration, it uses a product-like combination SpanTL\mathsf{SpanTL}18 that merges tuples from all children, because all universal branches must be realized simultaneously in an accepting computation. The bounded-number-of-universal-configurations condition on labeled-free paths is exactly what prevents exponential blow-up and ensures polynomial-time construction.

Two lemmas complete the reduction. First, SpanTL\mathsf{SpanTL}19 runs in polynomial time and returns an NFTA SpanTL\mathsf{SpanTL}20 such that

SpanTL\mathsf{SpanTL}21

Second, since computations of a well-behaved ATO have polynomial size, there is a polynomial SpanTL\mathsf{SpanTL}22 with

SpanTL\mathsf{SpanTL}23

The class-wide FPRAS theorem follows by combining these facts with the FPRAS for SpanTL\mathsf{SpanTL}24.

5. Membership results for operational consistent query answering

The main application concerns operational CQA under the following syntactic restrictions: primary keys, conjunctive queries, self-join-free queries, bounded generalized hypertreewidth SpanTL\mathsf{SpanTL}25, and combined complexity. In this setting, the paper proves

SpanTL\mathsf{SpanTL}26

The proof begins with a logspace normalization step putting SpanTL\mathsf{SpanTL}27 into a form where all relations in SpanTL\mathsf{SpanTL}28 occur in SpanTL\mathsf{SpanTL}29, and the given generalized hypertree decomposition SpanTL\mathsf{SpanTL}30 is strongly complete and 2-uniform. Closure of SpanTL\mathsf{SpanTL}31 under logspace reductions allows the argument to proceed under this normal form assumption (Calautti et al., 16 Aug 2025).

The alternating procedure SpanTL\mathsf{SpanTL}32, implementable by a well-behaved ATO SpanTL\mathsf{SpanTL}33, is then defined so that its valid outputs are trees encoding operational repairs SpanTL\mathsf{SpanTL}34 such that SpanTL\mathsf{SpanTL}35. The encoding uses the tree structure of the generalized hypertree decomposition, one path segment per relevant database block, and labels indicating which fact in each primary-key block is kept, or SpanTL\mathsf{SpanTL}36 if none is kept. The paper states that SpanTL\mathsf{SpanTL}37 can be implemented as a well-behaved ATO SpanTL\mathsf{SpanTL}38, and that for normalized input,

SpanTL\mathsf{SpanTL}39

This establishes SpanTL\mathsf{SpanTL}40.

Since every SpanTL\mathsf{SpanTL}41 function has an FPRAS and SpanTL\mathsf{SpanTL}42 is polynomial-time computable, the quotient

SpanTL\mathsf{SpanTL}43

also admits an FPRAS. The resulting positive theorem is

SpanTL\mathsf{SpanTL}44

The same framework extends to the “uniform sequences” variant. The corresponding quantity is

SpanTL\mathsf{SpanTL}45

and the paper states that the sequence-counting analogue SpanTL\mathsf{SpanTL}46 can also be placed in SpanTL\mathsf{SpanTL}47, yielding an FPRAS for the uniform-sequences version as well.

The positive approximation results do not extend to arbitrary conjunctive queries or arbitrary widths. The paper first proves exact hardness: SpanTL\mathsf{SpanTL}48 Thus exact counting remains intractable even inside the positive approximation regime. It then establishes the negative approximation boundary: SpanTL\mathsf{SpanTL}49 there is no FPRAS for SpanTL\mathsf{SpanTL}50, and for every SpanTL\mathsf{SpanTL}51, there is no FPRAS for SpanTL\mathsf{SpanTL}52. These two inapproximability statements show that dropping either self-join-freeness or bounded generalized hypertreewidth destroys the positive picture (Calautti et al., 16 Aug 2025).

These negative results are not claims about SpanTL\mathsf{SpanTL}53 itself. Rather, they show that the operational CQA problem leaves the approximable regime once one removes either of the syntactic restrictions that permit placement in SpanTL\mathsf{SpanTL}54. This sharp boundary clarifies the role of the class: it captures the structurally restricted region where the witness objects can be represented as trees generated by bounded alternation under logspace-like control and counted via distinct accepted tree outputs.

The paper also identifies other natural database counting problems in SpanTL\mathsf{SpanTL}55: SpanTL\mathsf{SpanTL}56, counting answers to a conjunctive query given a width-SpanTL\mathsf{SpanTL}57 generalized hypertree decomposition; SpanTL\mathsf{SpanTL}58, counting subsets SpanTL\mathsf{SpanTL}59 with SpanTL\mathsf{SpanTL}60; and SpanTL\mathsf{SpanTL}61, counting classical subset repairs entailing the query. For the first two, the paper notes that membership in SpanTL\mathsf{SpanTL}62 reproves known FPRAS results in a cleaner and more modular way.

A plausible implication is that SpanTL\mathsf{SpanTL}63 isolates a broader methodological pattern: counting problems whose combinatorial witnesses are naturally trees rather than strings, whose generation requires alternation rather than mere nondeterminism, and whose structure still permits compilation to finite tree automata. In the operational CQA setting, that abstraction yields a two-step proof strategy: show that the numerator-counting problem belongs to SpanTL\mathsf{SpanTL}64, then invoke the theorem that every SpanTL\mathsf{SpanTL}65 function admits an FPRAS.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to SpanTL.