Approximate Counting in SMT and Value Estimation for Probabilistic Programs

#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 a value estimation problem for a model of loop-free probabilistic programs with nondeterminism.

[1]  Corina S. Pasareanu,et al.  Reliability analysis in Symbolic PathFinder , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[2]  Supratik Chakraborty,et al.  Approximate Probabilistic Inference via Word-Level Counting , 2015, AAAI.

[3]  Christos H. Papadimitriou,et al.  Games against nature , 1983, 24th Annual Symposium on Foundations of Computer Science (sfcs 1983).

[4]  Martin E. Dyer,et al.  A random polynomial-time algorithm for approximating the volume of convex bodies , 1991, JACM.

[5]  Annabelle McIver,et al.  Abstraction, Refinement and Proof for Probabilistic Systems , 2004, Monographs in Computer Science.

[6]  Chung-chieh Shan,et al.  Monolingual Probabilistic Programming Using Generalized Coroutines , 2009, UAI.

[7]  J. Filar,et al.  Competitive Markov Decision Processes , 1996 .

[8]  J. Lawrence Polytope volume computation , 1991 .

[9]  V. Klee Can the Measure of ∪ n 1 [ a i , b i ] be Computed in Less Than O(n logn) Steps? , 1977 .

[10]  C. S. Jackson A Problem in Probability , 1913 .

[11]  Oded Goldreich,et al.  Computational complexity: a conceptual perspective , 2008, SIGA.

[12]  Leslie G. Valiant,et al.  The Complexity of Computing the Permanent , 1979, Theor. Comput. Sci..

[13]  Supratik Chakraborty,et al.  A Scalable and Nearly Uniform Generator of SAT Witnesses , 2013, CAV.

[14]  Supratik Chakraborty,et al.  A Scalable Approximate Model Counter , 2013, CP.

[15]  Guy Van den Broeck,et al.  Hashing-Based Approximate Probabilistic Inference in Hybrid Domains , 2015, UAI.

[16]  Mihir Bellare,et al.  Uniform Generation of NP-Witnesses Using an NP-Oracle , 2000, Inf. Comput..

[17]  Dexter Kozen,et al.  Semantics of probabilistic programs , 1979, 20th Annual Symposium on Foundations of Computer Science (sfcs 1979).

[18]  Sanjit A. Seshia,et al.  Distribution-Aware Sampling and Weighted Model Counting for SAT , 2014, AAAI.

[19]  Mark Jerrum,et al.  The Markov chain Monte Carlo method: an approach to approximate counting and integration , 1996 .

[20]  Leonid A. Levin,et al.  Pseudo-random Generation from one-way functions (Extended Abstracts) , 1989, STOC 1989.

[21]  Thomas A. Henzinger,et al.  Probabilistic programming , 2014, FOSE.

[22]  Guy Van den Broeck,et al.  Probabilistic Inference in Hybrid Domains by Weighted Model Integration , 2015, IJCAI.

[23]  Dan Grossman,et al.  Expressing and verifying probabilistic assertions , 2014, PLDI.

[24]  Jörg Hoffmann,et al.  From Sampling to Model Counting , 2007, IJCAI.

[25]  David Monniaux Abstract interpretation of programs as Markov decision processes , 2005, Sci. Comput. Program..

[26]  Somesh Jha,et al.  Satisfiability modulo counting: a new approach for analyzing privacy properties , 2014, CSL-LICS.

[27]  Marcelo d'Amorim,et al.  Compositional solution space quantification for probabilistic software analysis , 2014, PLDI.

[28]  Andrew D. Gordon,et al.  Bayesian inference using data flow analysis , 2013, ESEC/FSE 2013.

[29]  Chung-Kil Hur,et al.  Slicing probabilistic programs , 2014, PLDI.

[30]  Jie-Hong Roland Jiang,et al.  When Boolean Satisfiability Meets Gaussian Elimination in a Simplex Way , 2012, CAV.

[31]  Annabelle McIver,et al.  Linear-Invariant Generation for Probabilistic Programs: - Automated Support for Proof-Based Methods , 2010, SAS.

[32]  Leslie G. Valiant,et al.  Random Generation of Combinatorial Structures from a Uniform Distribution , 1986, Theor. Comput. Sci..

[33]  Shweta Shinde,et al.  A model counter for constraints over unbounded strings , 2014, PLDI.

[34]  Claude Castelluccia,et al.  Extending SAT Solvers to Cryptographic Problems , 2009, SAT.

[35]  Walter R. Gilks,et al.  A Language and Program for Complex Bayesian Modelling , 1994 .

[36]  Matthew B. Dwyer,et al.  Exact and approximate probabilistic symbolic execution for nondeterministic programs , 2014, ASE.

[37]  Adnan Darwiche,et al.  Modeling and Reasoning with Bayesian Networks , 2009 .

[38]  Patrick Cousot,et al.  Probabilistic Abstract Interpretation , 2012, ESOP.

[39]  Mate Soos,et al.  Enhanced Gaussian Elimination in DPLL-based SAT Solvers , 2010, POS@SAT.

[40]  Min Zhou,et al.  Estimating the Volume of Solution Space for Satisfiability Modulo Linear Real Arithmetic , 2014, Theory of Computing Systems.

[41]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[42]  Sriram K. Rajamani,et al.  Efficiently Sampling Probabilistic Programs via Program Analysis , 2013, AISTATS.

[43]  Nir Friedman,et al.  Probabilistic Graphical Models - Principles and Techniques , 2009 .

[44]  R. Durrett Probability: Theory and Examples , 1993 .

[45]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

[46]  Bart Selman,et al.  Taming the Curse of Dimensionality: Discrete Integration by Hashing and Optimization , 2013, ICML.

[47]  Larry J. Stockmeyer,et al.  On Approximation Algorithms for #P , 1985, SIAM J. Comput..

[48]  Leslie G. Valiant,et al.  NP is as easy as detecting unique solutions , 1985, STOC '85.

[49]  Sumit Gulwani,et al.  Static analysis for probabilistic programs: inferring whole program properties from finitely many paths , 2013, PLDI.

[50]  Alexander I. Barvinok,et al.  A Polynomial Time Algorithm for Counting Integral Points in Polyhedra when the Dimension Is Fixed , 1993, FOCS.

[51]  Michael Sipser,et al.  A complexity theoretic approach to randomness , 1983, STOC.

[52]  Catuscia Palamidessi,et al.  Making random choices invisible to the scheduler , 2010, Inf. Comput..

[53]  Sheng Liu,et al.  Volume Computation for Boolean Combination of Linear Arithmetic Constraints , 2009, CADE.

[54]  Alasdair Urquhart,et al.  Formal Languages]: Mathematical Logic--mechanical theorem proving , 2022 .

[55]  Martin E. Dyer,et al.  On the Complexity of Computing the Volume of a Polyhedron , 1988, SIAM J. Comput..