Home Knowledge Base SAT solving

SAT solving is the problem of determining whether a boolean formula can be satisfied — finding an assignment of true/false values to variables that makes the formula true, or proving that no such assignment exists, serving as the foundation for many automated reasoning and verification tasks.

What Is SAT?

Why SAT Solving?

CNF (Conjunctive Normal Form)

Example: SAT Problem

Formula: (x ∨ y) ∧ (¬x ∨ z) ∧ (¬y ∨ ¬z)

Try x=true:
  Clause 1: (true ∨ y) = true ✓
  Clause 2: (¬true ∨ z) = (false ∨ z) = z
    → Must have z=true
  Clause 3: (¬y ∨ ¬true) = (¬y ∨ false) = ¬y
    → Must have y=false

Check: (true ∨ false) ∧ (false ∨ true) ∧ (true ∨ false)
     = true ∧ true ∧ true = true ✓

Solution: x=true, y=false, z=true (SAT)

DPLL Algorithm

1. Unit Propagation: If clause has only one unassigned literal, assign it to satisfy the clause. 2. Pure Literal Elimination: If variable appears only positive (or only negative), assign it to satisfy all clauses. 3. Branching: Pick unassigned variable, try both true and false. 4. Backtrack: If conflict, undo assignments and try alternative.

CDCL (Conflict-Driven Clause Learning)

1. Make decisions and propagate. 2. If conflict: Analyze conflict, learn clause, backtrack. 3. Learned clause prevents repeating same mistake. 4. Continue until SAT or UNSAT proven.

Example: CDCL Learning

Formula: (x ∨ y) ∧ (¬x ∨ z) ∧ (¬y ∨ ¬z) ∧ (¬z ∨ w) ∧ (¬w)

Decisions: x=true, y=true
Propagation:
  From (¬x ∨ z): z=true
  From (¬y ∨ ¬z): conflict! (y=true and z=true violate this)

Conflict Analysis:
  Why conflict? Because x=true → z=true and y=true → ¬z
  Learn clause: (¬x ∨ ¬y)  # x and y can't both be true

Add learned clause to formula, backtrack, continue.

Applications

SAT Solvers

Example: Encoding Graph Coloring as SAT

Problem: Color graph with 3 colors such that adjacent nodes have different colors.

Variables: x_i_c = "node i has color c"
  For 3 nodes, 3 colors: x_1_1, x_1_2, x_1_3, x_2_1, x_2_2, x_2_3, x_3_1, x_3_2, x_3_3

Constraints:
  1. Each node has exactly one color:
     (x_1_1 ∨ x_1_2 ∨ x_1_3) ∧ (¬x_1_1 ∨ ¬x_1_2) ∧ (¬x_1_1 ∨ ¬x_1_3) ∧ (¬x_1_2 ∨ ¬x_1_3)
     ... (similar for nodes 2 and 3)

  2. Adjacent nodes have different colors:
     If nodes 1 and 2 are adjacent:
     (¬x_1_1 ∨ ¬x_2_1) ∧ (¬x_1_2 ∨ ¬x_2_2) ∧ (¬x_1_3 ∨ ¬x_2_3)

SAT solver finds satisfying assignment → valid coloring.

MaxSAT

Incremental SAT

Challenges

SAT Solver Heuristics

LLMs and SAT Solving

Benefits

Limitations

SAT solving is a cornerstone of automated reasoning — despite being NP-complete, modern SAT solvers are remarkably effective on real-world problems, making SAT solving essential for verification, testing, planning, and many other applications.

sat solving

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.