arminbiere / cadical

CaDiCaL SAT Solver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Output LRAT proofs in VeriPB format?

jakobnordstrom opened this issue · comments

Could you add a feature for CaDiCaL to output its LRAT proofs in VeriPB format (as explained below)?

The motivation for this is that this would massively improve the performance of proof verification for applications where VeriPB is used for proof logging of more sophisticated techniques (such as Gaussian elimination, symmetry breaking, or even MaxSAT solving), but where a big part of the final proof will consist of a standard SAT solver proof log.

To give some context, for DRAT-to-VeriPB one can use the dictionary on slide 26 in the slides http://www.jakobnordstrom.se/docs/presentations/TalkVeriPB_PoS23.pdf for the presentation of VeriPB at the Pragmatics of SAT workshop:

DRAT VeriPB
1 x1
-2 ∼x2
1 -2 3 0 1 x1 1 ∼x2 1 x3 >= 1 ;
1 -2 3 0 is RUP rup 1 x1 1 ∼x2 1 x3 >= 1 ;
1 -2 3 0 is RAT red 1 x1 1 ∼x2 1 x3 >= 1 ; x1 -> 1

If there is a conflict analysis involving clauses with identifiers id1, id2, id3, id4, ..., idN, to be resolved in this order to get the learned constraint, then the VeriPB proof line for such a conflict analysis would be

(1) pol id1 id2 + s id3 + s id4 + s ... idN + s

(which might be the reverse order compared to the LRAT proof).

If you know that the clause resulting from this derivation is "1 -2 3 0", then it would be nice to add a second line

(2) e -1 1 x1 1 ∼x2 1 x3 >= 1 ;

directly below (perhaps there would be an optional flag for this, or perhaps this would be the default).

More details about the VeriPB proof format are at https://gitlab.com/MIAOresearch/software/VeriPB --- with the caveat that we will be releasing version 2.0 of the proof format in the autumn, so some details will change --- but just to explain briefly what these magic lines mean:

Line (1) says that this is a reverse polish notation derivation, which does the following:

  • take constraints id1 and id2, add them up, and saturate (this corresponds exactly to resolving the two clauses);
  • then push constraint id3 on the stack, add it to what was already there, and saturate;
  • then push constraint id4 on the stack, add it to what was already there, and saturate, et cetera,

or, in other worse, this reverse polish notation line is just explicitly describing the conflict analysis.

One feature of the VeriPB proof format is that there is no explicit specification what the final result of the derivation is --- the proof checker will know this anyway.

But for purposes of debugging, there is a command

e [id] [explicit constraint]

which checks that the constraint with identifier id is syntactically equal to the explicitly listed constraint. Line (2) is using that -1 refers to the constraint most recently added to the constraint database.

This command is also what will probably be used in the future to implement proof trimming in VeriPB --- a solver author who wants to support proof trimming efficiently will be asked to provide equality "e" statements after each derivation.

Proof logging for LRAT in the VeriPB format is now supported with release 1.7.1. Please check it out and let us know if there are any issues.