CSB: A Counting and Sampling tool for Bit-vectors
This work presents the first systematic solution to the problems of model counting and sampling in the theory of bit-vectors. By leveraging bit-blasting to translate bit-vector formulas into conjunctive normal form (CNF), the approach integrates modern CNF counters and samplers to uniformly support a wide range of modes, including exact and approximate counting, projected and unprojected counting, as well as near-uniform and uniform sampling. The resulting tool, csb, addresses a critical gap in efficient counting and sampling for bit-vector constraints and demonstrates substantial performance advantages over existing methods in empirical evaluations, highlighting its practicality and effectiveness.