pl_search_cpp 1.4
|
Represents a disjunction of predicates. More...
#include <pred.hpp>
Public Member Functions | |
DisjPred (Engine *eng, std::vector< PredPtr > preds) | |
Constructs a DisjPred with the given predicates. | |
void | initialize_call () override |
Initializes the predicate call. | |
bool | apply_choice () override |
Applies a choice. | |
bool | more_choices () override |
Checks if there are more choices. | |
![]() | |
Pred (Engine *eng) | |
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. | |
bool | is_non_det () |
Determines if the predicate is non-deterministic. | |
void | wrap_with_once () |
Wraps the predicate with a once. | |
virtual | ~Pred ()=default |
Virtual destructor for proper cleanup. | |
std::string | get_name () |
For debugging. | |
Protected Attributes | |
std::vector< PredPtr > | preds |
The predicates in the disjunction. | |
int | index |
index of the current predicate choice | |
![]() | |
PredPtr | continuation |
The continuation of the predicate. | |
Engine * | engine |
Represents a disjunction of predicates.
Constructs a DisjPred with the given predicates.
eng | Pointer to the engine. |
preds | A vector of shared pointers to the predicates. |
preds become the list of choices - when a choice is made that choice becomes the next predicate to be called.
|
inlineoverridevirtual |
Applies a choice.
< Get the next choice
By setting continuation to choice, it will be the next predicate to be called
Reimplemented from pl_search::Pred.
|
inlineoverridevirtual |
Initializes the predicate call.
< Set the continuations for each of preds to this continuation
Reimplemented from pl_search::Pred.
|
inlineoverridevirtual |
Checks if there are more choices.
Reimplemented from pl_search::Pred.
|
protected |
index of the current predicate choice
|
protected |
The predicates in the disjunction.