Clingo
|
Class to control propagation of a user-defined propagator. More...
#include <propagate.hh>
Public Member Functions | |
PropagateControl (clingo_propagate_control_t *ctl) | |
Constructor from the underlying C representation. | |
auto | add_literal () const -> SolverLiteral |
Add solver local literal to the solver. | |
auto | add_clause (SolverLiteralSpan literals, ClauseFlags flags=ClauseFlags::none) const -> bool |
Add a clause to the solver. | |
auto | add_clause (SolverLiteralList literals, ClauseFlags flags=ClauseFlags::none) const -> bool |
Add a clause to the solver. | |
auto | add_nogood (SolverLiteralSpan literals, ClauseFlags flags=ClauseFlags::none) const -> bool |
Add a nogood to the solver. | |
void | add_watch (SolverLiteral literal) const |
Add a watch for the given solver literal. | |
auto | has_watch (SolverLiteral literal) const -> bool |
Check whether the given solver literal is watched. | |
auto | propagate () const -> bool |
Propagate consequences of previously added clauses. | |
void | remove_watch (SolverLiteral lit) const |
Remove a watch for the given solver literal. | |
auto | assignment () const -> Assignment |
Get the assignment of the current solver. | |
auto | thread_id () const -> ProgramId |
Get the thread id of the current solver. | |
Class to control propagation of a user-defined propagator.
This class provides methods for adding clauses, literals, and nogoods, as well as managing watches and performing propagation.
|
inlineexplicit |
Constructor from the underlying C representation.
ctl | the C representation of the control object |
|
inline |
Add a clause to the solver.
If adding the clause results in a conflict, the function returns false and the calling propagator must not add further clauses from the current callback.
literals | the literals of the clause to add |
flags | the flags for the clause |
|
inline |
Add a clause to the solver.
If adding the clause results in a conflict, the function returns false and the calling propagator must not add further clauses from the current callback.
literals | the literals of the clause to add |
flags | the flags for the clause |
|
inline |
Add solver local literal to the solver.
Solver local literals are not shared between solvers and are removed at the end of the current solving step.
|
inline |
Add a nogood to the solver.
This is the same as calling add clause with the negated literals.
literals | the literals of the nogood to add |
flags | the flags for the nogood |
|
inline |
Add a watch for the given solver literal.
literal | the literal to watch |
|
inline |
Get the assignment of the current solver.
|
inline |
Check whether the given solver literal is watched.
literal | the literal to check |
Propagate consequences of previously added clauses.
If a confilct is detected during propagation, the function returns false and the calling propagator must not add further clauses from the current callback.
|
inline |
Remove a watch for the given solver literal.
lit | the literal to remove the watch for |
Get the thread id of the current solver.