A kernel-reducible LRUP (RUP-only LRAT) checker #
An LRAT certificate Cruz-Filipe et al. refutes a
formula in conjunctive normal form by a sequence of steps, each adding a clause (by RUP or RAT),
adding the empty clause, or deleting clauses. Every clause has a number: the clauses of the formula
are numbered 1, 2, … in order, and every added clause carries its own number. An added RUP clause
comes with hints, a list of numbers of clauses. Starting from the negation of the added clause,
the hinted clauses are visited in order. Each must have all but one of its literals false, and then
the remaining literal becomes true, except the last, which must have all its literals false. So the
added clause follows from the hinted clauses by unit propagation: it is a RUP clause.
Cslib.Logic.PL.CNF.checkLRUP φ cert checks the RUP-only (LRUP) fragment of LRAT in the format
of Lean core's Std.Tactic.BVDecide.LRAT.IntAction: literals are nonzero integers in DIMACS style,
so the variable v of φ : CNF ℕ is written v + 1, and is negated by negating the integer. It
accepts RUP steps, empty-clause steps and deletions, and rejects every RAT step. Full LRAT with
RAT steps is checked separately by Cslib.Logic.PL.CNF.checkLRATRat (alongside the kernel trie
checker Cslib.Logic.PL.CNF.checkLRATKernel and the array checker
Cslib.Logic.PL.CNF.checkLRATFast). Because RAT steps simulate Extended Resolution while RUP-only
certificates are polynomially equivalent to Resolution, the two checkers belong to exponentially
separated proof systems.
checkLRUP is written with structural recursion on lists, so the kernel can evaluate it and
decide proves that it accepts a given certificate. Lean core's Std.Tactic.BVDecide.LRAT.check
checks full LRAT in the same format, but the kernel cannot evaluate it, and it is only proved
sound, not complete.
A clause added by a RUP step holds under every assignment satisfying the clauses so far, so an
accepted LRUP certificate shows that the formula has no model
(Cslib.Logic.PL.CNF.not_satisfiable_of_checkLRUP).
Main definitions #
Cslib.Logic.PL.Clause.ofDIMACS: a clause from DIMACS integers.Cslib.Logic.PL.Literal.toDIMACS,Cslib.Logic.PL.Clause.toDIMACS: a literal and a clause as DIMACS integers, inverted byCslib.Logic.PL.Literal.ofDIMACS_toDIMACSandCslib.Logic.PL.Clause.ofDIMACS_toDIMACS.Cslib.Logic.PL.Clause.residual: what is left of a clause once its false literals are removed: nothing, one literal possibly repeated, or more.Cslib.Logic.PL.CNF.propagateHints: unit propagation along hints.Cslib.Logic.PL.CNF.lrupHintCount: the number of RUP and empty-clause hints of a certificate.Cslib.Logic.PL.CNF.checkLRUP: the RUP-only (LRUP) checker.
Main results #
Cslib.Logic.PL.CNF.propagateHints_cons_of_forall_ne: a hinted clause whose literals other thanlare false ends propagation successfully or propagatesl.Cslib.Logic.PL.CNF.not_satisfiable_of_checkLRUP: a formula with an accepted LRUP certificate is unsatisfiable.
References #
The DIMACS integer of a literal: v + 1 for the variable v, -(v + 1) for its negation.
What is left of a clause under the literals assumed true, once its false literals are
removed (Cslib.Logic.PL.Clause.residual).
The residual of a clause under the literals t assumed true: the literals of c whose
negation is not in t, classified as none (empty), one literal possibly repeated (unit), or
more (other). A literal repeated in the clause counts once. Unit propagation along hints
(Cslib.Logic.PL.CNF.propagateWith) reads every hinted clause through this classification.
The residual of a clause is the unit l exactly when l is a literal of the clause that is
not false, and every other literal of the clause is false.
Unit propagation along hints, from the literals trail assumed true, reading the hinted
clauses with lookup. Each hinted clause must have every literal but one false under trail, and
that literal is added to trail; the run succeeds when a hinted clause has every literal false
(Cslib.Logic.PL.Clause.residual). The checker reads clauses from a list of numbered clauses
(Cslib.Logic.PL.CNF.propagateHints); a solver can read them from an index.
One step of unit propagation along hints: if every literal of the hinted clause other
than l is false, propagation succeeds, at once when l is also false or absent, and otherwise
when it succeeds from the trail extended by l.
Unit propagation along hints in a database of numbered clauses
(Cslib.Logic.PL.CNF.propagateWith), looking up the first clause of each number (List.lookup).
One step of unit propagation along hints in a database, by the residual of the hinted clause.
One step of unit propagation along hints in a database: if every literal of the hinted
clause other than l is false, propagation succeeds, at once when l is also false or absent,
and otherwise when it succeeds from the trail extended by l.
The number of RUP and empty-clause hints of a certificate: the total length of the hint
lists of its RUP and empty-clause steps. CNF.checkLRUP reads no other hints and rejects RAT
steps.
The RUP-only (LRUP) checker on a database of numbered clauses; RAT steps are rejected.
The LRUP (RUP-only LRAT) checker: the clauses of φ are numbered from 1, and the
certificate must reach an empty-clause step through RUP steps and deletions; RAT steps are
rejected (for full LRAT with RAT steps, see Cslib.Logic.PL.CNF.checkLRATRat).
Soundness #
If unit propagation along hints succeeds, no assignment satisfying every clause the lookup returns makes the starting literals true.
If unit propagation along hints succeeds, no assignment satisfies the database and makes the starting literals true.
A RUP clause holds: if unit propagation along hints from its negation succeeds, every assignment satisfying the database satisfies it.
If the LRUP checker accepts on a database, no assignment satisfies the database.
A formula with an accepted LRUP (RUP-only LRAT) certificate is unsatisfiable.