![]() |
Connect++ 0.6.0
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. | |
ClauseCopyCache (size_t _size) | |
This is the only constructor that makes sense if you know the size. | |
void | set_size (size_t) |
You probably don't know the size at the point when this needs to be constructed. | |
void | make_copy_with_new_variables (size_t, Clause &, 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 | clear () |
We will sometimes need to clear the cache and start again because of reordering operations on the matrix. | |
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 > | current_copy_number |
When 0, there are no copies available. When 1, the last copy we used is the one at index 0, and so on. | |
vector< size_t > | stack |
Each time you supply a copy, remember the action so that you can backtrack. | |
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 77 of file ClauseCopyCache.hpp.
|
inline |
This is the only constructor that makes sense if you know the size.
Definition at line 88 of file ClauseCopyCache.hpp.
void ClauseCopyCache::backtrack | ( | ) |
Backtracking is just looking at the last copy supplied and undoing that action.
Definition at line 48 of file ClauseCopyCache.cpp.
void ClauseCopyCache::clear | ( | ) |
We will sometimes need to clear the cache and start again because of reordering operations on the matrix.
Definition at line 54 of file ClauseCopyCache.cpp.
void ClauseCopyCache::make_copy_with_new_variables | ( | size_t | _index, |
Clause & | _clause, | ||
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. |
_vi | Reference to the variable index. |
_ti | Reference to the term index. |
Definition at line 33 of file ClauseCopyCache.cpp.
void ClauseCopyCache::set_size | ( | size_t | _size | ) |
You probably don't know the size at the point when this needs to be constructed.
Definition at line 28 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 |
When 0, there are no copies available. When 1, the last copy we used is the one at index 0, and so on.
Definition at line 66 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 71 of file ClauseCopyCache.hpp.