|
| | CList (std::list< TermPtr > elems) |
| | Constructs a CList with the given elements.
|
| |
| std::string | repr () const override |
| | Returns a string representation of the list.
|
| |
| bool | isEqualTo (Term &other) const override |
| | Checks if the term is equal to another term.
|
| |
| bool | isLessThan (Term &other) const override |
| | < operator for a CList and a Term
|
| |
| const std::list< TermPtr > | getElements () const |
| | Gets the elements of the list.
|
| |
| virtual TermPtr | dereference () |
| | Dereferences the term. The default is to return a shared pointer to term itself.
|
| |
| 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.
|
| |
Represents a list of terms.
CList objects replace Prolog lists for efficiency. The list passed to the constructor is copied.
| const std::list< TermPtr > pl_search::CList::getElements |
( |
| ) |
const |
|
inline |
Gets the elements of the list.
The elements are returned as a list of shared pointers to Terms. The caller can modify the elements of the list through the shared pointers, but cannot modify the list itself. Making the list itself modifiable would break the immutability of CList, which is a key feature for its use in Prolog-like logic programming. This means that any changes to the list will be undone on backtracking, which is essential for the correct functioning of the engine. If users need to modify the list itself, they should create a new CList with the modified list of elements.
- Returns
- The elements of the list.