clingo
|
Primitive representation of weight constraint literals in normal form. More...
#include <weight_constraint.h>
Public Member Functions | |
bool | propagate (Solver &s, Literal W) |
Propagates the constraint W == *this. More... | |
bool | sat () const |
bool | unsat () const |
bool | open () const |
bool | hasWeights () const |
Static Public Member Functions | |
static WeightLitsRep | create (Solver &s, WeightLitVec &lits, weight_t bound) |
Transforms the given literals to the normal form expected by WeightConstraint. More... | |
Public Attributes | |
WeightLiteral * | lits |
uint32 | size |
weight_t | bound |
weight_t | reach |
Primitive representation of weight constraint literals in normal form.
|
static |
Transforms the given literals to the normal form expected by WeightConstraint.
The function simplifies lits and bound by removing assigned and merging duplicate/complementary literals. Furthermore, negative weights and their literals are inverted, bound is updated accordingly, and literals are sorted by decreasing weight.
|
inline |
|
inline |
Propagates the constraint W == *this.
If *this is always satisfied (bound <= 0) or unsatisfied (bound > reach), the function forward propagates W. Otherwise, if W is not free, it assigns (and removes) literals from *this that must hold.
|
inline |
|
inline |
weight_t Clasp::WeightLitsRep::bound |
Rhs of linear constraint.
WeightLiteral* Clasp::WeightLitsRep::lits |
Literals sorted by decreasing weight.
weight_t Clasp::WeightLitsRep::reach |
Sum of weights of lits.
uint32 Clasp::WeightLitsRep::size |
Number of literals in lits.