FRAT-rs is a toolchain for processing and transforming files in the FRAT format.
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
--full
is 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
-s
is specified, the FRAT file is checked in "strict mode", which means that bogus proofs inl
steps will be rejected. (The default behavior is to instead fall back on no-hint mode if the hint is wrong.) -
If
-ss
is specified, the FRAT file is checked in "extra-strict mode", in whichl
steps cannot be omitted. -
If
-m
is specified, the intermediate file (between FRAT and LRAT) will be generated in memory instead of on disk, which might be faster. The optionalNUM
argument is a size hint for the initial allocation in bytes, which defaults to 5 times the size of theFRATFILE
. -
If
DIMACSFILE
is specified, the resulting output will be checked against the given CNF, otherwise only the first phase of elaboration will run, producing aFRATFILE.temp
file but no other output. (This temporary file is useful as input torefrat
.) -
If
LRATFILE
is specified, the output will be placed inLRATFILE
, otherwise the elaborator will run but no output will be produced. -
If
-v
is specified, the LRAT file is passed directly tolratchk
. OmittingLRATFILE
and specifying-v
is a way to verify FRAT files without otherwise generating output. -
If
-c
is 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
: ChecksLRATFILE
against the input problemDIMACSFILE
.This is essentially the same as
lrat-check.c
but 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 useelab
to generate an LRAT file and then use a formally verified LRAT checker likecake_lpr
to check the resulting file. -
frat-rs stat FRATFILE
: AnalyzesFRATFILE
and displays statistics -
frat-rs strip-frat FRATFILE NEWFRATFILE
: ProcessesFRATFILE
, and produces a correspondingNEWFRATFILE
with 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 thatFRATFILE
could be a proof of, and writes it to stdout (or pipes it toDIMACSFILE
in this example) -
frat-rs from-drat DIMACSFILE DRATFILE FRATFILE
: ProcessesDIMACSFILE
andDRATFILE
to produce a correspondingFRATFILE
with 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
: ProcessesDIMACSFILE
andPRFILE
to produce a correspondingFRATFILE
with no PR steps. This implements thepr2drat
algorithm, but with proofs supplied in the resulting FRAT file.Note that
elab
can 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-trim
in 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
: ChecksDRATFILE
against the input problemDIMACSFILE
(unmaintained)
-