Clingo
|
Interface for user-defined propagators. More...
#include <propagate.hh>
Public Member Functions | |
Propagator ()=default | |
The default constructor. | |
Propagator (Propagator &&other)=delete | |
Disable copy and move operations. | |
virtual | ~Propagator ()=default |
The default destructor. | |
void | init (PropagateInit init) |
Callback to initialize the propagator before each solving step. | |
void | propagate (PropagateControl ctl, ProgramLiteralSpan changes) |
Callback to propagate consequences of the given literals. | |
void | undo (ProgramId thread_id, Assignment assignment, ProgramLiteralSpan changes) |
Called when the solver backtracks to a previous decision level. | |
void | check (PropagateControl ctl) |
Callback that is called on propagation fixpoints or total assignments. | |
Interface for user-defined propagators.
|
inline |
Callback that is called on propagation fixpoints or total assignments.
Clingo::PropagateInit::check_mode() can be used to control when this callback is called.
Like in Clingo::Propagator::Propagate(), a propagator can add clauses here to propagate consequences or discard the current assignment.
ctl | the propagate control object |
|
inline |
Callback to initialize the propagator before each solving step.
init | the initialization object |
|
inline |
Callback to propagate consequences of the given literals.
The function is only called for watched literals that were assigned on the current decision level.
A propagator can add clauses here to propagate consequences of the underlying theory.
ctl | the propagate control object |
changes | the literals that were assigned on the current decision level |
|
inline |
Called when the solver backtracks to a previous decision level.
The function is called with literals from all previous propagate calls on the same decision level.
Clingo::PropagateInit::undo_mode() can be used to control when this function is called.
thread_id | the id of the current solver thread |
assignment | the current assignment of the solver |
changes | the literals that were assigned on the current decision level |