Public Member Functions | |
Constraint * | cloneAttach (Solver &) |
Returns a clone of this and adds necessary watches to the given solver. | |
void | destroy (Solver *s, bool b) |
Default is to call delete this. | |
uint32 | isOpen (const Solver &, const TypeSet &, LitVec &) |
Shall return 0 if either !t.inSet(type()) or this constraint is satisfied w.r.t the current assignment. | |
bool | locked (const Solver &) const |
PropResult | propagate (Solver &, Literal, uint32 &) |
void | reason (Solver &, Literal, LitVec &out) |
bool | simplify (Solver &, bool) |
TestingConstraint (bool *del=0, ConstraintType t=Constraint_t::static_constraint) | |
ConstraintType | type () const |
Returns the type of this learnt constraint. | |
void | undoLevel (Solver &) |
Called when the solver undid a decision level watched by this constraint. | |
Static Public Member Functions | |
static uint32 | size () |
Public Attributes | |
LitVec | ante |
bool * | deleted |
bool | keepWatch |
int | propagates |
bool | sat |
bool | setConflict |
ConstraintType | type_ |
int | undos |
Definition at line 26 of file solver_test.cpp.
Clasp::Test::TestingConstraint::TestingConstraint | ( | bool * | del = 0 , |
ConstraintType | t = Constraint_t::static_constraint |
||
) | [inline] |
Definition at line 27 of file solver_test.cpp.
Constraint* Clasp::Test::TestingConstraint::cloneAttach | ( | Solver & | other | ) | [inline, virtual] |
Returns a clone of this and adds necessary watches to the given solver.
The function shall create and return a copy of this constraint to be used in the given solver. Furthermore, it shall add necessary watches to the given solver.
Implements Clasp::Constraint.
Definition at line 29 of file solver_test.cpp.
void Clasp::Test::TestingConstraint::destroy | ( | Solver * | s, |
bool | detach | ||
) | [inline, virtual] |
Default is to call delete this.
Reimplemented from Clasp::Constraint.
Definition at line 41 of file solver_test.cpp.
uint32 Clasp::Test::TestingConstraint::isOpen | ( | const Solver & | s, |
const TypeSet & | t, | ||
LitVec & | freeLits | ||
) | [inline, virtual] |
Shall return 0 if either !t.inSet(type()) or this constraint is satisfied w.r.t the current assignment.
If this constraint is currently not satisfied and t.inSet(type()), shall return type() and freeLits shall contain all currently unassigned literals of this constraint.
Implements Clasp::LearntConstraint.
Definition at line 46 of file solver_test.cpp.
bool Clasp::Test::TestingConstraint::locked | ( | const Solver & | s | ) | const [inline, virtual] |
Shall return true if this constraint can't be deleted because it currently implies one ore more literals and false otherwise.
Implements Clasp::LearntConstraint.
Definition at line 45 of file solver_test.cpp.
PropResult Clasp::Test::TestingConstraint::propagate | ( | Solver & | s, |
Literal | p, | ||
uint32 & | data | ||
) | [inline, virtual] |
Propagate is called for each constraint that watches p. It shall enqueue all consequences of p becoming true.
s | The solver in which p became true. |
p | A literal watched by this constraint that recently became true. |
data | The data-blob that this constraint passed when the watch for p was registered. |
Implements Clasp::Constraint.
Definition at line 32 of file solver_test.cpp.
void Clasp::Test::TestingConstraint::reason | ( | Solver & | s, |
Literal | p, | ||
LitVec & | lits | ||
) | [inline, virtual] |
Implements Clasp::Constraint.
Definition at line 40 of file solver_test.cpp.
bool Clasp::Test::TestingConstraint::simplify | ( | Solver & | s, |
bool | reinit | ||
) | [inline, virtual] |
Simplify this constraint.
Reimplemented from Clasp::Constraint.
Definition at line 39 of file solver_test.cpp.
static uint32 Clasp::Test::TestingConstraint::size | ( | ) | [inline, static] |
Definition at line 47 of file solver_test.cpp.
ConstraintType Clasp::Test::TestingConstraint::type | ( | ) | const [inline, virtual] |
Returns the type of this learnt constraint.
Reimplemented from Clasp::LearntConstraint.
Definition at line 48 of file solver_test.cpp.
void Clasp::Test::TestingConstraint::undoLevel | ( | Solver & | s | ) | [inline, virtual] |
Called when the solver undid a decision level watched by this constraint.
s | the solver in which the decision level is undone. |
Reimplemented from Clasp::Constraint.
Definition at line 36 of file solver_test.cpp.
Definition at line 49 of file solver_test.cpp.
Definition at line 56 of file solver_test.cpp.
Definition at line 54 of file solver_test.cpp.
Definition at line 51 of file solver_test.cpp.
Definition at line 53 of file solver_test.cpp.
Definition at line 55 of file solver_test.cpp.
Definition at line 50 of file solver_test.cpp.
Definition at line 52 of file solver_test.cpp.