English

#CFG and #DNNF admit FPRAS

Data Structures and Algorithms 2026-05-18 v3

Abstract

We provide the first fully polynomial-time randomized approximation scheme for the following two counting problems: 1. Given a Context Free Grammar GG over alphabet Σ\Sigma, count the number of words of length exactly nn generated by GG. 2. Given a circuit φ\varphi in Decomposable Negation Normal Form (DNNF) over the set of Boolean variables XX, compute the number of assignments to XX such that φ\varphi evaluates to 1. Finding polynomial time algorithms for the aforementioned problems has been a longstanding open problem. Prior work could either only obtain a quasi-polynomial runtime (SODA 1995) or a polynomial-time randomized approximation scheme for restricted fragments, such as non-deterministic finite automata (JACM 2021) or non-deterministic tree automata (STOC 2021).

Keywords

Cite

@article{arxiv.2406.18224,
  title  = {#CFG and #DNNF admit FPRAS},
  author = {Kuldeep S. Meel and Alexis de Colnet},
  journal= {arXiv preprint arXiv:2406.18224},
  year   = {2026}
}

Comments

Full version of the paper published at SODA 2026

R2 v1 2026-06-28T17:19:43.769Z