26#ifndef PL_SEARCH_TRAIL_HPP
27#define PL_SEARCH_TRAIL_HPP
78 auto entry = std::make_shared<trail_entry>();
80 entry->value = v->value;
91 entry->var->reset(entry->value);
The Trail class is used to manage variable bindings during the execution of Prolog-like predicates.
Definition trail.hpp:64
std::stack< std::shared_ptr< trail_entry > > trail_stack
The stack of trail entries.
Definition trail.hpp:67
PVarPtr top()
Definition trail.hpp:104
friend class TailTest
Definition trail.hpp:71
void trail_var(PVarPtr v)
Trails a variable.
Definition trail.hpp:77
void unbind_to(int index)
Unbind (reset) variables back to a certain point in the trail.
Definition trail.hpp:88
int size() const
Returns the number of trail entries in the trail (top of stack)
Definition trail.hpp:100
Definition of the CList class.
std::shared_ptr< PVar > PVarPtr
Definition typedefs.hpp:45
std::shared_ptr< Term > TermPtr
Typedefs for shared pointers to Terms and subclasses.
Definition typedefs.hpp:44
Definition of the PAtom class.
Definition of the PFloat class.
Definition of the PInt class.
Definition of the PVar class.
PVarPtr var
Definition trail.hpp:47
TermPtr value
Definition trail.hpp:48
Definition of the Term class.
Definition of common typedefs used in the pl_search library.