#include "application.h" #include "check.h" #include "colors.h" #include "config.h" #include "error.h" #include "internal.h" #include "parse.h" #include "print.h" #include "proof.h" #include "resources.h" #include "witness.h" #include #include #include #include typedef struct application application; struct application { kissat *solver; const char *input_path; #ifndef NPROOFS const char *proof_path; file proof_file; bool force; int binary; #endif int time; int conflicts; int decisions; strictness strict; bool partial; bool witness; int max_var; }; static void init_app (application * application, kissat * solver) { memset (application, 0, sizeof *application); application->solver = solver; application->witness = true; application->time = 0; application->conflicts = -1; application->decisions = -1; application->strict = NORMAL_PARSING; } static void print_common_dimacs_and_proof_usage (void) { printf ("\n"); printf ("Furthermore '' is the input file in DIMACS format.\n"); #ifndef NPROOFS printf ("If '' is specified then a proof trace is written.\n"); #endif } static void print_complete_dimacs_and_proof_usage (void) { printf ("\n"); printf ("Furthermore '' is the input file in DIMACS format.\n"); #ifdef _POSIX_C_SOURCE printf ("The solver reads from '' if '' is unspecified.\n"); printf ("If the path has a '.bz2', '.gz', '.lzma', '7z' or '.xz' suffix\n"); printf ("then the solver tries to find a corresponding decompression\n"); printf ("tool ('bzip2', 'gzip', 'lzma', '7z', or 'xz') to decompress\n"); printf ("the input file on-the-fly after checking that the input file\n"); printf ("has the correct format (starts with the corresponding\n"); printf ("signature bytes).\n"); #endif printf ("\n"); #ifndef NPROOFS printf ("If '' is specified then a proof trace is written to the\n"); printf ("given file. If the file name is '-' then the proof is written\n"); printf ("to ''. In this case the ASCII version of the DRAT format\n"); printf ("is used. For real files the binary proof format is used unless\n"); printf ("'--no-binary' is specified.\n"); printf ("\n"); #ifdef _POSIX_C_SOURCE printf ("Writing of compressed proof files follows the same principle\n"); printf ("as reading compressed files. The compression format is based\n"); printf ("on the file suffix and it is checked that the corresponding\n"); printf ("compression utility can be found.\n"); #else printf ("The solver was built without POSIX support. Thus compressed\n"); printf ("and unlocked reading and writing are not available. This is\n"); printf ("usually enforced by the '-p' (pedantic) configuration. If you\n"); printf ("need compressed reading and writing then configure and build\n"); printf ("the solver without '-p'. This will also speed-up file I/O.\n"); #endif #else printf ("The solver was built without proof support. If you need proofs\n"); printf ("use a configuration without '--no-proofs' nor '--ultimate'.\n"); #endif } static void print_common_usage (void) { printf ("usage: kissat [