|
pl_search_cpp 1.4
|
Represents the equivalent of Prolog if-then-else i.e. (G1 -> G2; G3) - similar to (G1, !, G2; G3) ) More...
#include <pred.hpp>


Public Member Functions | |
| IfThenElse (Engine *eng, PredPtr if_pred, PredPtr then_pred, PredPtr else_pred) | |
| The equlvalent of the Prolog call (If -> Then ; Else) | |
| 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. | |
| void | set_continuation (PredPtr cont) |
| Sets the continuation of the predicate. | |
Public Member Functions inherited from pl_search::Pred | |
| Pred (Engine *eng) | |
| Default constructor. | |
| PredPtr | get_continuation () |
| Gets 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 | |
| PredPtr | if_pred |
| PredPtr | then_pred |
| PredPtr | else_pred |
| PredPtr | if_then_pred |
| std::shared_ptr< Cut > | cut_pred |
| int | choice_number |
Protected Attributes inherited from pl_search::Pred | |
| PredPtr | continuation |
| The continuation of the predicate. | |
| Engine * | engine |
Represents the equivalent of Prolog if-then-else i.e. (G1 -> G2; G3) - similar to (G1, !, G2; G3) )
| pl_search::IfThenElse::IfThenElse | ( | Engine * | eng, |
| PredPtr | if_pred, | ||
| PredPtr | then_pred, | ||
| PredPtr | else_pred | ||
| ) |
The equlvalent of the Prolog call (If -> Then ; Else)
| eng | Pointer to the engine |
| if_pred | The guard predicate |
| then_pred | The then predicate |
| else_pred | The else predicate |
|
overridevirtual |
Applies a choice.
Reimplemented from pl_search::Pred.
|
overridevirtual |
Initializes the predicate call.
Reimplemented from pl_search::Pred.
|
overridevirtual |
Checks if there are more choices.
Reimplemented from pl_search::Pred.
|
virtual |
Sets the continuation of the predicate.
| cont | A shared pointer to the continuation predicate. |
Reimplemented from pl_search::Pred.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |