An FPRAS and Polynomial-Time Uniform Sampler for Tree Automata

05/20/2020
by   Marcelo Arenas, et al.
0

In this work, we introduce the first fully polynomial time randomized approximation scheme (FPRAS) for counting the number of trees of size n accepted by a tree automaton, where n is given in unary, and the first polynomial time algorithm for sampling uniformly from this set of trees. Our results improve over the prior quasi-polynomial time randomized approximation scheme (QPRAS) and sampling algorithm of Gore, Jerrum, Kannan, Sweedyk, and Mahaney 97'. At the heart of our algorithm is a reduction to the problem of estimating the number of strings of length n accepted by a succinct non-deterministic finite automaton (NFA), which is an NFA where the transitions are labeled by succinctly encoded sets of symbols, whose sizes can be exponential in the encoding length. Assuming these sets of symbols can be efficiently sampled from, and their sizes approximated, we show that there is an FPRAS and polynomial time almost uniform sampler for succinct NFAs, which may be of independent interest. We demonstrate that, by applying our FPRAS for tree automata, we can obtain an FPRAS for many hitherto open problems in the fields of constraint satisfaction problems (CSPs), database systems, software verification, and knowledge compilation. Specifically, we obtain an FPRAS for counting solutions for CSPs that are acyclic or, more generally, that have bounded hypertree-width, which results in an FPRAS for counting the number of answers to conjunctive queries that are acyclic or which have bounded hypertree-width. Moreover, these results can be extended to unions of acyclic conjunctive queries, and to the more general class of unions of conjunctive queries with bounded hypertree-width. Finally, we also obtain FPRAS for the problems of counting the number of error threads in programs with nested call subroutines, and counting valid assignments to structured DNNF circuits.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/21/2019

Efficient Logspace Classes for Enumeration, Counting, and Uniform Generation

In this work, we study two simple yet general complexity classes, based ...
research
11/09/2017

Counting hypergraph colorings in the local lemma regime

We give a fully polynomial-time approximation scheme (FPTAS) to count th...
research
08/18/2023

Counting and Sampling Labeled Chordal Graphs in Polynomial Time

We present the first polynomial-time algorithm to exactly compute the nu...
research
12/23/2021

Learning with distributional inverters

We generalize the "indirect learning" technique of Furst et. al., 1991 t...
research
08/15/2018

Counting Minimal Transversals of β-Acyclic Hypergraphs

We prove that one can count in polynomial time the number of minimal tra...
research
08/27/2019

Counting Candy Crush Configurations

A k-stable c-coloured Candy Crush grid is a weak proper c-colouring of a...
research
12/06/2022

Inapproximability of counting independent sets in linear hypergraphs

It is shown in this note that approximating the number of independent se...

Please sign up or login with your details

Forgot password? Click here to reset