|
pl_search_cpp 2.2
|
A base class that represents a choice predicate. More...
#include <pred.hpp>


Public Member Functions | |
| ChoicePred (Trail *trail) | |
| Constructs a ChoicePred that tries available choices. | |
| bool | call () override |
| Calls the choice predicate. | |
| virtual bool | has_next ()=0 |
| Checks if there are more choices available. | |
| virtual bool | make_choice ()=0 |
| Makes a choice from the available options. | |
| virtual bool | test_choice () |
| Tests the current choice for validity. | |
Public Member Functions inherited from pl_search::Pred | |
| Pred (Trail *trail) | |
| Default constructor. | |
| PredPtr | get_continuation () |
| Gets the continuation of the predicate. | |
| virtual void | set_continuation (PredPtr cont) |
| Sets the continuation of the predicate. | |
| PredPtr | last_pred () |
| Follows the continuation chain to the last predicate. | |
| virtual void | call_init () |
| Initialize call. | |
| bool | call_continuation () |
| Calls the continuation of the predicate - first call_init and then call. | |
| virtual | ~Pred ()=default |
| Virtual destructor for proper cleanup. | |
| virtual std::string | get_name () |
| For debugging. | |
Additional Inherited Members | |
Protected Attributes inherited from pl_search::Pred | |
| PredPtr | continuation |
| The continuation of the predicate. | |
| Trail * | trail |
| Pointer to the trail for managing variable bindings. | |
A base class that represents a choice predicate.
The ChoicePred class represents a choice point in the execution of predicates. It tries to make a choice and, if successful, calls the continuation. If the choice fails, it tries the next choice until all choices are exhausted.
|
inline |
Constructs a ChoicePred that tries available choices.
| trail | Pointer to the trail. |
|
overridevirtual |
Calls the choice predicate.
Reimplemented from pl_search::Pred.
|
pure virtual |
Checks if there are more choices available.
Implemented in pl_search::VarChoicePred.
|
pure virtual |
Makes a choice from the available options.
Implemented in pl_search::VarChoicePred.
|
inlinevirtual |
Tests the current choice for validity.
This method is typically overridden in derived classes to implement specific choice validation logic. By default, it returns true, indicating that the choice is valid.