pl_search_cpp 1.4
|
Abstract base class for Prolog-like predicates. More...
#include <pred.hpp>
Public Member Functions | |
Pred (Engine *eng) | |
Default constructor. | |
virtual void | initialize_call () |
Initializes the predicate call. | |
virtual bool | apply_choice () |
Applies a choice. | |
virtual bool | more_choices () |
Checks if there are more choices. | |
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 | |
PredPtr | continuation |
The continuation of the predicate. | |
Engine * | engine |
Abstract base class for Prolog-like predicates.
The Pred class provides an interface for Prolog-like predicates. It includes methods for initializing calls, applying choices, testing choices, and checking for more choices. It also includes methods for managing continuations.
|
inline |
Default constructor.
|
virtualdefault |
Virtual destructor for proper cleanup.
|
inlinevirtual |
Applies a choice.
Reimplemented in pl_search::ChoicePred, pl_search::DetPred, pl_search::DisjPred, pl_search::Cut, pl_search::NotNotEnd, pl_search::NotNot, pl_search::IfThenElse, and pl_search::Loop.
|
inline |
Gets the continuation of the predicate.
|
inline |
For debugging.
|
inlinevirtual |
Initializes the predicate call.
Reimplemented in pl_search::ChoicePred, pl_search::DisjPred, pl_search::Cut, pl_search::NotNotEnd, pl_search::NotNot, pl_search::IfThenElse, and pl_search::Loop.
|
inline |
Determines if the predicate is non-deterministic.
PredPtr pl_search::Pred::last_pred | ( | ) |
Follows the continuation chain to the last predicate.
Initializes the predicate call.
Follows the continuation chain to the last predicate.
|
inlinevirtual |
Checks if there are more choices.
Reimplemented in pl_search::ChoicePred, pl_search::SemiDetPred, pl_search::DisjPred, pl_search::NotNot, and pl_search::IfThenElse.
|
inlinevirtual |
Sets the continuation of the predicate.
cont | A shared pointer to the continuation predicate. |
Reimplemented in pl_search::IfThenElse, and pl_search::Loop.
void pl_search::Pred::wrap_with_once | ( | ) |
Wraps the predicate with a once.
|
protected |
The continuation of the predicate.
|
protected |