What is SAT solving?
The Boolean satisfiability problem (SAT) is the problem of determining if there exists an assignment of truth values to variables that makes a Boolean formula evaluate to true. SAT is the first problem proven to be NP-complete, making it fundamentally important in computer science.SAT solvers like MiniSat are used in hardware verification, software testing, constraint solving, and many other applications where finding valid assignments to Boolean constraints is needed.
Problem structure
A SAT problem consists of:- Variables: Boolean variables that can be true or false
- Literals: A variable or its negation
- Clauses: Disjunctions (OR) of literals
- Formula: A conjunction (AND) of clauses (CNF form)
Example problem
How MiniSat works
MiniSat uses the DPLL algorithm with modern enhancements:Core algorithm steps
Unit propagation
When a clause has only one unassigned literal, that literal must be true. MiniSat automatically assigns it and propagates consequences.
Decision
When no more unit propagations are possible, MiniSat picks an unassigned variable and assigns it a value based on heuristics.
Conflict analysis
If a conflict occurs (a clause becomes false), MiniSat analyzes the conflict to learn a new clause that prevents the same mistake.
Key optimizations
Conflict-driven clause learning (CDCL)
Conflict-driven clause learning (CDCL)
When conflicts occur, MiniSat learns new clauses that capture the reason for the conflict. These learned clauses guide future search and prevent repeating the same mistakes.
Variable activity heuristics
Variable activity heuristics
MiniSat tracks variable activity and prioritizes variables that appear frequently in recent conflicts. This focuses the search on the most constrained parts of the problem.
Two-watched literals
Two-watched literals
Instead of checking every clause after each assignment, MiniSat uses a watched literals scheme that only examines clauses when necessary, dramatically improving performance.
Restart strategies
Restart strategies
MiniSat periodically restarts the search to escape from unproductive regions while keeping learned clauses. This prevents getting stuck in difficult parts of the search space.
Solver results
When you callsolve(), MiniSat returns one of three results:
The
lbool type represents lifted booleans with three values: l_True, l_False, and l_Undef. This allows MiniSat to represent unknown or undefined states during the solving process.Performance characteristics
MiniSat is highly optimized for industrial SAT problems:- Time complexity: Exponential worst-case, but often polynomial in practice
- Space complexity: Linear in the number of variables and clauses
- Learned clauses: May grow significantly during solving
- Memory management: Automatic garbage collection for deleted clauses
Next steps
Variables and literals
Learn how variables and literals are represented in MiniSat
Clauses
Understand how clauses are stored and manipulated
DIMACS format
Learn the standard input format for SAT problems
API reference
Explore the complete MiniSat API