|
pl_search_cpp 2.2
|
Represents a disjunction of predicates. More...
#include <pred.hpp>


Public Member Functions | |
| DisjPred (Trail *trail, std::vector< PredPtr > preds) | |
| Constructs a DisjPred with the given predicates. | |
| bool | call () override |
| Calls the disjunction predicate, iterating through available predicates. | |
| void | set_continuation (PredPtr cont) override |
| Sets the continuation for all predicates in the disjunction. | |
Public Member Functions inherited from pl_search::Pred | |
| Pred (Trail *trail) | |
| Default constructor. | |
| PredPtr | get_continuation () |
| Gets 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. | |
Protected Attributes | |
| std::vector< PredPtr > | preds |
| The predicates in the disjunction. | |
Protected Attributes inherited from pl_search::Pred | |
| PredPtr | continuation |
| The continuation of the predicate. | |
| Trail * | trail |
| Pointer to the trail for managing variable bindings. | |
Represents a disjunction of predicates.
Constructs a DisjPred with the given predicates.
| trail | Pointer to the trail. |
| preds | A vector of shared pointers to the predicates. It is the vector of predicate choices - when a choice is made that choice becomes the next predicate to be called. |
The DisjPred class represents a disjunction of predicates, where each predicate is tried in order until one succeeds or all fail.
|
overridevirtual |
Calls the disjunction predicate, iterating through available predicates.
Reimplemented from pl_search::Pred.
|
overridevirtual |
Sets the continuation for all predicates in the disjunction.
| cont | A shared pointer to the continuation predicate. |
All disjuncts are set to the same continuation, which is the continuation of the DisjPred itself. This ensures that when any disjunct succeeds, the correct continuation is called.
Reimplemented from pl_search::Pred.
|
protected |
The predicates in the disjunction.