# Approximate Counting in SMT and Value Estimation for Probabilistic Programs

arXiv: https://arxiv.org/abs/1411.0659 · HTML: https://mlsanity.com/paper/1411.0659/

## Key facts

- Cited by 6 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 3 Nov 2014.

## Built on by (most cited first, 6 of 6)

- [Enhancing SMT-based Weighted Model Integration by Structure Awareness](https://mlsanity.com/paper/2302.06188/) (2023)
- [Probabilistic ML Verification via Weighted Model Integration](https://mlsanity.com/paper/2402.04892/) (2024)
- [Entailment vs. Verification for Partial-assignment Satisfiability and Enumeration](https://mlsanity.com/paper/2503.01536/) (2025)
- [Approximate SMT Counting Beyond Discrete Domains](https://mlsanity.com/paper/2507.18612/) (2025)
- [Satisfiability Modulo Theory Meets Inductive Logic Programming](https://mlsanity.com/paper/2512.12918/) (2025)
- [CSB: A Counting and Sampling tool for Bit-vectors](https://mlsanity.com/paper/2607.04142/) (2026)

## Abstract (arXiv)

#SMT, or model counting for logical theories, is a well-known hard problem that generalizes such tasks as counting the number of satisfying assignments to a Boolean formula and computing the volume of a polytope. In the realm of satisfiability modulo theories (SMT) there is a growing need for model counting solvers, coming from several application domains (quantitative information flow, static analysis of probabilistic programs). In this paper, we show a reduction from an approximate version of #SMT to SMT. We focus on the theories of integer arithmetic and linear real arithmetic. We propose model counting algorithms that provide approximate solutions with formal bounds on the approximation error. They run in polynomial time and make a polynomial number of queries to the SMT solver for the underlying theory, exploiting "for free" the sophisticated heuristics implemented within modern SMT solvers. We have implemented the algorithms and used them to solve the value problem for a model of loop-free probabilistic programs with nondeterminism.
