![]() |
Connect++ 0.5.0
A fast, readable connection prover for first-order logic.
|
Management of Predicate objects. More...
#include <PredicateIndex.hpp>
Public Member Functions | |
PredicateIndex (const PredicateIndex &)=delete | |
Copying these is a terrible idea. | |
PredicateIndex (const PredicateIndex &&)=delete | |
PredicateIndex & | operator= (const PredicateIndex &)=delete |
PredicateIndex & | operator= (const PredicateIndex &&)=delete |
size_t | get_num_preds () const |
Basic get method. | |
Predicate * | add_predicate (const string &, Arity) |
Self-explanatory. | |
Predicate * | find_predicate (const string &, Arity) |
Self-explanatory. | |
Arity | find_maximum_arity () const |
Find the largest arity appearing in the index. | |
bool | true_false_added () const |
Sometimes $true and $false appear in the TPTP collection. See if you included them during the parsing. | |
Predicate * | operator[] (size_t i) |
Access to Predicate pointers, but don't mess with them! | |
Predicate * | make_definitional_predicate (Arity arity) |
Make a new, unique definitional predicate. | |
Private Attributes | |
vector< Predicate * > | preds |
Pointers to all predicates. | |
unordered_map< PredIndexType, Predicate *, fun_hash > | name_index |
Fast lookup using name and arity. | |
ID | next_index |
Automatically generate IDs. | |
ID | next_definitional_id |
Automatically generate IDs for definitional predicates. | |
Friends | |
ostream & | operator<< (ostream &, const PredicateIndex &) |
Management of Predicate objects.
Note that the unordered_map can use the hash function from FunctionHash.hpp.
As usual only use this to make Predicates. As long as you do so then it takes care of memory allocation and deallocation.
Definition at line 58 of file PredicateIndex.hpp.
PredicateIndex::PredicateIndex | ( | ) |
Definition at line 27 of file PredicateIndex.cpp.
PredicateIndex::~PredicateIndex | ( | ) |
Definition at line 35 of file PredicateIndex.cpp.
|
delete |
Copying these is a terrible idea.
As usual, let the compiler help you out.
Predicate * PredicateIndex::add_predicate | ( | const string & | name, |
Arity | arity ) |
Self-explanatory.
Definition at line 40 of file PredicateIndex.cpp.
Arity PredicateIndex::find_maximum_arity | ( | ) | const |
Find the largest arity appearing in the index.
Definition at line 66 of file PredicateIndex.cpp.
Predicate * PredicateIndex::find_predicate | ( | const string & | fun_name, |
Arity | arity ) |
Self-explanatory.
Definition at line 55 of file PredicateIndex.cpp.
|
inline |
|
inline |
Make a new, unique definitional predicate.
arity | Arity of predicate. |
Definition at line 127 of file PredicateIndex.hpp.
|
inline |
Access to Predicate pointers, but
don't mess with them!
Definition at line 121 of file PredicateIndex.hpp.
bool PredicateIndex::true_false_added | ( | ) | const |
Sometimes $true and $false appear in the TPTP collection. See if you included them during the parsing.
Definition at line 76 of file PredicateIndex.cpp.
|
friend |
Definition at line 86 of file PredicateIndex.cpp.
Fast lookup using name and arity.
Definition at line 67 of file PredicateIndex.hpp.
|
private |
Automatically generate IDs for definitional predicates.
Definition at line 76 of file PredicateIndex.hpp.
|
private |
Automatically generate IDs.
Definition at line 71 of file PredicateIndex.hpp.
|
private |
Pointers to all predicates.
Definition at line 63 of file PredicateIndex.hpp.