SAT solver
A SAT solver is an algorithm or program that determines whether a given Boolean formula in conjunctive normal form (CNF) has a satisfying assignment — a set of truth values for its variables that makes the entire formula true. The problem is NP-complete, as established by the Cook-Levin Theorem, meaning that no known algorithm solves all instances in time polynomial in the input size, yet a satisfying assignment can be verified in polynomial time. SAT solvers are the workhorses of automated reasoning, deployed in hardware verification, software testing, cryptography, planning, and constraint satisfaction.
Modern SAT solvers — particularly Conflict-Driven Clause Learning (CDCL) solvers — achieve surprising practical performance despite the theoretical hardness of the problem. CDCL combines backtracking search with clause learning: when the solver encounters a conflict — a partial assignment that falsifies the formula — it analyzes the conflict to derive a new clause that prevents the same conflict from recurring. This learned clause is added to the formula, pruning the search space. Combined with heuristics for variable ordering, restart strategies, and efficient Boolean constraint propagation, CDCL solvers routinely handle formulas with millions of variables and clauses.
SAT Solvers and Computational Complexity
The gap between SAT's theoretical intractability and its practical solvability is one of the most instructive cases in computer science. The phase transition phenomenon explains part of the gap: randomly generated SAT instances are hardest when the ratio of clauses to variables is near a critical threshold (approximately 4.26 for 3-SAT). Below the threshold, instances are almost always satisfiable and relatively easy. Above it, they are almost always unsatisfiable and also relatively easy. At the threshold, the search space is maximally constrained and maximally ambiguous, producing the hardest instances. Real-world problems are not random, but many exhibit similar clustered-hardness structures.
The success of SAT solvers challenges naive assumptions about the P versus NP problem. If P ≠ NP, then SAT has no polynomial-time algorithm for all instances. But "no polynomial-time algorithm" does not mean "no useful algorithm." The worst-case hardness of SAT is a statement about all possible inputs; the practical utility of SAT solvers is a statement about the inputs that actually arise in engineering. The two are not in contradiction. They are complementary: the theoretical result tells us what we cannot expect; the empirical result tells us what we can achieve.
SAT Solvers as Inference Engines
Beyond their role as decision procedures, SAT solvers have become general-purpose inference engines. The technique of SAT encoding translates problems from other domains — graph coloring, scheduling, circuit equivalence, program synthesis — into Boolean formulas, then applies a SAT solver. The translation is often exponential in the worst case, but in practice, the solver's heuristics exploit structure that the original problem domain provides.
This connects SAT solving to automated theorem proving and formal verification. A hardware design can be encoded as a Boolean formula; a SAT solver can verify that no input sequence triggers a specified failure mode. A software program can be encoded as a formula over its control flow; a SAT solver can find inputs that reach a target line of code. The solver is not reasoning about the design in the way an engineer does. It is reasoning about a Boolean shadow of the design — a shadow that preserves the properties of interest.
Limits and Extensions
The Boolean shadow has limits. SAT solvers reason about propositional logic, which cannot express quantification, arithmetic, or unbounded data structures. For these, SAT solvers are extended to SMT solvers (Satisfiability Modulo Theories), which combine SAT search with decision procedures for theories like linear arithmetic, arrays, and bit-vectors. SMT solvers inherit the architecture of CDCL but delegate theory-specific reasoning to specialized engines.
Even with these extensions, the fundamental limit remains: the solver operates on a formalization of the problem, not the problem itself. If the formalization omits a constraint that the real problem possesses, the solver may declare satisfiable what is actually impossible, or unsatisfiable what is actually possible. The gap between formula and reality is not a bug in the solver. It is an epistemic limit on all formal reasoning.
See also: SAT, Cook-Levin Theorem, NP-completeness, Automated Theorem Proving, Formal Verification, SMT Solver, Constraint Satisfaction, P versus NP