30#include <unordered_map>
32#include "TermHash.hpp"
34using std::unordered_map;
63 unordered_map<Term, Term*, term_hash>
index;
143 friend ostream& operator<<(ostream&,
const TermIndex&);
Basic representation of functions.
General representation of terms.
Look after terms, using hash consing to avoid storing copies of terms.
Term * find(const Term &)
Find a term in the index.
size_t get_size() const
Basic get method.
Term * add_function_term(Function *, const vector< Term * > &)
Self-explanatory: add a Term containing a function to the index.
vector< Term * > term_pointers
Used to make destruction easy.
unordered_map< Term, Term *, term_hash > index
Hash table for storing pointers to where Terms are actually stored.
Term * add_variable_term(Variable *)
Self-explanatory: add a Term containing a variable to the index.
Term * replace_variable_in_term_with_term(Term *, Variable *, Term *)
Minor variation on replace_variable_in_term.
Term * replace_variable_in_term(Variable *, Variable *, Term *)
Replace a variable in a term with an alternative, maintaining the structure of the TermIndex.
TermIndex(const TermIndex &)=delete
Don't allow copying as this is a terrible idea.
Basic representation of variables.