Lecture 3 · Proof Systems

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

课程源码 ZIP ↓

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

本篇目录

Maps to: Stanford CS 257 Introduction to Automated Reasoning (Winter 2026), Lecture 3 · Tue 01/13/2026 · Proof systems (guest lecture by Clark Barrett). Reading: a book chapter on proof systems (distributed on Canvas; not public). Basis: The Stanford slides are on Canvas and not public. This lecture follows the public deck Abstract Proof Systems of the Iowa course CS:4980 (Cesare Tinelli, Spring 2024), which states that it is based on slides by Tinelli and by Clark Barrett, Caroline Trippel and Andrew (Haoze) Wu at Stanford. “The slides” below means that deck. Its definitions and examples are reused here:

  • proof states, rules as partial functions, rule schemas, and the rules MP, SPLIT and CONTR;
  • the derivation tree from {b⇒c,¬b⇒c,¬c}\{b \Rightarrow c, \neg b \Rightarrow c, \neg c\};
  • satisfiability proof systems, soundness, weakly and strongly satisfiability-preserving rules, and the exercise with eight candidate rules;
  • completeness and termination, the stuck state {b}\{b\};
  • the decision procedure PEP_E and its two examples;
  • strategies, the strategy πPL\pi_{PL} and its exercise, properties of strategies, and Theorem 5.

These notes add proofs of the theorems, a careful reading of “progressive”, the resolution system of Lecture 2 recast in the same framework, Hilbert-style proof checking with the deduction theorem as an algorithm, and an introduction to proof complexity (Cook–Reckhow). Four experiments check every claim by machine, by exploring every derivation from thousands of small states. The experiments and their code were designed for these notes and do not reflect what was said in class. Code: code/lecture03/ (4 scripts + 1 module; Python standard library only, matplotlib optional; under 7 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. Define an abstract proof system — states, rules, derivation trees, derivations — and present an algorithm as one.
  2. Define satisfiability proof systems, refutations and corroborations, and the two halves of soundness.
  3. Decide whether a rule is strongly, weakly or not satisfiability preserving, with a proof or a counterexample.
  4. Prove soundness from rule-level preservation, prove termination with a measure, and show incompleteness with a stuck state.
  5. Explain how a sound, complete and terminating proof system is a decision procedure, and why the choice of strategy then changes only the cost.
  6. State and use the theorem “complete iff there is a progressive and terminating strategy”.
  7. Check a Hilbert-style proof by program and expand the deduction theorem into a proof transformation.
  8. Explain the Cook–Reckhow view of proof systems and why proof size bounds the speed of every solver built on a proof system.

0.2 Prerequisites and scope

AssumedIntroduced hereDeveloped later
truth tables, semantic arguments, H2 (Lecture 1)the general framework they are instances ofabstract DPLL as a proof system (Lecture 4)
resolution, saturation, DP (Lecture 2)the resolution system ⟨Δ,Φ⟩\langle \Delta, \Phi \rangle as a satisfiability proof systemabstract CDCL (Lecture 5), DPLL(T) (Lecture 10)
structural induction (Lecture 1)induction on derivations, termination measuresthe same proofs for every later procedure
“NP” and “coNP” informallypolynomially bounded proof systems, p-simulationproof certificates from SAT solvers (Lecture 5)

0.3 Map

§1  why present algorithms as proof systems
§2  abstract proof systems: states, rules, derivation trees, derivations                 ← code 01
§3  satisfiability proof systems and soundness; preserving rules; the slides' exercise   ← code 02
§4  completeness and termination; from proof systems to decision procedures; P_E         ← code 03
§5  strategies; π_PL; properties of strategies; Theorem 5                                ← code 03
§6  the resolution system of Lecture 2, revisited                                        ← code 03
§7  Hilbert systems: checking proofs, the deduction theorem as an algorithm, proof search ← code 04
§8  how long must proofs be? Cook–Reckhow and proof complexity                            ← code 04
§9 summary   §10 common pitfalls   §11 exercises   §12 further reading   §13 next lecture

0.4 Notation

SymbolMeaning
P=⟨S,R⟩P = \langle \mathcal{S}, \mathcal{R} \ranglea proof system: states S\mathcal{S} and rules R\mathcal{R}
S,S′,SiS, S', S_iproof states (here mostly sets of formulas)
P1  ⋯  PmC1∣⋯∣Cn\dfrac{P_1 \;\cdots\; P_m}{C_1 \mid \cdots \mid C_n}a rule: premises (all must hold) over conclusions (alternatives)
SAT, UNSATthe two distinguished states of a satisfiability proof system
SSat\mathcal{S}_{Sat}a satisfiability predicate: the “satisfiable” states, containing SAT, not UNSAT
τ,τ0,τ1,…\tau, \tau_0, \tau_1, \dotsderivation trees; a derivation is a sequence of them
π\pia strategy
VVthe set of propositional variables

0.5 The code of this lecture

One module, proof_systems.py, turns every definition into code:

  • Rule (a function from a state to its applicable instances and their conclusions) and ProofSystem (a list of rules);
  • derivation trees (Node), derive(system, state, strategy) with strategies (leftmost_strategy, random_strategy, the slides’ pi_pl), and format_tree;
  • the systems of the lecture: P_PL, the eight exercise rules, P_E, P_E_DNEG, and the resolution system P_RES;
  • machine checks: preservation(rule, states) classifies a rule as strongly / weakly / not preserving with a counterexample; explore(system, state) explores every derivation from a state and reports whether a refutation or a corroboration exists, the longest derivation, and stuck states;
  • Hilbert proofs: check_hilbert, proof_of_identity, deduction (the deduction theorem as a proof transformation), forward_search.

1. Why present algorithms as proof systems?

Lectures 1 and 2 met several procedures: truth tables, semantic arguments, resolution saturation, Davis–Putnam. Each came with its own correctness argument. They have a common shape: a state of knowledge (“these formulas hold on this branch”, “these clauses have been derived”), and steps that transform the state, sometimes into several alternative states (case splits). Lecture 3 makes that shape a definition.

Intuition. Think of a board game. The rules say which moves are legal in which position; they do not say which move to make. A strategy chooses moves. A position is won (UNSAT reached on every branch, or SAT reached) or stuck (no legal move). Questions about the game split cleanly: “Do the rules allow a wrong win?” (soundness), “Can every game be won?” (completeness), “Does every game end?” (termination), and separately, “Which strategy wins fastest?” (efficiency).

The slides list the advantages of presenting automated-reasoning algorithms as proof systems:

  • Modularity and composability. Rules are independent pieces; adding a rule (pure literals, learning, theory reasoning) means adding a piece and re-checking a local property.
  • Easier proofs. Soundness of the whole system follows from a property of each rule separately (Theorem 1 below). Termination follows from one measure.
  • Abstraction. The proof system says what may be done, not how to implement it. Data structures (watched literals, Lecture 4) and heuristics (VSIDS, Lecture 5) are implementation choices that do not affect correctness, as long as they only choose among legal rule applications.

This is how modern SAT and SMT procedures are specified in the literature: “Abstract DPLL” and “DPLL(T)” (Nieuwenhuis, Oliveras and Tinelli 2006) are proof systems in exactly this sense (Lectures 4, 5 and 10).


2. Abstract proof systems

2.1 States and rules

Definition. An abstract proof system is a pair P=⟨S,R⟩P = \langle \mathcal{S}, \mathcal{R} \rangle, where S\mathcal{S} is a set of proof states and R\mathcal{R} a set of proof rules. A proof rule is a partial function from proof states to sets of proof states.

A state is a data structure representing what is known at a stage of the proof — for example a set of formulas. A rule takes a state, applies only if the state satisfies some premises, and returns one or more conclusions:

R    P1P2⋯PmC1∣C2∣⋯∣CnR\;\; \frac{P_1 \quad P_2 \quad \cdots \quad P_m}{C_1 \mid C_2 \mid \cdots \mid C_n}

Premises are conjunctive (all must hold); conclusions are disjunctive (alternatives, i.e. a case split). A rule with n=1n = 1 transforms the state; a rule with n≥2n \ge 2 branches.

Three rules on states that are sets of formulas:

\textscMP  α∈Sα⇒β∈Sβ∉SS∪{β}\textscSplit  p∈Vp occurs in Sp∉S¬p∉SS∪{p}∣S∪{¬p}\textscContr  p∈Vp∈S¬p∈SUNSAT\textsc{MP}\;\frac{\alpha \in S \quad \alpha \Rightarrow \beta \in S \quad \beta \notin S}{S \cup \{\beta\}} \qquad \textsc{Split}\;\frac{p \in V \quad p \text{ occurs in } S \quad p \notin S \quad \neg p \notin S}{S \cup \{p\} \mid S \cup \{\neg p\}} \qquad \textsc{Contr}\;\frac{p \in V \quad p \in S \quad \neg p \in S}{\mathit{UNSAT}}

These form the system PPLP_{PL}. Technically each is a rule schema: α,β,p\alpha, \beta, p are parameters, and every instantiation is a separate rule. Script 01 applies them to the slides’ examples:

state SSMP gives
{a,a⇒b}\{a, a \Rightarrow b\}{a,b,a⇒b}\{a, b, a \Rightarrow b\}
{¬d,a∨¬c,¬d⇒b}\{\neg d, a \vee \neg c, \neg d \Rightarrow b\}{b,¬d,a∨¬c,¬d⇒b}\{b, \neg d, a \vee \neg c, \neg d \Rightarrow b\}
{c,d,c⇒d}\{c, d, c \Rightarrow d\}does not apply (β=d\beta = d is already in SS)

On {a∨(b∧c),¬d}\{a \vee (b \wedge c), \neg d\}, SPLIT has three instances — on aa, bb or cc — but none on dd, because ¬d\neg d is already there. Formally, \textscSplitb\textsc{Split}_b maps that state to the set {{a∨(b∧c),¬d,b},{a∨(b∧c),¬d,¬b}}\{\{a \vee (b \wedge c), \neg d, b\}, \{a \vee (b \wedge c), \neg d, \neg b\}\}.

The premise "β∉S\beta \notin S" of MP matters more than it looks: without it, MP would apply forever to the same pair and no derivation would end. Most rules in automated reasoning have such a “something new is added” premise.

2.2 Derivation trees and derivations

Definition. A derivation tree from S0S_0 is a finite tree whose nodes are states, whose root is S0S_0, and in which the children of a node SS are the conclusions of one application of a rule to SS. A state is reducible if some rule applies to it, irreducible otherwise; a tree is reducible if at least one of its leaves is. A derivation from τ0\tau_0 is a (possibly infinite) sequence of trees τ0,τ1,…\tau_0, \tau_1, \dots in which each τi+1\tau_{i+1} is obtained from τi\tau_i by applying a rule to one leaf. A derivation is saturated if it is finite and ends with an irreducible tree.

The slides’ example: from {b⇒c,¬b⇒c,¬c}\{b \Rightarrow c, \neg b \Rightarrow c, \neg c\}, script 01 (Part 2) prints the whole derivation τ0,…,τ5\tau_0, \dots, \tau_5, one tree per step. The final tree:

{¬c, b ⇒ c, ¬b ⇒ c}
├─ SPLIT b (case 1 of 2)
│  {b, ¬c, b ⇒ c, ¬b ⇒ c}
│  └─ MP b, b ⇒ c
│     {b, c, ¬c, b ⇒ c, ¬b ⇒ c}
│     └─ CONTR c
│        UNSAT
└─ SPLIT b (case 2 of 2)
   {¬b, ¬c, b ⇒ c, ¬b ⇒ c}
   └─ MP ¬b, ¬b ⇒ c
      {c, ¬b, ¬c, b ⇒ c, ¬b ⇒ c}
      └─ CONTR c
         UNSAT

It is irreducible (both leaves are UNSAT, and no rule applies to UNSAT), so the derivation is saturated.

Note the distinction: a tree is a snapshot; a derivation is the history of how the snapshot was built. Properties like termination are about derivations (can the sequence be infinite?), while verdicts are read off the final tree.


3. Satisfiability proof systems and soundness

3.1 SAT and UNSAT

Definition. PP is a satisfiability proof system if S\mathcal{S} contains two distinguished states SAT and UNSAT.

  • A refuting rule has UNSAT as its only conclusion; a corroborating rule has SAT as its only conclusion.
  • A refutation tree has only UNSAT leaves; a corroboration tree has at least one SAT leaf.
  • A refutation of SS is a derivation from SS ending with a refutation tree; a corroboration one ending with a corroboration tree.

The asymmetry is natural. To show unsatisfiability, every case must fail; to show satisfiability, one case must succeed. PPLP_{PL} becomes a satisfiability proof system by adding SAT to its states; CONTR is a refuting rule; PPLP_{PL} has no corroborating rule.

3.2 What soundness means

Definition. A satisfiability predicate is a set SSat⊆S\mathcal{S}_{Sat} \subseteq \mathcal{S} with SAT∈SSat\mathit{SAT} \in \mathcal{S}_{Sat} and UNSAT∉SSat\mathit{UNSAT} \notin \mathcal{S}_{Sat}. PP is refutation sound if no state with a refutation is in SSat\mathcal{S}_{Sat}; solution sound if every state with a corroboration is in SSat\mathcal{S}_{Sat}; sound if both.

For PPLP_{PL}, SSat={SAT}∪{S:S is a satisfiable set of formulas}\mathcal{S}_{Sat} = \{\mathit{SAT}\} \cup \{S : S \text{ is a satisfiable set of formulas}\}.

Soundness is a property of whole derivations, which are hard to reason about directly. The trick is to find a local property of each rule that implies it:

Definition. A rule RR is weakly satisfiability preserving if for every state SS: if S∈SSatS \in \mathcal{S}_{Sat} then some S′∈R(S)S' \in R(S) is in SSat\mathcal{S}_{Sat}. It is (strongly) satisfiability preserving if: S∈SSatS \in \mathcal{S}_{Sat} iff some S′∈R(S)S' \in R(S) is in SSat\mathcal{S}_{Sat}.

Theorem 1. If every rule of PP is satisfiability preserving, then PP is sound.

Proof. By induction on the number of steps of a derivation, show the invariant: the root is in SSat\mathcal{S}_{Sat} iff some leaf of the current tree is in SSat\mathcal{S}_{Sat}. It holds for τ0\tau_0 (the root is the only leaf). A step replaces a leaf LL by its conclusions C1,…,CnC_1, \dots, C_n; by strong preservation, L∈SSatL \in \mathcal{S}_{Sat} iff some Ci∈SSatC_i \in \mathcal{S}_{Sat}, so “some leaf is in SSat\mathcal{S}_{Sat}” keeps its truth value. Now, a refutation tree has only UNSAT leaves, none in SSat\mathcal{S}_{Sat}, so its root is not in SSat\mathcal{S}_{Sat}: refutation soundness. A corroboration tree has a SAT leaf, which is in SSat\mathcal{S}_{Sat}, so the root is: solution soundness. ∎

Look at the proof more closely: the “if root ∈ SSat\mathcal{S}_{Sat} then some leaf ∈ SSat\mathcal{S}_{Sat}” half of the invariant needs only weak preservation, and it is all that refutation soundness uses. Solution soundness needs the other half. Script 02 confirms this split by machine (§3.4).

3.3 The slides’ exercise, decided by machine

Which of these rules are weakly / strongly / not satisfiability preserving (with respect to the predicate above)?

\textscAddVar1 p∈Vp∉S¬p∉SS∪{p}\textscAddVar2 p∈V occurs nowhere in SS∪{p}\textscAnd1 α∧β∈SS∪{α}\textscAnd2 α∧β∈SS∪{α,β}\textscOrSplit α∨β∈SS∪{α}∣S∪{β}\textscAnd3 S=S1∪{α∧β}S1∪{α}\textscAnd4 S=S1∪{α∧β}S1∪{α,β}\textscUnsat ⁣→ ⁣{α} S=UNSAT{α}\begin{aligned} &\textsc{AddVar1}\ \frac{p \in V \quad p \notin S \quad \neg p \notin S}{S \cup \{p\}} & &\textsc{AddVar2}\ \frac{p \in V \text{ occurs nowhere in } S}{S \cup \{p\}} & &\textsc{And1}\ \frac{\alpha \wedge \beta \in S}{S \cup \{\alpha\}} & &\textsc{And2}\ \frac{\alpha \wedge \beta \in S}{S \cup \{\alpha, \beta\}}\\[4pt] &\textsc{OrSplit}\ \frac{\alpha \vee \beta \in S}{S \cup \{\alpha\} \mid S \cup \{\beta\}} & &\textsc{And3}\ \frac{S = S_1 \cup \{\alpha \wedge \beta\}}{S_1 \cup \{\alpha\}} & &\textsc{And4}\ \frac{S = S_1 \cup \{\alpha \wedge \beta\}}{S_1 \cup \{\alpha, \beta\}} & &\textsc{Unsat}\!\to\!\{\alpha\}\ \frac{S = \mathit{UNSAT}}{\{\alpha\}} \end{aligned}

Script 02 (Part 1) checks every instance of every rule on 2,049 small states — every set of 1 to 3 formulas from a pool of 23 small formulas over a,ba, b, plus SAT and UNSAT — and prints a counterexample for each failure:

ruleinstances checkedverdictcounterexample
MP189strong
SPLIT3,112strong
CONTR44strong
ADD-VAR15,169none{a∧¬b}→{b,a∧¬b}\{a \wedge \neg b\} \to \{b, a \wedge \neg b\}: satisfiable to unsatisfiable
ADD-VAR22,057strong
AND1, AND21,270 eachstrong
OR-SPLIT1,270strong
AND31,270weak{a∧¬a}→{a}\{a \wedge \neg a\} \to \{a\}: unsatisfiable to satisfiable
AND41,270strong
UNSAT → {α}4weakUNSAT→{a}\mathit{UNSAT} \to \{a\}

Why, rule by rule:

  • Strongly preserving rules add a consequence (MP, AND1, AND2: S⊨βS \models \beta, so S∪{β}S \cup \{\beta\} has the same models), split into exhaustive cases (SPLIT, OR-SPLIT: every model of SS satisfies one case), replace a formula by an equivalent set (AND4), add a fact about a fresh variable (ADD-VAR2: any model extends with pp true), or detect an obvious contradiction (CONTR).
  • ADD-VAR1 guesses a value of a variable that already occurs. It can destroy all models: not even weakly preserving.
  • AND3 forgets β\beta. It never destroys models (weak), but it can create them from an unsatisfiable state.
  • UNSAT → {α} is weakly preserving vacuously: its premise UNSAT is never in SSat\mathcal{S}_{Sat}. It is not strongly preserving when α\alpha is satisfiable.

(Rules whose parameter ranges over all variables or all formulas are instantiated with a small universe in the code: variables a,b,ca, b, c for ADD-VAR, four formulas for UNSAT → {α}. A machine check over finitely many states can refute a claim, never prove it; the verdicts “strong” are then backed by the one-line arguments above.)

3.4 What a single bad rule does

Script 02 (Part 2) builds the damage explicitly.

(a) Refutation soundness lost. PPLP_{PL} + ADD-VAR1 on the satisfiable state {¬b,a⇒b}\{\neg b, a \Rightarrow b\} (a model: a=b=falsea = b = \text{false}):

{¬b, a ⇒ b}
└─ ADD-VAR1 a
   {a, ¬b, a ⇒ b}
   └─ MP a, a ⇒ b
      {a, b, ¬b, a ⇒ b}
      └─ CONTR b
         UNSAT

(b) Solution soundness lost. PEP_E (§4.3) + AND3 on the unsatisfiable state {a∧¬a}\{a \wedge \neg a\}: AND3 gives {a}\{a\}, and the SAT rule of PEP_E concludes SAT.

Every other step in both derivations is impeccable; one bad rule suffices. Part 3 then explores all derivations of PEP_E + AND3 from 276 states: 0 violations of refutation soundness, 43 of solution soundness — exactly as the analysis of Theorem 1’s proof predicted for a weakly-but-not-strongly preserving rule.

Part 4 confirms Theorem 1 on the systems we will rely on: for PPLP_{PL}, PEP_E and the resolution system, over every small state, no state is refuted wrongly and none is corroborated wrongly.


4. Completeness, termination, and decision procedures

4.1 Definitions

Definition. PP is complete (with respect to SSat\mathcal{S}_{Sat}) if every state has a refutation or a corroboration. PP is terminating if every derivation is finite.

Completeness is existential: some derivation reaches a verdict. Termination is universal: every derivation stops. Neither implies the other.

4.2 PPLP_{PL}: terminating, not complete

Terminating. Every MP or SPLIT step adds a formula that was not there before, taken from a finite pool determined by the start state: consequents β\beta of implications α⇒β\alpha \Rightarrow \beta occurring in it (MP), and literals p,¬pp, \neg p of its variables (SPLIT). CONTR ends a branch. So no branch can be longer than the pool size plus one, and a tree with finitely many finite branches, built by adding finitely many children at each step, is finite. Script 03 (Part 1) explores every derivation from 276 small states: none is infinite, the longest branch has 5 steps, and every state stays within the bound.

Not complete. The slides ask for a satisfiable state other than SAT and UNSAT that is irreducible: {b}\{b\}. No rule applies (no implication, bb is already there, no contradiction), and there is no corroborating rule. Script 03 finds the extent of the problem: 274 of the 276 states have neither a refutation nor a corroboration. The stuck states are of two kinds:

  • every satisfiable state (smallest: {a},{b},{¬a},{¬b}\{a\}, \{b\}, \{\neg a\}, \{\neg b\}), since PPLP_{PL} can never conclude SAT;
  • unsatisfiable states that PPLP_{PL} cannot decompose, such as {a,a∧¬a}\{a, a \wedge \neg a\} (reached from {a∧¬a}\{a \wedge \neg a\} by SPLIT): there is no rule for ∧.

4.3 From proof systems to decision procedures

Proposition. If PP is sound, complete and terminating with respect to SSat\mathcal{S}_{Sat}, it induces a decision procedure for membership in SSat\mathcal{S}_{Sat}: start with SS and produce any derivation until no rule applies. It terminates; if the final tree is a refutation tree, S∉SSatS \notin \mathcal{S}_{Sat}; otherwise S∈SSatS \in \mathcal{S}_{Sat}.

Careful: “otherwise” relies on completeness in a strong sense — that a derivation which cannot be extended has reached a verdict. That holds when the only irreducible states are SAT and UNSAT, as in the system below. §5.4 returns to this point.

The slides’ decision procedure PEP_E. The assignment induced by a set of formulas SS is v(p)=truev(p) = \text{true} if p∈Sp \in S, false if ¬p∈S\neg p \in S, undefined otherwise. SS fully defines vv if every variable occurring in SS has p∈Sp \in S or ¬p∈S\neg p \in S.

\textscSplit p∈V occurs in Sp∉S¬p∉SS∪{p}∣S∪{¬p}\textscSat S fully defines vv⊨SSAT\textscUnsat S fully defines vv⊭α for some α∈SUNSAT\textsc{Split}\ \frac{p \in V \text{ occurs in } S \quad p \notin S \quad \neg p \notin S}{S \cup \{p\} \mid S \cup \{\neg p\}} \qquad \textsc{Sat}\ \frac{S \text{ fully defines } v \quad v \models S}{\mathit{SAT}} \qquad \textsc{Unsat}\ \frac{S \text{ fully defines } v \quad v \not\models \alpha \text{ for some } \alpha \in S}{\mathit{UNSAT}}

Theorem. Every rule of PEP_E is satisfiability preserving; PEP_E is sound, terminating and complete.

Proof. SPLIT: every model of SS makes pp true or false. SAT and UNSAT: when SS fully defines vv, every formula of SS has all its variables assigned, so ”SS is satisfiable” is equivalent to "v⊨Sv \models S" (any model of SS must agree with vv on the literals in SS, i.e. on all variables of SS). Soundness follows by Theorem 1. Termination: each SPLIT adds a literal for one more of the finitely many variables of SS, so a branch has at most ∣vars(S)∣|vars(S)| SPLITs and then one SAT/UNSAT step. Completeness: a state that does not fully define its assignment admits SPLIT; one that does admits exactly one of SAT and UNSAT. So the only irreducible states are SAT and UNSAT, and any maximal derivation ends with a verdict. ∎

Script 03 (Part 2): on all 276 small states, every state is refutable xor corroborable, matching the truth, and the longest branch has 3 steps. The slides’ two examples:

{a, a ⇒ ¬b, ¬a ∨ b}  -> refutation           {a, a ∧ ¬b, ¬a ∨ ¬b}  -> corroboration
├─ SPLIT b (case 1 of 2)                     ├─ SPLIT b (case 1 of 2)
│  {a, b, a ⇒ ¬b, ¬a ∨ b}                    │  {a, b, a ∧ ¬b, ¬a ∨ ¬b}
│  └─ UNSAT v ⊭ a ⇒ ¬b                       │  └─ UNSAT v ⊭ a ∧ ¬b
│     UNSAT                                  │     UNSAT
└─ SPLIT b (case 2 of 2)                     └─ SPLIT b (case 2 of 2)
   {a, ¬b, a ⇒ ¬b, ¬a ∨ b}                      {a, ¬b, a ∧ ¬b, ¬a ∨ ¬b}
   └─ UNSAT v ⊭ ¬a ∨ b                          └─ SAT v ⊨ S
      UNSAT                                        SAT

On 300 random states over a,b,ca, b, c, each run with a random strategy, all 300 verdicts were correct. That is the practical meaning of “sound, complete, terminating”: the strategy cannot affect the answer.

PEP_E is the truth-table method written as a proof system: each branch is one row (restricted to the variables that occur). It is a bad algorithm but a clean specification. DPLL (Lecture 4) is a refinement of it: the same SPLIT, plus rules that deduce literals instead of guessing them.


5. Strategies

5.1 Definition

Rules are non-deterministic: at each step, several leaves and several rule instances may be eligible. A strategy resolves the choice.

Definition. A strategy for PP is a partial function that takes a derivation tree τ\tau and returns a tree τ′\tau' such that (τ,τ′)(\tau, \tau') is a derivation step in PP. A derivation follows π\pi if each non-initial tree is π\pi applied to the previous one and, if the derivation is finite, π\pi is undefined on its last tree.

5.2 The slides’ strategy πPL\pi_{PL}

Order literals alphabetically by variable, each variable before its negation (a≺¬a≺b≺¬b≺⋯a \prec \neg a \prec b \prec \neg b \prec \cdots). For states whose formulas are literals or implications between literals:

  1. Find the first reducible leaf in a left-to-right depth-first traversal; if none, πPL\pi_{PL} is undefined.
  2. If MP applies, apply it to l1l_1 and l1⇒l2l_1 \Rightarrow l_2 with l1l_1 minimal for ≺\prec, ties broken by minimal l2l_2.
  3. Otherwise, if SPLIT applies, split on the smallest variable occurring in the state.
  4. Otherwise, apply CONTR if possible.

The slides’ exercise: apply πPL\pi_{PL} to S={a⇒c,a⇒¬b,¬b⇒¬a}S = \{a \Rightarrow c, a \Rightarrow \neg b, \neg b \Rightarrow \neg a\}. Script 03 (Part 3) gives:

{a ⇒ c, a ⇒ ¬b, ¬b ⇒ ¬a}
├─ SPLIT a (case 1 of 2)
│  {a, a ⇒ c, a ⇒ ¬b, ¬b ⇒ ¬a}
│  └─ MP a, a ⇒ ¬b                       (¬b ≺ c breaks the tie between a ⇒ ¬b and a ⇒ c)
│     └─ MP a, a ⇒ c
│        └─ MP ¬b, ¬b ⇒ ¬a
│           {a, c, ¬a, ¬b, a ⇒ c, a ⇒ ¬b, ¬b ⇒ ¬a}
│           └─ CONTR a
│              UNSAT
└─ SPLIT a (case 2 of 2)
   {¬a, a ⇒ c, a ⇒ ¬b, ¬b ⇒ ¬a}
   ├─ SPLIT b ... SPLIT c   (four leaves, all irreducible and open)

(abbreviated). No MP applies at the root (no literal yet), so πPL\pi_{PL} splits on aa. The aa-branch is refuted: aa forces ¬b\neg b and cc, and ¬b\neg b forces ¬a\neg a. The ¬a\neg a-branch contains no contradiction; it splits on bb and cc and ends in four irreducible open leaves — each one a model of SS, but PPLP_{PL} has no rule to say so.

5.3 Properties of strategies

Definition. A strategy π\pi is

  • solution sound if S∈SSatS \in \mathcal{S}_{Sat} whenever a corroboration of SS follows π\pi; refutation sound similarly; sound if both;
  • terminating if every derivation following π\pi is finite;
  • progressive if it is defined on every derivation tree that is not a refutation tree or a “saturated” tree (see §5.4).

Two easy facts: if PP is sound, every strategy for it is sound; if PP is terminating, every strategy for it is terminating. The interesting case is a system that is not terminating, where a strategy can restore termination.

Script 03 (Part 3) adds to PEP_E the rule

\textscDNeg α∈S¬¬α∉SS∪{¬¬α}\textsc{DNeg}\ \frac{\alpha \in S \quad \neg\neg\alpha \notin S}{S \cup \{\neg\neg\alpha\}}

which is strongly satisfiability preserving (it adds an equivalent formula) but makes the state space infinite: ¬¬α\neg\neg\alpha, ¬¬¬¬α\neg\neg\neg\neg\alpha, … Exploration from {¬a,a∨b}\{\neg a, a \vee b\} passes 2,000 states without end. Then:

strategy on PEP_E + DNEGoutcome
leftmost, DNEG firstnever stops (300 steps, then cut off)
leftmost, DNEG lastcorroboration after 2 steps
random (20 seeds)all 20 stopped with a corroboration — by luck, nothing guarantees it

Termination is a property of a system together with a strategy. Real solvers contain such rules — CDCL’s restarts and learning can, in principle, repeat forever — and their termination proofs are proofs about the strategy (Lecture 5).

5.4 Theorem 5, and how to read “progressive”

Theorem 5 (slides). PP is complete iff there exists a progressive and terminating strategy for it.

What does “not a saturated tree” mean in the definition of progressive? If “saturated” meant just “irreducible”, the theorem would be false: PPLP_{PL} has a strategy (leftmost, as in script 01) that is defined on every reducible tree and always terminates, yet PPLP_{PL} is incomplete — on {b}\{b\} the strategy is simply undefined. For the theorem to hold, “saturated” must be read as “has reached a verdict”: a progressive strategy is defined on every tree that is neither a refutation tree nor a corroboration tree. In particular, a progressive strategy can exist only if no stuck state is ever reached.

Proof (with that reading). (⇐) Given SS, run the strategy from SS. It terminates, so the derivation is finite, and at its end the strategy is undefined; since it is progressive, the last tree is a refutation or a corroboration tree. So every SS has one. (⇒) If PP is complete, then no state other than SAT/UNSAT is irreducible (an irreducible state has no derivation beyond itself, hence no verdict). For each start state SS, fix one refutation or corroboration of SS (it exists by completeness) and let the strategy follow it; on trees outside these fixed derivations, let it apply any applicable rule to any non-verdict leaf (one exists, because no other state is irreducible). Every derivation following the strategy from a one-node tree is one of the fixed finite derivations, so the strategy is terminating, and it is defined on every tree without a verdict, so it is progressive. ∎

The useful direction is (⇐): to build a decision procedure, design rules that are preserving, and one strategy that is progressive and terminating. That is the recipe Lectures 4 and 5 follow for DPLL and CDCL.


6. The resolution system of Lecture 2, revisited

Lecture 2 presented resolution as a satisfiability proof system with states ⟨Δ,Φ⟩\langle \Delta, \Phi \rangle:

\textscResolve C1,C2∈Δp∈C1¬p∈C2C=(C1∖{p})∪(C2∖{¬p})C∉Δ∪ΦΔ:=Δ∪{C}\textsc{Resolve}\ \frac{C_1, C_2 \in \Delta \quad p \in C_1 \quad \neg p \in C_2 \quad C = (C_1 \setminus \{p\}) \cup (C_2 \setminus \{\neg p\}) \quad C \notin \Delta \cup \Phi}{\Delta := \Delta \cup \{C\}} \textscClash C∈Δp,¬p∈CΔ:=Δ∖{C}, Φ:=Φ∪{C}\textscUnsat {}∈ΔUNSAT\textscSat no other rule appliesSAT\textsc{Clash}\ \frac{C \in \Delta \quad p, \neg p \in C}{\Delta := \Delta \setminus \{C\},\ \Phi := \Phi \cup \{C\}} \qquad \textsc{Unsat}\ \frac{\{\} \in \Delta}{\mathit{UNSAT}} \qquad \textsc{Sat}\ \frac{\text{no other rule applies}}{\mathit{SAT}}

In the language of this lecture: RESOLVE is strongly preserving (it adds a consequence), CLASH too (it removes a valid clause), UNSAT is a refuting rule whose premise makes the state unsatisfiable, and SAT is a corroborating rule whose premise — saturation — implies satisfiability by refutational completeness (Lecture 2, §6.3). Every derivation is finite (at most 3n3^n clauses over nn variables), and the only irreducible states are SAT and UNSAT. Script 03 (Part 4) explores all 987 sets of 1–3 clauses over p1,p2,p3p_1, p_2, p_3: all decided correctly, no stuck state, longest derivation 10 steps.

The strategy changes the work. Script 03 counts RESOLVE steps until {}\{\} appears:

unsatisfiable inputshortestsystematicshortest-clause-firstof which used20 random strategies
the slides’ example34949–21 (median 18)
random 2-CNF #1 (5 vars, 11 clauses)3714327–40 (median 38)
random 2-CNF #25716621–54 (median 48.5)
random 2-CNF #332312319–40 (median 36)
random 2-CNF #45918625–51 (median 49)

(“shortest” is a breadth-first search over all derivations; “systematic” always resolves the first pair in a fixed order; “shortest-clause-first” is Lecture 2’s saturate, with the steps its extracted proof actually uses.)

Two lessons. The slides’ example has a refutation shorter than the slides’ 4-step one: resolve {¬p1,p3}\{\neg p_1, p_3\} and {¬p1,¬p3}\{\neg p_1, \neg p_3\} into {¬p1}\{\neg p_1\}, then {p1}\{p_1\} from the first two clauses, then {}\{\}. And the median random run does 6 to 13 times more work than necessary. Lecture 2 saw the same effect at scale: on the 4-hole pigeonhole formula, saturation kept 39,256 clauses while Davis–Putnam — another strategy for resolution — never held more than 113.


7.1 Two kinds of proof systems

The systems above are satisfiability proof systems: they refute or corroborate a set of formulas. Lecture 1 also met a theorem-proving proof system, the Hilbert system H2, which derives valid formulas from axioms:

A1: α⇒(β⇒α)A2: (α⇒(β⇒γ))⇒((α⇒β)⇒(α⇒γ))A3: (¬β⇒¬α)⇒(α⇒β)MP: from α and α⇒β infer β\begin{aligned} \text{A1: } & \alpha \Rightarrow (\beta \Rightarrow \alpha) \qquad \text{A2: } (\alpha \Rightarrow (\beta \Rightarrow \gamma)) \Rightarrow ((\alpha \Rightarrow \beta) \Rightarrow (\alpha \Rightarrow \gamma)) \\ \text{A3: } & (\neg\beta \Rightarrow \neg\alpha) \Rightarrow (\alpha \Rightarrow \beta) \qquad \text{MP: from } \alpha \text{ and } \alpha \Rightarrow \beta \text{ infer } \beta \end{aligned}

It fits the abstract framework too (the state is the set of formulas proved so far; each axiom instance and MP are rules), but its use is different: a proof is a certificate of validity that anyone can check.

7.2 Checking is easy

check_hilbert checks each line: an axiom line must match its schema (the checker finds the substitution for α, β, γ itself, by structural pattern matching); a hypothesis must be in the hypothesis set; an MP line must cite two earlier lines ii and jj with line jj literally equal to “line ii ⇒ this line”. Script 04 (Part 1) checks the 5-line proof of p⇒pp \Rightarrow p and rejects three tampered copies, each with a precise message (a wrongly claimed schema, MP lines in the wrong order, an unjustified hypothesis). A few dozen lines of code suffice to trust any H2 proof.

7.3 The deduction theorem is an algorithm

The deduction theorem says: if U∪{α}⊢βU \cup \{\alpha\} \vdash \beta then U⊢α⇒βU \vdash \alpha \Rightarrow \beta. Its proof is constructive, so it is an algorithm on proofs: replace each line γk\gamma_k of the old proof by a few lines proving α⇒γk\alpha \Rightarrow \gamma_k:

old line γk\gamma_knew lines
γk=α\gamma_k = \alphathe 5-line proof of α⇒α\alpha \Rightarrow \alpha
an axiom or a hypothesis other than α\alphaγk\gamma_k; γk⇒(α⇒γk)\gamma_k \Rightarrow (\alpha \Rightarrow \gamma_k) [A1]; α⇒γk\alpha \Rightarrow \gamma_k [MP]
MP from γi\gamma_i and γj=γi⇒γk\gamma_j = \gamma_i \Rightarrow \gamma_k(α⇒(γi⇒γk))⇒((α⇒γi)⇒(α⇒γk))(\alpha \Rightarrow (\gamma_i \Rightarrow \gamma_k)) \Rightarrow ((\alpha \Rightarrow \gamma_i) \Rightarrow (\alpha \Rightarrow \gamma_k)) [A2]; two MPs with the already proved α⇒γj\alpha \Rightarrow \gamma_j and α⇒γi\alpha \Rightarrow \gamma_i

Script 04 (Part 2) starts from the 5-line proof of {p,p⇒q,q⇒r}⊢r\{p, p \Rightarrow q, q \Rightarrow r\} \vdash r and applies the transformation three times, checking each result:

statementlineslargest formula (nodes)
{p,p⇒q,q⇒r}⊢r\{p, p \Rightarrow q, q \Rightarrow r\} \vdash r53
{p⇒q,q⇒r}⊢p⇒r\{p \Rightarrow q, q \Rightarrow r\} \vdash p \Rightarrow r1717
{p⇒q}⊢(q⇒r)⇒(p⇒r)\{p \Rightarrow q\} \vdash (q \Rightarrow r) \Rightarrow (p \Rightarrow r)5347
⊢(p⇒q)⇒((q⇒r)⇒(p⇒r))\vdash (p \Rightarrow q) \Rightarrow ((q \Rightarrow r) \Rightarrow (p \Rightarrow r))161107

Each application triples the proof plus 2 lines, and the formulas grow as α\alpha is prefixed to everything. Humans and proof assistants reason with the theorem (“assume α, prove β”); a fully expanded proof is long, but still checked by the same tiny program. Lecture 15 (proof automation in Lean) returns to this division of labour between a small trusted checker and powerful untrusted proof producers.

7.4 Finding proofs is hard

Script 04 (Part 3) runs a naive forward search for p⇒pp \Rightarrow p: take every axiom instance whose α,β,γ\alpha, \beta, \gamma come from a small pool of formulas, then apply MP to all pairs, round by round.

poolformulas known after rounds 0, 1, 2, …p⇒pp \Rightarrow p found
{p,p⇒p}\{p, p \Rightarrow p\}16 → 20 → 22round 2
{p,q,¬p,¬q,p⇒p,q⇒p}\{p, q, \neg p, \neg q, p \Rightarrow p, q \Rightarrow p\}288 → 324 → 327round 2
{p,q,¬p,¬q,q⇒p}\{p, q, \neg p, \neg q, q \Rightarrow p\}175 → 200 → 202round 2
{p,q,¬p,¬q}\{p, q, \neg p, \neg q\}96 → 112 → 112 → 112never

The proof of p⇒pp \Rightarrow p needs an A2 instance whose β\beta is an implication — p⇒pp \Rightarrow p itself in Lecture 1’s proof, or q⇒pq \Rightarrow p, which the search found as an alternative. A search must guess such formulas; nothing in the rules points to them, and with literals only the search closes without ever reaching the goal. This is why the slides of Lecture 1 concluded that automated reasoning prefers systems with the subformula property — semantic arguments, resolution, DPLL — where every formula in a proof is built from pieces of the input, and the search space is finite.


8. How long must proofs be?

8.1 Proof systems as certificates (Cook and Reckhow)

Cook and Reckhow (1979) abstracted away the rules entirely:

Definition. A propositional proof system for unsatisfiability is a polynomial-time algorithm V(F,π)V(F, \pi) such that a formula FF is unsatisfiable iff there exists some π\pi (a “proof”) with V(F,π)=acceptV(F, \pi) = \text{accept}.

The checkers of this lecture and of Lecture 2 are exactly such algorithms: check_refutation for resolution, check_hilbert for H2 (applied to ¬F\neg F‘s validity), and even the truth table (a proof is the list of all rows, checked row by row). A proof system is polynomially bounded if every unsatisfiable FF has a proof of size polynomial in ∣F∣|F|.

Theorem (Cook–Reckhow 1979). A polynomially bounded proof system exists iff NP = coNP.

So, unless NP = coNP (which most researchers doubt), every proof system has families of unsatisfiable formulas that need super-polynomially long proofs. The research field of proof complexity maps which systems are stronger than which. System PP p-simulates QQ if proofs in QQ can be translated into proofs in PP with only polynomial growth.

8.2 Why solver builders care

A solver that is a strategy for a proof system cannot run faster than the shortest proof the system allows: its trace is a proof. DPLL’s search tree is a tree-like resolution proof (Lecture 4); CDCL with restarts p-simulates general resolution (Pipatsrisawat and Darwiche 2011, as reported in the proof-complexity literature). So Haken’s pigeonhole bound (Lecture 2) applies to every CDCL solver, whatever its heuristics.

8.3 Measured: three systems, three families

Script 04 (Part 4) measures the size of the unsatisfiability certificates our own provers find: truth-table rows, semantic-argument lines (Lecture 1’s prover, goal “unsatisfiable”), resolution refutation steps (Lecture 2’s saturation).

familynvarsclausestruth table: rowssemantic argument: linesresolution: proof steps
implication chain44516194
implication chain2020211,048,5769920
all 2n2^n clauses4416161,04515
all 2n2^n clauses55323217,62131
all 2n2^n clauses666464> 200,00063
pigeonhole2696413512
pigeonhole312224,0966,92966
pigeonhole420451,048,576> 200,000362

Certificate sizes

  • Implication chains: both deductive systems give linear proofs; the truth table needs 2n2^n rows.
  • All 2n2^n clauses: resolution needs 2n−12^n - 1 steps — linear in the input — while the semantic argument explodes, exactly the numbers of Lecture 1 (1,045 and 17,621). D’Agostino (1992): tableaux cannot even polynomially simulate truth tables.
  • Pigeonholes: everything grows; resolution’s growth is unavoidable (Haken 1985). Stronger systems have polynomial-size pigeonhole proofs: Frege systems (Hilbert-style systems like H2; Buss 1987) and extended resolution (resolution plus Tseitin-style definitions of new variables; Cook 1976).

No system is best everywhere among those we can automate efficiently. The strongest systems (Frege, extended resolution) have short proofs but no known efficient proof search; the weaker ones (resolution) have good search (CDCL) but provably long proofs for some families. That trade-off shapes SAT solving: modern solvers emit proofs in DRAT, a format that extends resolution with new definitions, so that even preprocessing steps beyond resolution can be checked (Lecture 5).

Run it. python3 04_hilbert_and_proof_size.py (about 7 seconds).


9. Summary

  1. An abstract proof system has states and rules; rules are partial functions from a state to one or more conclusion states (several = a case split). Derivations grow derivation trees one rule application at a time.
  2. A satisfiability proof system has SAT and UNSAT; refutations end with only UNSAT leaves, corroborations with a SAT leaf. Soundness has two halves: refutation soundness and solution soundness.
  3. If every rule is strongly satisfiability preserving, the system is sound (induction on derivations). Weak preservation gives refutation soundness only. One non-preserving rule is enough to “prove” falsehoods (measured).
  4. Completeness (some derivation reaches a verdict) and termination (every derivation is finite) are separate properties: PPLP_{PL} terminates but gets stuck on {b}\{b\} and on 274 of 276 small states.
  5. Sound + complete + terminating = a decision procedure, and then every strategy gives the right answer: PEP_E is such a system (the truth-table method as rules).
  6. A strategy turns non-deterministic rules into an algorithm. It cannot affect correctness in a sound system, but it decides cost, and it can restore termination in a non-terminating system. Theorem 5: complete iff a progressive and terminating strategy exists (with “progressive” read as “defined until a verdict”).
  7. Lecture 2’s resolution system fits the framework; strategies change its work by an order of magnitude.
  8. Hilbert proofs are easy to check and hard to find; the deduction theorem is a proof transformation that triples proof length per use.
  9. Cook–Reckhow: a proof system is a polynomial-time checker. No proof system has short proofs for all tautologies unless NP = coNP; solvers are limited by the proof systems they implicitly use.

10. Common pitfalls

PitfallWhy it is wrongCorrect view
“Each rule step is correct, so the system is sound”“Correct” must mean satisfiability preserving in both directionsADD-VAR1 and AND3 look harmless and break soundness (§3.4)
Treating weak preservation as enoughIt gives refutation soundness onlyAND3: 0 wrong refutations, 43 wrong corroborations
“Terminating implies complete”PPLP_{PL} terminates and gets stuckShow that only SAT/UNSAT are irreducible
“Complete implies terminating”PEP_E + DNEG is complete, with infinite derivationsCompleteness needs one good derivation; termination constrains all
“The strategy can make an unsound system sound”Soundness is about all derivations that the rules allowA strategy can only restrict which derivations run — it can make a run terminate, not make bad rules good
Reading “progressive” as “defined on every reducible tree”Then PPLP_{PL} would satisfy Theorem 5’s premise“Defined on every tree without a verdict” (§5.4)
Confusing a rule with its instancesSPLIT is a schema: SPLITa_a, SPLITb_b, …Count instances when reasoning about search
“Short proofs exist, so a solver will find them”Frege has short pigeonhole proofs; no efficient search is knownProof size is a lower bound on solver time, not an upper bound
Using the deduction theorem and then counting linesIts expansion is ~3× per useCheck the expanded proof when certificates matter

11. Exercises

Answers are collapsed; try each exercise first.

1. (rule properties) Prove by hand that MP, SPLIT and CONTR are strongly satisfiability preserving.

Answer

MP: if α,α⇒β∈S\alpha, \alpha \Rightarrow \beta \in S then S⊨βS \models \beta, so SS and S∪{β}S \cup \{\beta\} have the same models: one is satisfiable iff the other is. SPLIT: a model of SS makes pp true (then it models S∪{p}S \cup \{p\}) or false (S∪{¬p}S \cup \{\neg p\}); conversely a model of either conclusion is a model of SS. CONTR: if p,¬p∈Sp, \neg p \in S then SS is unsatisfiable, and UNSAT ∉SSat\notin \mathcal{S}_{Sat}: both sides of the “iff” are false.

2. (soundness) Write out the induction of Theorem 1 for a derivation τ0,…,τk\tau_0, \dots, \tau_k, and point to the place where each half of strong preservation is used.

Answer

Invariant I(τ)I(\tau): root ∈SSat\in \mathcal{S}_{Sat} ⇔ some leaf of τ\tau is in SSat\mathcal{S}_{Sat}. Base: τ0\tau_0 has the root as its only leaf. Step: τi+1\tau_{i+1} replaces leaf LL by C1,…,CnC_1, \dots, C_n; the other leaves are unchanged. ”⇒” half of preservation (L∈SSatL \in \mathcal{S}_{Sat} ⇒ some CjC_j in it) keeps “some leaf is in SSat\mathcal{S}_{Sat}” true when it was true because of LL; the ”⇐” half ensures it does not become true if LL was not in SSat\mathcal{S}_{Sat}. Refutation soundness uses only the first half (if the root were satisfiable, some leaf would be, but all leaves are UNSAT). Solution soundness uses the second (a SAT leaf makes the right side true, hence the root).

3. (completeness) Add a corroborating rule to PPLP_{PL} that makes it complete on states whose formulas are literals and implications between literals. Prove it.

Answer

Use PEP_E‘s SAT and UNSAT rules (fully defined assignment, check every formula). With SPLIT already in PPLP_{PL}, every state that does not fully define its assignment admits SPLIT, and one that does admits SAT or UNSAT: the only irreducible states are SAT and UNSAT, and the rules are preserving. (MP and CONTR become optional shortcuts.) Check it with explore(ProofSystem("P", [MP, SPLIT, CONTR, SAT_RULE, UNSAT_RULE]), S) on the small states.

4. (the exercise strategy) Apply πPL\pi_{PL} by hand to {a⇒c,a⇒¬b,¬b⇒¬a}\{a \Rightarrow c, a \Rightarrow \neg b, \neg b \Rightarrow \neg a\} and compare with §5.2. Which models of the state can be read off the open leaves?

Answer

As in §5.2: SPLIT aa; the aa-branch closes by MP (¬b\neg b, then cc, then ¬a\neg a) and CONTR. The ¬a\neg a-branch splits on bb and cc: four open leaves, giving the models a=0a = 0 with any b,cb, c. All four are indeed models: with aa false, a⇒ca \Rightarrow c and a⇒¬ba \Rightarrow \neg b hold, and ¬b⇒¬a\neg b \Rightarrow \neg a holds since ¬a\neg a is true.

5. (termination measure) Give a natural-number measure on states of PEP_E that every rule decreases.

Answer

μ(S)=2⋅∣{p∈vars(S):p∉S,¬p∉S}∣+1\mu(S) = 2 \cdot |\{p \in vars(S) : p \notin S, \neg p \notin S\}| + 1 for ordinary states and μ(SAT)=μ(UNSAT)=0\mu(\mathit{SAT}) = \mu(\mathit{UNSAT}) = 0. SPLIT lowers the count of undefined variables by one in each conclusion (−2); SAT/UNSAT go from at least 1 to 0. For trees, use the multiset of leaf measures: replacing a leaf by finitely many smaller leaves decreases a multiset in the Dershowitz–Manna order, which is well-founded.

6. (strategies and termination) Show that every strategy for PEP_E + DNEG that applies DNEG only when no other rule applies is terminating. Is the system still complete?

Answer

In PEP_E, every state other than SAT/UNSAT admits SPLIT, SAT or UNSAT. So “DNEG only when nothing else applies” never applies DNEG, and the strategy’s derivations are PEP_E-derivations: finite. It is also progressive, so by Theorem 5 the system is complete. Termination of the system fails, but that does not matter for a decision procedure that uses this strategy.

7. (resolution system) Is the resolution system still sound and complete without CLASH (tautologies stay in Δ\Delta)? Still terminating?

Answer

Yes to all three. Tautologies are satisfied by everything, so keeping them changes no satisfiability; resolvents of a tautology are either tautologies or weaker than an existing clause, so they never help derive {}\{\} — refutational completeness is unaffected — and SAT still fires only at saturation. Termination: still at most 3n3^n distinct clauses (now counting tautologies, 4n4^n subsets of literals at most). CLASH is an efficiency rule.

8. (slides’ shorter proof) Find the 3-step refutation of {p1,p2},{p1,¬p2},{¬p1,p3},{¬p1,¬p3}\{p_1, p_2\}, \{p_1, \neg p_2\}, \{\neg p_1, p_3\}, \{\neg p_1, \neg p_3\} and check it with check_refutation.

Answer

{p1}\{p_1\} from clauses 1, 2 on p2p_2; {¬p1}\{\neg p_1\} from clauses 3, 4 on p3p_3; {}\{\} from those two on p1p_1. In proof_lines format: inputs 1–4, then (5, {1}, (1, 2, 2)), (6, {-1}, (3, 4, 3)), (7, {}, (5, 6, 1)).

9. (deduction theorem) Apply the transformation of §7.3 by hand to the proof {p}⊢q⇒p\{p\} \vdash q \Rightarrow p: line 1 pp (hyp), line 2 p⇒(q⇒p)p \Rightarrow (q \Rightarrow p) (A1), line 3 q⇒pq \Rightarrow p (MP 1, 2), with α:=p\alpha := p. How many lines?

Answer

Line 1 is α\alpha: 5 lines (proof of p⇒pp \Rightarrow p). Line 2 is an axiom: 3 lines (p⇒(q⇒p)p \Rightarrow (q \Rightarrow p); its A1-weakening (p⇒(q⇒p))⇒(p⇒(p⇒(q⇒p)))(p \Rightarrow (q \Rightarrow p)) \Rightarrow (p \Rightarrow (p \Rightarrow (q \Rightarrow p))); MP). Line 3 by MP: 3 lines (an A2 instance and two MPs). Total 11 lines proving p⇒(q⇒p)p \Rightarrow (q \Rightarrow p) — an instance of A1 that one line would prove! The transformation is mechanical, not clever.

10. (Cook–Reckhow) Show that the truth-table method is a propositional proof system in the Cook–Reckhow sense. Why is it not polynomially bounded, and why does that not contradict anything?

Answer

Let a “proof” of the unsatisfiability of FF over nn variables be the list of all 2n2^n rows with the value of FF in each. The checker verifies that all rows are present and evaluates FF on each: polynomial in the length of the proof (which is about 2n∣F∣2^n |F|). It accepts iff FF is unsatisfiable. It is not polynomially bounded: the proof is exponential in nn, which can be linear in ∣F∣|F|. Cook–Reckhow only says that some system would be polynomially bounded iff NP = coNP; a weak system failing proves nothing.

11. (programming) Write a strategy for PEP_E that splits on the variable occurring in the most formulas of the leaf. Compare tree sizes with leftmost_strategy() on 300 random states over a,b,c,da, b, c, d.

Answer

Copy leftmost_strategy and, instead of taking the first SPLIT instance, pick the instance whose variable maximizes sum(1 for f in S if name in variables(f)). Expect smaller trees on average when some variables are shared by many formulas (they settle more formulas at once). Lecture 4 develops such decision heuristics for DPLL.

12. (programming) Use explore to show that PPLP_{PL} extended with OR-SPLIT and AND2 is still incomplete. Which states remain stuck?

Answer

Build ProofSystem("P", [MP, SPLIT, CONTR] + [r for r in EXERCISE_RULES if r.name in ("OR-SPLIT", "AND2")]) and explore the small states. Every satisfiable state is still stuck — there is still no corroborating rule. Some unsatisfiable states become refutable ({a∧¬a}\{a \wedge \neg a\} via AND2 and CONTR). Completeness needs a way to say SAT.


12. Further reading

  • Slides: C. Tinelli, Abstract Proof Systems, Iowa CS:4980, Spring 2024 (based on slides by Tinelli and by Barrett, Trippel and Wu at Stanford).
  • Proof systems for solvers
    • 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 — the “abstract DPLL” style of Lectures 4, 5 and 10.
    • S. Krstić, A. Goel, “Architecting solvers for SAT modulo theories: Nelson–Oppen with DPLL”, FroCoS 2007.
    • C. Tinelli, “A DPLL-based calculus for ground satisfiability modulo theories”, JELIA 2002 (derivation trees and strategies in this style).
  • Proof complexity
    • S. Cook, R. Reckhow, “The relative efficiency of propositional proof systems”, Journal of Symbolic Logic, 1979.
    • A. Haken, “The intractability of resolution”, 1985; S. Buss, “Polynomial size proofs of the propositional pigeonhole principle”, Journal of Symbolic Logic, 1987.
    • M. D’Agostino, “Are tableaux an improvement on truth-tables?”, 1992.
    • K. Pipatsrisawat, A. Darwiche, “On the power of clause-learning SAT solvers as resolution engines”, Artificial Intelligence, 2011.
    • S. Buss, J. Nordström, “Proof complexity and SAT solving”, Ch. 7 of the Handbook of Satisfiability, 2nd ed., 2021.
  • Textbooks: M. Ben-Ari, Mathematical Logic for Computer Science, 3rd ed., Ch. 3 (Hilbert systems, the deduction theorem); H. Enderton, A Mathematical Introduction to Logic, §1.7 (soundness and completeness of a deductive calculus).

13. Next lecture

Lecture 4 (DPLL, guest lecture by Clark Barrett) applies this lecture’s recipe to the procedure at the heart of SAT solving.

  • Abstract DPLL is a satisfiability proof system on states ⟨M,Δ⟩\langle M, \Delta \rangle (MM a partial assignment with decision marks): DECIDE, PROPAGATE, PURE, BACKTRACK, FAIL. Its soundness, completeness and termination are proved exactly as here.
  • Why split on variables with unit propagation, rather than on formulas (Lecture 1) or by eliminating variables (Lecture 2)? Memory stays linear and every split is exclusive.
  • The cost of a strategy, measured: decision heuristics, unit propagation with two watched literals, and the phase transition of random 3-SAT near 4.26 clauses per variable.
  • DPLL refutations are tree-like resolution proofs, which our Lecture 2 checker will verify.
  • Code: dpll.py (recursive DPLL, the abstract transition system with traces, a watched-literal solver with heuristics, proof output).
← 返回课程目录