Model counting with error-correcting codes
The idea of counting the number of satisfying truth assignments (models) of a formula by adding random parity constraints can be traced back to the seminal work of Valiant and Vazirani showing that NP is as easy as detecting unique solutions. While theoretically sound, the random parity constraints used in that construction suffer from the following drawback: each constraint, on average, involves half of all variables. As a result, the branching factor associated with searching for models that also satisfy the parity constraints quickly gets out of hand. In this work we prove that one can work with much shorter parity constraints and still get rigorous mathematical guarantees, especially when the number of models is large so that many constraints need to be added. Our work is motivated by the realization that the essential feature for a system of parity constraints to be useful in probabilistic model counting is that its set of solutions resembles an error-correcting code.
KeywordsModel counting Satisfiability Randomized algorithms Systems of parity equations Coding theory Low density parity check codes
We are grateful to Kuldeep Meel and Moshe Vardi for sharing their code and formulas and for several valuable conversations. We also thank Zayd Hammoudeh, Ben Sherman, and Kostas Zampetakis for several comments on earlier versions.
- 1.Achim, T., Sabharwal, A., Ermon, S. (2016). Beyond parity constraints: Fourier analysis of hash functions for inference. In M. Balcan, & K.Q. Weinberger (Eds.) Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, JMLR Workshop and Conference Proceedings. JMLR.org. http://jmlr.org/proceedings/papers/v48/achim16.html, (Vol. 48 pp. 2254–2262).
- 2.Chakraborty, S., Fremont, D.J., Meel, K.S., Seshia, S.A., Vardi, M.Y. (2014). Distribution-aware sampling and weighted model counting for SAT. In Brodley, C.E., & Stone, P. (Eds.) Proceedings of the Twenty-Eighth AAAI Conference on Artificial Intelligence. http://www.aaai.org/ocs/index.php/AAAI/AAAI14/paper/view/8364 (pp. 1722–1730). Québec City: AAAI Press.
- 3.Chakraborty, S., Meel, K.S., Vardi, M.Y. (2013). A scalable approximate model counter. In Schulte, C. (Ed.) Principles and Practice of Constraint Programming - 19th International Conference, CP 2013, Uppsala, Proceedings, Lecture Notes in Computer Science. https://doi.org/10.1007/978-3-642-40627-0_18, (Vol. 8124 pp. 200–216): Springer.
- 4.Chakraborty, S., Meel, K.S., Vardi, M.Y. (2016). Algorithmic improvements in approximate counting for probabilistic inference: From linear to logarithmic SAT calls. In Kambhampati, S. (Ed.) Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence, IJCAI 2016. http://www.ijcai.org/Abstract/16/503 (pp. 3569–3576). New York: IJCAI/AAAI Press.
- 5.Ermon, S., Gomes, C.P., Sabharwal, A., Selman, B. (2013). Taming the curse of dimensionality: Discrete integration by hashing and optimization. In Proceedings of the 30th international conference on machine learning (ICML).Google Scholar
- 6.Ermon, S., Gomes, C.P., Sabharwal, A., Selman, B. (2014). Low-density parity constraints for hashing-based discrete integration. In Proceedings of the 31st international conference on machine learning (ICML) (pp. 271–279).Google Scholar
- 7.Gomes, C.P., Hoffmann, J., Sabharwal, A., Selman, B. (2007). Short XORs for model counting: From theory to practice. In Theory and applications of satisfiability testing (SAT) (pp. 100–106).Google Scholar
- 8.Gomes, C.P., Sabharwal, A., Selman, B. (2006). Model counting: a new strategy for obtaining good bounds. In Proceedings of the 21st national conference on artificial intelligence (AAAI) (pp 54–61).Google Scholar
- 10.Meel, K.S., Vardi, M.Y., Chakraborty, S., Fremont, D.J., Seshia, S.A., Fried, D., Ivrii, A., Malik, S. (2016). Constrained sampling and counting: Universal hashing meets sat solving. In Workshops at the thirtieth AAAI conference on artificial intelligence.Google Scholar
- 12.Sipser, M. (1983). A complexity theoretic approach to randomness. In Proceedings of the 15th ACM symposium on theory of computing (STOC) (pp 330–335).Google Scholar
- 14.Soos, M. (2009). Cryptominisat–a sat solver for cryptographic problems. http://www.msoos.org/cryptominisat4.
- 16.Thurley, M. (2006). Sharpsat: Counting models with advanced component caching and implicit bcp. In Proceedings of the 9th International Conference on Theory and Applications of Satisfiability Testing, SAT’06. https://doi.org/10.1007/11814948_38(pp. 424–429). Berlin: Springer.
- 18.Zhao, S., Chaturapruek, S., Sabharwal, A., Ermon, S. (2016). Closing the gap between short and long xors for model counting. In Schuurmans, D., & Wellman, M.P. (Eds.) Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence. http://www.aaai.org/ocs/index.php/AAAI/AAAI16/paper/view/12546 (pp. 3322–3329). Phoenix: AAAI Press.