Boolean satisfiability problem

Also known as: SAT problem · SAT solver

On this page 7

The Boolean satisfiability problem (often called the SAT problem) asks whether there exists an assignment of true and false values to the variables of a propositional formula that makes the whole formula true. It is a foundational question in Symbolic AI & reasoning, because many planning, verification and configuration tasks can be encoded as SAT instances and handed to a general-purpose solver.

SAT was the first problem proven NP-complete, by Stephen Cook in 1971 and independently by Leonid Levin. That result means no known algorithm solves every instance in polynomial time, yet modern SAT solvers routinely handle industrial instances with millions of variables and clauses.

How a SAT instance is formulated

A SAT instance is a propositional logic formula built from Boolean variables, negation, conjunction and disjunction. Solvers almost always expect the formula in conjunctive normal form (CNF): a conjunction of clauses, where each clause is a disjunction of literals, and a literal is a variable or its negation.

Any formula can be converted to an equisatisfiable CNF in linear size with the Tseitin transformation, which introduces auxiliary variables for subformulas. A naive conversion by distribution can grow exponentially, so the Tseitin approach is the standard choice. The common exchange format is DIMACS CNF, a plain-text file that lists clauses as signed integers terminated by zero.

The table below summarizes the building blocks of a CNF instance.

ElementDefinitionExample
VariableBoolean unknown that takes true or falsex1
LiteralVariable or its negationx1, NOT x2
ClauseDisjunction of literals, true if any literal is true(x1 OR NOT x2 OR x3)
FormulaConjunction of clauses, true if every clause is true(x1 OR x2) AND (NOT x1 OR x3)
ModelAssignment that satisfies the formulax1 = true, x3 = true
Building blocks of a CNF formula

Complexity classes and SAT variants

The difficulty of SAT depends sharply on the shape of the clauses. Restricting clause length or clause form can move a variant from NP-complete to solvable in polynomial or even linear time, which is why recognizing the variant matters before choosing a method.

For random 3-SAT, instances show a phase transition near a clause-to-variable ratio of about 4.26. Below that ratio most instances are satisfiable and easy, above it most are unsatisfiable and easy to refute, and instances close to the threshold are the hardest on average.

VariantRestrictionComplexity
2-SATAt most two literals per clauseLinear time via implication graph
Horn-SATAt most one positive literal per clauseLinear time via unit propagation
3-SATExactly three literals per clauseNP-complete
MAX-SATMaximize the number of satisfied clausesNP-hard optimization
#SATCount all satisfying assignments#P-complete
QBFVariables bound by universal and existential quantifiersPSPACE-complete
Common SAT variants and their complexity

Horn-SAT is closely tied to Horn clauses in logic programming and Datalog, which explains why those systems can answer queries efficiently while general SAT cannot be guaranteed to do so.

Most practical solvers descend from the DPLL algorithm (Davis, Putnam, Logemann and Loveland, 1962), a backtracking search that assigns a variable, simplifies the formula and backtracks on contradiction. Its key inference step is unit propagation: when a clause has a single unassigned literal and all others are false, that literal is forced to true.

Since the late 1990s, conflict-driven clause learning (CDCL) has dominated. When propagation produces a conflict, the solver analyzes the implication graph, derives a learned clause that blocks the same failure, and performs non-chronological backjumping to the decision level that caused the problem. Combined with efficient data structures, this turned SAT from a theoretical obstacle into a practical engineering tool.

The following table lists the techniques that make CDCL solvers fast.

TechniquePurposeEffect on performance
Two watched literalsDetect unit clauses lazilyCheap propagation on large formulas
VSIDS heuristicPrefer variables involved in recent conflictsFocuses search on the hard core
RestartsAbandon the current search path periodicallyEscapes unproductive regions
Phase savingReuse the last polarity of each variableKeeps progress across restarts
PreprocessingEliminate variables and subsumed clausesShrinks the instance before search
Core techniques in CDCL solvers

Stochastic local search methods such as WalkSAT take a different route. They flip variables to reduce the number of unsatisfied clauses and can be fast on satisfiable random instances, but they are incomplete: they cannot prove that a formula is unsatisfiable.

SAT sits at the propositional end of automated reasoning. Richer formalisms add expressiveness at the cost of harder decision procedures, and many of them reuse a SAT engine internally.

FormalismWhat it adds to SATTypical use
Satisfiability modulo theoriesArithmetic, arrays, bit-vectors and other theoriesProgram verification, symbolic execution
Answer set programmingNon-monotonic rules with stable model semanticsCombinatorial search with defaults
Constraint programmingFinite-domain variables and global constraintsScheduling and timetabling
First-order theorem provingQuantifiers, functions and predicatesMathematical proofs, ontology checks
SAT and neighboring formalisms

In practice, SMT solvers run a CDCL core over Boolean structure and call theory solvers for the rest, and many answer set solvers use the same conflict-learning machinery. Resolution, the proof system behind automated theorem proving, also underlies the refutation proofs that CDCL solvers implicitly construct.

Applications and practical limits

SAT is valuable because of reduction: a problem is translated into clauses, solved by an off-the-shelf solver, and the model is decoded back. Typical uses include hardware verification through bounded model checking, classical planning encoded as SAT over a fixed horizon, software package dependency resolution, cryptanalysis and combinatorial design.

  • Encoding quality matters more than solver choice: a compact encoding with symmetry breaking can be orders of magnitude faster.
  • Worst-case behavior remains exponential: small crafted instances, such as pigeonhole formulas, defeat resolution-based solvers.
  • Unsatisfiability needs evidence: solvers can emit DRAT proofs so that an independent checker can verify an unsatisfiable result.
  • Cardinality and arithmetic constraints inflate CNF size; SMT or pseudo-Boolean solvers often handle them better.

In simple terms

Imagine a set of light switches. Each one is on or off. You also have a list of rules, such as “switch 1 or switch 3 must be on”. The SAT problem asks a single question: can you set the switches so that every rule holds?

With a few switches, you can try every option. With thousands, trying everything would take longer than the age of the universe. SAT solvers are clever search programs that learn from each dead end and avoid repeating it. That is why they can solve huge puzzles in seconds, even though no method is guaranteed to be fast every time.

A practical example

A chip design team needs to confirm that a new arithmetic unit never produces a wrong result within the first 30 clock cycles. Engineers unroll the circuit for 30 cycles and add a property stating that the output differs from a reference model. The resulting formula contains roughly two million variables and eight million clauses in DIMACS format.

A CDCL solver processes the instance in about forty minutes on a single workstation. In the first run it returns a satisfying assignment, which is a concrete counterexample: a specific input sequence that triggers a carry-handling bug. After the fix, the solver reports unsatisfiable and emits a DRAT proof, which an independent checker validates. The team now has verified evidence that no failing input exists within that 30-cycle bound.