The DPLL solver on the word RAM: what the scan computes #
The scan of the word-RAM DPLL solver (Cslib.Algorithms.WordRAM.DPLL.scan) makes one pass over the
clauses. This file states what it computes as a fold over the clauses and their literals
(Cslib.Algorithms.WordRAM.DPLL.clauseStep, Cslib.Algorithms.WordRAM.DPLL.litStep), proves that
the fold gives the status of the trail (Cslib.Algorithms.Lean.DPLL.status): a falsified clause,
satisfaction, the literal of the first unit clause, and the variable of the first literal
occurrence that is open (Cslib.Algorithms.WordRAM.DPLL.foldl_clauseStep_init), and proves that
the program computes the fold (Cslib.Algorithms.WordRAM.DPLL.scan_spec).
Main definitions #
Cslib.Algorithms.WordRAM.DPLL.litStep,Cslib.Algorithms.WordRAM.DPLL.clauseStep: one literal and one clause of the scan.Cslib.Algorithms.WordRAM.DPLL.LitArr: the literal array holds a partial assignment.
Main results #
Cslib.Algorithms.WordRAM.DPLL.foldl_clauseStep_init: the fold computes the status.Cslib.Algorithms.WordRAM.DPLL.scan_spec: the scan computes the status within23 E + 9instructions, whereEis the number of words of the clauses, and leaves memory unchanged.
The fold of the scan #
The registers of the literal loop: the number of literals of the current clause not falsified so far, the code of the last of them, whether one of them is true, and the first open variable.
- cnt : ℕ
The number of literals not falsified so far.
- uc : ℕ
The code of the last such literal.
- sat : Bool
Whether a true literal was found.
The first open variable.
Instances For
One literal against the partial assignment π: a falsified literal changes nothing; a true
one is counted and recorded; the variable of any other is open, and is recorded when it is the
first.
Whether some literal of π has the code u.
The registers of the scan: a falsified clause, whether every clause has a true literal, the code of the literal of the first unit clause, and the first open variable.
- conf : Bool
A falsified clause was found.
- alls : Bool
Every clause so far has a true literal.
The code of the literal of the first unit clause not on the trail.
The first open variable.
Instances For
The registers at the start of the scan.
The end of a clause whose literal loop ended with the registers r.
One clause of the scan.
The fold computes the status #
The literals of a clause not falsified by π.
Assignment of a variable through the two literals on it.
What the literal loop computes: the number of literals not falsified, whether one of them holds, the code of the last of them, and the first open variable.
The code of the literal of a unit clause.
What the scan computes, from any registers.
The scan computes the status of the trail: whether a clause is falsified, whether every clause has a true literal, the code of the literal of the first unit clause, and the variable of the first literal occurrence that is open.
The code left by the literal loop is 0 or that of a literal not falsified.
The program computes the fold #
The literal array at T holds the partial assignment π on the variables below N: the cell
T + 2 v + b is 1 when (v, b) is in π and 0 otherwise.
The registers of the literal loop hold r.
The scan registers hold s.
One literal of the scan performs litStep.
The literal loop folds litStep over the literals at lptr, and leaves memory
unchanged.
The end of a clause performs endClause.
The clause loop folds clauseStep over the clauses from ptr to cend, and leaves
memory unchanged.
The scan of the clauses φ stored from address 2 to cend against the partial
assignment π: the registers end with the status of π, and memory is unchanged.