The DPLL solver on the word RAM: correctness and running time #
This file proves the main theorem about the word-RAM DPLL solver
(Cslib.Algorithms.WordRAM.DPLL.program). On the input encode N φ of length E, where every
variable of φ is below N, it returns the output of Cslib.Algorithms.Lean.DPLL.solve
(Cslib.Algorithms.WordRAM.DPLL.answerWords): [0] when φ is unsatisfiable, and 1 followed by
the bits of the solver's model otherwise. It halts within
2 ^ (d + 1) (37 E + 62) + 10 N + 14 instructions, where d is the number of distinct
variables of φ (Cslib.Algorithms.WordRAM.DPLL.program_spec), and so within 222 · 2 ^ N · E
(Cslib.Algorithms.WordRAM.DPLL.program_spec_pow).
Each iteration of the main loop runs one step of the search with an explicit trail
(Cslib.Algorithms.Lean.DPLL.Trail.step) in O(E) instructions, and the search ends within
2 ^ (d + 1) steps (Cslib.Algorithms.Lean.DPLL.Trail.run_answer). The term 10 N is charged
once, on the exit that writes a model: it writes one word for each of the N variables. It is
not covered by the O(E) cost of a step, because the header N is only an upper bound on the
variables and can exceed the input length E.
Main results #
Cslib.Algorithms.WordRAM.DPLL.mainLoop_spec: the main loop runs the search.Cslib.Algorithms.WordRAM.DPLL.program_spec,Cslib.Algorithms.WordRAM.DPLL.program_spec_pow: correctness and the instruction bounds.
The main loop runs the search: from the state of the trail t, if the run of k steps
from t ends with the answer a, the loop writes the output of a at T + 4 N.
The memory of the input encode N φ of length E is that of the empty trail, with the end of
the clauses at T = E + 1.
The solver on the word RAM ends with the output answerWords N φ at the address in
out.
The DPLL solver on the word RAM. At any word size w that fits E + 5 N + 3, the program
run on the input encode N φ of length E, where every variable of φ is below N, returns the
output of Cslib.Algorithms.Lean.DPLL.solve: [0] when φ is unsatisfiable, and 1 followed by
the bits of the solver's model on the variables below N otherwise. It halts within
2 ^ (d + 1) (37 E + 62) + 10 N + 14 instructions, the final halt included, where
d = Cslib.Algorithms.Lean.DPLL.depth φ is the number of distinct variables of φ.
The running time in the form c · 2 ^ N · E: the program halts within
222 · 2 ^ N · E instructions on the input encode N φ of length E.