Abstract
Many Boolean functions that need to be encoded as CNF in practice, have only exponential size CNF representations. To avoid this effect, one usually introduces nondeterministic variables. For example, whereas the minimum number of clauses in a CNF computing the parity function \(x_1\oplus x_2 \oplus \cdots \oplus x_n\) is \(2^{n-1}\), one can use \(n-1\) nondeterministic variables to get a CNF encoding with 4n clauses. In this paper, we prove tradeoffs between various parameters (the number of clauses, the width of clauses, and the number of nondeterministic variables) of CNF encodings of various symmetric functions. In particular, we show that a folklore way of encoding parity as CNF is provably optimal. We do this by using a tight connection between CNF encodings and depth-3 circuits. This connection shows that CNF encodings is an interesting computational model for Boolean functions: on the one hand, it is routinely used in practice when translating a computational problem to a format acceptable by a SAT solver, on the other hand, lower bounds on the size of CNF encodings imply depth-3 circuit lower bounds.
Similar content being viewed by others
Notes
Sedrakyan’s inequality is a special case of Cauchy–Schwarz inequality: for all \(a_1, \dotsc , a_n \in \mathbb R\) and \(b_1, \dotsc , b_n \in \mathbb {R}_{>0}\), \(\sum _{i=1}^n a_i^2/b_i \ge \left( \sum _{i=1}^n a_i\right) ^2/\sum _{i=1}^n b_i\).
References
Allender, E., Hellerstein, L., McCabe, P., Pitassi, T., Saks, M.E.: Minimizing disjunctive normal form formulas and \(\mathit{AC}^0\) circuits given a truth table. SIAM J. Comput. 38(1), 63–84 (2008). https://doi.org/10.1137/060664537
Bailleux, O., Boufkhad, Y.: Efficient cnf encoding of boolean cardinality constraints. In: Rossi, F. (ed.) Principles and Practice of Constraint Programming - CP 2003, pp. 108–122. Heidelberg, Springer, Berlin Heidelberg, Berlin (2003)
Bittner, P.M., Thüm, T., Schaefer, I.: SAT encodings of the at-most-k constraint - A case study on configuring university courses. In: Ölveczky, P.C., Salaün, G. (eds.) Software Engineering and Formal Methods - 17th International Conference, SEFM 2019, Oslo, Norway, September 18-20, 2019, Proceedings, volume 11724 of Lecture Notes in Computer Science, pp. 127–144. Springer, (2019). https://doi.org/10.1007/978-3-030-30446-1_7
Cabon, B., de Givry, S., Lobjois, L., Schiex, T., Warners, J.P.: Radio link frequency assignment. Constraints An Int. J. 4(1), 79–89 (1999). https://doi.org/10.1023/A:1009812409930
Demenkov, E., Kojevnikov, A., Kulikov, A.S., Yaroslavtsev, G.: New upper bounds on the boolean circuit complexity of symmetric functions. Inf. Process. Lett. 110(7), 264–267 (2010). https://doi.org/10.1016/j.ipl.2010.01.007
Emdin, G., Kulikov, A.S., Mihajlin, I., Slezkin, N.: CNF Encodings of Parity. In: Szeider, S., Ganian, R., Silva, A. (eds.) 47th International Symposium on Mathematical Foundations of Computer Science (MFCS 2022), volume 241 of Leibniz International Proceedings in Informatics (LIPIcs), pp. 47:1–47:12, Dagstuhl, Germany, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2022). https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.MFCS.2022.47, https://doi.org/10.4230/LIPIcs.MFCS.2022.47
Frisch, A.M., Giannaros, P.A.: SAT encodings of the at-most-\(k\) constraint: Some old, some new, some fast, some slow. In: Proceedings of the 9th International Workshop on Constraint Modelling and Reformulation (2010)
Håstad, J.: Almost optimal lower bounds for small depth circuits. In: Hartmanis, J. (ed.) Proceedings of the 18th Annual ACM Symposium on Theory of Computing, May 28-30, 1986, Berkeley, California, USA, pp. 6–20. ACM, (1986). https://doi.org/10.1145/12130.12132
Håstad, J., Jukna, S., Pudlák, P.: Top-down lower bounds for depth 3 circuits. In: 34th Annual Symposium on Foundations of Computer Science, Palo Alto, California, USA, 3–5 November 1993, pp. 124–129. IEEE Computer Society, (1993). https://doi.org/10.1109/SFCS.1993.366875
Hirahara, S.: A duality between depth-three formulas and approximation by depth-two. Electron. Colloquium Comput. Complex., pp. 92, (2017). https://eccc.weizmann.ac.il/report/2017/092
Hrubeš, P., Natarajan Ramamoorthy, S., Rao, A., Yehudayoff, A.: Lower Bounds on Balancing Sets and Depth-2 Threshold Circuits. In: Baier, C., Chatzigiannakis, I., Flocchini, P., Leonardi, S. (eds.) 46th International Colloquium on Automata, Languages, and Programming (ICALP 2019), volume 132 of Leibniz International Proceedings in Informatics (LIPIcs), pp. 72:1–72:14, Dagstuhl, Germany, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2019). https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ICALP.2019.72, https://doi.org/10.4230/LIPIcs.ICALP.2019.72
Ignatiev, A., Morgado, A., Marques-Silva, J.: Pysat: A python toolkit for prototyping with sat oracles. In: International Conference on Theory and Applications of Satisfiability Testing, (2018)
Jukna, S.: Boolean Function Complexity - Advances and Frontiers, vol. 27 of Algorithms and combinatorics. Springer, (2012). https://doi.org/10.1007/978-3-642-24508-4
Klawe, M., Paul, W.J., Pippenger, N., Yannakakis, M.: On monotone formulae with restricted depth. In: Proceedings of the Sixteenth Annual ACM Symposium on Theory of Computing, STOC ’84, pp. 480–487, New York, NY, USA, Association for Computing Machinery (1984). https://doi.org/10.1145/800057.808717
Kochemazov, S., Zaikin, O., Semenov, A.: The comparison of different sat encodings for the problem of search for systems of orthogonal latin squares. In: International Conference Mathematical and Information Technologies-MIT, pp. 155–165, (2016)
Kucera, P., Savický, P., Vorel, V.: A lower bound on CNF encodings of the at-most-one constraint. Theor. Comput. Sci. 762, 51–73 (2019). https://doi.org/10.1016/j.tcs.2018.09.003
Kuechlin, W., Sinz, C.: Proving consistency assertions for automotive product data management. J. Autom. Reasoning 24, 145–163 02 (2000). https://doi.org/10.1023/A:1006370506164
Li, C.-M.: Integrating equivalency reasoning into davis-putnam procedure. 04 (2000)
Li, J., Yang, T.: 3.1n - o(n) circuit lower bounds for explicit functions. In: Leonardi, S., Gupta, A. (eds.) STOC ’22: 54th Annual ACM SIGACT Symposium on Theory of Computing, Rome, Italy, June 20 - 24, 2022, pp. 1180–1193. ACM, (2022). https://doi.org/10.1145/3519935.3519976
Marques-Silva, J., Lynce, I.: Towards robust cnf encodings of cardinality constraints. In: Bessière, C. (ed.) Principles and Practice of Constraint Programming - CP 2007, pp. 483–497. Heidelberg, Springer, Berlin Heidelberg, Berlin (2007)
Masek, W.J.: Some NP-complete set covering problems. Unpublished Manuscript (1979)
Paturi, R., Pudlák, P., Zane, F.: Satisfiability coding lemma. Chic. J. Theor. Comput. Sci. 1999 (1999). http://cjtcs.cs.uchicago.edu/articles/1999/11/contents.html
Prestwich, S.D.: SAT problems with chains of dependent variables. Discret. Appl. Math. 130(2), 329–350 (2003). https://doi.org/10.1016/S0166-218X(02)00410-9
Prestwich, S.D.: CNF encodings. In: Biere, A., Heule, M., van Maaren, H., Walsh, T. (eds.) Handbook of Satisfiability, vol. 185 of Frontiers in Artificial Intelligence and Applications, pp. 75–97. IOS Press, (2009). https://doi.org/10.3233/978-1-58603-929-5-75
Sinz, C.: Towards an optimal CNF encoding of boolean cardinality constraints. In: van Beek, P. (ed.) Principles and Practice of Constraint Programming - CP 2005, 11th International Conference, CP 2005, Sitges, Spain, October 1-5, 2005, Proceedings, volume 3709 of Lecture Notes in Computer Science, pp. 827–831. Springer, (2005). https://doi.org/10.1007/11564751_73
Tsejtin, G.S.: On the complexity of derivation in propositional calculus. Semin. Math. V. A. Steklov Math. Inst., Leningrad 8, 115–125 (1970); translation from Zap. Nauchn. Semin. Leningr. Otd. Mat. Inst. Steklova 8, 234–259 (1968), 1968
Valiant, L.G.: Graph-theoretic arguments in low-level complexity. In: International Symposium on Mathematical Foundations of Computer Science (1977)
Valiant, L.G.: Graph-theoretic arguments in low-level complexity. In: Gruska, J. (ed.) Mathematical Foundations of Computer Science 1977, 6th Symposium, Tatranska Lomnica, Czechoslovakia, September 5–9, 1977, Proceedings, vol. 53 of Lecture Notes in Computer Science, pp. 162–176. Springer, (1977). https://doi.org/10.1007/3-540-08353-7_135
Acknowledgements
Research is partially supported by Huawei (grant TC20231108096). Preliminary version of this paper appeared in [6].
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.