pl_search_cpp 1.4
|
Abstract base class for terms that approximate Prolog terms. More...
#include <term.hpp>
Public Member Functions | |
virtual TermPtr | dereference () |
Dereferences the term. The default is to return a shared pointer to term itself. | |
virtual std::string | repr () const |
Returns a string representation of the term. | |
virtual bool | isLessThan (Term &t) const =0 |
Checks if the term is less than another term. | |
virtual bool | unifyWith (Engine *engine, TermPtr t) |
A hook for unification of user-defined classes. Only override this method if you want to unify user-defined classes. | |
virtual bool | is_var () |
Checks if the term is a variable. | |
Term () | |
Default constructor. | |
virtual | ~Term () |
Virtual destructor for proper cleanup. | |
Protected Member Functions | |
virtual bool | isEqualTo (Term &t) const =0 |
Checks if the term is equal to another term. | |
virtual Term * | deref_term () |
Similar to dereference but returning the "raw" pointer. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Term &t) |
Overloaded output stream operator for Term. | |
bool | operator< (Term &t1, Term &t2) |
< operator for Terms. | |
bool | operator<= (Term &t1, Term &t2) |
<= operator for Term | |
bool | operator== (Term &t1, Term &t2) |
== operator for Terms | |
Abstract base class for terms that approximate Prolog terms.
The Term class provides an interface for Prolog-like terms. It includes methods for dereferencing, binding, resetting, and representing terms as strings. It also includes methods for comparing terms and unifying user-defined classes.
|
inline |
Default constructor.
|
inlinevirtual |
Virtual destructor for proper cleanup.
|
inlineprotectedvirtual |
Similar to dereference but returning the "raw" pointer.
Reimplemented in pl_search::PVar, and pl_search::UpdatablePVar.
|
inlinevirtual |
Dereferences the term. The default is to return a shared pointer to term itself.
Reimplemented in pl_search::PVar, and pl_search::UpdatablePVar.
|
inlinevirtual |
Checks if the term is a variable.
Reimplemented in pl_search::PVar.
|
protectedpure virtual |
Checks if the term is equal to another term.
t | The term to compare to. |
Implemented in pl_search::CList, pl_search::PVar, pl_search::PAtom, pl_search::PFloat, and pl_search::PInt.
|
pure virtual |
Checks if the term is less than another term.
t | The term to compare to. |
Implemented in pl_search::CList, pl_search::PVar, pl_search::PAtom, pl_search::PFloat, and pl_search::PInt.
|
inlinevirtual |
Returns a string representation of the term.
Reimplemented in pl_search::CList, pl_search::PAtom, pl_search::PFloat, pl_search::PInt, and pl_search::PVar.
A hook for unification of user-defined classes. Only override this method if you want to unify user-defined classes.
engine | Pointer to the Engine. |
t | The term to unify with. |
< operator for Terms.
Approximates the @< operator in Prolog. The ordering is as follows:
t1 | The first term. |
t2 | The second term. |
t1 | The first term. |
t2 | The second term. |
|
friend |
Overloaded output stream operator for Term.
os | The output stream. |
t | The term to output. |
<= operator for Term
t1 | The first term. |
t2 | The second term. |
== operator for Terms
t1 | The first term. |
t2 | The second term. |
t1 | The first term. |
t2 | The second term. |