Approximate Model Counting, Sparse XOR Constraints and Minimum Distance
The problem of counting the number of models of a given Boolean formula has numerous applications, including computing the leakage of deterministic programs in Quantitative Information Flow. Model counting is a hard, #P-complete problem. For this reason, many approximate counters have been developed in the last decade, offering formal guarantees of confidence and accuracy. A popular approach is based on the idea of using random XOR constraints to, roughly, successively halving the solution set until no model is left: this is checked by invocations to a SAT solver. The effectiveness of this procedure hinges on the ability of the SAT solver to deal with XOR constraints, which in turn crucially depends on the length of such constraints. We study to what extent one can employ sparse, hence short, constraints, keeping guarantees of correctness. We show that the resulting bounds are closely related to the geometry of the set of models, in particular to the minimum Hamming distance between models. We evaluate our theoretical results on a few concrete formulae. Based on our findings, we finally discuss possible directions for improvements of the current state of the art in approximate model counting.
KeywordsModel counting Approximate counting XOR sampling
We thank Marco Baldi, Massimo Battaglioni and Franco Chiaraluce for providing us with the generator and parity check matrices of the LDPC code in Subsect. 4.3.
- 2.Babai, L., Frankl, P.: Linear Algebra Methods in Combinatorics. The University of Chicago, Chicago (1992)Google Scholar
- 3.Biondi, F., Enescu, M.A., Heuser, A., Legay, A., Meel, K.S., Quilbeuf, J.: Scalable approximation of quantitative information flow in programs. Verification, Model Checking, and Abstract Interpretation. LNCS, vol. 10747, pp. 71–93. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-73721-8_4CrossRefGoogle Scholar
- 4.Boreale, M., Gorla, D.: Approximate model counting, sparse XOR constraints and minimum distance. https://arxiv.org/abs/1907.05121 (2019)
- 7.Chakraborty, S., Meel, K.S., Vardi, M.Y.: Algorithmic improvements in approximate counting for probabilistic inference: from linear to logarithmic SAT calls. In: Proceedings of International Joint Conference on Artificial Intelligence (2016)Google Scholar
- 9.Ermon, S., Gomes, C.P., Sabharwal, A., Selman, B.: Low-density parity constraints for hashing-based discrete integration. In: Proceedings of the 31th International Conference on Machine Learning, ICML 2014, Beijing, China, 21–26 June 2014, pp. 271–279 (2014)Google Scholar
- 10.Fuja, T.E., Sridhara, D., Tanner, R.M.: A class of group-structured LDPC codes. In: International Symposium on Communication Theory and Applications (2001)Google Scholar
- 13.Gomes, C.P., Sabharwal, A., Selman, B.: Model counting: a new strategy for obtaining good bounds. In: Proceedings of AAAI, pp. 54–61 (2006)Google Scholar
- 14.Gomes, C.P., Sabharwal, A., Selman, B.: Model counting. In: Handbook of Satisfiability, pp. 633–654. IOS Press (2009)Google Scholar
- 16.Klebanov, V., Manthey, N., Muise, C.: SAT-based analysis and quantification of information flow in programs. In: Joshi, K., Siegle, M., Stoelinga, M., D’Argenio, P.R. (eds.) QEST 2013. LNCS, vol. 8054, pp. 177–192. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-40196-1_16CrossRefGoogle Scholar
- 17.Klebanov, V., Weigl, A., Weibarth, J.: Sound probabilistic #SAT with projection. In: Proceedings of QAPL (2016)Google Scholar
- 21.Soos, M., Meel, K.S.: BIRD: engineering an efficient CNF-XOR SAT solver and its applications to approximate model counting. In: Proceedings of AAAI Conference on Artificial Intelligence (AAAI) (2019)Google Scholar