frat
frat copied to clipboard
DRAT proof processor
The FRAT format and FRAT-rs
FRAT-rs is a toolchain for processing and transforming files in the FRAT format.
Usage
FRAT-rs can be compiled using make. (It is written in Rust, so you will need to
get Rust first to put cargo in your path.)
-
frat-rs elab FRATFILE [--full] [-s|-ss] [-m[NUM]] [DIMACSFILE [LRATFILE] [-v] [-c]]: ElaboratesFRATFILE, the unsatisfiability proof ofDIMACSFILE, and produces the correspondingLRATFILE.-
If
--fullis specified, the entire FRAT file is checked, including steps that do not contribute to the final contradiction. (The default is to skip these steps, so we might generate a valid proof without ever noticing that the step that was skipped is not well formed.) -
If
-sis specified, the FRAT file is checked in "strict mode", which means that bogus proofs inlsteps will be rejected. (The default behavior is to instead fall back on no-hint mode if the hint is wrong.) -
If
-ssis specified, the FRAT file is checked in "extra-strict mode", in whichlsteps cannot be omitted. -
If
-mis specified, the intermediate file (between FRAT and LRAT) will be generated in memory instead of on disk, which might be faster. The optionalNUMargument is a size hint for the initial allocation in bytes, which defaults to 5 times the size of theFRATFILE. -
If
DIMACSFILEis specified, the resulting output will be checked against the given CNF, otherwise only the first phase of elaboration will run, producing aFRATFILE.tempfile but no other output. (This temporary file is useful as input torefrat.) -
If
LRATFILEis specified, the output will be placed inLRATFILE, otherwise the elaborator will run but no output will be produced. -
If
-vis specified, the LRAT file is passed directly tolratchk. OmittingLRATFILEand specifying-vis a way to verify FRAT files without otherwise generating output. -
If
-cis specified (requiresLRATFILE), comment lines from the original FRAT file will be transmitted to theLRATFILE. This is a good way to align important points in the proof with the output, but it is disabled by default since some LRAT checkers don't support comments.
This is the main subcommand you want to use, if you are a solver developer producing FRAT files.
-
-
frat-rs lratchk DIMACSFILE LRATFILE: ChecksLRATFILEagainst the input problemDIMACSFILE.This is essentially the same as
lrat-check.cbut it is more robust (at the time of writing) and has no known bugs. It is provided as a convenience for FRAT and LRAT file testing, but for actual high assurance scenarios you should useelabto generate an LRAT file and then use a formally verified LRAT checker likecake_lprto check the resulting file. -
frat-rs stat FRATFILE: AnalyzesFRATFILEand displays statistics -
frat-rs strip-frat FRATFILE NEWFRATFILE: ProcessesFRATFILE, and produces a correspondingNEWFRATFILEwith 0% annotations -
frat-rs refrat ELABFILE FRATFILE: ProcessesELABFILE, a temporary file produced by the first elaboration pass of frat-rs, and producesFRATFILE, a corresponding FRAT proof with 100% annotations -
frat-rs to-cnf FRATFILE > DIMACSFILE: FRAT files contain a copy of the CNF inside them. This command constructs a CNF file thatFRATFILEcould be a proof of, and writes it to stdout (or pipes it toDIMACSFILEin this example) -
frat-rs from-drat DIMACSFILE DRATFILE FRATFILE: ProcessesDIMACSFILEandDRATFILEto produce a correspondingFRATFILEwith 0% annotations. Note that despite the name, this also works on PR files, and will translate them into FRAT files with PR steps. -
frat-rs from-pr DIMACSFILE PRFILE FRATFILE: ProcessesDIMACSFILEandPRFILEto produce a correspondingFRATFILEwith no PR steps. This implements thepr2dratalgorithm, but with proofs supplied in the resulting FRAT file.Note that
elabcan directly handle PR steps in FRAT files, and they will be preserved in the output (resulting in LPR files instead of LRAT). So the main reason you would use this command is if you want pure LRAT output, or just as another way to slice data to get another data set. -
Experimental subcommands:
-
frat-rs drat-trim: A clone ofdrat-trimin true "Rewrite it in Rust" fashion. It has exactly the same behavior and options as the original, see the README there for more info. -
frat-rs dratchk DIMACSFILE DRATFILE: ChecksDRATFILEagainst the input problemDIMACSFILE(unmaintained)
-