Clingo
|
Class to control a user-defined propagator. More...
#include <propagate.hh>
Public Member Functions | |
PropagateControl (clingo_propagate_control_t *ctl) | |
Constructor from the underlying C representation. | |
PropagateControl (clingo_propagate_init_t *init) | |
Constructor from the underlying C representation. | |
auto | add_literal (bool freeze=true) const -> SolverLiteral |
Adds a literal to the problem or the active solver thread. | |
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_weight_constraint (SolverLiteral literal, WeightedLiteralSpan literals, Weight bound, WeightConstraintType type) const -> bool |
Add a weight constraint 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 in the current context. | |
void | remove_watch (SolverLiteral lit) const |
Remove a watch for the given solver literal. | |
auto | propagate () const -> bool |
Propagate consequences of previously added clauses. | |
Class to control 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 |
|
inlineexplicit |
Constructor from the underlying C representation.
init | the C representation of the init object |
|
inline |
Add a clause to the solver.
If adding the clause results in a conflict or requires backtracking, 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 or requires backtracking, 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 |
Adds a literal to the problem or the active solver thread.
freeze | whether to freeze the literal |
|
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 |
Add a weight constraint to the solver.
literal | the literal associated with the constraint |
literals | the weighted literals of the constraint |
bound | the bound of the constraint |
type | the type of the weight constraint |
|
inline |
Check whether the given solver literal is watched in the current context.
literal | the literal to check |
|
inline |
Propagate consequences of previously added clauses.
If a conflict 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 |