Lecture 4 · DPLL

Introduction to Automated Reasoning · Lecture 04。个人学习讲义与配套实验,按主题整理并持续修订。

课程源码 ZIP ↓

个人整理的学习笔记,非官方讲义;课程来源与整理说明见课程介绍。配套示例未逐一运行验证。

本篇目录

Maps to: Stanford CS 257 Introduction to Automated Reasoning (Winter 2026), Lecture 4 · Thu 01/15/2026 · Propositional logic: DPLL (guest lecture by Clark Barrett). Reading: Kroening & Strichman, Decision Procedures (DP), Chapter 2 (decision procedures for propositional logic: DPLL, unit propagation and watched literals, decision heuristics). Basis: The Stanford slides are on Canvas and not public. This lecture follows the public decks of the Iowa course CS:4980 (Cesare Tinelli, Spring 2024), which state that they are adapted from slides by Clark Barrett, Caroline Trippel and Andrew (Haoze) Wu at Stanford and by Emina Torlak at the University of Washington: the first half of DPLL and CDCL and the end of Decision Procedures for Satisfiability (“from DP to DPLL”). “The slides” below means those decks. Reused from them:

  • the original DPLL idea and the step from DP to DPLL;
  • the clause terminology (satisfied, conflicting, unit, unresolved);
  • Abstract DPLL with the rules PROPAGATE, PURE, DECIDE, BACKTRACK, FAIL;
  • the derivation example on {{1,2ˉ},{1ˉ,2ˉ},{2,3},{3ˉ,2},{1,4}}\{\{1, \bar 2\}, \{\bar 1, \bar 2\}, \{2, 3\}, \{\bar 3, 2\}, \{1, 4\}\} and the exercise;
  • the remark that DPLL can be turned into a resolution proof;
  • the three shortcomings of DPLL that motivate CDCL.

These notes add proofs of correctness for Abstract DPLL, unit propagation engines including two watched literals, decision heuristics, the construction of tree-like resolution proofs from DPLL runs, and the phase transition of random 3-SAT. Four experiments measure each of them. The experiments and their code were designed for these notes and do not reflect what was said in class. Code: code/lecture04/ (4 scripts + 1 module; Python standard library only, matplotlib optional; from 3 seconds to about 50 seconds each) Reading time: 3–4 hours including running the code


0. How to read this lecture

0.1 Learning goals

After this lecture you should be able to:

  1. Explain the step from Davis–Putnam to DPLL: split instead of eliminate, and why that trades memory for time.
  2. Run DPLL by hand, recursively and as the Abstract DPLL proof system, and read its derivation tables.
  3. Prove Abstract DPLL sound, complete and terminating with invariants and a lexicographic measure.
  4. Explain why unit propagation is the workhorse of SAT solving and implement it with two watched literals.
  5. Define and compare decision heuristics (DLIS, Jeroslow–Wang, MOMS), and explain why they are encoding-sensitive.
  6. Turn a failed DPLL search into a tree-like resolution refutation, and draw the consequences for lower bounds.
  7. Describe the phase transition of random 3-SAT and the easy–hard–easy pattern.
  8. Name the shortcomings of DPLL that CDCL removes, and show them on a measured example.

0.2 Prerequisites and scope

AssumedIntroduced hereDeveloped later
clause sets, unit resolution, DP (Lecture 2)splitting, decision levels, backtrackingnon-chronological backjumping (Lecture 5)
proof systems, invariants, measures, strategies (Lecture 3)Abstract DPLL and its correctnessabstract CDCL (Lecture 5), DPLL(T) (Lecture 10)
tree vs DAG resolution proofs (Lecture 2)DPLL runs as tree-like refutationsCDCL and DRUP proofs (Lecture 5)
the adder miters of Lectures 1–2DPLL’s exponential behaviour on themCDCL on the same miters (Lecture 5)

0.3 Map

§1  from Davis–Putnam to DPLL: split, propagate, backtrack
§2  the recursive procedure; correctness and cost against DP and semantic arguments      ← code 01
§3  Abstract DPLL: states, rules, the slides' derivations; correctness proofs             ← code 02
§4  unit propagation: the workhorse; naive, counting and two watched literals            ← code 03
§5  decision heuristics                                                                   ← code 04
§6  DPLL refutations are tree-like resolution proofs                                     ← code 02
§7  random 3-SAT and the phase transition                                                ← code 04
§8  the limits of DPLL, and the road to CDCL                                             ← code 04
§9 summary   §10 common pitfalls   §11 exercises   §12 further reading   §13 next lecture

0.4 Notation

SymbolMeaning
1,2,3ˉ,…1, 2, \bar 3, \dotsliterals, with pnp_n abbreviated as nn (as in the slides); in code and output 3ˉ\bar 3 is written ¬3
lˉ\bar lthe complement of ll
MMa sequence of literals (a partial assignment); ∙l\bullet l marks a decision literal
MiM_i, M[i]M[i]decision level ii of MM (the literals after the ii-th decision); levels 0..i0..i
l∈Ml \in M / ”ll is false in MM”ll is assigned true / lˉ∈M\bar l \in M
⟨M,Δ⟩\langle M, \Delta \ranglea state of Abstract DPLL; UNSAT is the failure state

The slides’ clause terminology, for the partial assignment v={p1↦true,p2↦false,p4↦true}v = \{p_1 \mapsto \text{true}, p_2 \mapsto \text{false}, p_4 \mapsto \text{true}\}:

clausestatus under vvwhy
{p1,p3,p4}\{p_1, p_3, p_4\}satisfieda literal is true
{¬p1,p2}\{\neg p_1, p_2\}conflictingevery literal is false
{¬p1,¬p4,p3}\{\neg p_1, \neg p_4, p_3\}unitall literals but one are false, the last (p3p_3) unassigned
{¬p1,p3,p5}\{\neg p_1, p_3, p_5\}unresolvednone of the above

0.5 The code of this lecture

One module, dpll.py, with four versions of the same procedure:

  • dpll_recursive — the textbook recursion on clause sets, with traces;
  • AbstractDPLL — the slides’ proof system on states ⟨M,Δ⟩\langle M, \Delta \rangle, printing derivation tables in the slides’ format, runnable with any strategy;
  • DPLLSolver — an iterative solver on a trail with chronological backtracking, three unit-propagation engines (naive, counting, watched) and five decision heuristics (first, random, dlis, jw, moms), with machine-independent work counters;
  • dpll_refutation — DPLL that records why each branch failed, producing a tree-like resolution refutation that Lecture 2’s checker verifies.

1. From Davis–Putnam to DPLL

Lecture 2 ended with a trade-off. The Davis–Putnam procedure (1960) never guesses: it eliminates variables by resolution. But each elimination can square the number of clauses, and on random 3-CNF with 4.26 clauses per variable it ran out of a 2-million-pair budget at 25 variables.

Two years later, Davis, Logemann and Loveland (1962) replaced elimination by splitting. The slides:

Let Δ\Delta be the input clause set. Choose a literal ll occurring in Δ\Delta. Recursively check Δ∪{{l}}\Delta \cup \{\{l\}\}; if SAT, return SAT. Otherwise recursively check Δ∪{{lˉ}}\Delta \cup \{\{\bar l\}\} and return that result.

Intuition. DP asks “what do all the clauses say about xx, taken together?” and writes the answer down as new clauses — a lot of writing. DPLL asks “what if xx were true?” and looks: the unit clause {x}\{x\} is propagated at once, the problem shrinks, and if it fails, “what if xx were false?”. Nothing is written down beyond the current branch. A detective who keeps a notebook of every inference (DP) versus one who tries a hypothesis, follows its consequences, and crosses it out when it fails (DPLL).

DPLL is built from three ingredients, each met before:

ingredientfromrole
splitting on a variablethe SPLIT rule (Lectures 1, 3)exhaustive, disjoint cases: every assignment is in exactly one branch
unit propagationDP’s 1-literal rule, unit resolution (Lecture 2)deduce instead of guess; complete with splitting
backtrackingdepth-first searchmemory linear in the number of variables

Modern CDCL solvers (Lecture 5) are still DPLL at heart: the slides call modern SAT solvers an extension of the DPLL procedure.


2. The recursive procedure

2.1 The algorithm

DPLL(Δ):
    repeat:                                  # simplify
        if {} ∈ Δ: return UNSAT              #   a conflict
        if some {l} ∈ Δ: Δ := Δ|l            #   unit propagation: make l true
        elif some literal l is pure: Δ := Δ|l  #   (optional) pure literal
        else: break
    if Δ = ∅: return SAT
    choose a literal l
    if DPLL(Δ|l) = SAT: return SAT
    return DPLL(Δ|l̄)

where Δ∣l\Delta|l removes the clauses containing ll and deletes lˉ\bar l from the others. Script 01 (Part 1) traces it on the slides’ DPLL example (the clause set of §3.3) and on DP example 2:

Δ = {p1, ¬p2} {¬p1, ¬p2} {p2, p3} {¬p3, p2} {p1, p4}       Δ = {p1, p2} {p1, ¬p2} {¬p1, p3} {¬p1, ¬p3}
pure 4                                                     decide 1
decide 1                                                      unit 3
   unit ¬2                                                    conflict
   unit 3                                                  decide ¬1
   conflict                                                   unit 2
decide ¬1                                                     conflict
   unit ¬2                                                 -> UNSAT
   unit 3
   conflict
-> UNSAT

Each split creates two simpler problems: the decision literal becomes a unit clause, and unit propagation follows. In both examples, a single decision suffices to expose the conflict, in each branch.

2.2 Correct, and cheap in memory

DPLL is sound and complete because splitting is exhaustive (every model makes ll true or false) and simplification by a unit clause preserves satisfiability given that branch; it terminates because every split removes a variable. §3 proves this formally for the abstract version. Script 01 (Part 2) checks it on 2,000 random clause sets (3–12 variables): the recursive and the iterative solver agree with the truth table 2,000/2,000 times, and all 1,225 models returned satisfy their input.

Memory. The recursion keeps one simplified copy of the clauses per level; the iterative solver of §4 keeps only the input and a trail of at most nn assigned literals. Script 01 (Part 3) runs both procedures on the very instances where DP drowned in Lecture 2 (3 instances per row):

varsclausesDP: peak clausesDPLL: decisionsDPLL: max level
104378, 66, 616, 4, 46
20852,047, 1,953, 2,97212, 16, 1515
25106> 8,798, > 6,947, > 6,855 (stopped)10, 17, 88
50213(not run)80, 58, 6014
100426(not run)407, 714, 12532

Space was DP’s bottleneck; DPLL removes it. Its time still grows exponentially — the decision counts climb — but at 100 variables it is still well under a second here.

2.3 Why split on variables? Lecture 1’s puzzle solved

Lecture 1’s semantic argument also splits — on formulas: from I⊨a∨b∨cI \models a \vee b \vee c it branches into I⊨aI \models a and I⊨b∨cI \models b \vee c. Script 01 (Part 4) runs it and DPLL on the same random 3-CNF (5 clauses per variable; the tableau stops at its first open branch, as in Lecture 1):

varstableau lines, plaintableau lines, skip fulfilledDPLL nodestruth-table rows
336, 16,456, 20,63936, 1,636, 1,2704, 7, 78
4> 100,000, 84,151, > 100,0006,574, 2,998, 2,8507, 7, 616
5> 100,000, 273, > 100,0001,406, 106, 23,3815, 4, 632

Thousands of tableau lines against a handful of DPLL nodes, on identical inputs. The three differences are exactly what Lecture 1’s “plan vs reality” diagnosed:

  1. Disjoint cases. xx and ¬x\neg x cannot both hold, so each assignment is explored once; the cases aa and b∨cb \vee c overlap.
  2. Satisfied clauses disappear. After xx is set, every clause containing xx is gone for the rest of the branch; the tableau splits on satisfied disjunctions again and again.
  3. Propagation after every decision. Forced literals are deduced before the next guess.

Run it. python3 01_from_dp_to_dpll.py (about 6 seconds).


3. Abstract DPLL

3.1 States and rules

To reason about DPLL independently of data structures, the slides present it as a satisfiability proof system in the style of Lecture 3 (after Nieuwenhuis, Oliveras and Tinelli 2006, and Krstić and Goel 2007). A state is UNSAT or a pair ⟨M,Δ⟩\langle M, \Delta \rangle: MM is a sequence of literals, some marked as decision points ∙\bullet; Δ\Delta is the clause set. MM determines the partial assignment vM(p)=truev_M(p) = \text{true} if p∈Mp \in M, false if pˉ∈M\bar p \in M, undefined otherwise. The initial state is ⟨ϵ,Δ0⟩\langle \epsilon, \Delta_0 \rangle; the expected final states are UNSAT, or ⟨M,Δ⟩\langle M, \Delta \rangle with MM a model.

\textscPropagate {l1,…,ln,l}∈Δlˉ1,…,lˉn∈Ml,lˉ∉MM:=M l\textscPure l literal of Δlˉ not literal of Δl,lˉ∉MM:=M l\textscDecide l∈Lits(Δ)l,lˉ∉MM:=M∙l\textscBacktrack {l1,…,ln}∈Δlˉ1,…,lˉn∈MM=M1∙l M2∙∉M2M:=M1 lˉ\textscFail {l1,…,ln}∈Δlˉ1,…,lˉn∈M∙∉MUNSAT\begin{aligned} &\textsc{Propagate}\ \frac{\{l_1, \dots, l_n, l\} \in \Delta \quad \bar l_1, \dots, \bar l_n \in M \quad l, \bar l \notin M}{M := M\, l} &&\textsc{Pure}\ \frac{l \text{ literal of } \Delta \quad \bar l \text{ not literal of } \Delta \quad l, \bar l \notin M}{M := M\, l}\\[6pt] &\textsc{Decide}\ \frac{l \in \mathrm{Lits}(\Delta) \quad l, \bar l \notin M}{M := M \bullet l} &&\textsc{Backtrack}\ \frac{\{l_1, \dots, l_n\} \in \Delta \quad \bar l_1, \dots, \bar l_n \in M \quad M = M_1 \bullet l\, M_2 \quad \bullet \notin M_2}{M := M_1\, \bar l}\\[6pt] &\textsc{Fail}\ \frac{\{l_1, \dots, l_n\} \in \Delta \quad \bar l_1, \dots, \bar l_n \in M \quad \bullet \notin M}{\mathit{UNSAT}} \end{aligned}

(Lits(Δ)\mathrm{Lits}(\Delta) contains the literals of Δ\Delta and their complements.) The clause that makes PROPAGATE fire is the antecedent of ll. BACKTRACK goes back over the last decision only — the premise ∙∉M2\bullet \notin M_2 enforces chronological backtracking — and puts the complement of the decision literal in its place, now without a decision mark: it is no longer a guess but a consequence. Note that no rule changes Δ\Delta: DPLL learns nothing (CDCL’s rules will).

3.2 The slides’ derivation and exercise

Δ0={{1,2ˉ},{1ˉ,2ˉ},{2,3},{3ˉ,2},{1,4}}\Delta_0 = \{\{1, \bar 2\}, \{\bar 1, \bar 2\}, \{2, 3\}, \{\bar 3, 2\}, \{1, 4\}\}. Script 02 (Part 1) runs Abstract DPLL with the slides’ priorities (repair a conflict, then PROPAGATE, then PURE, then DECIDE) and prints:

MMrule
44PURE
4∙14 \bullet 1DECIDE
4∙1 2ˉ4 \bullet 1\, \bar 2PROPAGATE (by {1ˉ,2ˉ}\{\bar 1, \bar 2\})
4∙1 2ˉ 34 \bullet 1\, \bar 2\, 3PROPAGATE (by {2,3}\{2, 3\})
4 1ˉ4\, \bar 1BACKTRACK (conflicting clause {3ˉ,2}\{\bar 3, 2\})
4 1ˉ 2ˉ4\, \bar 1\, \bar 2PROPAGATE (by {1,2ˉ}\{1, \bar 2\})
4 1ˉ 2ˉ 34\, \bar 1\, \bar 2\, 3PROPAGATE
UNSATFAIL (conflicting clause {3ˉ,2}\{\bar 3, 2\}, no decision left)

The exercise decides 3 first: 44, 4∙34 \bullet 3, 4∙3 24 \bullet 3\, 2 (by {3ˉ,2}\{\bar 3, 2\}), 4∙3 2 14 \bullet 3\, 2\, 1 (by {1,2ˉ}\{1, \bar 2\}), BACKTRACK on {1ˉ,2ˉ}\{\bar 1, \bar 2\} to 4 3ˉ4\, \bar 3, then 4 3ˉ 24\, \bar 3\, 2, 4 3ˉ 2 14\, \bar 3\, 2\, 1, FAIL. Both tables match the slides row for row.

On a satisfiable set the run stops when no rule applies. On {{1},{1ˉ,2},{3,4},{5ˉ,6ˉ},{1ˉ,5ˉ,7},{2ˉ,5ˉ,6,7ˉ}}\{\{1\}, \{\bar 1, 2\}, \{3, 4\}, \{\bar 5, \bar 6\}, \{\bar 1, \bar 5, 7\}, \{\bar 2, \bar 5, 6, \bar 7\}\} (the set Lecture 5 will use for CDCL), the default strategy propagates 1 and 2, sets the pure literals 3, 4 and 5ˉ\bar 5, then decides 6 and 7: M=1 2 3 4 5ˉ∙6∙7M = 1\,2\,3\,4\,\bar 5 \bullet 6 \bullet 7, a model.

3.3 Correctness

We prove the three properties of Lecture 3. (For simplicity, leave PURE aside first; it is discussed at the end.)

Lemma (invariants). In every state ⟨M,Δ⟩\langle M, \Delta \rangle reachable from ⟨ϵ,Δ0⟩\langle \epsilon, \Delta_0 \rangle:

  1. MM contains no literal twice and never both ll and lˉ\bar l;
  2. every non-decision literal ll of MM is entailed by Δ\Delta together with the decision literals that precede it in MM.

Proof. (1) Every rule adds only literals whose variable is unassigned. (2) By induction on the derivation. PROPAGATE adds ll because of {l1,…,ln,l}∈Δ\{l_1, \dots, l_n, l\} \in \Delta with all lˉi∈M\bar l_i \in M; each lˉi\bar l_i is a decision or (by induction) entailed by Δ\Delta and earlier decisions, so Δ\Delta plus the decisions entail lˉ1∧⋯∧lˉn\bar l_1 \wedge \dots \wedge \bar l_n, and with the clause, ll. BACKTRACK applies when a clause C∈ΔC \in \Delta is false in M=M1∙l M2M = M_1 \bullet l\, M_2: by the invariant, Δ∧d1∧⋯∧dk\Delta \wedge d_1 \wedge \dots \wedge d_k entails every literal of MM, hence ¬C\neg C, while C∈ΔC \in \Delta — so Δ∧d1∧⋯∧dk\Delta \wedge d_1 \wedge \dots \wedge d_k is unsatisfiable, where dk=ld_k = l is the last decision. Therefore Δ∧d1∧⋯∧dk−1⊨lˉ\Delta \wedge d_1 \wedge \dots \wedge d_{k-1} \models \bar l: exactly invariant (2) for lˉ\bar l in M1 lˉM_1\, \bar l. ∎

Theorem. Abstract DPLL is sound, complete and terminating.

Soundness of FAIL. FAIL applies when a clause C∈ΔC \in \Delta is false in MM and MM has no decision. By the invariant, Δ\Delta entails every literal of MM, hence ¬C\neg C; with C∈ΔC \in \Delta, Δ\Delta is unsatisfiable.

Final SAT states. If no rule applies to ⟨M,Δ⟩\langle M, \Delta \rangle, then no clause is false in MM (otherwise BACKTRACK or FAIL would apply), and every variable of Δ\Delta is assigned (otherwise DECIDE would apply). So every clause has all its literals assigned and not all false: it contains a true literal. MM is a model.

Termination. For M=M0∙M1∙⋯∙MkM = M_0 \bullet M_1 \bullet \cdots \bullet M_k, consider the tuple (∣M0∣,∣M1∣,…,∣Mk∣,0,…,0)(|M_0|, |M_1|, \dots, |M_k|, 0, \dots, 0) of length n+1n + 1 (there are at most nn decisions). PROPAGATE and PURE increase the last non-zero component; DECIDE turns a 0 into 1 at a new position; BACKTRACK removes level kk and adds lˉ\bar l to level k−1k - 1, so component k−1k - 1 increases and later components become 0. Every rule increases the tuple lexicographically. All components are at most nn, so there are finitely many tuples, and no derivation is infinite.

Completeness. Every derivation is finite, and in a final state either FAIL has produced UNSAT or no rule applies, in which case MM is a model. So every maximal derivation ends with a verdict — by Lecture 3, Abstract DPLL is a decision procedure, for every strategy.

PURE. A pure literal is not entailed; it is merely harmless: if Δ\Delta (with the current decisions) has a model, it has one in which ll is true, since no clause contains lˉ\bar l. The proof goes through if pure literals are treated like decisions in invariant (2) — they are assumptions that can never cause a conflict.

Checked by machine. Script 02 (Part 2) runs Abstract DPLL on 1,000 random clause sets (3–6 variables), each with a random strategy (a random applicable rule instance at every step), and checks every step:

checkresult
final state correct (UNSAT iff unsatisfiable; SAT with a model)1,000 / 1,000
steps where MM contains ll and lˉ\bar l0
deduced literals not entailed by Δ\Delta + the decisions and pure literals before them0
steps where the measure did not increase lexicographically0
median / max number of steps7 / 53

3.4 Which rules are necessary?

The proof shows something surprising: DECIDE, BACKTRACK and FAIL alone are already sound, complete and terminating — the final-state argument never used PROPAGATE. That system enumerates assignments and backtracks at the first falsified clause: a truth table that stops early. Script 02 (Part 3), on 300 random 3-CNF with 4–8 variables at 4.26 clauses per variable:

variantcorrectmean stepsmax stepsmean DECIDE steps
all rules300 / 30014.3563.8
without PURE300 / 30014.3563.8
without PROPAGATE and PURE300 / 30035.319119.0

PROPAGATE is “only” an optimization — the one that matters: 2.5 times fewer steps and 5 times fewer guesses even on these tiny instances. PURE fired once in the 300 runs: with the slides’ definition a literal must be pure in all of Δ\Delta, which almost never happens at this density. Modern solvers drop PURE.

Run it. python3 02_abstract_dpll.py (about 7 seconds).


4. Unit propagation: the workhorse

4.1 Who does the work?

Script 03 (Part 1) counts how the variables of a solved instance got their values:

instancevarsclausesdecisionspropagationsby propagationconflicts
Sudoku (easy)72912,0200729100.0%0
Sudoku (hard)72912,009272,25798.8%18
12-queens1442,60813870083.5%34
random 3-SAT, 50 vars (UNSAT)502134879394.3%49
random 3-SAT, 200 vars, 3 clauses/var2006001435728.5%0
pigeonhole, 5 holes30813743,12789.3%375
6-bit adder miter722022,19420,12290.2%2,195

(Propagations count every deduced assignment over the whole search, so they can exceed the number of variables.) The easy Sudoku is solved by unit propagation alone. On every constrained instance, 83–99% of assignments are deduced; only the under-constrained random instance is decided mostly by guesses — and it never meets a conflict. The time of a DPLL solver is dominated by unit propagation, so its implementation matters.

4.2 Three implementations

The question unit propagation asks after each assignment: which clauses just became unit or conflicting?

  1. Naive. Scan every clause, repeat until nothing changes. Simple, and hopeless on large inputs.
  2. Counting. Keep, for each clause, the number of true and of false literals, and occurrence lists from literals to clauses. Assigning ll updates every clause containing ll or lˉ\bar l; a clause with no true literal and one unassigned literal is unit. The catch: backtracking must undo every counter update.
  3. Two watched literals (Moskewicz, Madigan, Zhao, Zhang and Malik, Chaff, 2001). Each clause watches two of its literals. A clause can become unit or conflicting only when one of its watched literals becomes false; until then it is ignored. When a watched literal becomes false, look for another literal of the clause that is not false and watch it instead; if there is none, the other watch is the only candidate: if it is unassigned the clause is unit, if false it is conflicting.

The invariant behind watched literals: in a state where propagation has finished without conflict, for every clause, either both watched literals are non-false, or one of them is true. Backtracking only unassigns literals, which can only make literals non-false, so the invariant survives: nothing needs to be done on backtracking. That is the decisive advantage over counting, since a DPLL (and CDCL) solver backtracks constantly.

Script 03 (Part 3) follows one clause C={p1,p2,p3,p4}C = \{p_1, p_2, p_3, p_4\}, initially watching p1,p2p_1, p_2:

eventvisits of CCwatches afterwardseffect
assign ¬p3\neg p_30p1,p2p_1, p_2– (p3p_3 is not watched)
assign ¬p1\neg p_11p2,p4p_2, p_4the watch moves to p4p_4
assign ¬p4\neg p_41p2,p4p_2, p_4no replacement left: p2p_2 propagated
backtrack: undo ¬p4\neg p_4 and p2p_20p2,p4p_2, p_4nothing to do
assign p4p_40p2,p4p_2, p_4–

4.3 Measured: same search, different cost

All three engines reach the same propagation fixpoint, so with the same heuristic they perform the same search (script 03 checks: same decisions and conflicts). Only the work differs (Part 2):

instanceengineclause visitsvisits per propagation
Sudoku (hard)naive / counting / watched1,937,323 / 139,348 / 16,168864.1 / 62.7 / 7.2
12-queensnaive / counting / watched629,494 / 59,188 / 6,419891.6 / 84.6 / 9.2
random 3-SAT, 50 vars (UNSAT)naive / counting / watched43,185 / 23,467 / 2,85851.2 / 29.4 / 3.6
random 3-SAT, 200 varsnaive / counting / watched109,200 / 1,857 / 5711,915.8 / 32.6 / 10.0
pigeonhole, 5 holesnaive / counting / watched92,404 / 49,447 / 6,24229.6 / 15.8 / 2.0
6-bit adder miternaive / counting / watched2,420,817 / 351,883 / 62,549125.0 / 17.9 / 3.1

Watched literals visit 15 to 190 times fewer clauses than naive rescanning, and several times fewer than counting (whose figures include the undo work on backtracking). In our Python code the wall-clock gap between counting and watching is smaller than the visit counts suggest, since each watched visit does more interpreted work; in compiled solvers the visits dominate.

Run it. python3 03_unit_propagation.py (about 3 seconds).


5. Decision heuristics

When nothing can be deduced, DPLL must guess. Which variable, and which value? A good choice leads quickly to a model or to a short refutation; a bad one explores a big useless subtree. Classic heuristics score literals by looking at the unresolved clauses (not yet satisfied) and their unassigned literals:

heuristicscore of literal llintuition
firstsmallest unassigned variable, value trueno intelligence: a baseline
randomrandom variable and valueanother baseline
DLIS (dynamic largest individual sum)number of unresolved clauses containing llsatisfy as many clauses as possible
Jeroslow–Wang (JW)J(l)=∑C∋l, C unresolved2−∣C∣J(l) = \sum_{C \ni l,\ C \text{ unresolved}} 2^{-\lvert C \rvert}short clauses weigh more: they are closest to becoming unit or conflicting (2−∣C∣2^{-\lvert C\rvert} is the chance that a random assignment falsifies CC)
MOMSamong the shortest unresolved clauses, occurrence counts ff; choose xx maximizing (f(x)+f(xˉ))⋅210+f(x)f(xˉ)(f(x) + f(\bar x)) \cdot 2^{10} + f(x) f(\bar x)Maximum Occurrences in clauses of Minimum Size; the product favours variables that occur in both polarities (Freeman 1995)

(Our JW uses the current number of unassigned literals as ∣C∣|C|.) Script 04 (Part 1) — decisions until the answer:

instancefirstrandomDLISJWMOMS
random 3-SAT, 75 vars, 320 clauses (median of 5)1,368604453421
pigeonhole, 5 holes374214374374259
10-queens2813144144115
Sudoku (hard)27> 1,000> 1,000> 1,000> 1,000
6-bit adder miter4,0957,4645,0852,1941,950
  • On random 3-SAT, counting heuristics need 30 to 65 times fewer decisions than a fixed order.
  • On n-queens and Sudoku the ranking flips. These encodings consist mostly of binary at-most-one clauses ¬x∨¬y\neg x \vee \neg y (Lecture 2, §8), so negative literals (“no queen here”, “this cell is not a 3”) occur in many short clauses, and the counting heuristics keep choosing them — which propagates little. The fixed order sets a variable true (place a queen, fill a cell), which propagates a lot. Heuristics are encoding-sensitive: the same problem, encoded differently, can reverse their ranking.
  • No heuristic is best everywhere. These “static counting” heuristics also cost a full scan of the clauses per decision. Modern solvers use VSIDS (Variable State Independent Decaying Sum, also from Chaff), which scores variables by their involvement in recent conflicts — cheap to maintain and robust — but it needs the learned clauses of CDCL to work well (Lecture 5).

6. DPLL refutations are tree-like resolution proofs

The slides note that the search of DPLL can be turned, after the fact, into a resolution proof. Here is the construction that dpll_refutation implements.

Attach to every failed node of the search, with partial assignment α\alpha, a clause CαC_\alpha that is falsified by α\alpha — the reason for the failure:

  • at a conflict, CαC_\alpha is the input clause all of whose literals are false under α\alpha;
  • at a split on xx, the children give C1C_1 (falsified by α∪{x}\alpha \cup \{x\}) and C0C_0 (falsified by α∪{xˉ}\alpha \cup \{\bar x\}). If C1C_1 does not contain xˉ\bar x, it is already falsified by α\alpha: take it. Likewise for C0C_0 and xx. Otherwise C1C_1 contains xˉ\bar x and C0C_0 contains xx: their resolvent on xx is falsified by α\alpha;
  • a unit propagation of ll by clause DD is a split whose lˉ\bar l-branch fails at once, with DD as its clause.

At the root, α\alpha is empty, and the only clause falsified by the empty assignment is {}\{\}. So a failed DPLL search, read bottom-up, is a resolution refutation — a tree-like one, since the two branches share nothing. On DP example 2 the search of §2.1 gives three steps:

5. {¬p1}   resolve {¬p1, p3}, {¬p1, ¬p3} on p3      (the branch p1 failed)
6. {p1}    resolve {p1, p2}, {p1, ¬p2} on p2        (the branch ¬p1 failed)
7. {}      resolve 6, 5 on p1                        (the split on p1)

On the slides’ DPLL example the extracted proof derives {p2}\{p_2\} twice (lines 5 and 7 of script 02’s output): a tree cannot reuse a clause. Script 02 (Part 4) extracts proofs from DPLL and lets Lecture 2’s independent checker verify them:

unsatisfiable inputDPLL nodestree-like refutation stepscheckerLecture 2 saturation: DAG steps
random 3-CNF #1 (10 vars, 60 clauses)4335yes31
random 3-CNF #23428yes36
random 3-CNF #32622yes27
pigeonhole, 3 holes6642yes66
pigeonhole, 4 holes410188yes362
pigeonhole, 5 holes3,040970yes> budget

Two consequences:

  • A lower bound for every DPLL solver. Whatever its heuristics and data structures, DPLL’s running time is at least the size of the shortest tree-like resolution refutation of its input. Haken’s pigeonhole bound (Lecture 2) therefore applies, and tree-like resolution is known to be exponentially weaker than general resolution on some families.
  • A surprise in the measurements. The tree-like proofs DPLL finds are often shorter than the DAG proofs found by Lecture 2’s saturation (188 vs 362 steps on 4 holes), and DPLL finishes 5 holes, where saturation ran out of budget. A DAG proof can be shorter, but saturation’s shortest-clause-first strategy does not find the shortest one. As in Lecture 3, the strategy matters as much as the proof system.

7. Random 3-SAT and the phase transition

7.1 The model

A random kk-CNF with nn variables and mm clauses draws each clause by choosing kk distinct variables uniformly and negating each with probability 12\frac12 (the “fixed clause length” model). The key parameter is the density m/nm / n. Two easy facts:

  • The probability of satisfiability decreases with mm: adding a clause can only remove models.
  • First-moment bound. A fixed assignment satisfies a random 3-clause with probability 7/87/8, so the expected number of models is 2n(7/8)m2^n (7/8)^m. When m/n>ln⁡2/ln⁡(8/7)≈5.19m/n > \ln 2 / \ln(8/7) \approx 5.19, this expectation tends to 0, so the formula is unsatisfiable with high probability (exercise 9).

The true threshold is lower. Experiments by Mitchell, Selman and Levesque (1992) and Crawford and Auton (1996) located it near 4.26 clauses per variable for 3-SAT, and statistical-physics methods predict about 4.267 (Mézard, Parisi and Zecchina 2002) — as reported in the literature. Friedgut (1999) proved that the transition is sharp, and Ding, Sly and Sun (2015) proved the predicted threshold for all sufficiently large kk.

7.2 Easy–hard–easy, measured

Script 04 (Part 2) generates 30 instances per cell, for n=25..100n = 25..100 and densities 3.0 to 6.0, and runs DPLL (watched literals, Jeroslow–Wang). It reports the fraction of satisfiable instances and the median number of conflicts (failed branches — a better measure of search effort than decisions, because an easy satisfiable instance still needs one decision per unconstrained variable, but no conflict):

nn \ density3.03.54.04.254.54.755.05.56.0
P(SAT), n=25n = 251.000.970.900.500.500.370.230.000.00
P(SAT), n=100n = 1001.001.000.870.600.200.070.000.000.00
conflicts, n=25n = 2500010989109
conflicts, n=50n = 50001521.53140.5323027
conflicts, n=75n = 75012098172.5120.5119.57364.5
conflicts, n=100n = 1000115517604.5509.5363.5239138

Phase transition

  • Under-constrained (few clauses): almost always satisfiable, and easy — DPLL assigns values and never meets a conflict.
  • Over-constrained (many clauses): almost always unsatisfiable, and easy again — conflicts come fast and refutations are short.
  • At the transition (4.25–4.75 here), P(SAT) falls from near 1 to near 0, more steeply as nn grows, and the work peaks: at n=100n = 100, about 600 conflicts at density 4.5 against 0–1 at 3.5 and 138 at 6.0. The peak itself grows exponentially with nn (10 → 40.5 → 172.5 → 604.5 median conflicts from n=25n = 25 to 100).

Hardness is a property of the instance distribution, not of the size alone. Random instances at the threshold became the standard stress test for SAT solvers in the 1990s. Industrial instances behave very differently: they are huge but highly structured, which is what CDCL exploits.

Run it. python3 04_heuristics_and_phase_transition.py (about 50 seconds).


8. The limits of DPLL, and the road to CDCL

The slides list DPLL’s shortcomings on practical instances:

  1. No learning. All work done to conclude that the current assignment is bad is thrown away; bad partial assignments that fail for the same root cause are revisited.
  2. Chronological backtracking. It backtracks only one level, even when the assignment became doomed at a much lower level.
  3. Naïve decisions. It ignores the state of the search when choosing the next decision.

Script 04 (Part 3) shows the consequence on Lecture 1’s adder-equivalence problem (ripple-carry vs or-carry miter, Tseitin-encoded, Jeroslow–Wang):

bitsvarsclausesdecisionstruth-table rows
446128155256
6722022,1944,096
89827631,27165,536
9111313119,031262,144

The decisions grow by about ×3.8 per bit — the same rate as the 4n4^n rows of the truth table. On this problem plain DPLL is essentially an enumeration of half the input space: it needed about 8 seconds at 9 bits here, and the measured growth extrapolates to about 1.6×10141.6 \times 10^{14} seconds at 32 bits. Lecture 1’s bit-parallel truth table did 12 bits in under a tenth of a second.

Why? When the two adders disagree on a carry under some partial assignment, DPLL detects the conflict, backtracks one decision, and later meets the same carry conflict again in every other branch below the same root cause. A solver that learned a clause summarizing the cause (“these three carry bits cannot all be like this”) would never re-explore it, and could jump straight back to the decision that caused it. That is conflict-driven clause learning:

  • learning: add a clause, derived by resolution from the conflict, that captures its root cause;
  • non-chronological backjumping: jump back several levels, to where the learned clause becomes unit;
  • conflict-driven heuristics (VSIDS): decide on the variables involved in recent conflicts.

9. Summary

  1. DPLL = splitting on a variable + unit propagation + backtracking. It replaces DP’s variable elimination, trading DP’s memory explosion for (exponential, but often small) search time. Memory stays linear.
  2. Splitting on variables gives disjoint cases and removes satisfied clauses; splitting on formulas (semantic arguments) does neither — thousands of lines against a handful of nodes on the same instances.
  3. Abstract DPLL (PROPAGATE, PURE, DECIDE, BACKTRACK, FAIL) is a proof system; it is sound, complete and terminating for every strategy, proved by two invariants and a lexicographic measure on decision-level sizes, and checked step by step by machine.
  4. DECIDE + BACKTRACK + FAIL already decide SAT; unit propagation is what makes DPLL fast. It assigns 83–99% of the variables on constrained instances.
  5. Two watched literals make propagation cheap: a clause is visited only when a watch becomes false, and backtracking costs nothing.
  6. Decision heuristics (DLIS, JW, MOMS) help a lot on random instances and can hurt on structured ones; they are encoding-sensitive.
  7. A failed DPLL run is a tree-like resolution refutation; every DPLL solver is bounded below by tree-like resolution proof size.
  8. Random 3-SAT has a phase transition near 4.26 clauses per variable; the hardest instances cluster there (easy–hard–easy).
  9. DPLL has no learning and backtracks chronologically; on the adder miters its work grows like the truth table’s. CDCL fixes both.

10. Common pitfalls

PitfallWhy it is wrongCorrect view
“BACKTRACK undoes the last literal”It undoes everything after the last decision and flips that decisionM1∙l M2→M1 lˉM_1 \bullet l\, M_2 \to M_1\, \bar l
Keeping the decision mark on the flipped literallˉ\bar l is now entailed (by Δ\Delta and earlier decisions), not guessedWithout the mark; otherwise FAIL would never fire
“Unit propagation is needed for correctness”DECIDE + BACKTRACK + FAIL are already completeIt is needed for speed (§3.4)
“A pure literal is entailed”It is harmless, not entailedTreat it like a decision in the invariant
Updating watches on backtrackingUnassigning never breaks the watch invariantWatched literals need no undo work
Watching the same literal twiceThen one false literal makes the clause look unit or conflicting too earlyTwo distinct literals; unit clauses are handled before the search
Measuring random-instance hardness by decisionsEasy satisfiable instances need one decision per free variableCount conflicts (failed branches)
“A heuristic that wins on random 3-SAT wins everywhere”DLIS/JW lose on queens and Sudoku encodingsHeuristics are encoding-sensitive; VSIDS is the robust choice in CDCL
“DPLL beats truth tables”On the adder miters it grows at the same rateWithout learning, DPLL can re-explore the same conflict exponentially often

11. Exercises

Answers are collapsed; try each exercise first.

1. (Abstract DPLL) Run Abstract DPLL on {{1},{1ˉ,2},{3,4},{5ˉ,6ˉ},{1ˉ,5ˉ,7},{2ˉ,5ˉ,6,7ˉ}}\{\{1\}, \{\bar 1, 2\}, \{3, 4\}, \{\bar 5, \bar 6\}, \{\bar 1, \bar 5, 7\}, \{\bar 2, \bar 5, 6, \bar 7\}\} without PURE, deciding 3ˉ\bar 3 first and then 5 (then smallest variable, true first). Write the table.

Answer

11 PROPAGATE; 1 21\,2 PROPAGATE; 1 2∙3ˉ1\,2 \bullet \bar 3 DECIDE; 1 2∙3ˉ 41\,2 \bullet \bar 3\,4 PROPAGATE (by {3,4}\{3, 4\}); 1 2∙3ˉ 4∙51\,2 \bullet \bar 3\,4 \bullet 5 DECIDE; ⋯∙5 6ˉ\dots \bullet 5\, \bar 6 PROPAGATE (by {5ˉ,6ˉ}\{\bar 5, \bar 6\}); ⋯∙5 6ˉ 7\dots \bullet 5\, \bar 6\, 7 PROPAGATE (by {1ˉ,5ˉ,7}\{\bar 1, \bar 5, 7\}); conflict on {2ˉ,5ˉ,6,7ˉ}\{\bar 2, \bar 5, 6, \bar 7\}: BACKTRACK to 1 2∙3ˉ 4 5ˉ1\,2 \bullet \bar 3\,4\,\bar 5; DECIDE 6, DECIDE 7; no rule applies: SAT. (Lecture 5’s CDCL runs on the same set and learns the clause {1ˉ,2ˉ,5ˉ}\{\bar 1, \bar 2, \bar 5\} from the same conflict.)

2. (termination) Show that BACKTRACK increases the measure (∣M0∣,…,∣Mn∣)(|M_0|, \dots, |M_n|) lexicographically, using the slides’ example step 4∙1 2ˉ 3→4 1ˉ4 \bullet 1\, \bar 2\, 3 \to 4\, \bar 1.

Answer

Before: M0=4M_0 = 4, M1=1 2ˉ 3M_1 = 1\, \bar 2\, 3: tuple (1,3,0,… )(1, 3, 0, \dots). After: M0=4 1ˉM_0 = 4\, \bar 1: tuple (2,0,0,… )(2, 0, 0, \dots). The first component grew from 1 to 2, so the new tuple is larger, although it is “shorter” overall. In general BACKTRACK increases component k−1k - 1 and zeroes the later ones.

3. (soundness) Why must the flipped literal lˉ\bar l lose its decision mark? What would go wrong if BACKTRACK produced M1∙lˉM_1 \bullet \bar l?

Answer

lˉ\bar l is entailed by Δ\Delta and the earlier decisions (invariant proof, §3.3), so it is not a guess. If it kept a mark, the next conflict below it would BACKTRACK over it again, flipping lˉ\bar l back to ll — an infinite loop between the two values — and FAIL, which requires no decision in MM, would never be reachable. The measure argument would also break.

4. (final states) Prove that if no rule of Abstract DPLL applies to ⟨M,Δ⟩\langle M, \Delta \rangle, then MM satisfies Δ\Delta. Which rules does the proof use?

Answer

See §3.3: no conflicting clause (else BACKTRACK or FAIL), every variable assigned (else DECIDE). Only DECIDE, BACKTRACK and FAIL are used — which is why the system without PROPAGATE and PURE is still complete (§3.4).

5. (heuristics) Compute the JW scores of all literals for {a,b},{a,cˉ},{aˉ,b,c},{bˉ,c,d}\{a, b\}, \{a, \bar c\}, \{\bar a, b, c\}, \{\bar b, c, d\} (nothing assigned). Which literal does JW choose?

Answer

J(a)=14+14=12J(a) = \frac14 + \frac14 = \frac12; J(b)=14+18=38J(b) = \frac14 + \frac18 = \frac38; J(cˉ)=14J(\bar c) = \frac14; J(aˉ)=18J(\bar a) = \frac18; J(c)=18+18=14J(c) = \frac18 + \frac18 = \frac14; J(bˉ)=18J(\bar b) = \frac18; J(d)=18J(d) = \frac18. JW chooses aa (it satisfies both binary clauses).

6. (watched literals) Why two watches and not one? And why are clauses of length 1 not watched?

Answer

With one watch ww, the clause is unit when all other literals are false; detecting that needs to know when the second-to-last non-false literal becomes false — information a single watch cannot give without scanning. With two watches, as long as both are non-false the clause cannot be unit or conflicting; the moment one becomes false, a scan for a replacement either succeeds (keep ignoring the clause) or proves that the other watch is the last candidate. A unit clause has no second literal to watch: it is propagated once, before the search, at level 0 (and never unassigned).

7. (DPLL to resolution) Build the tree-like refutation from the DPLL run on DP example 2 (§2.1) by hand.

Answer

Branch p1p_1: unit p3p_3 (by {pˉ1,p3}\{\bar p_1, p_3\}) then conflict on {pˉ1,pˉ3}\{\bar p_1, \bar p_3\}: resolve them on p3p_3 into {pˉ1}\{\bar p_1\}, falsified by {p1}\{p_1\}. Branch pˉ1\bar p_1: unit p2p_2 by {p1,p2}\{p_1, p_2\}, conflict on {p1,pˉ2}\{p_1, \bar p_2\}: resolve on p2p_2 into {p1}\{p_1\}. Split on p1p_1: resolve {p1}\{p_1\} and {pˉ1}\{\bar p_1\} into {}\{\}. Three steps — the output of dpll_refutation in §6.

8. (counting vs watching) In the counting engine, why does backtracking cost as much as propagating? Give the number of counter updates for assigning, then unassigning, a literal that occurs in aa clauses positively and bb clauses negatively.

Answer

Assigning ll increments the true-counter of the aa clauses containing ll and the false-counter of the bb clauses containing lˉ\bar l: a+ba + b updates. Unassigning must undo exactly those: another a+ba + b. With watched literals, assigning visits only the clauses watching lˉ\bar l (usually far fewer than bb), and unassigning visits none.

9. (phase transition) Show that a random 3-CNF with mm clauses over nn variables has expected model count 2n(7/8)m2^n (7/8)^m, and deduce that it is unsatisfiable with high probability when m/n>5.19m / n > 5.19. Why is this not the true threshold?

Answer

Each of the 2n2^n assignments satisfies each clause independently with probability 1−1/81 - 1/8; by linearity of expectation, E[#models]=2n(7/8)m=exp⁡(n(ln⁡2+(m/n)ln⁡(7/8)))E[\#\text{models}] = 2^n (7/8)^m = \exp(n(\ln 2 + (m/n)\ln(7/8))), which tends to 0 when m/n>ln⁡2/ln⁡(8/7)≈5.19m/n > \ln 2 / \ln(8/7) \approx 5.19. By Markov’s inequality, P(#models≥1)≤E[#models]→0P(\#\text{models} \ge 1) \le E[\#\text{models}] \to 0. It is only an upper bound: below 5.19 the expectation is huge, but it is dominated by rare formulas with exponentially many models, while typical formulas have none above about 4.27.

10. (encodings and heuristics, programming) Explain the Sudoku result of §5, then modify the jw heuristic so that it only considers positive literals (variables set to true). Measure decisions on the hard Sudoku and on random 3-SAT.

Answer

In the Sudoku encoding each negative literal xˉrcv\bar x_{rcv} occurs in 32 binary at-most-one clauses (8 each for its cell, row, column and box), each positive literal in 4 “at least one” clauses of length 9; JW weighs binary clauses 4 times more per occurrence than ternary ones and much more than 9-literal ones, so it picks negative literals. Restricting to positive literals on the Sudoku turns each decision into “put digit vv in cell (r,c)(r, c)”, which propagates many negations; expect far fewer decisions there, and somewhat worse results on random 3-SAT, where polarity carries information.

11. (programming) Implement the two-sided Jeroslow–Wang rule: choose the variable xx maximizing J(x)+J(xˉ)J(x) + J(\bar x), then the value with the larger JJ. Compare with one-sided JW on the instances of script 04, Part 1.

Answer

In DPLLSolver.choose, after computing score, pick v = max(vars, key=lambda v: score.get(v, 0) + score.get(-v, 0)) and return v or -v depending on which score is larger. Two-sided JW favours variables that matter in both directions, which tends to shorten refutations; measure and report.

12. (programming) Instrument DPLLSolver to record the index of every conflicting clause, and print the 5 most frequent on the 8-bit adder miter. What does this say about learning?

Answer

Append conflict to a list in solve() and use collections.Counter(...).most_common(5). A few clauses (in the carry logic) account for a large share of all 31,272 conflicts: the same local contradiction is rediscovered in many branches. A learned clause that forbids its cause would prune every one of those branches — the motivation for CDCL.


12. Further reading

  • Textbooks
    • D. Kroening, O. Strichman, Decision Procedures, 2nd ed., 2016, Ch. 2 (DPLL, BCP, watched literals, decision heuristics, CDCL).
    • A. Biere, M. Heule, H. van Maaren, T. Walsh (eds.), Handbook of Satisfiability, 2nd ed., 2021: Ch. 3 (complete algorithms, by A. Darwiche and K. Pipatsrisawat), Ch. 4 (CDCL solvers, by J. Marques-Silva, I. Lynce and S. Malik), Ch. 10 (random satisfiability, by D. Achlioptas).
    • D. Knuth, The Art of Computer Programming, Vol. 4B (2022), “Satisfiability”, Algorithms A–D (from backtracking to DPLL with watched literals).
  • Papers
    • M. Davis, G. Logemann, D. Loveland, “A machine program for theorem-proving”, Communications of the ACM, 1962.
    • R. Nieuwenhuis, A. Oliveras, C. Tinelli, “Solving SAT and SAT Modulo Theories: from an abstract Davis–Putnam–Logemann–Loveland procedure to DPLL(T)”, Journal of the ACM, 2006.
    • M. Moskewicz, C. Madigan, Y. Zhao, L. Zhang, S. Malik, “Chaff: engineering an efficient SAT solver”, DAC 2001 (two watched literals, VSIDS).
    • R. Jeroslow, J. Wang, “Solving propositional satisfiability problems”, Annals of Mathematics and AI, 1990.
    • J. Freeman, Improvements to propositional satisfiability search algorithms, PhD thesis, University of Pennsylvania, 1995 (POSIT, MOMS).
    • D. Mitchell, B. Selman, H. Levesque, “Hard and easy distributions of SAT problems”, AAAI 1992.
    • J. Crawford, L. Auton, “Experimental results on the crossover point in random 3-SAT”, Artificial Intelligence, 1996.
    • E. Friedgut, “Sharp thresholds of graph properties, and the k-SAT problem”, JAMS, 1999; J. Ding, A. Sly, N. Sun, “Proof of the satisfiability conjecture for large k”, STOC 2015.
    • P. Beame, H. Kautz, A. Sabharwal, “Towards understanding and harnessing the potential of clause learning”, JAIR, 2004 (DPLL as tree-like resolution, CDCL vs resolution).
  • Slides: C. Tinelli, DPLL and CDCL and Decision Procedures for Satisfiability in Propositional Logic, Iowa CS:4980, Spring 2024 (adapted from Stanford CS 257 slides by Barrett, Trippel and Wu, and from slides by Torlak).

13. Next lecture

Lecture 5 (CDCL, Trippel) removes DPLL’s shortcomings.

  • Abstract CDCL: BACKTRACK becomes CONFLICT, EXPLAIN and BACKJUMP, with a third state component, the conflict clause; FAIL is adapted. The invariant Δ⊨C\Delta \models C and M⊨¬CM \models \neg C holds whenever a conflict clause is present.
  • The implication graph, the first unique implication point (1-UIP), and why a learned clause is a resolvent — so CDCL proofs are (DAG-like) resolution proofs, checkable in the DRUP format.
  • VSIDS, restarts and phase saving, measured by ablation.
  • Code: cdcl.py and drup_check.py, built on this lecture’s trail and watched literals; the first test is the 9-bit adder miter that DPLL needed 119,031 decisions for.
← 返回课程目录