Documentation

CslibFrontier.Algorithms.Lean.DPLL.SearchTree

The search tree of the DPLL trail run #

The run of the DPLL search with an explicit trail (Cslib.Algorithms.Lean.DPLL.Trail.run) explores a binary tree: at a partial assignment that falsifies a clause it backtracks, and at one that neither falsifies nor satisfies every clause it tries both literals of the branch variable. This file names that tree as a decision tree (Cslib.Algorithms.Lean.DPLL.searchTree): it queries the branch variable at each branching, and its leaves carry the first clause falsified there. On an unsatisfiable formula, the tree from the empty partial assignment finds a falsified clause on every assignment (Cslib.Algorithms.Lean.DPLL.findsFalsifiedClause_searchTree), so it is a DPLL tree in the sense of Cslib.DecisionTree.FindsFalsifiedClause, which converts to a tree-like resolution refutation with at most as many leaves (Cslib.DecisionTree.FindsFalsifiedClause.exists_derivation_leafCount_le). The lower bound of Beyersdorff, Galesi and Lauria [BeyersdorffGalesiLauria2010, Theorem 2] then gives the tree at least (n / 2 + 1) ^ (n / 2) leaves on PHP^m_n, m > n (Cslib.Algorithms.Lean.DPLL.pow_half_le_leafCount_searchTree_pigeonhole).

The trail run need not explore the tree of the recursive search (Cslib.Algorithms.Lean.DPLL.search), whose refutation Cslib.Algorithms.Lean.DPLL.refutation? is: the recursive search skips the second branch of a variable when the derivation of the first branch does not mention it, and the trail run never skips. The bound above is for the tree the trail run explores.

A run can also emit words as it goes, some words for each partial assignment it visits (Cslib.Algorithms.Lean.DPLL.Trail.runLog). Without a model below the trail, the words emitted while the run explores the subtree at the top of the trail are those of the subtree in preorder (Cslib.Algorithms.Lean.DPLL.preorder, Cslib.Algorithms.Lean.DPLL.Trail.runLog_add_nodes).

Main definitions #

Main results #

References #

The search tree #

The first clause of φ falsified by π, or the empty clause if there is none.

The tree explored by the trail run from π with fuel levels: a query of the branch variable at each branching, and the first falsified clause at each leaf.

theorem Cslib.Algorithms.Lean.DPLL.eval_searchTree (φ : Logic.PL.CNF ℕ) (fuel : ℕ) (π : List (Logic.PL.Literal ℕ)) :
(openVars φ π).length ≤ fuel → dfs φ fuel π = none → ∀ (σ : ℕ → Bool), (∀ l ∈ π, σ l.1 = l.2) → (searchTree φ fuel π).eval σ ∈ φ ∧ Logic.PL.Clause.eval σ ((searchTree φ fuel π).eval σ) = false

The tree from π, without a model below π, finds a falsified clause on the assignments that agree with π.

The search without skipping finds no model of an unsatisfiable formula.

The trail run explores a DPLL tree: on an unsatisfiable formula, the tree explored from the empty partial assignment finds a falsified clause on every assignment.

The trail run explores 2 ^ Ω(n log n) leaves on the pigeonhole formulas. For m > n and an injective map f numbering the variables of PHP^m_n, the tree explored by the trail run on the renamed formula has at least (n / 2 + 1) ^ (n / 2) leaves. This is the bound of [BeyersdorffGalesiLauria2010, Theorem 2] for every tree-like refutation, applied to the refutation that the tree gives.

Words emitted along the tree #

The words out π of the nodes of the tree from π in preorder.

theorem Cslib.Algorithms.Lean.DPLL.leafCount_searchTree_le_length_preorder (φ : Logic.PL.CNF ℕ) (out : List (Logic.PL.Literal ℕ) → List ℕ) (hout : ∀ (π : List (Logic.PL.Literal ℕ)), status φ π ≠ Status.sat → out π ≠ []) (fuel : ℕ) (π : List (Logic.PL.Literal ℕ)) :
(openVars φ π).length ≤ fuel → dfs φ fuel π = none → (searchTree φ fuel π).leafCount ≤ (preorder φ out fuel π).length

If every leaf emits a word, there are at least as many words as leaves.

theorem Cslib.Algorithms.Lean.DPLL.length_preorder_le (φ : Logic.PL.CNF ℕ) (out : List (Logic.PL.Literal ℕ) → List ℕ) (hout : ∀ (π : List (Logic.PL.Literal ℕ)), (out π).length ≤ 1) (fuel : ℕ) (π : List (Logic.PL.Literal ℕ)) :
(preorder φ out fuel π).length ≤ Trail.nodes φ fuel π

With at most one word per node, the preorder has at most one word per node of the tree.

theorem Cslib.Algorithms.Lean.DPLL.exists_mem_of_mem_preorder (φ : Logic.PL.CNF ℕ) (out : List (Logic.PL.Literal ℕ) → List ℕ) {x : ℕ} (fuel : ℕ) (π : List (Logic.PL.Literal ℕ)) :
x ∈ preorder φ out fuel π → ∃ (π' : List (Logic.PL.Literal ℕ)), x ∈ out π'

Every word of the preorder is a word of some node.

The words emitted by a run of at most k steps from the trail t: the words out π of the partial assignment of each trail it steps from.

theorem Cslib.Algorithms.Lean.DPLL.Trail.runLog_add_nodes (φ : Logic.PL.CNF ℕ) (out : List (Logic.PL.Literal ℕ) → List ℕ) (fuel : ℕ) (t : Trail) (k : ℕ) :
(openVars φ t.lits).length ≤ fuel → dfs φ fuel t.lits = none → runLog φ out (k + nodes φ fuel t.lits) t = preorder φ out fuel t.lits ++ match t.backtrack with | none => [] | some t' => runLog φ out k t'

The run emits the words of the subtree at the top of the trail in preorder, when the subtree has no model, and then continues by backtracking.