33#include <boost/program_options.hpp>
35#include "connect++-version.hpp"
37#include "StackProver.hpp"
38#include "Schedule.hpp"
39#include "ProofChecker.hpp"
45namespace fs = std::filesystem;
46namespace chrono = std::chrono;
47namespace po = boost::program_options;
49using namespace verbose_print;
50using namespace boost::spirit;
56void memory_allocation_failed() {
57 cout << endl <<
"% SZS status MemoryOut for "
58 << params::problem_name
59 <<
" : unable to allocate memory." << endl;
66void SIGINT_handler(
int p) {
67 cout << endl <<
"% SZS status Error for "
68 << params::problem_name
69 <<
" : terminated by SIGINT." << endl;
72void SIGXCPU_handler(
int p) {
73 cout << endl <<
"% SZS status Timeout for "
74 << params::problem_name
75 <<
" : terminated by SIGXCPU." << endl;
78void SIGALRM_handler(
int p) {
79 cout << endl <<
"% SZS status Timeout for "
80 << params::problem_name
81 <<
" : terminated by SIGALRM." << endl;
85int main(
int argc,
char** argv) {
89 chrono::steady_clock::time_point startTime;
90 startTime = chrono::steady_clock::now();
94 std::signal(SIGINT, SIGINT_handler);
95 std::signal(SIGXCPU, SIGXCPU_handler);
96 std::signal(SIGALRM, SIGALRM_handler);
102 char* tptp_env = getenv(
"TPTP");
103 if (tptp_env !=
nullptr) {
104 params::tptp_path = fs::path(tptp_env);
106 char* pwd_env = getenv(
"PWD");
107 if (pwd_env !=
nullptr) {
108 params::pwd_path = fs::path(pwd_env);
110 char* path_env = getenv(
"CONNECTPP_PATH");
111 if (path_env !=
nullptr) {
112 params::connectpp_path = fs::path(path_env);
115 params::connectpp_path = params::pwd_path;
121 po::options_description main_options(
"Basic options");
122 main_options.add_options()
124 "Show this message.")
126 "Show version number.")
127 (
"input,i", po::value<string>(),
129 (
"output,o", po::value<string>()->implicit_value(
string(
"default")),
130 "Write a short output summary (file, status, outcome, time etc) to the specified file. Default value: \"./output_summary.txt\".")
132 "Don't add equality axioms. (For example, if they were added elsewhere.) NOTE: also inhibits adding of distinct object axioms.")
134 "Place equality axioms at the end of the matrix, not the beginning")
135 (
"all-distinct-objects",
136 "By default Connect++ follows the TPTP convention of considering \"foobar\" to be a distinct object. This option makes *all* constants distinct.")
137 (
"no-distinct-objects",
138 "By default Connect++ follows the TPTP convention of considering \"foobar\" to be a distinct object. This option disables that behaviour, so constants can be equal to others.")
139 (
"timeout,t", po::value<int>(),
140 "Timeout in seconds. (Default UINT32_MAX).")
141 (
"show-default-schedule",
142 "Display the build-in default schedule and halt.")
143 (
"schedule,s", po::value<string>(),
144 "Instead of running with fixed parameters, use a schedule from the specified file. Use value \"default\" for the default schedule. If no --timeout is specified use 600s.")
145 (
"random-seed", po::value<int>(),
146 "Specify the (non-negative, integer) seed to use for random number generation. Default 0.")
148 "Use the alternative, polynomial-time unification algorithm.")
149 (
"tptp", po::value<string>(),
150 "Specify a path for the TPTP. Alternative to using the TPTP environment variable.")
151 (
"path", po::value<string>(),
152 "Specify the path for output files other than the one produced by --output. Alternative to using the CONNECTPP_PATH environment variable.");
154 po::options_description conversion_options(
"Clause conversion");
155 conversion_options.add_options()
157 "Don't apply definitional transformation for any formula.")
159 "Apply definitional transformation to all formulas.")
160 (
"reorder,r", po::value<int>(),
161 "Reorder the clauses a specified number of times.")
163 "Randomly reorder the clauses.")
164 (
"random-reorder-literals",
165 "Randomly reorder the literals in each clause in the matrix.")
167 "Don't miniscope when converting to CNF.")
169 "Show translation of first-order formulas to clauses and halt.");
171 po::options_description output_options(
"Output formatting");
172 output_options.add_options()
173 (
"verbosity,v", po::value<int>(),
174 "Set verbosity level (0-3). Default is 2.")
176 "Don't use colour to highlight output.")
178 "Include substitutions when writing output.")
179 (
"indent", po::value<int>(),
180 "Set indentation size. (Default 4.)")
181 (
"out-int", po::value<int>(),
182 "Interval for updating output (default 50,000).");
184 po::options_description search_options(
"Search control");
185 search_options.add_options()
187 "Use all start clauses. (Overides other start clause options.)")
189 "Use all positive/negative start clauses, according to representation (currently always negative). (Interacts with other start clause options.)")
191 "Use all conjecture clauses as start clauses. (Interacts with other start clause options.)")
193 "Only use one start clause. (Interacts with other start clause options.)")
195 "Don't use the regularity test.")
197 "Compute reductions for all literals in the clause, not just the first one.")
199 "Compute extensions for all literals in the clause, not just the first one.")
201 "When using lemmata, consider all literals in the clause, not just the first one.")
203 "Do not use lemmata.");
205 po::options_description backtrack_options(
"Backtracking");
206 backtrack_options.add_options()
208 "Do not limit any backtracking.")
209 (
"lemmata-backtrack",
210 "Do not limit backtracking for lemmata.")
211 (
"reduction-backtrack",
212 "Do not limit backtracking for reductions.")
213 (
"extension-backtrack",
214 "Do not limit backtracking for extensions.")
215 (
"explore-left-trees",
216 "Apply backtracking within left extension trees.")
217 (
"complete,c", po::value<int>(),
218 "Start again with a complete search on reaching the specified depth. (Default UINT32_MAX.)");
220 po::options_description depth_options(
"Depth limiting");
221 depth_options.add_options()
222 (
"depth-limit,d", po::value<int>(),
223 "Maximum depth/path length. (Default UINT32_MAX.)")
224 (
"start-depth", po::value<int>(),
225 "Initial depth/path length. (Default 1.)")
226 (
"depth-increment", po::value<int>(),
227 "Increment for iterative deepening. (Default 1.)");
229 po::options_description proof_options(
"Proof generation");
230 proof_options.add_options()
232 "Generate a proof compatible with the TPTP. Note that what constitutes a TPTP-compatible proof in connection calculus is currently a moving target, so the format is subject to change. Output is to stdout.")
234 "Generate Prolog format files proof.pl and matrix.pl and store in the $CONNECTPP_PATH directory. You can check these using the check_proof utility.")
236 "Verify any proof found using the internal proof checker. Use this version to get a detailed description of the verification sent to stdout.")
238 "Verify any proof found using the internal proof checker. Use this version for a quiet verification that only adds \"Verified\" or \"FaliedVerification\" to the output string.");
240 po::options_description latex_options(
"LaTeX output");
241 latex_options.add_options()
242 (
"latex", po::value<string>()->implicit_value(
string(
"default")),
243 "Make a LaTeX file containing a typeset proof in the (clausal) connection calculus format. Default value: \"./latex_proof.tex\".")
247 "Include substitutions in the LaTeX proof.")
249 "Typeset the latex proof in a tiny font.")
251 "Don't include the matrix in the LaTeX proof.");
253 po::options_description all_options(
"Options");
254 all_options.add(main_options)
255 .add(conversion_options)
258 .add(backtrack_options)
263 po::positional_options_description pos_opts;
264 pos_opts.add(
"input", -1);
265 po::variables_map vars_map;
267 po::store(po::command_line_parser(argc, argv).
268 options(all_options).
269 positional(pos_opts).
275 catch (boost::program_options::error& err) {
276 cout <<
"% SZS status Error for "
277 << params::problem_name <<
" : " << err.what() << endl;
280 po::notify(vars_map);
285 if (vars_map.count(
"help")) {
286 cout << all_options << endl;
287 cout <<
"If you wish to report a bug, please supply:" << endl << endl;
288 cout <<
"1. A description of the claimed bug." << endl;
289 cout <<
"2. The input file used." << endl;
290 cout <<
"3. The exact command-line used, including all options." << endl;
291 cout <<
"4. The output from \"connect++ --version\"." << endl << endl;
292 cout <<
"The author can be contacted at: sbh11@cl.cam.ac.uk" << endl;
295 if (vars_map.count(
"version")) {
296 cout <<
"Connect++ Version V" << VERSION <<
"." << endl;
297 cout <<
"Copyright © 2021-24 Sean Holden. All rights reserved." << endl;
300 if (vars_map.count(
"verbosity")) {
301 int v = vars_map[
"verbosity"].as<
int>();
302 if (v >= 0 && v <= 3)
303 params::verbosity = v;
305 cerr <<
"Verbosity should be between 0 and 3. Using default (2)." << endl;
310 VPrint show(params::verbosity);
314 if (vars_map.count(
"sub-output")) {
315 params::output_terms_with_substitution =
true;
317 if (vars_map.count(
"indent")) {
318 int i = vars_map[
"indent"].as<
int>();
319 if (i >= 0 && i <= UINT8_MAX)
320 params::indent_size = i;
322 cerr <<
"Indent size is negative or too large. Using default." << endl;
324 if (vars_map.count(
"out-int")) {
325 int i = vars_map[
"out-int"].as<
int>();
326 if (i > 0 && i <= UINT32_MAX)
327 params::output_frequency = i;
329 cerr <<
"Interval is negative or too large. Using default." << endl;
331 if (vars_map.count(
"no-equality")) {
332 params::add_equality_axioms =
false;
334 if (vars_map.count(
"equality-last")) {
335 params::equality_axioms_at_start =
false;
337 if (vars_map.count(
"all-distinct-objects")) {
338 params::all_distinct_objects =
true;
340 if (vars_map.count(
"no-distinct-objects")) {
341 if (params::all_distinct_objects) {
342 cerr <<
"Cancelled --all-distinct-objects." << endl;
343 params::all_distinct_objects =
false;
345 params::no_distinct_objects =
true;
347 if (vars_map.count(
"timeout")) {
348 params::timeout =
true;
349 int t = vars_map[
"timeout"].as<
int>();
352 params::timeout_value = t;
354 cerr <<
"Timeout is too small. Using 10 seconds." << endl;
355 params::timeout_value = 10;
359 cerr <<
"Timeout should be positive. Using default." << endl;
361 params::global_timeout += chrono::seconds(params::timeout_value);
363 if (vars_map.count(
"show-default-schedule")) {
364 params::set_default_schedule();
365 cout << params::default_schedule << endl;
368 if (vars_map.count(
"path")) {
369 params::connectpp_path = vars_map[
"path"].as<
string>();
375 params::LaTeX_proof_path
376 = params::pwd_path / params::LaTeX_proof_path;
377 params::LaTeX_tableau_proof_path
378 = params::pwd_path / params::LaTeX_tableau_proof_path;
379 params::Prolog_matrix_path
380 = params::connectpp_path / params::Prolog_matrix_path;
381 params::Prolog_proof_path
382 = params::connectpp_path / params::Prolog_proof_path;
383 params::output_summary_path
384 = params::pwd_path / params::output_summary_path;
388 if (vars_map.count(
"output")) {
389 params::write_output_summary =
true;
390 string op = vars_map[
"output"].as<
string>();
392 params::output_summary_path = op;
394 if (vars_map.count(
"all-definitional")) {
395 params::all_definitional =
true;
397 if (vars_map.count(
"no-definitional")) {
398 params::no_definitional =
true;
399 if (params::all_definitional) {
400 cerr <<
"Setting --no-definitional has cancelled --all-definitional." << endl;
401 params::all_definitional =
false;
405 if (vars_map.count(
"schedule")) {
406 params::use_schedule =
true;
407 if (!params::timeout) {
408 params::timeout =
true;
409 params::timeout_value = 600;
411 params::schedule_path = vars_map[
"schedule"].as<
string>();
413 schedule.read_schedule_from_file(params::schedule_path);
415 catch (std::exception& err) {
416 cout <<
"% SZS status Error for "
417 << params::problem_name <<
" : " << err.what() << endl;
425 if (vars_map.count(
"tptp")) {
426 params::tptp_path = vars_map[
"tptp"].as<
string>();
428 if (vars_map.count(
"reorder")) {
429 int n = vars_map[
"reorder"].as<
int>();
431 params::deterministic_reorder =
true;
432 params::number_of_reorders = n;
435 cerr <<
"Number of re-orders should be positive. Skipping." << endl;
437 if (vars_map.count(
"random-seed")) {
438 int seed = vars_map[
"random-seed"].as<
int>();
440 params::random_seed =
static_cast<unsigned>(seed);
441 params::boost_random_seed =
static_cast<uint32_t
>(seed);
444 cerr <<
"Error: random seed must be a non-negative integer. Using default of 0." << endl;
447 if (vars_map.count(
"random-reorder")) {
448 params::random_reorder =
true;
450 if (vars_map.count(
"random-reorder-literals")) {
451 params::random_reorder_literals =
true;
453 if (vars_map.count(
"no-miniscope")) {
454 params::miniscope =
false;
456 if (vars_map.count(
"show-clauses")) {
457 params::show_clauses =
true;
459 if (vars_map.count(
"no-colour")) {
460 params::use_colours =
false;
462 if (vars_map.count(
"poly-unification")) {
463 params::poly_unification =
true;
483 fs::path initial_path;
484 bool found_file =
false;
485 if (vars_map.count(
"input")) {
487 initial_path = vars_map[
"input"].as<
string>();
490 if (initial_path.is_relative()) {
492 if (fs::exists(initial_path)) {
496 initial_path = fs::canonical(initial_path);
498 catch (std::filesystem::filesystem_error& err) {
499 cout <<
"% SZS status Error for "
500 << params::problem_name <<
" : "
501 << err.what() << endl;
509 fs::path tptp_path(params::tptp_path);
510 initial_path = tptp_path / initial_path;
512 if (fs::exists(initial_path)) {
515 initial_path = fs::canonical(initial_path);
517 catch (std::filesystem::filesystem_error& err) {
518 cout <<
"% SZS status Error for "
519 << params::problem_name <<
" : "
520 << err.what() << endl;
529 if (initial_path.is_absolute() && fs::exists(initial_path)) {
532 initial_path = fs::canonical(initial_path);
534 catch (std::filesystem::filesystem_error& err) {
535 cout <<
"% SZS status Error for "
536 << params::problem_name <<
" : "
537 << err.what() << endl;
545 cout <<
"% SZS status Error for "
546 << params::problem_name <<
" : no problem specified." << endl;
551 cout <<
"% SZS status Error for "
552 << params::problem_name <<
" : the specified file does not exist." << endl;
556 params::full_problem_path = initial_path;
557 params::full_problem_path.remove_filename();
558 params::problem_name = initial_path.stem().string();
559 fs::path path = initial_path;
564 if (vars_map.count(
"depth-limit")) {
565 int l = vars_map[
"depth-limit"].as<
int>();
567 params::depth_limit = l;
569 cerr <<
"Depth limit should be positive. Using default." << endl;
571 if (vars_map.count(
"start-depth")) {
572 int l = vars_map[
"start-depth"].as<
int>();
573 if (l > 1 && l <= params::depth_limit)
574 params::start_depth = l;
576 cerr <<
"Start depth should be positive and bounded by the maximum depth. Using default." << endl;
578 if (vars_map.count(
"depth-increment")) {
579 int l = vars_map[
"depth-increment"].as<
int>();
581 params::depth_increment = l;
583 cerr <<
"Depth increment should be positive. Using default." << endl;
597 if (vars_map.count(
"restrict-start")) {
598 params::restrict_start =
true;
600 if (vars_map.count(
"pos-neg-start")) {
601 params::all_pos_neg_start =
true;
603 if (vars_map.count(
"conjecture-start")) {
604 params::conjecture_start =
true;
606 if (vars_map.count(
"all-start")) {
607 show(2,
string(
"--all-start set. This cancels all other start options."),
true);
620 if (vars_map.count(
"no-regularity")) {
621 params::use_regularity_test =
false;
623 if (vars_map.count(
"lemmata-backtrack")) {
624 params::limit_bt_lemmas =
false;
626 if (vars_map.count(
"reduction-backtrack")) {
627 params::limit_bt_reductions =
false;
629 if (vars_map.count(
"extension-backtrack")) {
630 params::limit_bt_extensions =
false;
632 if (vars_map.count(
"explore-left-trees")) {
633 params::limit_bt_extensions_left_tree =
false;
635 if (vars_map.count(
"all-backtrack")) {
636 show(2,
string(
"--all-backtrack set. This prevails over all other backtracking options."),
true);
639 if (vars_map.count(
"all-reductions")) {
640 params::limit_reductions =
false;
642 if (vars_map.count(
"all-extensions")) {
643 params::limit_extensions =
false;
645 if (vars_map.count(
"all-lemmata")) {
646 params::limit_lemmata =
false;
648 if (vars_map.count(
"no-lemmata")) {
649 params::use_lemmata =
false;
651 if (vars_map.count(
"complete")) {
652 int d = vars_map[
"complete"].as<
int>();
653 if (d >= params::start_depth)
654 params::switch_to_complete = d;
656 cerr <<
"Switch to complete search must happen after start depth. Using start depth." << endl;
657 params::switch_to_complete = params::start_depth;
660 if (vars_map.count(
"latex")) {
661 params::generate_LaTeX_proof =
true;
662 params::build_proof =
true;
663 string lp = vars_map[
"latex"].as<
string>();
665 params::LaTeX_proof_path = lp;
667 if (vars_map.count(
"latex-tableau")) {
668 params::generate_LaTeX_tableau_proof =
true;
669 params::build_proof =
true;
670 string lp = vars_map[
"latex-tableau"].as<
string>();
672 params::LaTeX_tableau_proof_path = lp;
674 if (vars_map.count(
"sub-latex")) {
675 params::sub_LaTeX_proof =
true;
677 if (vars_map.count(
"tiny-latex")) {
678 params::latex_tiny_proof =
true;
680 if (vars_map.count(
"latex-no-matrix")) {
681 params::latex_include_matrix =
false;
683 if (vars_map.count(
"tptp-proof")) {
684 params::generate_tptp_proof =
true;
685 params::build_proof =
true;
687 if (vars_map.count(
"prolog-proof")) {
688 params::generate_Prolog_proof =
true;
689 params::build_proof =
true;
691 if (vars_map.count(
"verify")) {
692 params::verify_proof =
true;
693 params::build_proof =
true;
695 if (vars_map.count(
"full-verify")) {
696 params::verify_proof =
true;
697 params::verify_proof_verbose =
true;
698 params::build_proof =
true;
712 show(1,
string(
"Connect++ V"));
713 show(1,
string(VERSION));
714 show(1,
string(
" started at: "));
715 time_t date_and_time;
716 time(&date_and_time);
717 show(1, asctime(localtime(&date_and_time)));
741 if (params::use_schedule) {
742 params::no_definitional =
false;
743 params::all_definitional =
false;
745 show(1,
string(
"Reading from: "));
746 show(1, path.c_str(),
true);
747 bool found_conjecture =
false;
752 catch (std::exception& err) {
753 cout <<
"% SZS status Error for "
754 << params::problem_name <<
" : "
755 << err.what() << endl;
762 if (params::use_schedule) {
763 params::all_definitional =
true;
767 catch (std::exception& err) {
768 cout <<
"% SZS status Error for "
769 << params::problem_name <<
" : "
770 << err.what() << endl;
773 params::all_definitional =
false;
774 params::no_definitional =
true;
778 catch (std::exception& err) {
779 cout <<
"% SZS status Error for "
780 << params::problem_name <<
" : "
781 << err.what() << endl;
789 chrono::milliseconds parse_time =
790 chrono::duration_cast<chrono::milliseconds>(chrono::steady_clock::now() - startTime);
791 show(1,
string(
"Total parse and conversion time: "));
792 show(1, std::to_string(parse_time.count()));
793 show(1,
string(
" milliseconds."),
true);
799 show(2,
string(
"Starting proof attempt for: "),
false);
800 show(2, params::problem_name,
true);
804 ProverOutcome prover_outcome;
805 ProverOutcome final_outcome;
806 final_outcome = ProverOutcome::TimeOut;
816 if (!params::use_schedule) {
817 if (params::verbosity > 2) {
827 if (params::timeout) {
828 chrono::seconds timeout_duration(params::timeout_value);
829 prover_standard.
set_timeout(startTime + timeout_duration);
834 prover_outcome = prover_standard.
prove();
835 final_outcome = prover_outcome;
850 if (!params::timeout) {
851 params::timeout =
true;
852 params::timeout_value = 600;
857 chrono::milliseconds time_chunk((params::timeout_value * 1000) / 100);
858 chrono::steady_clock::time_point start_time = startTime;
859 chrono::milliseconds chunk_time;
864 size_t schedule_step_number = 1;
865 pair<bool, unsigned int> next_schedule =
schedule.set_next_schedule();
866 if (params::verbosity > 0)
871 while (next_schedule.first) {
872 show(1,
string(
"Schedule step "));
873 show(1, std::to_string(schedule_step_number));
874 show(1,
string(
": "));
875 show(1,
schedule.step_to_string(schedule_step_number - 1),
true);
876 if (params::verbosity > 2) {
882 if (params::all_definitional) {
883 prover = &prover_all_definitional;
885 else if (params::no_definitional) {
886 prover = &prover_no_definitional;
889 prover = &prover_standard;
894 if (next_schedule.second == 0) {
895 prover->
set_timeout(startTime + chrono::seconds(params::timeout_value));
897 else if (schedule_step_number == 1) {
898 prover->
set_timeout(startTime + (next_schedule.second * time_chunk));
901 prover->
set_timeout(start_time + (next_schedule.second * time_chunk));
904 prover_outcome = prover->
prove();
906 if (prover_outcome == ProverOutcome::Valid ||
907 prover_outcome == ProverOutcome::Error ||
908 prover_outcome == ProverOutcome::False) {
909 final_outcome = prover_outcome;
913 chunk_time = chrono::duration_cast<chrono::milliseconds>(chrono::steady_clock::now() - start_time);
916 show(1,
string(
"Timeout after "));
917 show(1, std::to_string(chunk_time.count()));
918 show(1,
string(
" milliseconds"),
true);
920 start_time = chrono::steady_clock::now();
921 schedule_step_number++;
922 next_schedule =
schedule.set_next_schedule();
935 chrono::milliseconds runTime =
936 chrono::duration_cast<chrono::milliseconds>(chrono::steady_clock::now() - startTime);
937 show(1,
string(
"Total run time: "));
938 show(1, std::to_string(runTime.count()));
939 show(1,
string(
" milliseconds."),
true);
941 if (params::verbosity > 0) {
942 if (params::show_full_stats) {
972 cout <<
"% SZS status ";
973 switch (final_outcome) {
974 case ProverOutcome::Valid:
977 outcome =
"Unsatisfiable";
981 if (simplified_has_axioms) {
984 outcome =
"ContradictoryAxioms";
987 else if (conj_false || neg_conj_removed) {
988 outcome =
"ContradictoryAxioms";
992 else if (conj_missing) {
993 outcome =
"Unsatisfiable";
1007 if (neg_conj_removed) {
1012 outcome =
"Theorem";
1016 case ProverOutcome::False:
1019 outcome =
"Satisfiable";
1022 if (simplified_has_axioms) {
1026 else if (conj_false || neg_conj_removed) {
1027 outcome =
"CounterSatisfiable";
1029 else if (conj_missing) {
1030 outcome =
"Satisfiable";
1033 outcome =
"CounterSatisfiable";
1039 outcome =
"Theorem";
1041 else if (neg_conj_removed) {
1046 outcome =
"CounterSatisfiable";
1050 case ProverOutcome::PathLenLimit:
1053 case ProverOutcome::Error:
1056 case ProverOutcome::TimeOut:
1060 if (chrono::duration_cast<chrono::milliseconds>(chrono::steady_clock::now() - startTime).count() < (params::timeout_value * 1000))
1063 outcome =
"Timeout";
1069 cout << outcome <<
" for " << params::problem_name;
1073 bool verified =
false;
1074 if (params::verify_proof && final_outcome == ProverOutcome::Valid) {
1081 vector<pair<string, vector<size_t>>>
1086 get<0>(inds), get<3>(inds));
1088 bool verification_outcome;
1089 string outcome_string;
1090 if (params::verify_proof_verbose) {
1091 pair<bool, string> outcome = checker.check_proof_verbose();
1092 verification_outcome = outcome.first;
1093 outcome_string = outcome.second;
1096 verification_outcome = checker.check_proof();
1099 if (verification_outcome) {
1101 cout <<
" : Verified";
1104 cout <<
" : FailedVerification";
1107 if (params::verify_proof_verbose) {
1108 cout << endl <<
"% SZS output start Proof for " << params::problem_name << endl << endl;
1109 cout << outcome_string << endl;
1110 cout <<
"% SZS output end Proof for " << params::problem_name << endl;
1117 if (params::write_output_summary) {
1119 std::ofstream out_file(params::output_summary_path);
1120 out_file <<
"ProblemName: " << params::problem_name << endl;
1121 if (found_conjecture)
1122 out_file <<
"ConjectureFound" << endl;
1124 out_file <<
"NoConjectureFound" << endl;
1126 status =
"NoStatus";
1127 out_file <<
"ProblemStatus: " << status << endl;
1128 out_file <<
"ProverOutcome: " << outcome << endl;
1129 if (params::verify_proof && final_outcome == ProverOutcome::Valid) {
1131 out_file <<
"Verified" << endl;
1133 out_file <<
"FailedVerification" << endl;
1136 out_file <<
"NoVerify" << endl;
1137 out_file <<
"Time: " << runTime.count() << endl;
1140 catch (std::exception& err) {
1141 cerr <<
"Error: can't write output summary." << endl;
1147 if (params::generate_tptp_proof && (final_outcome == ProverOutcome::Valid)) {
1148 cout <<
"% SZS output start Proof for " << params::problem_name << endl;
1149 cout << prover->get_tptp_conversion_string();
1151 cout <<
"% SZS output end Proof for " << params::problem_name << endl;
1153 return EXIT_SUCCESS;
Mechanism for looking after functions.
Management of Predicate objects.
Prover using a pair of stacks to conduct the proof search.
void read_from_tptp_file(const string &, bool &, size_t &)
Obviously, reads a problem from a TPTP file.
void show_full_statistics(size_t) const
Display counts of number of extensions tried and so on, as well as numbers per second.
bool problem_has_true_conjecture() const
Find out whether the problem's conjecture is $true.
void show_tptp_proof()
Show a Prolog-formatted proof.
bool problem_is_cnf_only() const
Find out whether the problem is CNF only.
void set_problem_path(fs::path &p)
Set the path for the problem being solved.
void show_statistics() const
Display counts of number of extensions tried and so on.
void show_matrix()
Show a nicely formatted matrix.
bool problem_has_missing_conjecture() const
Find out whether the problem's conjecture is missing, in the sense that it didn't appear in the inp...
bool problem_has_negated_conjecture_removed() const
Find out whether the problem's negated conjecture was simplified out.
void set_timeout(chrono::steady_clock::time_point time)
Set a timeout.
bool simplified_problem_has_fof_axioms() const
Find out from the parser whether the problem had axioms after simplification.
string get_status() const
Straightforward get method.
bool problem_has_fof_axioms() const
Find out from the parser whether the problem had axioms before simplification.
std::tuple< VariableIndex *, FunctionIndex *, PredicateIndex *, TermIndex * > get_indexes()
Straightforward get method.
vector< pair< string, vector< size_t > > > get_internal_proof() const
Get an internal representation of the proof stack.
Matrix & get_matrix()
Get a reference to the matrix.
bool problem_has_false_conjecture() const
Find out whether the problem's conjecture is $false.
ProverOutcome prove()
Here is where the magic happens.
Look after terms, using hash consing to avoid storing copies of terms.
Storage of named variables, and management of new, anonymous and unique variables.
Wrap up the parsing process and the operation of a schedule in a single class.
Hide all the global stuff in this namespace.
static void set_all_backtrack()
Self-explanatory.
static void set_all_start()
Self-explanatory.
static bool no_start_options()
Self-explanatory.
static void correct_missing_start_options()
Self-explanatory.
static void show_search_parameter_settings()
Give a detailed indication of what the parameters affecting the search are currently set to.