Connect++ 0.1
A fast, readable connection prover for first-order logic.
|
Mechanism for looking after functions. More...
#include <FunctionIndex.hpp>
Public Member Functions | |
FunctionIndex (const FunctionIndex &)=delete | |
As usual, trying to copy one of these is a really bad idea. | |
FunctionIndex (const FunctionIndex &&)=delete | |
FunctionIndex & | operator= (const FunctionIndex &)=delete |
FunctionIndex & | operator= (const FunctionIndex &&)=delete |
size_t | get_size () const |
Self-explanatory. | |
Function * | add_function (const string &, Arity) |
Add a new function to the index. | |
Function * | make_skolem_function (Arity) |
Add a new Skolem function. Naming is automatic. | |
Function * | find_function (const string &, Arity) |
Look up a stored Function by name and arity. | |
Arity | find_maximum_arity () const |
Find the largest arity appearing for any Function in the index. | |
Function * | operator[] (size_t i) |
Access to pointers to Functions, but don't mess with them! | |
Friends | |
ostream & | operator<< (ostream &, const FunctionIndex &) |
Mechanism for looking after functions.
Function names are only stored once, but functions can have the same name and a different arity.
Somewhat more straightforward than looking after variables as there is no need for anonymous functions other than Skolem functions, and those do not get recycled. For the same reason, there is no need to take account of backtracking.
You should only use this to make new Functions. As long as you do, it will take care of allocation and deallocation for you.
Function * FunctionIndex::add_function | ( | const string & | name, |
Arity | arity | ||
) |
Function * FunctionIndex::find_function | ( | const string & | fun_name, |
Arity | arity | ||
) |
Function * FunctionIndex::make_skolem_function | ( | Arity | arity | ) |
Add a new Skolem function. Naming is automatic.
arity | The arity of the new Skolem function. |