Algorithms and fine-grained complexity for nondeterministic and symmetric difference automata


Abstract

Symmetric difference automata (XNFA) are a variant of standard finite automata in which an input word is accepted iff the number of accepting runs is odd. Equivalently, these are weighted automata over the two-element field. We study the fine-grained complexity of the basic decision problems for XNFA: acceptance, emptiness, and equivalence, aiming to optimise the degree of the polynomial in their running-time bounds.

Under the assumption of polynomial ambiguity, we provide a randomised reduction of NFA acceptance to XNFA acceptance. For automata of bounded ambiguity (e.g., unambiguous automata), we show that acceptance for both NFA and XNFA can be decided faster than in the general case. Without ambiguity assumptions, we give faster algorithms for the verification of suitable certificates for (non)emptiness and (non)equivalence of XNFA. Several of our results extend to weighted automata over other semirings and fields.

1 Introduction↩︎

Connecting and comparing algorithmic problems over different algebraic structures is a well-known challenge. Consider the complexity classes \(\mathrm{NL}\) and \(\oplus\mathrm{L}\) corresponding to language recognition by logarithmic-space Turing machines. \(\mathrm{NL}\) machines accept a word if there is a positive number of accepting runs while \(\oplus\mathrm{L}\) machines accept if there is an odd number of accepting runs. It is still not known whether the inclusion \(\mathrm{NL} \subseteq \oplus \mathrm{L}\) (or its converse) holds; see [1], [2]. A complete problem for NL is the acceptance problem for nondeterministic finite automata, that is, given an NFA \(A\) and a word \(w\), decide whether \(A\) accepts \(w\). Similarly, a \(\oplus\)L-complete problem is the acceptance problem for weighted automata over the two-element field [3].

Weighted automata over the two-element field are also known in the literature as symmetric difference automata (\(\oplus\)-NFA) [4], or XOR-nondeterministic finite automata (XNFA) [5], or Mod \(2\) Multiplicity Automata (M2MA, for regular languages over infinite words) [6]. In this paper we use the term ‘XNFA’. A logspace reduction from NFA Acceptance to XNFA Acceptance would show that \(\mathrm{NL} \subseteq \oplus \mathrm{L}\). In a similar spirit, it is not known how the time complexities of these two problems compare (as we discuss below in sections 1.1 and 2).

In this work, we study the possibility of fine-grained reductions between NFA and XNFA Acceptance, focusing on the time complexity.

XNFA are a variant of standard finite automata in which an input word is accepted if and only if the number of accepting runs is odd [7], [8]. Like nondeterministic and deterministic finite automata, XNFA recognise exactly the class of regular languages. Much like NFA, XNFA are exponentially more succinct than deterministic automata [7]; they are incomparable with standard NFA in terms of succinctness. As weighted automata over a field, XNFA also enjoy properties stemming from the algebraic structure. Their complementation requires little effort, and the number of states can be minimised in cubic time [3], [9]; whilst minimising NFA is PSPACE-hard [10]. Angluin-style learning using only polynomially many queries in the size of the minimal automaton is possible for XNFA, while this is not the case for NFA [11].

Our work is part of a quest to understand the impact of the underlying algebraic structure on the computational complexity of algorithmic problems. The two-element field and the Boolean semiring are the simplest examples of a field and an idempotent semiring, respectively. How does this structure influence algorithmic properties of weighted automata?

In this paper, we study and compare basic decision problems for weighted automata over the Boolean semiring and the two-element field (NFA and XNFA, respectively):

(acceptance)

whether a given word is accepted by a given automaton,

(non-emptiness)

whether there exists a word that a given automaton accepts, and

(equivalence)

whether two automata accept exactly the same words.

We take the ‘fine-grained lens’: while all these problems (except NFA equivalence) can be solved efficiently, we are interested in optimising the degrees in polynomial time bounds, i.e., \(k\) in \(O(|A|^k)\) where \(|A|\) is the size of description of the automaton \(A\). Fine-grained complexity aims to match upper bounds on the running time of algorithms with lower bounds, conditional on a small number of common complexity assumptions.

1.1 The acceptance problem↩︎

Acceptance is perhaps the most basic problem that one can pose about automata. If \(A\) is an NFA, the textbook algorithm for it determines, for each prefix of the input word \(w\), which states can be reached on that prefix. The running time is \(O(|A| \cdot |w|)\), where \(|A|\) is the sum of the numbers of states and transitions of \(A\) and \(|w|\) is the length of \(w\). Essentially the same algorithm can be used for XNFA acceptance as well.

Is the running time optimal?

Interestingly, it is unknown whether substantially faster algorithms may be designed for NFA and XNFA Acceptance. Bringmann et al. [12] have recently hypothesised that, for NFA, there is no algorithm with running time \((|A| \cdot |w|)^{1-\varepsilon}\) for any real \(\varepsilon > 0\). This NFA acceptance hypothesis does not appear to be a consequence of standard complexity assumptions, fine-grained or not [12]. The NFA acceptance hypothesis really concerns dense NFA; i.e., those with many more transitions than states. Indeed, for sparse NFA (having \(n\) states and \(O(n)\) transitions) a faster than \((n \cdot |w|)^{1-\varepsilon}\)-time algorithm would contradict the well-established Orthogonal Vectors Hypothesis and thus also the Strong Exponential Time Hypothesis (SETH) on the complexity of Boolean satisfiability, SAT (see, e.g., [13]). This conditional lower bound is matched by the textbook algorithm.

The state of the art raises a question: is XNFA Acceptance similarly hard?

Our approach: Analysis by ambiguity.

We consider the acceptance problems under assumptions on the ambiguity of automata, i.e., possible number of runs relative to the length of the input word. Classes of unambiguous, finitely-ambiguous, and polynomially ambiguous weighted automata are well-known and can be characterised in terms of structure of the transition graph [14]. The ‘ambiguity class’ can be decided in polynomial time [14], and fine-grained complexity bounds have been obtained recently [15]. Analysis by ambiguity is an established tool in the research on weighted automata, used to obtain (un)decidability and complexity results [16][18] as well as language-theoretic properties [19].

Our contributions.

For acceptance problems, we show two results.

  1. The value problem for weighted automata of bounded ambiguity can be decided faster than in time \(\Theta(|\delta| \cdot |w|)\), where \(\delta\) is the set of transitions.

More precisely, if for every word \(A\) has at most \(k\) accepting runs on it, the standard algorithm for the value problem has a running time of \(O(k |Q| \cdot |w| + |\delta|)\), assuming unit-cost arithmetic in the underlying algebraic structure. An important special case is \(k = O(1)\), referred to as finite ambiguity. While we phrase this result more generally in terms of the value problem of weighted automata, it naturally specialises to both NFA and XNFA. We highlight the special case of unambiguous finite automata (see, e.g., [20]), in which there is at most one accepting run for every \(w \in \Sigma^*\). Every unambiguous automaton can be seen both as an NFA and as an XNFA; and every language recognised by an XNFA or NFA has an unambiguous automaton too (albeit possibly an exponentially bigger one, by determinisation). For \(A\) unambiguous, our running time of \(O(|Q| \cdot |w| + |\delta|)\) solves an open problem posed by Kiefer and Ryzhikov [21] on the complexity of multiplying matrices from zero-one matrix monoids.

  1. There is a randomised reduction from NFA acceptance to XNFA acceptance, under the assumption of polynomial ambiguity.

Let \(A\) be an NFA for which there exists a polynomial \(p \colon \mathbb{N} \to \mathbb{N}\) such that every word \(w \in \Sigma^*\) has at most \(p(|w|)\) accepting runs. We give a randomised algorithm that takes such an NFA \(A\) and a word \(w\) and produces XNFA \(A_1, \ldots, A_k\), \(k = \Theta(\log |w|)\), such that, with probability at least \(1/2\), \(A\) accepts \(w\) iff at least one of \(A_i\) accepts \(w\). Moreover, the reduction has only one-sided error: if \(A\) rejects \(w\), then all of \(A_i\) reject \(w\) as well. The reduction is fast enough to yield the following conclusion: if there is an algorithm for XNFA acceptance running in time \(O((|\delta| \cdot |w|)^{1-\varepsilon})\) for some \(\varepsilon>0\), then there is a randomized algorithm for polynomially ambiguous NFA acceptance running in time \(O(|\delta| + |w| + (|\delta| \cdot |w|)^{1-\varepsilon})\), up to polylogarithmic factors.

As we discuss below, prior work suggests that NFA Acceptance may already be hard for polynomially ambiguous automata. By our reduction, XNFA Acceptance cannot be easier. The reduction raises the question of whether parity acceptance can circumvent existing complexity obstacles: can we build on this reduction to refute the NFA Acceptance hypothesis? We leave open the existence of faster algorithms for unrestricted (X)NFA acceptance.

1.2 The emptiness and equivalence problems↩︎

The equivalence problem, that is, whether two automata recognise the same language, is a natural algorithmic problem. Its computational complexity varies depending on the model of computation. For NFA it is PSPACE-complete [22] but for XNFA, thanks to the ring structure on \(\{0,1\}\), it is easily reduced to the emptiness problem: whether a single given automaton accepts at least one word. Emptiness can be decided efficiently, in cubic time [3], [5]. More generally, emptiness and equivalence for weighted automata over fields can be decided in polynomial time [3], [23], [24]. Over the field of rational numbers, equivalence is in RNC and NC [25], [26], and is in fact C\(_{=}\)L-complete [27]. Several sources describe algorithms that decide emptiness using \(O(|\Sigma| \, |Q|^3)\) field operations and thus equivalence with \(O(|\Sigma| \, (|Q_1| + |Q_2|)^3)\) operations; see, e.g., [24].

Is the cubic dependency of the running time on \(\boldsymbol{|Q|}\) optimal?

It is open even for \(|\Sigma| = O(1)\) whether, for XNFA, the dependency on \(|Q|\) can be made subcubic. With randomness, running time \(O(|Q| \cdot |\delta|)\) can be achieved [26], which is subcubic for sparse but not dense automata. We have not been able to find a lower bound for this problem. We ask, however, what are suitable sources of hardness for a hypothetical lower bound.

Our contribution.

We show the following result.

  1. Reductions from the Strong Exponential Time Hypothesis (SETH) are unlikely to prove the optimality of cubic algorithms for XNFA emptiness and equivalence.

Reductions from SETH are a standard tool for conditional lower bounds [13]. We show, more precisely, that a reduction with the required properties would contradict NSETH, the nondeterministic version of SETH [28]. A refutation of NSETH would give a better-than-\(2^n\) proof system for propositional tautologies as well as establish new circuit lower bounds [28]. In fact, we prove a slightly more general statement, namely that reductions from SETH are unlikely to prove the optimality of current cubic algorithms for zero-ness and equivalence for weighted automata over fields.

To obtain this result, we describe efficient certification schemes for XNFA (and weighted automata) emptiness and non-emptiness. Informally, this means that a knowledgeable prover can come up with a suitable certificate (or ‘proof’) that the language of XNFA is empty or non-empty. (For NFA non-emptiness, for example, a certificate can be an accepting run; but this does not work for XNFA.) Crucially, the verification of a certificate may be more efficient than solving the problem from scratch. We describe how to certify both emptiness and non-emptiness of XNFA so that a suitable verifier can check the certificates in time \(O(|\Sigma| \, |Q|^\omega)\), where \(\omega \leq 2.38\) is the matrix multiplication exponent. This shows XNFA emptiness solvable in nondeterministic time \(O(|\Sigma| \, |Q|^\omega)\) as well as co-nondeterministic time \(O(|\Sigma| \, |Q|^\omega)\). By known results [28], it follows that any reduction from SETH for a lower bound stronger than \(\Omega(|\Sigma| \, |Q|^\omega)\) would contradict NSETH.

For the XNFA equivalence problem, our results extend directly from the emptiness problem. As mentioned above, the certification schemes also apply to the standard (non)emptiness and (non)equivalence problems for weighted automata over other fields.

2 Related work and discussion↩︎

Fine-grained reductions showing conditional lower bounds for automata-theoretic problems have been known for over two decades [29]. Several years ago Potechin and Shallit [30] showed that, for every real \(\alpha \ge 2\), if there is an algorithm that decides in time \(O(n^\alpha)\) whether an NFA with \(4 n\) states accepts a word of length \(n+2\), then there is also an algorithm with the same running time that decides if an \(n\)-vertex undirected graph contains a triangle. For the latter problem, called triangle detection, the best algorithms run in essentially the same time as best matrix multiplication algorithms, \(O(n^\omega)\).

The appearance of the matrix multiplication exponent \(\omega\) is not coincidental. As observed by Bringmann et al. [12], other existing reductions in the literature show that any (hypothetical) faster algorithms for NFA Acceptance would need to employ fast matrix multiplication. In a nutshell, this is established by a reduction from the \(k\)-Clique problem; for brevity we refer to it as “Bringmann et al.’s reduction”. Bringmann et al.’s reduction, as well as Potechin and Shallit’s reduction, can be seen as evidence for the above-mentioned NFA acceptance hypothesis. The hypothesis itself, in effect, postulates that fast matrix multiplication techniques cannot offer substantial running time improvements for NFA Acceptance.

There is a randomised reduction from the triangle detection problem to XNFA Acceptance.

Proof (sketch). We combine two reductions from the literature, adapted suitably. Firstly, an existing randomised reduction from Zero Weight Triangle to Zero Weight Triangle Parity [31] shows that standard triangle detection reduces to the computation of the parity of the number of triangles. Secondly, the reduction from triangle detection to NFA Acceptance [30] can be easily changed so that the number of triangles coincides with the number of accepting runs for the appropriately chosen input word. ◻

[obs:triangle-to-xnfa] above suggests that, for instance for the regime \(|Q| = \Theta(|w|)\), algorithms for XNFA Acceptance faster than matrix multiplication are unlikely to exist.

Intuitively, our reduction from polynomially ambiguous NFA Acceptance to XNFA Acceptance increases the conjectured hardness level: from \(n^\omega\) (based on triangle detection) to \(n^3\) (based on NFA Acceptance hypothesis on words of length \(\Theta(|Q|)\)). Arguably, a catch is that we assume that the NFA has polynomial ambiguity. However, this assumption is far from trivialising the problem.

In the following reductions, polynomially ambiguous NFA already suffice for hardness:

  • Potechin and Shallit’s reduction from triangle detection [30],

  • Bringmann et al.’s reduction from \(k\)-Clique [12].

(E.g., hard instances in [30] have \(O(|w|^3)\) accepting runs for every \(w\); and \(|Q| = \Theta(|w|)\).)

Generally, even randomised faster algorithms for the acceptance problems are of much interest. The state of the art for NFA Acceptance is an \(|Q|^2 \cdot |w| / 2^{\Omega(\sqrt{\log |Q|})}\)-time algorithm, assuming \(|\Sigma|=O(1)\): reduce [12] the problem to online matrix-vector multiplication in dimension \(n\), for which the naive algorithm achieves time \(O(n^3)\) but a randomised one running in time \(n^3 / 2^{\Omega(\sqrt{\log n})}\) exists [32]. For every \(c > 0\), function \(2^{c \sqrt{\log n}}\) grows faster than \((\log n)^k\) for all \(k > 0\) but slower than \(n^\varepsilon\) for all \(\varepsilon > 0\). No similar improvement over \(n^3\) is known for XNFA Acceptance, and in particular faster online matrix-vector multiplication techniques are not available over the field of two elements [32].

The value problem for weighted automata, a natural generalisation of acceptance, is provably hard for the min-plus semiring [33]; the argument is not known to extend to NFA.

We have already briefly mentioned Kiefer et al.’s results [26], deciding equivalence of weighted automata over \((\mathbb{Q}, +, \times)\) in randomised polylogarithmic parallel time. As in the case of our reduction from NFA acceptance to XNFA acceptance, randomness is used by one of their algorithms for polynomial identity testing, relying on the DeMillo–Lipton–Schwartz–Zippel lemma (a non-zero polynomial over a large enough field rarely evaluates to zero at a random point). The objectives are different, however: an equivalence checker determines if two automata assign the same weight to every word, whereas our reduction looks for some accepting run in a single NFA on a given word, by checking if the parity (XOR sum) of path-weights is non-zero.

Our reduction from NFA acceptance to XNFA acceptance under the polynomial ambiguity assumption goes against a possible intuition that ‘rings are easy while semirings are hard’ for weighted automata. In support of this intuition, contrast polynomial-time algorithms for the equivalence problem on weighted automata over the ring of rationals [3], [23][26] with the PSPACE-completeness of equivalence for NFA [22]. Over the max-plus semiring, again with weights from \(\mathbb{Q}\), equivalence is undecidable [34], [35]. But, by our results, the acceptance problem is no more difficult (possibly easier) for polynomially ambiguous automata over the Boolean semiring (classical NFA) than for the field of two elements (XNFA).

It is also interesting to compare our results with those on the NL- and \(\oplus\mathrm{L}\)-complete problems of deciding the value of an entry in the product of multiple matrices over the Boolean semiring and over \(\mathrm{GF}(2)\), respectively; see the papers [1], [2] mentioned above.

3 Preliminaries↩︎

We begin by defining the general model of a weighted automaton.

Definition 1 (Weighted Automaton). A weighted automaton* over a semiring \((\mathbb{K}, +, \cdot, 0, 1)\) is a tuple \(A = (Q, \Sigma, \Delta, \lambda, \gamma)\), where:*

  • \(Q\) is a finite set of states;

  • \(\Sigma\) is a finite input alphabet;

  • \(\Delta\colon \Sigma \rightarrow \mathbb{K}^{Q \times Q}\) assigns a transition matrix (denoted by \(\Delta_{\sigma}\)) to each symbol \(\sigma \in \Sigma\);

  • \(\lambda \in \mathbb{K}^{1 \times Q}\) is the initial weight vector;

  • \(\gamma \in \mathbb{K}^{Q \times 1}\) is the final weight vector.

The value of \(A\) on word \(w = a_1 a_2 \dots a_n \in \Sigma^*\) is \(A(w) = \lambda \cdot \Delta_{a_1} \cdot \Delta_{a_2} \cdot \ldots \cdot \Delta_{a_n}\cdot \gamma \in \mathbb{K}\).

Using this general framework, we define NFA and XNFA by specifying the underlying semiring and the interpretation of the resulting weight.

Definition 2 (NFA). A nondeterministic finite automaton (NFA) is a weighted automaton over the Boolean semiring \(\mathbb{B} = (\{0,1\}, \lor, \land, 0, 1)\).

Equivalently, we can define an NFA as a tuple \((Q, \Sigma, \delta, I, F)\), where the transition relation \(\delta \subseteq Q \times \Sigma \times Q\) replaces \(\Delta\), and \(I\) and \(F\) are subsets of \(Q\) corresponding to the non-zero elements of \(\lambda\) and \(\gamma\), respectively. Whenever there is a path in the underlying labelled graph \((Q, \Sigma, \delta)\) from a state \(q\) to a state \(q'\), we say \(q'\) is reachable from \(q\) and \(q\) co-reachable from \(q'\). An automaton is trim when every state is reachable from \(I\) and co-reachable from \(F\).

An accepting run of \(A\) on a word \(w\) is a path \(\rho\) in the underlying labelled graph \((Q, \Sigma, \delta)\) that starts at an initial state \(i \in I\), ends in a final state \(f \in F\), and whose edge labels yield \(w\) when concatenated. A word \(w\) is accepted if \(A(w) = 1\), which corresponds to the existence of at least one accepting run of \(A\) on \(w\).

Definition 3 (XNFA). A symmetric difference automaton (XNFA) is a weighted automaton over the finite field of two elements \(\mathrm{GF}(2) = (\{0,1\}, \oplus, \cdot, 0, 1)\).

Similarly to NFA, we can define an XNFA as a tuple \((Q, \Sigma, \delta, I, F)\), and an accepting run of \(A\) on a word \(w\) is a \(w\)-labelled path from \(I\) to \(F\). An XNFA \(A\) accepts a word \(w\) if \(A(w) = 1\), or equivalently, if the number of accepting runs of \(A\) on \(w\) is odd.

Definition 4 (Ambiguity [14]). Let \(A\) be an NFA or XNFA. For a word \(w \in \Sigma^*\), let \(d_A(w)\) denote the number of accepting runs of \(A\) on \(w\). We say \(A\) is finitely-ambiguous* if \(d_A(w)\) is \(\function{\mathrm{O}}{1}\) as \(\size{w} \to \infty\); polynomially ambiguous if \(d_A(w)\) is \(\function{\mathrm{O}}{p(\size{w})}\) for some polynomial \(p\); and exponentially ambiguous otherwise.*

If an NFA(or XNFA) is not polynomially ambiguous, then \(d_A(w_i)\) is \(2^{\Omega(|w_i|)}\) for some infinite sequence of words \((w_i)_{i\in\bN}\) [14].

When NFA or XNFA transition matrices are sparse (i.e., most entries are zero), representing them as full \(Q \times Q\) matrices is inefficient. In an NFA or XNFA, representing the set \(\set{q \nonscript\:\vert\nonscript\:\mathopen{}\PackageWarning{Radeks Macro}{Command suchthat used outside of matching PairedDelimiter was used on input line \the\inputlineno.}(p, \sigma,q)\in\delta}\), for all \(p \in Q\) and \(\sigma \in \Sigma\) as a single-linked list is standard and convenient for sparse automata.

4 Analysis of the dynamic programming algorithm for Acceptance and Value problems↩︎

The Acceptance problems for NFA and XNFA are special cases of the value problem for weighted automata: given a weighted automaton \(A\) and a word \(w\), compute \(A(w)\) (see 1). In this section, we show that, when the automaton \(A\) is \(k\)-ambiguous, the value problem can be decided faster than in the general case.

We describe a standard dynamic programming algorithm that computes the value of \(A\) on \(w\). We prove that, when \(A\) has a bounded number of runs to each final state on \(w\), this algorithm does not make as many transition traversals as in the worst case. As a consequence, under the assumption of \(k\)-ambiguity, this algorithm is guaranteed to run faster than the standard bound of \(O((|Q|+ |\delta|)\, |w|)\).

Let \(I\) be the initial set, i.e., the set of all states that have non-zero entries in \(\lambda\), and \(F\) be the final set, i.e., the set of all states with non-zero entries in \(\gamma\).

Figure 1: Standard dynamic programming algorithm for evaluation of weighted automata

Theorem 1. 1 computes the value of a weighted automaton \(A\) on a word \(w\). If \(w\) has, for every final state \(f \in F\), at most \(k\) runs from \(I\) to \(f\), then 1 uses at most \(2 k \, |w| \, |Q|\) semiring operations and additionally \(O(k \, |w| \, |Q| + |\delta|)\) time.

Even when \(A\) is \(k\)-ambiguous and trimmed, a single state may have an outdegree greater than \(k|\Sigma|\); \(k\)-ambiguity bounds the number of accepting runs (on a given input string), not the local branching of the transition graph.

Proof. We claim that during every iteration of the outermost for loop, for each state \(q \in Q\), the entry \(\textsf{curr}[q]\) is assigned (in lines 5–7) at most \(k\) times.

For all \(f \in F\), let \(A\) have at most \(k\) runs from \(I\) to \(f\) on \(w\). Consider iteration \(i \leq \size{w}\). Suppose there is a state \(q \in Q\) such that \(\textsf{curr}[q]\) is assigned more than \(k\) times during this iteration. This means that there are at least \(k+1\) paths from the initial set \(I\) to \(q\) labelled by the same prefix \(w[1, i]\). By line 1, since \(A\) is trim, there must exist a word \(v \in \Sigma^*\) that labels a path from \(q\) to some \(f \in F\). This would yield \(k+1\) runs on the word \(w[1,i]v\), from \(I\) to \(f\), contradicting our assumption.

To ensure the given running time bound, note that each of the sets \(\delta(p, \sigma)\) for every state \(p \in Q\) and every letter \(\sigma \in \Sigma\) can be implemented as a singly-linked list. Trimming the automaton in line 1 takes \(O(|Q| + |\delta|)\) time. Every iteration of the outermost for loop performs at most \(k\, |Q|\) assignments to \(\textsf{curr}\), and lines 4 and 8 perform an additional \(|Q|\) assignments to curr and prev each. Overall, there are exactly \(|w|\) iterations.

Hence, the algorithm runs in \(O(k\, \size{w}\, \size{Q} + \size{\delta})\) time. ◻

Note that a \(k\)-ambiguous automaton always has the property that, for every word \(w\) and final state \(f \in F\), there are at most \(k\) runs from \(I\) to \(f\) on \(w\). In terms of the usual degree of ambiguity of the automaton, 1 gives us the following bound:

Corollary 1. Given a \(k\)-ambiguous weighted automaton \(A\) and a word \(w\), 1 computes the value \(A(w)\) using at most \(2 k \, |w| \, |Q|\) semiring operations and additionally \(O(k \, |w| \, |Q| + |\delta|)\) time.

As an immediate consequence, the acceptance problem for finitely ambiguous NFA and XNFA is decidable faster than in time \(O(|\delta||w|)\) too.

Corollary 2. Given a \(k\)-ambiguous NFA or XNFA \(A\) and a word \(w\), 1 decides if \(A\) accepts \(w\) in \(O( k|w| \, |Q| + |\delta|)\) time.

Whenever \(k \, |Q| = o(|\delta|)\), this improves on the naive NFA acceptance bound of \(O(|w|\, |\delta|)\). By setting \(k=1\), 1 decides if an unambiguous automaton \(A\) accepts \(w\) in \(O( |w| \, |Q| + |\delta|)\) time.

A consequence of our tighter bound for unambiguous NFA Acceptance is the following bound on the complexity of 0–1 matrix multiplication if the product is known to be a 0–1 matrix too. This resolves an open problem posed by Kiefer and Ryzhikov [21]:

Corollary 3. Let \(P\) and \(R\) be 0–1 matrices of size \(n \times n\) such that the product \(PR\) is also a 0–1 matrix. Then \(PR\) can be computed from \(P\) and \(R\) in time \(O(n^2)\).

Proof. Form the automaton \(A\) over the alphabet \(\{a\}\) on states \(\{q_1,\dots , q_n\} \times \{1, 2, 3\}\) with the transitions defined as \((q_i, 1) \xrightarrow[]{a} (q_j, 2)\) if and only if \(P[i,j] = 1\) and \((q_i, 2) \xrightarrow{a} (q_j, 3)\) if and only if \(R[i,j] = 1\). The \(i\)-th row of \(PR\) has \(1\) in the \(j\)-th component precisely when \((q_i, 1)\) reaches \((q_j, 3)\) on reading \(aa\).

First, delete any state that is not co-reachable from \(Q \times \{3\}\). This can be done in \(O(n^2)\) time. Then run 1 (without any trimming) \(n\) times, for the \(i\)-th iteration setting \((q_i, 1)\) as the unique initial state. Each run of 1 computes the \(i\)-th row of \(PR\). Since \(PR\) is a 0–1 matrix, \(aa\) has at most one run from \((q_i, 1)\) to \((q_j,3)\) for all \(i, j\). By 1, the \(i\)-th row of \(PR\) can be computed by 1 in time \(O(|Q|\cdot |w|) = O(n)\), so \(PR\) can be computed in time \(O(n^2)\). ◻

5 Reducing polynomially ambiguous NFA Acceptance to XNFA Acceptance↩︎

In this section, we encode NFA acceptance of \(w\) as the question of whether a weighted automaton over a field \(\mathrm{GF}(2^k)\) computes a non-zero value on the input \(w\). We then translate this question into XNFA acceptance. To achieve this, we apply the Schwartz-Zippel Lemma for polynomial rings over fields (2).

Let \(\function{\mathbb{F}}_{}{}\) be a field. By \(\function{\mathbb{F}}_{}{}[x_1, \ldots, x_m]\) we denote the ring of (multivariate) polynomials with variables \(x_1, \ldots, x_m\) and coefficients from \(\function{\mathbb{F}}_{}{}\).

In order to apply the Schwartz-Zippel Lemma, we first turn an arbitrary NFA\(A\) into a weighted automaton, denoted \(A_{\function{\mathbb{F}}_{}{}[\vec{x}]}\), over a suitable ring of polynomials. In more detail, take \(\vec{x} = (x_1, \ldots, x_{|\delta|})\), one variable \(x_t\) per transition \(t\). For a field \(\function{\mathbb{F}}_{}{}\), the weighted automaton \(A_{\function{\mathbb{F}}_{}{}[\vec{x}]}\) over the ring \(\function{\mathbb{F}}_{}{}[\vec{x}]\) is obtained from \(A\) by using \(x_t\) as the weight of transition \(t\), for all \(t \in Q \times \Sigma \times Q\). By \(A_{\function{\mathbb{F}}_{}{}[\vec{x}]}(w)\) we denote the multivariate polynomial (over the variables \(\vec{x}\)) obtained when evaluating this weighted automaton on \(w\).

We next establish a relationship between the acceptance of a word \(w\) by \(A\) and the corresponding value \(A_{\function{\mathbb{F}}_{}{}[\vec{x}]}(w)\), under the assumption that \(A\) is polynomially ambiguous.

For a word \(u = t_1 t_2 \cdots t_l \in T^*\), over the alphabet \(T\), its Parikh image \(P_u\colon T \to \bN\) is the function that returns the number of times each symbol (in \(T\)) appears in \(u\). Given that at the cost of adding one state to \(Q\), we may assume that we have a single initial state. In the next result, we assume that, without loss of generality, there is exactly one initial state.

Lemma 1. Let \(A = (Q, \Sigma, \delta, \{q_0\}, F)\) be an NFA. Assume there exists \(w\in\Sigma^*\) that admits two different accepting runs (i.e., transition sequences) with the same Parikh image. Then \(A\) has exponential ambiguity.

Proof. Let \(w=a_1 \cdots a_k\), then \(w[i] = a_i\) for \(i \in \set{1, 2, \ldots, k}\), and \(w[i,j] = a_i a_{i+1}\cdots a_j\). For \(u \in \delta^*\) any sequence of transitions, let \(G_A(u)\) be a subgraph of the automaton graph containing only edges from \(u\). Formally, \(G_A(u) = (Q^\prime, E)\), where \(E = \{t\mid u[i] = t\text{ for some i}\}\), and \(Q^\prime\) is the minimal subset of \(Q\) incident with edges in \(E\).

Assume \(w \in \Sigma^*\) has two different accepting runs \(\pi, \pi' \in \delta^*\) with the same Parikh image. We show the existence of a useful state \(q \in Q\) (i.e., a state reachable from the initial state and co-reachable from a final state) and a word such that there are two different closed walks from \(q\) to \(q\) labelled by this word. This implies that \(A\) is exponentially ambiguous; see [14].

Let \(i\) be the first position such that \(\pi[i] \neq \pi'[i]\). Therefore, \(\pi[i] = (q_b, a, r)\) and \(\pi'[i] = (q_b, a, s)\) for some \(q_b,r,s \in Q\), \(r \neq s\), and \(a \in \Sigma\). But since \(P_\pi(\pi'[i]) = P_{\pi'}(\pi'[i])\), \(\pi\) revisits state \(q_b\) and there is some \(j > i\) where it takes the other transition, i.e., \(\pi[j] = \pi'[i]\). Therefore, \(G_A(\pi[i,j-1])\) is strongly connected. Choose minimal \(i' \leq i\) and maximal \(j' \geq j\) such that \(G_c = G_A(\pi[i', j'-1])\) is a strongly connected component of \(G_A(\pi)\). By strong connectivity, \(\pi\) does not use the edges of \(G_c\) outside the infix \(\pi[i', j'-1]\). By the equality of Parikh images, \(G_c\) is also a strongly connected component in \(G_A(\pi')\). By strong connectivity, \(\pi'\) uses the edges of \(G_c\) on some infix \(\pi'[i'', j''-1]\). But \(q_b\) is a vertex of \(G_c\) and is visited by both \(\pi\) and \(\pi'\), and the prefixes of \(\pi\) and \(\pi'\) before \(i\) are equal, so both runs enter \(G_c\) at the same time, i.e., \(i' = i''\). By equality of Parikh images, the intervals have equal lengths: \(j' - i' = \sum_{t \in E} P_\pi(t) = \sum_{t \in E} P_{\pi'}(t) = j'' - i'\), thus \(j'' = j'\), i.e., the runs leave \(G_c\) at the same time. Therefore, both \(\pi\) and \(\pi'\) use the edges of \(G_c\) exactly in the infixes \(\pi[i', j'-1]\) and \(\pi'[i', j'-1]\), both labelled by \(w[i', j'-1]\).

By the equality of Parikh images, the runs exit \(G_c\) via the same edge \((q_e, \cdot, \cdot)\), so they both visit the same state \(q_e\) as the last vertex of \(G_c\): \(\pi[j'-1] = (\cdot, \cdot, q_e)\) and \(\pi'[j'-1] = (\cdot, \cdot, q_e)\). By strong connectivity, there exists some \(w_l \in \Sigma^*\) such that there is a run \(\pi_l\) from \(q_e\) to \(q_b\) labelled by \(w_l\) in \(G_c\). Then \(\pi[i,j'-1]w_l\) and \(\pi'[i,j'-1]w_l\) are two different closed walks from \(q_b\) to \(q_b\), labelled with the same word \(w[i,j'-1]w_l\). Therefore, \(A\) is exponentially ambiguous. ◻

A polynomial \(p \in \function{\mathbb{F}}_{}{}[x_1, \ldots, x_m]\) is non-zero if it contains at least one monomial (term), and it represents a non-zero function if there exists some \(a = (a_1, \ldots, a_m) \in \function{\mathbb{F}}_{}{}^m\) such that \(p(a) \ne 0\). A non-zero multivariate polynomial of degree \(d\) over \(\function{\mathbb{F}}_{}{}\) is guaranteed to be a non-zero function if \(|\function{\mathbb{F}}_{}{}| > d\); see, e.g., [36].

A polynomially ambiguous NFA\(A\) accepts \(w\) precisely when the polynomial \(A_{\function{\mathbb{F}}_{}{}[\vec{x}]}(w)\) is non-zero: from 1 we see that different runs for a given input word evaluate to different monomials.

Recall that if \(A\) is exponentially ambiguous, then it contains a useful state that has two cycles on the same input (see [14]). These cycles can be permuted. This justifies the ‘polynomially ambiguous’ assumption in [lem:syntax].

Next, we recall the Schwartz-Zippel lemma in the form required in this section. We write \(\Pr[\ldots]\) to denote the probability of an event.

Lemma 2 (Schwartz-Zippel [37]). Let \(\function{\mathbb{F}}_{}{}\) be a finite field and \(p\in \function{\mathbb{F}}_{}{}[x_1,\dots,x_m]\) a polynomial of total degree \(d\) representing a non-zero function. If each \(r_i\) is chosen independently and uniformly from \(\function{\mathbb{F}}_{}{}\), then \(\Pr\bigl[p(r_1,\dots,r_m)=0\bigr] \;\le\; \frac{d}{\size{\function{\mathbb{F}}_{}{}}}\).

We may repeat the random assignment of values to variables \(r\) times, until \(\left(\frac{d}{|\function{\mathbb{F}}_{}{}|}\right)^r\) becomes smaller than some required error (assuming \(d<|\function{\mathbb{F}}_{}{}|\)).

By abuse of notation, we denote by \(A_{\function{\mathbb{F}}_{}{}}\) the weighted automaton over \(\function{\mathbb{F}}_{}{}\), obtained by taking \(A_{\function{\mathbb{F}}_{}{}[\vec{x}]}\) and replacing each variable weight \(x_t\) with a random value from \(\function{\mathbb{F}}_{}{}\). Next, we consider the relationship between whether \(A\) accepts \(w\) or not and the value of \(A_{\function{\mathbb{F}}_{}{}}(w)\).

Lemma 3. Assume that NFA\(A\) is polynomially ambiguous, \(\function{\mathbb{F}}_{}{}\) is a finite field, and \(|\function{\mathbb{F}}_{}{}| > |w|\). If \(A\) rejects \(w\), then \(A_{\function{\mathbb{F}}_{}{}}(w)=0\), and if \(A\) accepts \(w\), then \(\Pr[A_{\function{\mathbb{F}}_{}{}}(w)=0] \le \frac{|w|}{|\function{\mathbb{F}}_{}{}|}\).

Proof. By construction, the weighted automaton \(A_{\function{\mathbb{F}}_{}{}}\) sums the weights (from \(\function{\mathbb{F}}_{}{}\)) of all accepting runs of \(A\) on input \(w\). If \(A\) has no accepting runs on \(w\), then this sum is empty and \(A_{\function{\mathbb{F}}_{}{}}(w)=0\) deterministically.

Next, assume that \(A\) has at least one accepting run on \(w\). Because \(A\) is polynomially ambiguous, \(A_{\function{\mathbb{F}}_{}{}[\vec{x}]}(w)\) is non-zero by [lem:syntax]. Since \(|\function{\mathbb{F}}_{}{}| > |w|\) and since \(|w|\) is the degree of this polynomial, it represents a non-zero function [36]. The result now follows from the Schwartz-Zippel Lemma, noting that \(A_{\function{\mathbb{F}}_{}{}}(w)\) is equal to the polynomial \(A_{\function{\mathbb{F}}_{}{}[\vec{x}]}(w)\) evaluated by replacing \(x_t\) with the value from \(F\) assigned to \(t\) when defining \(A_{\function{\mathbb{F}}_{}{}}\). ◻

In our setting, the field \(\function{\mathbb{F}}_{}{}\) will be a finite field of cardinality \(2^k\), for some value of \(k\): Galois field \(\mathrm{GF}(2^k)\). Next, we consider how to go from a weighted automaton over \(\mathrm{GF}(2^k)\) to XNFA. Fix a basis of \(\mathrm{GF}(2^k)\) as a \(k\)-dimensional vector space over \(\mathrm{GF}(2)\). Multiplication by any fixed element from \(\mathrm{GF}(2^k)\) is a \(\mathrm{GF}(2)\)-linear map and can therefore be represented by a \(k\times k\) matrix over \(\mathrm{GF}(2)\).

To extend the parity acceptance concept to \(k\)-dimensional field representations, we define a generalised weighted automaton model, which we refer to as \(k\)-XNFA. Although the definition can be used on any semiring, we only use it on \(\mathrm{GF}(2)\), and thus we refer to these weighted automata as \(k\)-XNFA.

Definition 5. A \(k\)-XNFA* \(A\) is a weighted automaton over \(\mathrm{GF}(2)\), but with a final weight matrix \(\gamma \in \mathrm{GF}(2)^{Q \times k}\). The word \(w = a_1 a_2 \ldots a_l \in \Sigma^*\) is accepted if \(\lambda \cdot \Delta_{a_1} \cdot \Delta_{a_2} \cdots \Delta_{a_l} \cdot \gamma\) is a non-zero vector in \(\mathrm{GF}(2)^{1\times k}\).*

Every \(1\)-XNFA is, trivially, an XNFA. We refer to the acceptance condition of a \(k\)-XNFA as the generalised parity acceptance condition. We show how to simulate a weighted automaton over \(\mathrm{GF}(2^k)\) by a \(k\)-XNFA, with a small overhead on the state and transition count.

lemmaGFsimulation Let \(\function{\mathbb{F}}_{}{} = \mathrm{GF}(2^k)\), and \(A_F\) be a weighted automaton over \(\function{\mathbb{F}}_{}{}\) with \(|Q|\) states and \(|\delta|\) transitions, and with all entries in the initial and final vectors being 0 or 1. One may construct a \(k\)-XNFA\(B\) with \(k\cdot |Q|\) states and at most \(k^2\cdot |\delta|\) transitions such that, for every \(w\), the row vector \(B(w)\) equals the coordinate vector of \(A_{\function{\mathbb{F}}_{}{}}(w)\) with respect to a chosen basis of \(\function{\mathbb{F}}_{}{}\). This construction can be done in \(\function{\mathrm{O}}{|\delta| \cdot \mathrm{poly}(k)}\) time.

The construction is based on the isomorphism \(\mathrm{GF}(2^k) \cong \mathrm{GF}(2)^k\) as vector spaces over \(\mathrm{GF}(2)\). The \(k\)-XNFA\(B\) simulates the evaluation of \(A_{\function{\mathbb{F}}_{}{}}\) by replacing each state of a weighted automaton over \(\mathrm{GF}(2^k)\) with a vector of \(k\) states. Each transition with weight \(r\) is replaced by the corresponding linear update (matrix multiplication over \(\mathrm{GF}(2)\)) implementing \(g\mapsto r\cdot g\) in \(\mathrm{GF}(2^k)\). The details of the construction are relegated to the appendix.

A \(k\)-XNFA can be split into \(k\) ordinary XNFA with essentially no overhead:

lemmaXNFAdecomposition For a \(k\)-XNFA\(A = (Q, \Sigma, \Delta, \lambda, \gamma)\), consider \(k\) XNFA \(A_i = (Q, \Sigma, \Delta, \lambda, \gamma_i), i = 1, \ldots, k\), where \(\gamma_i\) denotes the \(i\)th column of \(\gamma\). Then \(A\) accepts \(w\) iff at least one of the XNFA \(A_i\) accepts \(w\).

Theorem 2. Let \(A\) be a polynomially ambiguous NFA with \(|Q|\) states, \(|\delta|\) transitions, and let \(w\in\Sigma^+\). Let \(k > \log_2 |w|\). There exists an algorithm that produces \(k\) XNFA \(A_i\) from \(A\), all identical except for their sets of accepting states, such that:

  1. If \(A\) rejects \(w\), then \(A_i\) rejects \(w\) for all \(i\), with probability \(1\).

  2. If \(A\) accepts \(w\), then \(A_{i}\) accepts \(w\) for at least one \(i\), with probability at least \(1-\frac{|w|}{2^k}\).

  3. The number of states and transitions in each \(A_i\) is \(k\cdot |Q|\) and at most \(k^2\cdot |\delta|\), respectively.

  4. The algorithm runs in time \(O(|\delta|\cdot \mathrm{poly}(k))\).

Proof. Set \(\function{\mathbb{F}}_{}{} = \mathrm{GF}(2^k)\) so that \(|\function{\mathbb{F}}_{}{}| = 2^k > |w|\). 2 (page ) has three steps.

Step 1 (Randomisation). Sample independently and uniformly a weight from \(\function{\mathbb{F}}_{}{}\) for each of the \(|\delta|\) transitions of \(A\), and let \(A_{\function{\mathbb{F}}_{}{}}\) be the resulting weighted automaton over \(\function{\mathbb{F}}_{}{}\) (as defined before 3).

Step 2 (Simulation). Apply [lem:simulate-general] to \(A_{\function{\mathbb{F}}_{}{}}\) to obtain a \(k\)-XNFA\(B\) with \(k\cdot |Q|\) states and at most \(k^2\cdot |\delta|\) transitions such that \(B\) accepts \(w\) iff \(A_{\function{\mathbb{F}}_{}{}}(w)\ne 0\).

Step 3 (Decomposition). Apply [lem:decompose] to \(B\) to obtain \(k\) XNFA \(A_1, \ldots, A_k\). By the lemma, they share the state set and transitions of \(B\), differ only in their accepting states, and \(B\) accepts \(w\) iff at least one \(A_i\) accepts \(w\).

We now verify each part of the theorem.

Parts (1) and (2): correctness. Since \(|\function{\mathbb{F}}_{}{}| = 2^k > |w|\), 3 applies. If \(A\) rejects \(w\), then \(A_{\function{\mathbb{F}}_{}{}}(w) = 0\) deterministically; by [lem:simulate-general], \(B\) rejects \(w\); by [lem:decompose], every \(A_i\) rejects \(w\). If \(A\) accepts \(w\), then \(A_{\function{\mathbb{F}}_{}{}}(w)\ne 0\) with probability at least \(1 - |w|/|\function{\mathbb{F}}_{}{}| = 1 - |w|/2^k\); on this event, [lem:simulate-general] gives that \(B\) accepts \(w\), and [lem:decompose] gives that at least one \(A_i\) accepts \(w\).

Part (3): size. By [lem:simulate-general], \(B\) has \(k\cdot |Q|\) states and at most \(k^2\cdot |\delta|\) transitions. By [lem:decompose], each \(A_i\) inherits the same state set and transitions.

Part (4): running time. Step 1 samples \(|\delta|\) elements of \(\function{\mathbb{F}}_{}{}\), each of \(k\) bits, in time \(O(|\delta|\cdot k)\). Step 2 runs in time \(O(|\delta|\cdot \mathrm{poly}(k))\) by [lem:simulate-general]. Step 3 only duplicates pointers to \(B\) while restricting the final weight vector, so it runs in time linear in the output size. The total running time is \(O(|\delta|\cdot \mathrm{poly}(k))\). ◻

Directly from the second part of the previous theorem, we obtain the following results:

Corollary 4. With the assumptions as in 2, suppose \(k \ge \left\lceil \log_2 |w|\right\rceil + 1\). If \(A\) accepts \(w\), then at least one of \(A_1, \dots , A_k\) accepts \(w\) with probability at least \(\frac{1}{2}\).

Figure 2: Reduction from polynomially ambiguous NFA Acceptance to XNFA Acceptance

Corollary 5. Suppose that, for some real \(\varepsilon > 0\), there is an algorithm that decides XNFA Acceptance for every XNFA \(C\) with transition relation \(\delta^{(C)}\) and every input word \(u\) in time \(O\!\left(\bigl(|\delta^{(C)}|\cdot|u|\bigr)^{1-\varepsilon}\right)\). Then the acceptance problem for a polynomially ambiguous NFA \(A\) with transition relation \(\delta\) and input word \(w\) admits a randomised algorithm with one-sided error of at most \(\tfrac{1}{2}\), running in time \(\widetilde{O}\!\left(|\delta| + |w| + \bigl(|\delta|\cdot|w|\bigr)^{1-\varepsilon}\right)\), where \(\widetilde{O}\) hides factors polylogarithmic in \(|w|\).

Proof. We may assume \(w \in \Sigma^{+}\), as the case \(w = \varepsilon\) is decided directly from the initial and final states. Set \(k = \lceil \log_2 |w| \rceil + 1\) so that \(k = \Theta(\log |w|)\) and \(|w|/2^{k} \le \tfrac{1}{2}\). By Theorem 2 we construct, in time \(O(|\delta|\cdot\mathrm{poly}(k))\), the \(k\) XNFA \(A_1,\dots,A_k\), each with at most \(k^{2}\cdot|\delta|\) transitions, such that (i) if \(A\) rejects \(w\) then every \(A_i\) rejects \(w\), and (ii) if \(A\) accepts \(w\) then at least one \(A_i\) accepts \(w\) with probability at least \(\tfrac{1}{2}\) (Corollary 4). Running the assumed XNFA Acceptance algorithm on each \(A_i\) with input \(w\) therefore decides the acceptance of \(A\) on \(w\) with one-sided error at most \(\tfrac{1}{2}\).

For the running time, each of the \(k\) calls costs \(O\!\left((k^{2}|\delta|\cdot|w|)^{1-\varepsilon}\right)\), writing the \(k\) input words costs \(O(|w|\,k)\), and the construction costs \(O(|\delta|\cdot\mathrm{poly}(k))\). The total is \[O\!\left(|\delta|\cdot\mathrm{poly}(k) + |w|\,k + k\cdot\bigl(k^{2}|\delta|\cdot|w|\bigr)^{1-\varepsilon}\right).\] Since \(k = \Theta(\log |w|)\), the factors \(\mathrm{poly}(k)\) and \(k\cdot(k^{2})^{1-\varepsilon}\) are polylogarithmic in \(|w|\) and are absorbed into \(\widetilde{O}\), giving \(\widetilde{O}\!\left(|\delta| + |w| + (|\delta|\cdot|w|)^{1-\varepsilon}\right)\). The general error bound \(\eta\in(0,1)\) is treated in Corollary 9 (appendix). ◻

The above reduction from polynomially ambiguous NFA Acceptance to XNFA Acceptance can be easily generalised to reducing polynomially ambiguous NFA Acceptance to the value problem for weighted automata over other finite fields. Since the strength of our reduction is that even the simplest field, GF(2), can efficiently simulate polynomially ambiguous NFA Acceptance, we state our results in terms of XNFA Acceptance.

6 Certificates for Emptiness and Equivalence for weighted automata over fields↩︎

In this section, we describe certification schemes for the (non)emptiness and (non)equivalence problems for weighted automata over fields. Intuitively, given a decision problem \(D\) and an instance \(x\), a certificate is a string that can be used to prove that \(D\) accepts \(x\). We say that we can certify a decision problem \(D\) in time \(T(n)\) if there exists a deterministic algorithm (verifier) that takes as input pairs \((x,c)\) where \(x\) is an instance of \(D\) and \(c\) is any string. The verifier must have the following properties:

(1) If \(x\) is accepted by \(D\), there must exist a string \(c\) (certificate) of size \(|c| \leq T(|x|)\) such that the verifier accepts (\(x,c\)) in \(T(|x|)\) time.

(2) If \(x\) is rejected by \(D\) then, for all strings \(c\), the verifier must reject \((x,c)\) in time \(T(|x|)\).

This is the same as saying there is a nondeterministic \(T(n)\)-time algorithm for \(D\), viewing \(c\) as the ‘guess’ and the verifier as the ‘check’ of the nondeterministic algorithm.

For a field \(\mathbb{F}\) or semiring \(\mathbb{K}\), we denote by \(\mathrm{op}(\mathbb{F})\) or \(\mathrm{op}(\mathbb{K})\), respectively, the time required to perform arithmetic operations in it.

Our certificate schemes build on existing algorithms for deciding emptiness and equivalence. In order to certify (non)emptiness of weighted automata, our first ingredient is the certificate scheme for the NFA acceptance problem from [12]. This scheme generalises to certifying whether the value of a weighted automata over a semiring \(\mathbb{K}\) on a word is zero or not, as follows.

¿tbl:tab:section6? summarises the complexity of certification for evaluation of weighted automata, and the emptiness, non-emptiness, and equivalence problems for weighted automata over fields. We also highlight the special cases of NFA and XNFA for the same. The bounds for NFA emptiness and non-emptiness certification (marked with a \(^\dagger\) in the table) are folklore.

5pt

Certificate-verification time bounds of Section [sec:sec:certificates95for95the95acceptance95and95value95problems] instantiated for general weighted automata (WA), NFA, and XNFA. Here \(n=|Q|\), \(\omega \le 2.38\) is the matrix-multiplication exponent, and \(|w|\) is the input length for the value problem.
NFA \((\mathbb{B})\) XNFA \((\mathrm{GF}(2))\)
([obs:cert-acc-rej]) \(\O{|\Sigma|(|w|\,n^{\omega-1}{+}n^{\omega})}\) \(\O{|\Sigma|(|w|\,n^{\omega-1}{+}n^{\omega})}\)
\(\O{n+|\delta|}^\dagger\) \(\O{|\Sigma|\,n^{\omega}}\)
(l7.5pt)1-4 \(\O{|\Sigma|\,n^{2}}\)
([thm:nonemp]) \(\O{n \log(\delta)} ^\dagger\) \(\O{|\Sigma|\,n^{\omega}}\)
([cor:equiv]) PSpace-complete [10] \(\O{|\Sigma|\,n^{\omega}}\)

Given a weighted automaton \(A\) over a semiring \(\mathbb{K}\) with \(n\) states over an alphabet \(\Sigma\), and a word \(w\), we can certify whether the value of \(A\) on \(w\) is \(A(w)\) in \(O(|\Sigma| \, (|w|\, n^{\omega-1} + n^{\omega}) \cdot \mathrm{op}(\mathbb{K}))\) time, where \(\omega\) is the matrix multiplication exponent for \(\mathbb{K}\).

Proof (sketch). Let \(v^T\) denote the transpose of the vector \(v\). Let us define configurations in \(A\) to be \(n\)-dimensional column vectors over \(\mathbb{K}\). Define the configuration of \(A\) on reading \(w\) to be the column vector \(\mathsf{conf}(w) = (\lambda \cdot \Delta_{w_1}\cdot \ldots \cdot \Delta_{w_k})^T\), where \(w = w_1 \ldots w_k\), \(w_i \in \Sigma\). The components of such a configuration represent the weight accumulated at each state on reading \(w\).

The certificate used in [12] is a set of \(n\)-dimensional bit-vectors, the \(i\)th vector representing the set of states reachable in \(A\) after having read the \(i\) length prefix of \(w\). For us, these are the configurations of \(A\) for each prefix of \(w\).

To verify that the certificate is the set \(\{ \mathsf{conf}(u)\mid u \text{ prefix of } w\}\), we check that each \(v_{i+1}\) is the product \(v_i^T \cdot \Delta_{w_i}\). Instead of verifying these vector-matrix multiplications one by one, we group them according to the letter being read, and verify them together using one matrix-matrix multiplication. Lastly, we ensure that the transpose of the first vector is \(\lambda\), and verify that \(v_{|w|}\cdot \gamma = A(w)\). To achieve the running time bound of \(O(|\Sigma| \, (|w|\, n^{\omega-1} + n^{\omega}) \cdot \mathrm{op}(\mathbb{K}))\) some further case analysis is required, for further details see [12]. ◻

This approach specialises naturally to certifying whether an XNFA accepts a given word \(w\).

Theorem 3. Given a weighted automaton \(A\) over a field \(\mathbb{F}\) with \(n\) states over an alphabet \(\Sigma\), we can certify in \(O(|\Sigma| \, n^{\omega} \cdot \mathrm{op}(\mathbb{F}))\) time that \(A(w) = 0\) for all words \(w \in \Sigma^*\), where \(\omega\) is the matrix multiplication exponent for \(\mathbb{F}\).

Proof. Given a set \(X \subseteq \mathbb{F}^n\) of vectors, let the \(\mathbb{F}\)-linear span (or span, for short) of \(X\) be denoted by \(\mathsf{span}(X) = \{v \in \mathbb{F}^n \mid v = \sum_{x \in X} c_x x \text{ where for all } x \text{ in }X\text{, }c_x \in \mathbb{F}\}\).

We define the set of reachable configurations of \(A\) to be \(\mathsf{Reach} = \{\mathsf{conf}(w) \mid w \in \Sigma^*\}\).

The certificate consists of \((|\Sigma|+1)\) matrices of size \(n \times n\), namely a matrix \(U\) and matrices \(M_{\sigma}\) for all \(\sigma \in \Sigma\). The columns of \(U\) are vectors \(u_1, \ldots , u_n\). Intuitively, we guess \(U\) to represent a basis for the linear span of \(\mathsf{Reach}\). (The set \(\mathsf{span(Reach)}\) is known as the forward space of \(A\); see, e.g., [24]. If it has dimension \(k < n\), then \(u_{k+1} = u_{k+2}= \ldots = u_n = \vec{0}\).) For each \(\sigma \in \Sigma\), the matrix \(M_{\sigma}\) is a matrix of coefficients.

In order to certify that \(A\) evaluates to \(0\) on every word, the verifier ensures that \(u_1^T\) is \(\lambda\), that \(U^T \cdot \gamma = \vec{0}\), and that \(U^T \cdot \Delta_\sigma = M_{\sigma} \cdot U\) for all \(\sigma \in \Sigma\).

Indeed, if \(A\) evaluates to \(0\) on every word, then all of \(\mathsf{Reach}\) is orthogonal to \(\gamma\). In particular, if we choose a basis of \(\mathsf{span}(\mathsf{Reach})\) that contains \(\lambda^T\), and build a matrix \(U\) whose columns are the elements of this basis, then every column of \(U\) is orthogonal to \(\gamma\). For all \(\sigma\) in \(\Sigma\), since \(\mathsf{Reach}\) is closed under multiplication by the transition matrix \(\Delta_\sigma\), every column of \(U\) when multiplied by \(\Delta_\sigma\) must be an \(\mathbb{F}\)-linear combination of the columns of \(U\). Hence, there must be a matrix of coefficients \(M_{\sigma}\) such that \(U^T \cdot \Delta_\sigma = M_{\sigma} \cdot U\). The certificate consisting of \(U\) and these \(M_{\sigma}\) for each \(\sigma\) in \(\Sigma\) is accepted by the verifier.

Conversely, if the verifier accepts \(A\) alongside (\(|\Sigma|+1\)) matrices \((U, \{M_{\sigma}\}_{\sigma \in \Sigma})\), then since \(\lambda^T\) is a column vector of \(U\), and the span of the column vectors of \(U\) is closed under multiplication by transition matrices, the span of the columns of \(U\) contains \(\mathsf{span}(\mathsf{Reach})\). But we know that the column vectors of \(U\) are all orthogonal to \(\gamma\), hence all of \(\mathsf{Reach}\) must be orthogonal to \(\gamma\). Therefore \(A\) must evaluate to \(0\) on every word.

Overall, this requires at most \(O(|\Sigma|)\) many square matrix multiplications, so this verifier runs in \(O(|\Sigma| \, n^{\omega} \cdot \mathrm{op}(\mathbb{F}))\) time, where \(\omega\) is the matrix multiplication exponent for \(\mathbb{F}\). ◻

The computation of matrix multiplication in our verifier is not fully necessary: it can be replaced by verification of matrix products (as long as the product is supplied as part of the certificate). Given matrices \(U\), \(V\), \(W\), a verifier checks if \(U \cdot V = W\). In the 1970s, Freivalds [38] famously gave a simple randomised verifier with running time \(O(n^2)\) and one-sided error. For Theorem 3, this reduces the running time to \(O(|\Sigma| \, n^2)\) at the cost of introducing a small chance that an invalid certificate is incorrectly accepted. (This is a Merlin–Arthur [39] protocol for weighted automaton zero-ness.)

Despite recent developments [40], [41], we are not aware of a deterministic algorithm for the verification of matrix multiplication with worst-case below \(n^\omega\).

For our next result, we use a standard upper bound on the length of the shortest word with non-zero value by a weighted automaton over a field; see, e.g., [3], [24], [42].

Lemma 4 ([3], [24], [42]). If a weighted automaton \(A\) over a field \(\mathbb{F}\) with \(n\) states evaluates to a non-zero value for some word, then there is a word with non-zero value with at most \(n\) letters.

Theorem 4. Given a weighted automaton \(A\) over a field \(\mathbb{F}\) with \(n\) states over an alphabet \(\Sigma\), we can certify in time \(O(|\Sigma| \, n^{\omega} \cdot \mathrm{op}(\mathbb{F}))\) the existence of \(w \in \Sigma^*\) such that \(A(w)\) is nonzero, where \(\omega\) is the matrix multiplication exponent for \(\mathbb{F}\).

Proof of 4. By 4, if \(A\) evaluates to a non-zero value on some word, there is such a word \(w\) with at most \(n\) letters. The certificate consists of \(w\) and the reachability configuration vectors for the run of \(A\) on \(w\). After guessing \(w\) and its \(n\) reachability configuration vectors, we simply run the verifier for weighted automata ([obs:cert-acc-rej]). ◻

This allows us to certify the equivalence of weighted automata over fields, by constructing the weighted automaton for the difference.

Corollary 6. Given two weighted automata \(A\) and \(B\) over a field \(\mathbb{F}\) with \(n\) states over an alphabet \(\Sigma\), we can certify in time \(O(|\Sigma| \, n^{\omega} \cdot \mathrm{op}(\mathbb{F}))\) that \(A(w) = B(w)\) for all \(w \in \Sigma^*\), where \(\omega\) is the matrix multiplication exponent for \(\mathbb{F}\).

All of these certification schemes specialise to the case of XNFA emptiness (or equivalence). Using the above approach, we can even certify whether a given XNFA accepts every word, i.e., (non)universality, by checking equivalence with an XNFA that accepts every word.

These subcubic certificate schemes have a consequence in fine-grained complexity. As a direct consequence of 3 and 4 (and 6) and Theorem 5.1 by Carmosino et al. [28], we have:

Corollary 7 (Informal version). Suppose there is a deterministic Turing reduction from SAT to weighted automaton emptiness (or equivalence) over a field \(\mathbb{F}\) such that, for every \(\varepsilon > 0\), every \(O((|\Sigma|n^{3}\cdot\mathrm{op}(\bF))^{1 - \varepsilon})\) time algorithm for weighted automaton emptiness (or equivalence) when composed with this reduction yields an \(\function{\mathrm{O}}{2^{n (1-\delta)}}\) time algorithm for SAT for some \(\delta >0\). Then NSETH is false.

The formal version of this statement can be found in the appendix. NSETH being false would mean there is a nondeterministic algorithm deciding propositional tautologies in time \(\function{\mathrm{O}}{2^{n (1-\delta)}}\) for some \(\delta > 0\), where \(n\) is the number of variables.

7 Open problems↩︎

We leave it open whether our randomised reduction can be made deterministic (error-less) or many-one, instead of making \(k\) oracle calls to XNFA Acceptance. Finding a fine-grained reduction in the other direction is also of interest. We do not know of problems that are provably hard for XNFA, but not for NFA. Minimal XNFA and minimal DFAs are linked: if we determinise a minimal XNFA, then we obtain the corresponding minimal DFA [4].

Our work raises the question whether parity acceptance can circumvent existing complexity obstacles. Is it possible to use our reduction to refute the NFA Acceptance hypothesis [12], or is XNFA acceptance equally hard in a fine-grained sense? In the case \(|\Sigma| = 1\), both NFA and XNFA acceptance can be solved in time \(O(|Q|^\omega \log|w|)\), see [30].

Without the assumption of polynomial ambiguity, NFA Acceptance still reduces to the non-zeroness of a polynomial, but the variables must no longer be commuting. The obstacle to overcome (or avoid) here is the high running time (on this polynomial) of state-of-the-art methods for non-commutative polynomial identity testing.

8 Reduction from NFA Acceptance to XNFA Acceptance↩︎

Here we detail the construction of a \(k\)-XNFA that simulates the evaluation of a weighted automaton over \(\mathrm{GF(2^k)}\).

Definition 6 (Coordinate simulation). Given a weighted automaton \(A_{\function{\mathbb{F}}_{}{}}\) over \(\mathrm{GF}(2^k)\), we construct a \(k\)-XNFA \(B\) in the following way:

  1. **Representation.* Find an irreducible polynomial \(f(y)\in\mathrm{GF}(2)[y]\) of degree \(k\), so that the fields \(\mathrm{GF}(2^k)\) and \(\mathrm{GF}(2)[y]/\langle f\rangle\) are isomorphic, and use the basis \(1, y, \ldots, y^{k-1}\). Note that \(\mathrm{GF}(2)[y]/\langle f\rangle\) and \(\mathrm{GF}(2)^k\) are isomorphic vector spaces, and let \(\mathrm{toVec}\colon \mathrm{GF}(2^k) \to \mathrm{GF}(2)^k\) be the composition of these isomorphisms.*

  2. **Matrix computation.* For each of the (at most) \(|\delta|\) transitions of \(A_{\function{\mathbb{F}}_{}{}}\), with weight \(g\in\mathrm{GF}(2^k)\), compute the \(k\times k\) matrix \(M_g\) representing \(h\mapsto g\cdot h\) in the basis \(1, y, \ldots, y^{k-1}\). The \(i\)th column of \(M_g\) is obtained by multiplying \(g\) by \(y^{i-1}\) to produce a polynomial of degree at most \(2k-2\), and then reducing the result modulo \(f\).*

  3. **Assembly.* Label each original transition in \(A_F\) carrying weight \(g\) with the transpose \(M_g^{\mathsf T}\) of the matrix computed in step (2) (so that, for a row vector \(\mathrm{toVec}(h)\cdot M_g^{\mathsf T} = \mathrm{toVec}(g\cdot h)\), it is consistent with the row vector acceptance of Definition 5). Replicate each state \(q\) into \(k\) field-component states \(S_q = \{q_1,\ldots,q_k\}\).*

    The initial vector of \(A_{\function{\mathbb{F}}_{}{}}\) is expanded coordinatewise, yielding \(\lambda_B \in \mathrm{GF}(2)^{1\times k\cdot|Q|}\). The final matrix \(\gamma_B \in \mathrm{GF}(2)^{k|Q|\times k}\) is defined blockwise: since the final weights are \(0\) or \(1\), the \(q\)th \(k\times k\) block of \(\gamma_B\) is \(I_k\) if \(\gamma_q=1\), and \(0_{k\times k}\) otherwise.

This produces a \(k\)-XNFA with \(k\cdot |Q|\) states; since each \(M_r\) contributes at most \(k^2\) non-zero entries, the total number of transitions is at most \(k^2\cdot |\delta|\).

Lemma 5 (Coordinate simulation). Let \(\function{\mathbb{F}}_{}{} = \mathrm{GF}(2^k)\). Given a weighted automaton \(A_{\function{\mathbb{F}}_{}{}}\) over \(\function{\mathbb{F}}_{}{}\) with \(|Q|\) states and \(|\delta|\) transitions, and with all entries in the initial and final vectors being 0 or 1, 6 produces a \(k\)-XNFA\(B\) such that, for every \(w\) , the row vector

\(B(w)\) equals the coordinate vector of \(A_{\function{\mathbb{F}}_{}{}}(w)\) with respect to a chosen basis of \(\function{\mathbb{F}}_{}{}\).

In particular, \(B\) accepts \(w\) (under the generalised parity acceptance condition) if and only if \(A_{\function{\mathbb{F}}_{}{}}(w) \ne 0\).

Proof. Fix a basis \(b_1,\dots,b_k\) of \(F\) over \(\mathrm{GF}(2)\). The proof is by induction on the length of the prefix of the input word \(w = a_1 a_2 \cdots a_\ell\). The invariant is that \(\mathrm{toVec}\big((\lambda_A \prod_{j\le i}\Delta_A(a_j))[q]\big) = (\lambda_B \prod_{j\le i}\Delta_B(a_j))[S_q]\), where the \([S_q]\) notation selects only the entries corresponding to states \(S_q\).

For each \(r \in \function{\mathbb{F}}_{}{}\) the map \(g \mapsto r\cdot g\) is \(\mathrm{GF}(2)\)-linear and is represented on column coordinate vectors by a \(k\times k\) matrix \(M_r\); since \(B\) propagates a row vector, the corresponding block is \(M_r^{\mathsf T}\), which gives \(\mathrm{toVec}(c_p)\cdot M_r^{\mathsf T} = \mathrm{toVec}(r\cdot c_p)\) and so preserves the invariant. The final multiplication by \(\gamma_B\) then sums exactly the coordinate vectors of the field values accumulated at the final states of \(A_F\).

The evaluation of \(B\) on \(w\) therefore returns exactly the coordinate vector of \(A_F(w)\) in the basis \(b_1,\dots,b_k\). This vector is non-zero in \(\mathrm{GF}(2)^k\) if and only if \(A_F(w) \ne 0\) in \(F\), which is the acceptance condition of \(B\). ◻

Lemma 6 (Efficiency of the simulation). Given \(A_{\function{\mathbb{F}}_{}{}}\) as in 5, the \(k\)-XNFA\(B\) of that lemma can be constructed in time \(O(|\delta|\cdot\mathrm{poly}(k))\).

Proof. We refer to 6 for the three steps.

Step (1) contributes \(\mathrm{poly}(k)\). Indeed, note that we can find an \(k\)-th degree irreducible polynomial in time polynomial in \(k\) (see, e.g., [43]).

Step (2) contributes \(O(|\delta|\cdot \mathrm{poly}(k))\) (at most \(|\delta|\) matrices, each computable in \(\mathrm{poly}(k)\) time). In this computation, reducing modulo \(f\) a polynomial of degree at most \(2 k - 2\) takes time polynomial in \(k\).

Step (3) has a running time that is linear in the output size, \(O(|\delta|\cdot k^2)\). The total is \(O(|\delta|\cdot \mathrm{poly}(k))\). ◻

Next, we decompose the \(k\)-XNFA we created into \(k\) XNFA.

Proof. By definition, \(A\) accepts \(w = a_1 \cdots a_l\) iff the row vector \(v := \lambda \cdot \Delta_{a_1} \cdots \Delta_{a_l} \cdot \gamma \in \mathrm{GF}(2)^{1\times k}\) is non-zero, i.e., iff at least one of its \(k\) coordinates is non-zero. The \(i\)-th coordinate of \(v\) is \(\lambda \cdot \Delta_{a_1} \cdot\ldots\cdot \Delta_{a_l} \cdot \gamma_i\), which is exactly the acceptance expression of \(A_i\). Hence, \(A\) accepts \(w\) iff at least one \(A_i\) does. The equality of state sets and transition matrices is immediate from the definition of \(A_i\). ◻

The decomposition of [lem:decompose] does not incur a significant complexity blow-up: all automata \(A_i\) share the same state set and transition structure and differ only in their accepting states. In fact, if we determinise a \(k\)-XNFA, we obtain the same DFA as when we determinise any one of the \(A_i\)’s, but a state in the DFA is declared final if and only if it is final in at least one of the determinised \(A_i\)’s. Thus, when determinising a \(k\)-XNFA with \(n^\prime\) states, we obtain a DFA with at most \(2^{n'}\) states.

As a direct consequence of 2, we have the following:

Corollary 8. With the assumptions as in 2, let \(\eta\in(0,1)\) and suppose \(k \ge \left\lceil \log_2\left(\frac{|w|}{\eta}\right)\right\rceil\). If \(A\) accepts \(w\), then at least one of the constructed XNFA accepts \(w\) with probability at least \(1-\eta\).

By the reduction presented in 2, we can also conclude the following:

Corollary 9. Suppose that, for some real \(\varepsilon>0\), there is an algorithm that decides XNFA Acceptance for every XNFA \(C\) with transition relation \(\delta^{(C)}\) and every input word \(u\) in time \(O\bigl((|\delta^{(C)}|\cdot|u|)^{1-\varepsilon}\bigr)\). Then, for every \(\eta\in(0,1)\), the acceptance problem for a polynomially ambiguous NFA \(A\) with transition relation \(\delta\) and input word \(w\) admits a randomised algorithm with one-sided error at most \(\eta\) and running time \(O\!\bigl(|\delta|\cdot\mathrm{poly}(k) + |w|\,k + k\cdot\bigl((k^{2}\cdot|\delta|)\,|w|\bigr)^{1-\varepsilon}\bigr)\), where \(k=\lceil\log_2(|w|/\eta)\rceil\). In particular, for constant \(\eta\) this is \(\widetilde{O}\bigl(|\delta| + |w| + (|\delta|\cdot|w|)^{1-\varepsilon}\bigr)\), where \(\widetilde{O}\) hides polylogarithmic factors in \(|w|\).

Proof. If \(w=\varepsilon\), acceptance can be checked directly from the initial and final states; thus, assume \(w\in\Sigma^+\). Choose \(k=\left\lceil \log_2\left(\frac{|w|}{\eta}\right)\right\rceil\). Then \(2^k\ge \frac{|w|}{\eta}\), and hence \(\frac{|w|}{2^k} \le \eta\). By Theorem 2, if the original NFA rejects \(w\), then all constructed XNFA reject \(w\) with probability \(1\). If the original NFA accepts \(w\), then at least one of the constructed XNFA accepts \(w\) with probability at least \(1-\eta\).

By Theorem 2, each constructed XNFA has at most \(k^2\cdot |\delta|\) transitions, and there are \(k\) such XNFA. Running the assumed XNFA Acceptance algorithm on each of them, therefore, takes time \(\function{\mathrm{O}}{k\cdot (k^2\cdot|\delta|\cdot|w|)^{1-\varepsilon}}\). The construction itself takes time \(O(|\delta|\cdot\operatorname{poly}(k))\) by Theorem 2. For constant \(\eta\), we have \(k=O(\log |w|)\); thus, the first term is \(\widetilde{O}(|\delta|)\) and the second term is \(\widetilde{O}((|\delta|\cdot|w|)^{1-\varepsilon})\). The term \(O(|w| k)\) accounts for preparing the \(k\) instances of XNFA Acceptance, namely for the time needed to write the input word \(w\). ◻

9 Certificates for acceptance and emptiness↩︎

Proof of 6. Given weighted automata \(A\) and \(B\), the weighted automaton made by simply placing \(A\) and \(B\) side by side computes the difference of the values of \(A\) and \(B\) on each word. To verify that this weighted automaton always evaluates to zero, we use 3. ◻

The subcubic certificate schemes we provide have a consequence in fine-grained complexity. We recall the following two popular fine-grained complexity hypotheses:

Hypothesis 1 (SETH = Strong Exponential Time Hypothesis [44]). For every \(\varepsilon > 0\), there exists a \(k\) such that \(k\)-SAT is not in \(\mathsf{DTIME}[2^{n(1-\varepsilon)}]\), where \(k\)-SAT is the language of all satisfiable Boolean formulas in \(k\)-CNF.

Here and below, \(n\) is the number of Boolean variables in the formula.

The following hypothesis strengthens SETH even further.

Hypothesis 2 (NSETH = Non-deterministic Strong Exponential Time Hypothesis [28]). For every \(\varepsilon > 0\), there exists a \(k\) such that \(k\)-TAUT is not in \(\mathsf{NTIME}[2^{n(1-\varepsilon)}]\), where \(k\)-TAUT is the language of all tautological Boolean formulas in \(k\)-DNF.

Theorem 5.1 by Carmosino et al. [28] states that if a problem \(\Pi\) has a certificate scheme that runs in a time bound \(T\), i.e. if \(\Pi \in \mathsf{NTIME}(T) \cap \mathrm{co\text{-}\mathsf{NTIME}(T)}\), then a SETH based lower bound that shows hardness stronger than \(T\) would contradict NSETH. The idea is that by composing such a reduction from SAT to \(\Pi\) with the certification scheme, one could obtain a faster nondeterministic algorithm for deciding if a Boolean formula is a tautology.

We have a certificate scheme (a nondeterministic and co-nondeterministic algorithm) for XNFA emptiness (and equivalence) that runs in \(O(|\Sigma|n^{\omega})\). Hence, we obtain the following corollary as a direct consequence of 3 and 4 (and 6) and Theorem 5.1 by Carmosino et al. [28]:

Corollary 10. For every \(\gamma>0\), suppose there is a deterministic Turing reduction from SAT to weighted automaton emptiness (or equivalence) over a field \(\mathbb{F}\). Let \(\omega\) be the matrix multiplication exponent for \(\mathbb{F}\) and \(\mathrm{op}(\mathbb{F})\) be the time taken to perform field operations in \(\mathbb{F}\).

Moreover, suppose that for every \(\varepsilon >0\) there exists a \(\delta>0\) such that any \(O((|\Sigma|n^{\omega + \gamma} \cdot \mathrm{op}(\mathbb{F}))^{1 - \varepsilon})\) time algorithm for weighted automaton emptiness (or equivalence) when composed with this reduction yields an \(O(2^{n (1-\delta)})\) time algorithm for SAT. Then NSETH is false.

That is, if we could prove hardness above \(\Omega(|\Sigma|n^{\omega} \cdot \mathrm{op}(\mathbb{F}))\) for weighted automaton emptiness (or equivalence) subject to SETH, then NSETH fails.

Intuitively, NSETH being false would mean there is a proof system for \(n\)-variable propositional tautologies which has complexity \(\function{\mathrm{O}}{2^{n (1-\delta)}}\) for some fixed \(\delta > 0\). Further consequences of NSETH failure are discussed in [28].

References↩︎

[1]
Carsten Damm. Problems complete for \(\oplus L\). Information Processing Letters, 36(5):247–250, 1990. https://doi.org/10.1016/0020-0190(90)90150-V.
[2]
Neil Immerman and Susan Landau. The complexity of iterated multiplication. Inf. Comput., 116(1):103–116, 1995. https://doi.org/10.1006/INCO.1995.1007.
[3]
Marcel Paul Schützenberger. On the definition of a family of automata. Information and Control, 4(2-3):245–270, 1961. https://doi.org/10.1016/S0019-9958(61)80020-X.
[4]
Brink van der Merwe, Hellis Tamm, and Lynette van Zijl. Minimal DFA for symmetric difference NFA. In 14th International Workshop on the Descriptional Complexity of Formal Systems, DCFS 2012, volume 7386 of Lecture Notes in Computer Science, pages 307–318. https://doi.org/10.1007/978-3-642-31623-4_24.
[5]
Jean Vuillemin and Nicolas Gama. Compact normal form for regular languages as xor automata. In 14th International Conference on Implementation and Application of Automata , CIAA 2009, volume 5642 of Lecture Notes in Computer Science, pages 24–33. https://doi.org/10.1007/978-3-642-02979-0_6.
[6]
Dana Angluin, Timos Antonopoulos, Dana Fisman, and Nevin George. Representing regular languages of infinite words using mod 2 multiplicity automata. In Foundations of Software Science and Computation Structures - 25th International Conference, FOSSACS 2022, volume 13242 of Lecture Notes in Computer Science, pages 1–20. https://doi.org/10.1007/978-3-030-99253-8_1.
[7]
Lynette van Zijl. On binary \(\oplus\)-NFAs and succinct descriptions of regular languages. Theor. Comput. Sci., 2004, 328(1-2):161–170. https://doi.org/10.1016/J.TCS.2004.07.012.
[8]
Lynette van Zijl and Jaco Geldenhuys. Symmetric difference NFA: the state of the art. In Formal Aspects of Computing: Essays dedicated to Derrick Kourie on the occasion of the 65th birthday, pages 77–92. 2013. URL: http://www.cs.sun.ac.za/j̃aco/PAPERS/vzg13.pdf.
[9]
A. Cardon and Maxime Crochemore. Détermination de la représentation standard d’une série reconnaissable. RAIRO Theor. Informatics Appl., 14(4):371–379, 1980. https://doi.org/10.1051/ITA/1980140403711.
[10]
Tao Jiang and Bala Ravikumar. Minimal NFA problems are hard. SIAM J. Comput., 22(6):1117–1141, 1993. https://doi.org/10.1137/0222067.
[11]
Artem Kaznatcheev and Prakash Panangaden. Weighted automata are compact and actively learnable. Inf. Process. Lett., 171:106133, 2021. https://doi.org/10.1016/J.IPL.2021.106133.
[12]
Karl Bringmann, Allan Grønlund, Marvin Künnemann, and Kasper Green Larsen. . In 15th Innovations in Theoretical Computer Science Conference (ITCS 2024), volume 287 of Leibniz International Proceedings in Informatics (LIPIcs), pages 22:1–22:25. https://doi.org/10.4230/LIPIcs.ITCS.2024.22.
[13]
Virginia Vassilevska Williams. On some fine-grained questions in algorithms and complexity. In Proceedings of the International Congress of Mathematicians (ICM 2018), pages 3447–3487. Available at https://people.csail.mit.edu/virgi/eccentri.pdf. https://doi.org/10.1142/9789813272880_0188.
[14]
Andreas Weber and Helmut Seidl. On the degree of ambiguity of finite automata. Theor. Comput. Sci., 88(2):325–349, 1991. https://doi.org/10.1016/0304-3975(91)90381-B.
[15]
Karolina Drabik, Anita Dürr, Fabian Frei, Filip Mazowiecki, and Karol Wegrzycki. Fine-grained complexity of ambiguity problems on automata and directed graphs. CoRR, abs/2501.14725, 2025. https://arxiv.org/abs/2501.14725, https://doi.org/10.48550/ARXIV.2501.14725.
[16]
Laure Daviaud. Containment and equivalence of weighted automata: Probabilistic and max-plus cases. In Language and Automata Theory and Applications - 14th International Conference, LATA 2020, volume 12038 of Lecture Notes in Computer Science, pages 17–32. Springer, 2020. https://doi.org/10.1007/978-3-030-40608-0_2.
[17]
Laure Daviaud, Marcin Jurdzinski, Ranko Lazic, Filip Mazowiecki, Guillermo A. Pérez, and James Worrell. When are emptiness and containment decidable for probabilistic automata? J. Comput. Syst. Sci., 119:78–96, 2021. https://doi.org/10.1016/J.JCSS.2021.01.006.
[18]
Nathanaël Fijalkow, Cristian Riveros, and James Worrell. Probabilistic automata of bounded ambiguity. Inf. Comput., 282:104648, 2022. https://doi.org/10.1016/J.IC.2020.104648.
[19]
Agnishom Chattopadhyay, Filip Mazowiecki, Anca Muscholl, and Cristian Riveros. Pumping lemmas for weighted automata. Log. Methods Comput. Sci., 17(3), 2021. https://doi.org/10.46298/LMCS-17(3:7)2021.
[20]
Thomas Colcombet. Unambiguity in automata theory. In Descriptional Complexity of Formal Systems - 17th International Workshop, DCFS 2015, volume 9118 of Lecture Notes in Computer Science, pages 3–18. Springer, 2015. https://doi.org/10.1007/978-3-319-19225-3_1.
[21]
Stefan Kiefer and Andrew Ryzhikov. . In 42nd International Symposium on Theoretical Aspects of Computer Science (STACS 2025), volume 327, pages 61:1–61:22, 2025. https://doi.org/10.4230/LIPIcs.STACS.2025.61.
[22]
Albert R. Meyer and Larry J. Stockmeyer. The equivalence problem for regular expressions with squaring requires exponential space. In 13th Annual Symposium on Switching and Automata Theory, 1972, pages 125–129. https://doi.org/10.1109/SWAT.1972.29.
[23]
Wen-Guey Tzeng. A polynomial-time algorithm for the equivalence of probabilistic automata. SIAM J. Comput., 21(2):216–227, 1992. https://doi.org/10.1137/0221017.
[24]
Stefan Kiefer. Notes on equivalence and minimization of weighted automata. CoRR, abs/2009.01217, 2020. URL: https://arxiv.org/abs/2009.01217, https://arxiv.org/abs/2009.01217.
[25]
Wen-Guey Tzeng. On path equivalence of nondeterministic finite automata. Inf. Process. Lett., 58(1):43–46, 1996. https://doi.org/10.1016/0020-0190(96)00039-7.
[26]
Stefan Kiefer, Andrzej S. Murawski, Joël Ouaknine, Björn Wachter, and James Worrell. . Logical Methods in Computer Science, 9(1), 2013. https://doi.org/10.2168/LMCS-9(1:8)2013.
[27]
Marek Cerný and Tim Seppelt. Homomorphism indistinguishability, multiplicity automata equivalence, and polynomial identity testing. In 43rd International Symposium on Theoretical Aspects of Computer Science, STACS 2026, pages 25:1–25:20. https://doi.org/10.4230/LIPICS.STACS.2026.25.
[28]
Marco L. Carmosino, Jiawei Gao, Russell Impagliazzo, Ivan Mihajlin, Ramamohan Paturi, and Stefan Schneider. Nondeterministic extensions of the strong exponential time hypothesis and consequences for non-reducibility. In Proceedings of the 2016 ACM Conference on Innovations in Theoretical Computer Science, page 261–270. https://doi.org/10.1145/2840728.2840746.
[29]
George Karakostas, Richard J. Lipton, and Anastasios Viglas. On the complexity of intersecting finite state automata and NL versus NP. Theor. Comput. Sci., 302(1-3):257–274, 2003. https://doi.org/10.1016/S0304-3975(02)00830-7.
[30]
Aaron Potechin and Jeffrey O. Shallit. Lengths of words accepted by nondeterministic finite automata. Inf. Process. Lett., 162:105993, 2020. https://doi.org/10.1016/J.IPL.2020.105993.
[31]
Amir Abboud, Shon Feller, and Oren Weimann. On the fine-grained complexity of parity problems. In 47th International Colloquium on Automata, Languages, and Programming, ICALP 2020, volume 168 of LIPIcs, pages 5:1–5:19. https://doi.org/10.4230/LIPICS.ICALP.2020.5.
[32]
Kasper Green Larsen and R. Ryan Williams. Faster online matrix-vector multiplication. In Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2017, pages 2182–2189. https://doi.org/10.1137/1.9781611974782.142.
[33]
Arturs Backurs and Christos Tzamos. Improving Viterbi is hard: Better runtimes imply faster clique algorithms. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, volume 70 of Proceedings of Machine Learning Research, pages 311–321. URL: http://proceedings.mlr.press/v70/backurs17a.html.
[34]
Daniel Krob. The equality problem for rational series with multiplicities in the tropical semiring is undecidable. International Journal of Algebra and Computation, 4:405–425, 1994. https://doi.org/10.1142/S0218196794000063.
[35]
Shaull Almagor, Udi Boker, and Orna Kupferman. What’s decidable about weighted automata? Inf. Comput., 282:104651, 2022. https://doi.org/10.1016/J.IC.2020.104651.
[36]
Dana Moshkovitz. An alternative proof of the Schwartz-Zippel lemma. Electron. Colloquium Comput. Complex., TR10-096, 2010. URL: https://eccc.weizmann.ac.il/report/2010/096.
[37]
Jacob T. Schwartz. Fast probabilistic algorithms for verification of polynomial identities. J. ACM, 27(4):701–717, 1980. https://doi.org/10.1145/322217.322225.
[38]
Rusins Freivalds. Fast probabilistic algorithms. In Mathematical Foundations of Computer Science 1979, volume 74 of Lecture Notes in Computer Science, pages 57–69. Springer, 1979. https://doi.org/10.1007/3-540-09526-8_5.
[39]
László Babai. Trading group theory for randomness. In Proceedings of the 17th Annual ACM Symposium on Theory of Computing, 1985, pages 421–429. https://doi.org/10.1145/22145.22192.
[40]
Marvin Künnemann. On nondeterministic derandomization of Freivalds’ algorithm: Consequences, avenues and algorithmic progress. In 26th Annual European Symposium on Algorithms, ESA 2018, volume 112 of LIPIcs, pages 56:1–56:16. https://doi.org/10.4230/LIPIcs.ESA.2018.56.
[41]
Huck Bennett, Karthik Gajulapalli, Alexander Golovnev, and Evelyn Warton. Matrix multiplication verification using coding theory. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, APPROX/RANDOM 2024, volume 317 of LIPIcs, pages 42:1–42:13. https://doi.org/10.4230/LIPICS.APPROX/RANDOM.2024.42.
[42]
Azaria Paz. Introduction to Probabilistic Automata. Computer Science and Applied Mathematics. Academic Press, New York, 1971.
[43]
Victor Shoup. Fast construction of irreducible polynomials over finite fields. In Proceedings of the Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’93, page 484–492, 1993. https://doi.org/10.1006/jsco.1994.1025.
[44]
Russell Impagliazzo and Ramamohan Paturi. Complexity of k-sat. In Proceedings of the 14th Annual IEEE Conference on Computational Complexity, 1999, pages 237–240. https://doi.org/10.1109/CCC.1999.766282.