arXiv Science⌕ Search

arXiv · 2611.37245

Approximate Counting for Symbolic Automata

Abstract

Given a nondeterministic finite automaton $\mathcal{A}$ and a length $n$ in unary, the problem #NFA seeks to compute the number of words of length $n$ accepted by $\mathcal{A}$. A celebrated result of Arenas, Croquevielle, Jayaram, and Riveros established that #NFA admits a fully polynomial-time randomized approximation scheme (FPRAS). Subsequent works have brought the running time down to $O(n^2m^3\log(nm)ε^{-2}\log(1/δ))$ for an NFA with $m$ states over a binary alphabet, with relative error at most $ε$ and failure probability at most $δ$. These running-time bounds concern explicitly represented alphabets, whereas automata arising from programs, strings, and structured data are naturally symbolic, i.e., their transitions carry predicates, or guards, over a large concrete alphabet $\mathbb{D}$. In this work, we study #Symbolic-NFA, which asks to count the number of words of a given length accepted by a symbolic NFA. We present a randomized approximation algorithm for this #P-hard problem. We formulate the algorithm using an oracle interface that supports membership testing, approximate counting, and almost-uniform sampling for transition guards. With polynomial-time implementations of these guard operations, the algorithm yields an FPRAS. Our algorithm extends the recent dependent sampling approach of Meel and de Colnet to symbolic automata. Our FPRAS queries only the input guards, avoiding the potentially exponential blowup from constructing Boolean combinations. For an automaton with transition set $Δ$, the algorithm makes $O(n^2|Δ|\log(n|Δ|)ε^{-2}\log(1/δ))$ counting and sampling queries. For constant-size explicit alphabets, our algorithm recovers the above running-time bound for #NFA. We also formalize the core probabilistic analysis, including concentration and confidence amplification, in Lean 4.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Kuldeep S. Meel, Umang Mathur, Alexis de Colnet. 2026-11-27. Approximate Counting for Symbolic Automata. https://doi.org/10.1145/3871764. https://arxiv.science/abs/2611.37245

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite arXiv Science by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

More on Maximally Permissive Similarity Control of Discrete Event Systems

Takai proposed a method for constructing a maximally permissive supervisor for the similarity control problem (IEEE Transactions on Automatic Control, 66(7):3197-3204, 2021). This paper points out that this construction does not(necessarily) work when the specification is not image-finite. Inspired by Takai's construction, the notion of a (saturated) (G, R)-automaton is introduced and metatheorems concerning (maximally permissive) supervisors for the similarity control problem are provided in terms of this notion. As an application of these metatheorems, the flaws in Takai's work are corrected.

cs.FL↗

Machine-Checked Grammar-Constrained Decoding

Grammar-constrained decoding (GCD) restricts a language model's next-token choices so that its output remains extendable to a string accepted by a user-provided grammar. GreatGramma is a compositional GCD algorithm built from automata-theoretic components. We formalize its executable checker in Lean 4 and prove it sound and complete under explicit assumptions on the vocabulary, lexer, parser, and whitespace. To our knowledge, this is the first machine-checked end-to-end correctness proof for a grammar-constrained decoding algorithm for LLMs. The formalization finds an end-of-stream bug in the published lexer construction and makes explicit a universal-assumption needed for the algorithm. The development also includes reusable verified components for finite-state automata and transducers, pushdown automata, parser overapproximations, and graph search.

cs.FL↗

Average-Case Parsing of Unambiguous Context-Free Grammars

We show that every fixed unambiguous context-free grammar admits a deterministic parser with expected running time $O(n^{1.5})$ on a uniformly random word of length $n$. The parser utilizes a certain form of sparsity estimate supplied by the unambiguity itself.

cs.FL↗