A solver-local (i.e. thread-local) constraint to support enumeration. More...
#include <enumerator.h>
Public Types | |
typedef EnumerationConstraint * | ConPtr |
typedef MinimizeConstraint * | MinPtr |
Public Member Functions | |
bool | commitModel (Enumerator &ctx, Solver &s) |
bool | commitUnsat (Enumerator &ctx, Solver &s) |
bool | disjointPath () const |
Returns true if search-path is disjoint from all others. | |
void | end (Solver &s) |
bool | integrateBound (Solver &s) const |
MinPtr | minimizer () const |
bool | optimize () const |
Returns true if optimization is active. | |
void | setDisjoint (bool x) |
void | setMinimizer (MinPtr min) |
bool | start (Solver &s, const LitVec &path, bool disjoint) |
ValueRep | state () const |
bool | update (Solver &s) |
Protected Member Functions | |
MinimizeConstraint * | cloneMinimizer (Solver &s) const |
virtual void | destroy (Solver *s, bool detach) |
Default is to call delete this. | |
virtual void | doCommitModel (Enumerator &, Solver &) |
virtual bool | doUpdate (Solver &s)=0 |
EnumerationConstraint (Solver &s, MinimizeConstraint *min) | |
virtual PropResult | propagate (Solver &, Literal, uint32 &) |
virtual void | reason (Solver &, Literal, LitVec &) |
virtual bool | simplify (Solver &s, bool reinit) |
virtual bool | valid (Solver &s) |
Shall return whether the constraint is valid (i.e. not conflicting) w.r.t the current assignment in s. | |
virtual | ~EnumerationConstraint () |
Private Types | |
enum | { clear_state_mask = ~uint32(value_true|value_false) } |
enum | Flag { flag_path_disjoint = 4u } |
Private Attributes | |
uint32 | flags_: 4 |
MinimizeConstraint * | mini_ |
LitVec | next_ |
uint32 | root_: 28 |
A solver-local (i.e. thread-local) constraint to support enumeration.
An enumeration constraint is used to extract/store enumeration-related information from models.
Definition at line 234 of file enumerator.h.
Definition at line 236 of file enumerator.h.
Definition at line 237 of file enumerator.h.
anonymous enum [private] |
Definition at line 269 of file enumerator.h.
enum Clasp::EnumerationConstraint::Flag [private] |
Definition at line 268 of file enumerator.h.
Clasp::EnumerationConstraint::EnumerationConstraint | ( | Solver & | s, |
MinimizeConstraint * | min | ||
) | [protected] |
Definition at line 27 of file enumerator.cpp.
Clasp::EnumerationConstraint::~EnumerationConstraint | ( | ) | [protected, virtual] |
Definition at line 33 of file enumerator.cpp.
MinimizeConstraint * Clasp::EnumerationConstraint::cloneMinimizer | ( | Solver & | s | ) | const [protected] |
Definition at line 30 of file enumerator.cpp.
bool Clasp::EnumerationConstraint::commitModel | ( | Enumerator & | ctx, |
Solver & | s | ||
) |
Definition at line 80 of file enumerator.cpp.
bool Clasp::EnumerationConstraint::commitUnsat | ( | Enumerator & | ctx, |
Solver & | s | ||
) |
Definition at line 88 of file enumerator.cpp.
void Clasp::EnumerationConstraint::destroy | ( | Solver * | s, |
bool | detach | ||
) | [protected, virtual] |
Default is to call delete this.
Reimplemented from Clasp::Constraint.
Reimplemented in Clasp::CBConsequences::CBFinder, and Clasp::ModelEnumerator::ModelFinder.
Definition at line 34 of file enumerator.cpp.
bool Clasp::EnumerationConstraint::disjointPath | ( | ) | const [inline] |
Returns true if search-path is disjoint from all others.
Definition at line 239 of file enumerator.h.
virtual void Clasp::EnumerationConstraint::doCommitModel | ( | Enumerator & | , |
Solver & | |||
) | [inline, protected, virtual] |
Reimplemented in Clasp::ModelEnumerator::BacktrackFinder, Clasp::ModelEnumerator::RecordFinder, and Clasp::CBConsequences::CBFinder.
Definition at line 265 of file enumerator.h.
virtual bool Clasp::EnumerationConstraint::doUpdate | ( | Solver & | s | ) | [protected, pure virtual] |
void Clasp::EnumerationConstraint::end | ( | Solver & | s | ) |
Definition at line 43 of file enumerator.cpp.
bool Clasp::EnumerationConstraint::integrateBound | ( | Solver & | s | ) | const |
Definition at line 37 of file enumerator.cpp.
MinPtr Clasp::EnumerationConstraint::minimizer | ( | ) | const [inline] |
Definition at line 243 of file enumerator.h.
bool Clasp::EnumerationConstraint::optimize | ( | ) | const |
Returns true if optimization is active.
Definition at line 38 of file enumerator.cpp.
virtual PropResult Clasp::EnumerationConstraint::propagate | ( | Solver & | s, |
Literal | p, | ||
uint32 & | data | ||
) | [inline, protected, 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.
Reimplemented in Clasp::ModelEnumerator::BacktrackFinder.
Definition at line 259 of file enumerator.h.
virtual void Clasp::EnumerationConstraint::reason | ( | Solver & | s, |
Literal | p, | ||
LitVec & | lits | ||
) | [inline, protected, virtual] |
Implements Clasp::Constraint.
Reimplemented in Clasp::ModelEnumerator::BacktrackFinder.
Definition at line 260 of file enumerator.h.
void Clasp::EnumerationConstraint::setDisjoint | ( | bool | x | ) |
Definition at line 39 of file enumerator.cpp.
void Clasp::EnumerationConstraint::setMinimizer | ( | MinPtr | min | ) | [inline] |
Definition at line 253 of file enumerator.h.
bool Clasp::EnumerationConstraint::simplify | ( | Solver & | s, |
bool | reinit | ||
) | [protected, virtual] |
Simplify this constraint.
Reimplemented from Clasp::Constraint.
Reimplemented in Clasp::ModelEnumerator::ModelFinder.
Definition at line 35 of file enumerator.cpp.
bool Clasp::EnumerationConstraint::start | ( | Solver & | s, |
const LitVec & | path, | ||
bool | disjoint | ||
) |
Definition at line 49 of file enumerator.cpp.
ValueRep Clasp::EnumerationConstraint::state | ( | ) | const [inline] |
Definition at line 240 of file enumerator.h.
bool Clasp::EnumerationConstraint::update | ( | Solver & | s | ) |
Definition at line 59 of file enumerator.cpp.
bool Clasp::EnumerationConstraint::valid | ( | Solver & | s | ) | [protected, virtual] |
Shall return whether the constraint is valid (i.e. not conflicting) w.r.t the current assignment in s.
Reimplemented from Clasp::Constraint.
Definition at line 36 of file enumerator.cpp.
uint32 Clasp::EnumerationConstraint::flags_ [private] |
Definition at line 272 of file enumerator.h.
Definition at line 270 of file enumerator.h.
LitVec Clasp::EnumerationConstraint::next_ [private] |
Definition at line 271 of file enumerator.h.
uint32 Clasp::EnumerationConstraint::root_ [private] |
Definition at line 273 of file enumerator.h.