An LRAT checker on the word RAM: unit propagation along hints #
This file proves that the propagation loop of the word-RAM LRAT checker
(Cslib.Algorithms.WordRAM.LRAT.propagate) computes Cslib.Logic.PL.CNF.propagateHints.
The database of numbered clauses is represented by a table (TableAt): the cell T + 2 i holds
the address of the encoding of the clause numbered i, found by List.find? as
propagateHints finds it, or 0. The trail is represented by stamps (TrailAt): the cell
T + 2 c + 1 of the literal with code c holds the current stamp exactly when the literal is on
the trail, and never more than the stamp.
Main definitions #
Cslib.Algorithms.WordRAM.LRAT.TableAt,Cslib.Algorithms.WordRAM.LRAT.TrailAt: the memory representation of the database and the trail.Cslib.Algorithms.WordRAM.LRAT.hintsWork: the total length of the hinted clauses.
Main results #
Cslib.Algorithms.WordRAM.LRAT.propagate_spec: the propagation loop computespropagateHintswithin40 k + 20 W + 10instructions forkhints whose clauses have total lengthW.
The memory representation #
The cell of the table for clause number i.
The cell of the assignment for the literal with code c.
The table at base T represents the database db: the cell of a clause number holds 0
when db has no clause of that number, and otherwise the address, below T, of the encoding of
the first such clause.
The assignment at base T represents the trail trail with stamp s: the cell of a literal
holds s exactly when the literal is on the trail, and never more than s.
Assigning a literal the stamp puts it on the trail.
Work #
The length of the clause the hint h names in db, or 0.
The total length of the clauses the hints name.
Scanning a hinted clause #
Scanning a clause at cl leaves in has, unit and bad the abstract state of its
literals that F does not mark, and leaves memory unchanged.
The trail marks of a trail: F l says that the complement of l is on the trail.
The hint loop computes propagateHints db trail hints for the hints in [ptr, hend),
changing only assignment cells, and leaves ptr at hend.
Unit propagation along hints: from the hints encodeNums hints at ptr, propagate
leaves propagateHints db trail hints in res and ptr past the hints, changing only
assignment cells.