arXiv:2611.05614cs.CCNov 2026

Manuscript Offprint

arXiv:2611.05614

The CNF Encoding Complexity of Boolean Functions

Andrew Krapivin, Benjamin Przybocki, Bernardo Subercaseaux

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

We study the minimum number of clauses required to encode a boolean function into a CNF formula with auxiliary variables. Our main result is that if a boolean function can be evaluated in nondeterministic time tt (in the RAM model) with mm bits of advice such that at most bb bits of advice are accessed for each input, then it admits a CNF encoding with O~(t+mb)\tilde{O}(t + \sqrt{mb}) clauses. This constitutes a nonuniform generalization of Robson's (TCS'91) variant of the Cook–Levin theorem, for which a naïve generalization would yield O~(t+m)\tilde{O}(t + m) clauses; our applications leverage b=o(m)b = o(m) to obtain significantly better bounds. Since preprocessed data structures can be modeled as computation with advice, our result allows us to translate space- and time-efficient data structures to compact CNF encodings. As an application, we derandomize a data structure of Larsen and Williams (SODA'17) to show that every kk-CNF function on nn inputs can be encoded with nk/2Ωk(lg⁡n)n^k/2^{\Omega_k(\sqrt{\lg n})} clauses. Notably, despite encoding a kk-CNF function, the encoding itself necessarily contains clauses of unbounded width, since an information-theoretic argument shows that the minimum number of bounded-width clauses to encode such functions is Ωk(nk/lg⁡n)\Omega_k(n^k/\lg n) in the worst case. In general terms, our results imply that for a wide variety of NP-complete problems, one can reduce to CNF-SAT in a way that results in asymptotically fewer clauses than previously known methods.

*andrew@krapivin.net †benjamin.przybocki@gmail.com ‡bersub@cmu.edu

1 Introduction

Given a boolean function ff, how compactly can we “encode” ff as a CNF formula (see Definition 1)? A partial answer was provided first by the Cook–Levin theorem [Coo71, Lev73], which implies that if ff can be computed nondeterministically in nn steps, then it can be encoded as a CNF instance of size nO(1)n^{O(1)}. Since then, more compact encodings of size O‾(n)\overline{O}(n) have been devised and extended to different models of computation [Sch78, PF79, Coo88, Rob91]. These optimized Cook–Levin theorems have several complexity-theoretic applications, including showing that CNF-SAT is complete for nondeterministic quasilinear time [Sch78, GS89] and proving time-space tradeoffs for CNF-SAT [For00]. The problem of compactly encoding boolean functions has also acquired tremendous practical utility with the advent of SAT solvers, where efficient encodings are often make-or-break for whether a problem can be solved in practice [SH23, KPSS25, HS24, QWSH25, HS15]; empirically, smaller encodings tend to perform better in practice [Bjö09, ANORC13].1^1

Consequently, the SAT community has studied encodings for a variety of concrete functions, including both classical NP-complete problems (e.g., Hamiltonian cycle [Zho20, Zho24], graph coloring [FJM24], kk-clique [IMM17, Sub25], and many others [CD26]) as well as elementary constraints such as parity [EKMS24] or at−most−kat-most-k [Sin05, KSV19, KPS26], which serve as building blocks of larger encodings. However, despite the theoretical and practical importance of CNF encodings, this model of computation has yet to receive a systematic theoretical treatment that focuses on large classes of boolean functions rather than particular instances, which is in stark contrast to other models of computation like boolean circuits [Juk12]. In this paper, we prove fundamental results about the complexity of boolean functions in this model and show how this complexity metric relates to complexities in other nonuniform models. We hope to convince the reader that the theory of CNF encodings is much deeper than has previously been appreciated. In particular, we show that the optimized Cook–Levin results mentioned above are not the end of the story.

A CNF encoding of a boolean function ff is a CNF formula with nondeterministic variables that computes ff. Formally:

Definition 1 (Encoding). Given a boolean function f:{0,1}n→{0,1}f: \{0,1\}^n \to \{0,1\}, we say that a triple (φ,X,Y)(\varphi, X, Y) is an encoding of ff if: (i) X:=(x1,…,xn)X := (x_1, \ldots, x_n) is a sequence of propositional variables, and YY is a set of propositional variables disjoint from XX; (ii) φ\varphi is a CNF formula over variables X⊔YX \sqcup Y; and (iii) for every assignment τ:X→{0,1}\tau: X \to \{0,1\},

f(τ(x1),…,τ(xn))=1  ⟺  ∃θ:Y→{0,1},(τ∪θ)⊨φ.f(\tau(x_1), \ldots, \tau(x_n)) = 1 \iff \exists \theta: Y \to \{0,1\}, (\tau \cup \theta) \models \varphi.

The variables in XX are called input variables, and those in YY are called auxiliary variables.

Thus, CNF encodings constitute a nondeterministic, nonuniform model of computation. We say that the CNF encoding complexity of a boolean function ff, denoted enc(f)\text{enc}(f), is the minimum number of clauses in a CNF encoding of ff. In Section 1.3, we elaborate on why we choose to focus on the clause count instead of, say, the total number of literals in a CNF encoding.

One of the few theoretical results known about encoding complexity is due to Tseitin [Tse70]: if the (nondeterministic) circuit complexity of ff is nn, then enc(f)=O(n)\text{enc}(f) = O(n). Each of our main results implies that the converse of Tseitin’s theorem fails strongly: there are boolean functions for which enc(f)\text{enc}(f)

1^1The claim here is not that formulas with fewer clauses are easier to solve—random formulas with hundreds of clauses tend to be much harder than structured formulas from industry with millions of clauses—but rather that for a fixed problem, performance tends to improve by choosing a smaller encoding [Pre21].

is much smaller than its (nondeterministic) circuit complexity. In Section 6, we characterize enc(f)\text{enc}(f) exactly in terms of nondeterministic conjunctive circuit complexity: whenever enc(f)⩾2\text{enc}(f) \geqslant 2, it equals the minimum number of wires entering ∧\wedge-gates in a nondeterministic De Morgan circuit computing ff. Thus, all of our results also have circuit complexity analogues.

References (54)