25#ifndef PL_SEARCH_TERM_HPP
26#define PL_SEARCH_TERM_HPP
50class Term :
public std::enable_shared_from_this<Term> {
79 virtual std::string
repr()
const {
return "TERM"; }
The Engine class manages the execution of predicates and backtracking.
Definition engine.hpp:69
Abstract base class for terms that approximate Prolog terms.
Definition term.hpp:50
friend bool operator<=(Term &t1, Term &t2)
<= operator for Term
Definition term.cpp:77
friend bool operator<(Term &t1, Term &t2)
< operator for Terms.
Definition term.cpp:66
virtual Term * deref_term()
Similar to dereference but returning the "raw" pointer.
Definition term.hpp:65
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-d...
Definition term.hpp:95
friend std::ostream & operator<<(std::ostream &os, const Term &t)
Overloaded output stream operator for Term.
Definition term.hpp:119
virtual ~Term()
Virtual destructor for proper cleanup.
Definition term.hpp:111
virtual bool is_var()
Checks if the term is a variable.
Definition term.hpp:101
virtual bool isEqualTo(Term &t) const =0
Checks if the term is equal to another term.
Term()
Default constructor.
Definition term.hpp:106
friend bool operator==(Term &t1, Term &t2)
== operator for Terms
Definition term.cpp:47
virtual TermPtr dereference()
Dereferences the term. The default is to return a shared pointer to term itself.
Definition term.hpp:73
virtual bool isLessThan(Term &t) const =0
Checks if the term is less than another term.
virtual std::string repr() const
Returns a string representation of the term.
Definition term.hpp:79
Definition choice_iterator.hpp:16
std::shared_ptr< Term > TermPtr
Typedefs for shared pointers to Terms and subclasses.
Definition typedefs.hpp:43
Definition of common typedefs used in the pl_search library.