Documentation

CslibFrontier.Algorithms.Lean.CDCL.Dimacs

The CDCL solver on DIMACS text #

What the executable lake exe cdcl prints, apart from the statistics and times: Cslib.Algorithms.Lean.CDCL.answerDIMACS reads a DIMACS CNF formula, solves it on renamed variables (Cslib.Algorithms.Lean.CDCL.solveCompactWith), and gives the answer in the format of the SAT competitions with MiniSat's exit code: s SATISFIABLE and the model on v lines, exit code 10, or s UNSATISFIABLE and the certificate, exit code 20.

The model lists one literal for each variable occurring in the formula, in increasing order, and ends with 0: a formula without variables gets v 0, and a formula over the single DIMACS variable 10⁶ gets one literal, not one for each smaller name.

Main definitions #

Main statements #

The text itself (modelLines and the s lines) is output formatting, with no theorem about it.

The variables occurring in φ, each once, in increasing order.

The variables passed to modelLines are those of the formula.

The variables passed to modelLines increase, so each appears once.

The variables passed to modelLines have no repeats.

The model σ on the variables vs as DIMACS literals on v lines of at most 80 characters, the variable v as v + 1, negated where σ is false, and the final 0.

The answer of the solver for a DIMACS formula.

The answer for a formula, solved with the options o on renamed variables.

Exit code 10 only for a satisfiable formula.

The certificate given is accepted by the LRUP (RUP-only LRAT) checker.

The answer for a DIMACS formula, read by Cslib.Logic.PL.CNF.ofDIMACS; an error if the text is not a DIMACS formula.

The answer for a printed formula is the answer for the formula: reading Cslib.Logic.PL.CNF.toDIMACS gives the formula back (Cslib.Logic.PL.CNF.ofDIMACS_toDIMACS).

Exit code 10 on the printed formula only for a satisfiable formula, end to end: the hypothesis is about the text φ.toDIMACS, the conclusion about φ.

A certificate given for the printed formula is accepted for the formula, end to end, so the formula is unsatisfiable (Cslib.Logic.PL.CNF.not_satisfiable_of_checkLRUP).