Correctness of the DPLL solver
TheoremCorrectness of DPLL with sufficient fuel#✓fully proved
Cslib.Algorithms.SAT.DPLL.decideWithFuel_eq_true_iff
Let \(\varphi\) be a CNF formula and let \(n\) be a natural number at least the number of distinct variables occurring in \(\varphi\). Then DPLL with fuel \(n\) returns true on \(\varphi\) if and only if \(\varphi\) is satisfiable.
theorem decideWithFuel_eq_true_iff {fuel : Nat} {formula : CNF}
(hfuel : formula.vars.card ≤ fuel) :
decideWithFuel fuel formula = true ↔ CNFSat formula
abbrev CNF := List CNFClause
CSLibExt/Logics/Propositional/CNF/Basic.lean:33
def decideWithFuel : Nat → CNF → Bool
| 0, formula => formula.isEmpty
| fuel + 1, formula =>
if formula.isEmpty then
true
else if formula.any List.isEmpty then
false
else
match firstUnit formula with
| some literal => decideWithFuel fuel (CNF.restrict literal formula)
| none =>
match firstVariable formula with
⋯
CSLibExt/Algorithms/SAT/DPLL/Solver.lean:68
def CNFSat (φ : CNF) : Prop :=
∃ v : Nat → Bool, ∀ C ∈ φ, ∃ (x : Nat) (b : Bool), (x, b) ∈ C ∧ v x = b
CSLibExt/Logics/Propositional/CNF/Basic.lean:36
Uses 15 · Used by 1
Statement usesDPLL with a fuel budget · CNF formula · Variables of a CNF formula · Satisfiability of a CNF formula
Proof usesFirst unit literal · First variable of a CNF formula · Satisfaction of a CNF formula · Restriction reduces the number of variables · Restriction of a CNF formula by a literal · Unit propagation preserves satisfiability · Splitting on a variable · CNF clause · Satisfaction of a clause · Variables of a clause · Satisfiability means having a satisfying assignment
Used byCorrectness of DPLL
TheoremCorrectness of DPLL#✓fully proved
Cslib.Algorithms.SAT.DPLL.dpll_eq_true_iff
For every CNF formula \(\varphi\), the DPLL procedure returns true on \(\varphi\) if and only if \(\varphi\) is satisfiable.
theorem dpll_eq_true_iff {formula : CNF} :
dpll formula = true ↔ CNFSat formula
abbrev CNF := List CNFClause
CSLibExt/Logics/Propositional/CNF/Basic.lean:33
def dpll (formula : CNF) : Bool :=
decideWithFuel formula.vars.card formula
CSLibExt/Algorithms/SAT/DPLL/Solver.lean:86
def CNFSat (φ : CNF) : Prop :=
∃ v : Nat → Bool, ∀ C ∈ φ, ∃ (x : Nat) (b : Bool), (x, b) ∈ C ∧ v x = b
CSLibExt/Logics/Propositional/CNF/Basic.lean:36
Uses 5 · Used by 1
2 fully proved
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.