![]() |
Connect++ 0.6.1
A fast, readable connection prover for first-order logic.
|
Public Member Functions | |
ClauseCopyCache () | |
You probably don't know the size at the point when this needs to be constructed. | |
void | set_size (size_t _s) |
Set the number of clauses we need cached copies for. | |
void | reset (const Matrix &, VariableIndex &, TermIndex &) |
This is for any actual initialisation, when you either (1) intially know what you're dealing with, or (2) need to restart after something like a re-ordering of the matrix. | |
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 make a copy, then add it to the cache and return it in the same way. | |
void | backtrack () |
Backtracking is just looking at the last copy supplied and undoing that action. | |
void | show_counts () const |
Mostly for development. See how many copies you actually ended up with. | |
Private Attributes | |
vector< vector< Clause > > | cache |
Cache containing some number of copies (with unique variables, not used anywhere else) of clauses from the matrix. | |
size_t | size |
Keep track of how many clauses there are in the matrix. | |
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 available immediately. Anything beyond this requires an actual new copy to be made. | |
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. | |
Friends | |
ostream & | operator<< (ostream &out, const ClauseCopyCache &_cache) |
Definition at line 40 of file ClauseCopyCache.hpp.
|
inline |
You probably don't know the size at the point when this needs to be constructed.
Definition at line 75 of file ClauseCopyCache.hpp.
void ClauseCopyCache::backtrack | ( | ) |
Backtracking is just looking at the last copy supplied and undoing that action.
Definition at line 61 of file ClauseCopyCache.cpp.
void ClauseCopyCache::make_copy_with_new_variables | ( | size_t | _index, |
Clause & | _clause, | ||
const Matrix & | _m, | ||
VariableIndex & | _vi, | ||
TermIndex & | _ti ) |
If there is a copy cached, replace the parameter with it. Otherwise, use the parameter to actually make a copy, then add it to the cache and return it in the same way.
_index | Index of the clause in the matrix. |
_clause | Clause you want a copy of. |
_m | Reference to the actual matrix. |
_vi | Reference to the variable index. |
_ti | Reference to the term index. |
Definition at line 46 of file ClauseCopyCache.cpp.
void ClauseCopyCache::reset | ( | const Matrix & | _m, |
VariableIndex & | _vi, | ||
TermIndex & | _ti ) |
This is for any actual initialisation, when you either (1) intially know what you're dealing with, or (2) need to restart after something like a re-ordering of the matrix.
_m | Reference to the actual matrix. |
_vi | Reference to variable index. |
_ti | Reference to term index. |
Definition at line 28 of file ClauseCopyCache.cpp.
|
inline |
Set the number of clauses we need cached copies for.
Definition at line 85 of file ClauseCopyCache.hpp.
void ClauseCopyCache::show_counts | ( | ) | const |
Mostly for development. See how many copies you actually ended up with.
Definition at line 67 of file ClauseCopyCache.cpp.
|
friend |
Definition at line 75 of file ClauseCopyCache.cpp.
|
private |
Cache containing some number of copies (with unique variables, not used anywhere else) of clauses from the matrix.
Definition at line 47 of file ClauseCopyCache.hpp.
|
private |
Index of the next available copy of each clause.
Definition at line 64 of file ClauseCopyCache.hpp.
|
private |
How many copies of each clause, in total, are currently available? At any given time some may be available immediately. Anything beyond this requires an actual new copy to be made.
Definition at line 60 of file ClauseCopyCache.hpp.
|
private |
Keep track of how many clauses there are in the matrix.
Definition at line 52 of file ClauseCopyCache.hpp.
|
private |
Each time you supply a copy, remember the action so that you can backtrack.
Definition at line 69 of file ClauseCopyCache.hpp.