25#ifndef STACKPROVER_HPP
26#define STACKPROVER_HPP
33#include "FunctionIndex.hpp"
34#include "PredicateIndex.hpp"
35#include "StackItem.hpp"
37#include "TPTPParser.hpp"
38#include "ProverOutcome.hpp"
39#include "SubstitutionStack.hpp"
40#include "ProofPrinter.hpp"
41#include "Interval.hpp"
43#include "PathUtilities.hpp"
44#include "vic_strings.hpp"
49namespace fs = std::filesystem;
50namespace chrono = std::chrono;
116 vector<StartClauseStatus> results;
160 uint32_t current_depth_limit;
164 uint32_t current_depth;
168 bool depth_limit_reached;
177 vector<StackItem> stack;
183 vector<StackItem> right_branch_stack;
196 fs::path problem_path;
208 uint32_t reductions_tried;
213 uint32_t extensions_tried;
218 uint32_t lemmata_tried;
223 uint32_t right_branches_started;
228 uint32_t proof_count;
236 chrono::steady_clock::time_point end_time;
256 void populate_stack_item();
261 void extend_with_action();
265 bool depth_limited();
276 void process_axiom_forward();
283 void backtrack_once();
287 void reduction_backtrack();
291 void lemmata_backtrack();
295 void left_extension_backtrack();
299 void right_extension_backtrack();
304 void set_up_start_clauses();
309 void reset_for_start() {
310 depth_limit_reached =
false;
316 right_branch_stack.clear();
334 std::tuple<VariableIndex*, FunctionIndex*, PredicateIndex*, TermIndex*>
get_indexes() {
335 auto result = std::make_tuple(&var_index, &fun_index, &pred_index, &term_index);
402 cout <<
"Matrix:" << endl;
411 ProverOutcome
prove();
415 void show_matrix()
const { cout << matrix << endl; }
416 void show_path()
const { cout << path << endl; }
418 void show_right_stack();
419 void show_term_index() { cout << term_index << endl; }
420 void show_statistics()
const;
421 friend ostream& operator<<(ostream&,
const StackProver&);
Representation of clauses.
Definition Clause.hpp:50
Mechanism for looking after functions.
Definition FunctionIndex.hpp:64
Simple class to help you count intervals.
Definition Interval.hpp:35
Representation of the lemma list.
Definition Lemmata.hpp:49
void clear()
Self-explanatory.
Definition Lemmata.hpp:70
Representation of the Matrix within a proof.
Definition Matrix.hpp:70
string to_string() const
Make a string representation.
Definition Matrix.cpp:201
void deterministic_reorder(size_t)
Deterministic reorder of the clauses.
Definition Matrix.cpp:103
Basic representation of predicates: here just names, ids and arities.
Definition Predicate.hpp:51
Management of Predicate objects.
Definition PredicateIndex.hpp:58
Class for rendering a proof in various formats.
Definition ProofPrinter.hpp:50
Simple representation of the path within a proof tree.
Definition SimplePath.hpp:55
void clear()
evert to the empty state without changing num_preds.
Definition SimplePath.cpp:34
Prover using a pair of stacks to conduct the proof search.
Definition StackProver.hpp:74
void set_num_preds(size_t)
Set the number of predicates.
Definition StackProver.cpp:63
void read_from_tptp_file(const string &, bool &, size_t &)
Obviously, reads a problem from a TPTP file.
Definition StackProver.cpp:69
StackProver(const StackProver &)=delete
Don't try to copy this.
void set_problem_path(fs::path &p)
Set the path for the problem being solved. U.
Definition StackProver.hpp:362
void deterministic_reorder(uint32_t n)
Deterministically reorder the matrix n times.
Definition StackProver.hpp:395
void show_matrix()
Show a nicely formatted matrix.
Definition StackProver.hpp:401
void add_equality_axioms(Predicate *)
After reading a problem in which = and/or != appears, add the axioms for equality.
Definition StackProver.cpp:113
void set_timeout(chrono::steady_clock::time_point time)
Set a timeout.
Definition StackProver.hpp:353
string get_status() const
Straightforward get method.
Definition StackProver.hpp:341
std::tuple< VariableIndex *, FunctionIndex *, PredicateIndex *, TermIndex * > get_indexes()
Straightforward get method.
Definition StackProver.hpp:334
StackProver()
You only need a basic constructor.
Definition StackProver.cpp:28
ProverOutcome prove()
Here is where the magic happens.
Definition StackProver.cpp:954
As you build a proof you make substitutions that apply to the entire proof: if you backtrack during t...
Definition SubstitutionStack.hpp:42
void clear()
Reset everything.
Definition SubstitutionStack.hpp:91
Look after terms, (ideally) using hash consing to avoid storing copies of terms.
Definition TermIndex.hpp:75
Wrap up various applications of unificiation into a single class: all the unification you need to do ...
Definition Unifier.hpp:83
Storage of named variables, and management of new, anonymous variables.
Definition VariableIndex.hpp:61
Definition vic_strings.hpp:238
The tptp_parser namespace contains a lot of stuff that's essentially just global.
Definition TPTPParser.cpp:71
Full representation of inferences, beyond just the name.
Definition InferenceItem.hpp:61
Stack items: each contains its own stack of possible next inferences.
Definition StackItem.hpp:51