Skip to main content
Log in

Model counting with error-correcting codes

  • Published:
Constraints Aims and scope Submit manuscript

Abstract

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

Notes

  1. This can be done by selecting a uniformly random permutation of size [n] and using it to map each of the n non-zeros to equations; when , ∈ O(1), the variables in each equation will be distinct with probability Ω(1), so that a handful of trials suffice to generate a matrix as desired.

References

  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).

  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).

  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).

  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).

  9. Ivrii, A., Malik, S., Meel, K.S., Vardi, M.Y. (2016). On computing minimal independent support and its applications to sampling and counting. Constraints, 21(1), 41–58. https://doi.org/10.1007/s10601-015-9204-z.

    Article  MathSciNet  MATH  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.

  11. Richardson, T., & Urbanke, R. (2008). Modern coding theory. New York: Cambridge University Press.

    Book  MATH  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).

  13. Sipser, M., & Spielman, D.A. (1996). Expander codes. IEEE Transactions on Information Theory, 42(6), 1710–1722. https://doi.org/10.1109/18.556667.

    Article  MathSciNet  MATH  Google Scholar 

  14. Soos, M. (2009). Cryptominisat–a sat solver for cryptographic problems. http://www.msoos.org/cryptominisat4.

  15. Stockmeyer, L. (1985). On approximation algorithms for Ṗ. SIAM Journal on Computing, 14(4), 849–861.

    Article  MathSciNet  MATH  Google Scholar 

  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.

  17. Valiant, L., & Vazirani, V. (1986). NP is as easy as detecting unique solutions. Theoretical Computer Science, 47, 85–93.

    Article  MathSciNet  MATH  Google Scholar 

  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.

Download references

Acknowledgements

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.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Panos Theodoropoulos.

Additional information

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Research supported by European Research Council Starting Grant 210743, NSF grant CCF-1514128, NSF CCF-1733884, an Adobe research grant, and the Greek State Scholarships Foundation (IKY).

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Achlioptas, D., Theodoropoulos, P. Model counting with error-correcting codes. Constraints 24, 162–182 (2019). https://doi.org/10.1007/s10601-018-9296-3

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10601-018-9296-3

Keywords

Navigation