Connect++ 0.1
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
FunctionIndex Class Reference

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
 
FunctionIndexoperator= (const FunctionIndex &)=delete
 
FunctionIndexoperator= (const FunctionIndex &&)=delete
 
size_t get_size () const
 Self-explanatory.
 
Functionadd_function (const string &, Arity)
 Add a new function to the index.
 
Functionmake_skolem_function (Arity)
 Add a new Skolem function. Naming is automatic.
 
Functionfind_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.
 
Functionoperator[] (size_t i)
 Access to pointers to Functions, but don't mess with them!
 

Friends

ostream & operator<< (ostream &, const FunctionIndex &)
 

Detailed Description

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.

Member Function Documentation

◆ add_function()

Function * FunctionIndex::add_function ( const string &  name,
Arity  arity 
)

Add a new function to the index.

If you add twice, the original will get re-used.

Parameters
nameThe name of the Function
arityThe arity of the Function.

◆ find_function()

Function * FunctionIndex::find_function ( const string &  fun_name,
Arity  arity 
)

Look up a stored Function by name and arity.

Parameters
fun_nameName of Function to find
arityArity of Function to find

◆ make_skolem_function()

Function * FunctionIndex::make_skolem_function ( Arity  arity)

Add a new Skolem function. Naming is automatic.

Parameters
arityThe arity of the new Skolem function.

The documentation for this class was generated from the following files: