25#include "ClauseCopyCache.hpp"
29 if (params::clause_copy_cache_start_size < 1) {
30 cerr <<
"params::clause_copy_cache_start_size must be at least 1" << endl;
33 cache = vector<vector<Clause>>(
size, vector<Clause>());
35 for (
size_t i = 0; i <
size; i++) {
36 for (
size_t j = 0; j < params::clause_copy_cache_start_size; j++) {
38 cache[i].push_back(new_c);
50 stack.push_back(_index);
54 for (
size_t i = 0; i < params::clause_copy_cache_increment; i++) {
56 cache[_index].push_back(new_c);
62 size_t i =
stack.back();
77 for (
const vector<Clause>& vc : _cache.
cache) {
78 out <<
"---------------------------------------------------------------" << endl;
79 out <<
"Cached clauses for clause: " << i << endl;
81 out <<
"---------------------------------------------------------------" << endl;
83 for (
const Clause& c : vc) {
vector< vector< Clause > > cache
Cache containing some number of copies (with unique variables, not used anywhere else) of clauses fro...
vector< size_t > next_copy_index
Index of the next available copy of each clause.
vector< size_t > stack
Each time you supply a copy, remember the action so that you can backtrack.
void make_copy_with_new_variables(size_t, Clause &, const Matrix &, VariableIndex &, TermIndex &)
If there is a copy cached, replace the parameter with it. Otherwise, use the parameter to actually ma...
void backtrack()
Backtracking is just looking at the last copy supplied and undoing that action.
vector< size_t > number_of_copies_available
How many copies of each clause, in total, are currently available? At any given time some may be avai...
void reset(const Matrix &, VariableIndex &, TermIndex &)
This is for any actual initialisation, when you either (1) intially know what you're dealing with,...
size_t size
Keep track of how many clauses there are in the matrix.
void show_counts() const
Mostly for development. See how many copies you actually ended up with.
Representation of clauses.
Representation of the Matrix within a proof.
void make_copy_with_new_unique_vars(size_t, Clause &, VariableIndex &, TermIndex &) const
Make a new copy of a clause in the matrix.
Look after terms, using hash consing to avoid storing copies of terms.
Storage of named variables, and management of new, anonymous and unique variables.