8#ifndef PL_SEARCH_CHOICE_ITERATOR_HPP
9#define PL_SEARCH_CHOICE_ITERATOR_HPP
Base class for choice iterators.
Definition choice_iterator.hpp:23
virtual bool test_choice()
Tests a choice which would tyically involve constraint deductions based on the choice.
Definition choice_iterator.hpp:42
virtual bool has_next()=0
Checks if there are more choices available.
virtual ~ChoiceIterator()=default
Virtual destructor for proper cleanup.
virtual bool make_choice()=0
Makes a choice.
The Engine class manages the execution of predicates and backtracking.
Definition engine.hpp:69
bool unify(TermPtr t1, TermPtr t2)
Unifies two terms.
Definition engine.cpp:76
Represents a Prolog variable.
Definition pvar.hpp:44
Choice iterator for variables.
Definition choice_iterator.hpp:53
virtual bool make_choice() override
Makes a choice.
Definition choice_iterator.hpp:75
VarChoiceIterator(Engine *engine, PVarPtr v, std::vector< TermPtr > ch)
Constructs a VarChoiceIterator.
Definition choice_iterator.hpp:61
std::vector< TermPtr > choices
Reference to the vector of choices.
Definition choice_iterator.hpp:84
int index
Current index in the choices vector.
Definition choice_iterator.hpp:82
PVarPtr var
Pointer to the variable.
Definition choice_iterator.hpp:83
bool has_next() override
Checks if there are more choices available.
Definition choice_iterator.hpp:68
Engine * engine
Pointer to the Engine.
Definition choice_iterator.hpp:81
Definition of the Engine class and related structures.
Definition choice_iterator.hpp:16
std::shared_ptr< PVar > PVarPtr
Definition typedefs.hpp:44
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.