36 template<
class BVA,
class BVB,
class BVC>
41 template<
class BVA,
class BVB,
class BVC>
46 template<
class BVA,
class BVB,
class BVC>
60 }
else if (b1.zero()) {
67 }
else if (b1.zero()) {
71 (void)
new (home)
Eqv(home,b0,b1,b2);
79 template<
class BVA,
class BVB,
class BVC>
85 template<
class BVA,
class BVB,
class BVC>
88#define GECODE_INT_STATUS(S0,S1,S2) \
89 ((BVA::S0<<(2*BVA::BITS))|(BVB::S1<<(1*BVB::BITS))|(BVC::S2<<(0*BVC::BITS)))
90 switch ((
x0.status() << (2*BVA::BITS)) | (
x1.status() << (1*BVB::BITS)) |
91 (
x2.status() << (0*BVC::BITS))) {
148#undef GECODE_INT_STATUS
161 assert(
x.
size() >= 2);
174 return sizeof(*this);
183 if (
x[i].assigned()) {
188 x0=
x[i];
x[i]=
x[--n];
Base-class for both propagators and branchers.
BinaryPropagator(Space &home, BinaryPropagator &p)
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Home class for posting propagators
Boolean view for Boolean variables.
int val(void) const
Return assigned value (only if assigned).
BoolTernary(Home home, BVA b0, BVB b1, BVC b2)
BVC x2
Boolean view Constructor for posting.
static ExecStatus post(Home home, BVA x0, BVB x1)
Post propagator .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, BVA b0, BVB b1, BVC b2)
Post propagator (equivalence).
Eqv(Space &home, Eqv &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
void resubscribe(Space &home, BoolView &x0)
Update subscription.
NaryEqv(Home home, ViewArray< BoolView > &x, int pm2)
Constructor for posting.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
int pm2
Parity information mod 2.
ViewArray< BoolView > x
Views not yet subscribed to.
bool assigned(void) const
Test whether view is assigned.
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to view.
void update(Space &home, ViewArray< View > &a)
Update array to be a clone of array a.
void drop_fst(int i)
Drop views from positions 0 to i-1 from array.
int size(void) const
Return size of array (number of elements).
ExecStatus ES_SUBSUMED(Propagator &p)
Propagator p is subsumed
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
#define GECODE_INT_STATUS(S0, S1)
const Gecode::PropCond PC_BOOL_VAL
Propagate when a view becomes assigned (single value).
BoolTest bool_test(const BoolView &b0, const BoolView &b1)
@ BT_COMP
Same variable but complement.
Gecode toplevel namespace
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_FAILED
Execution has resulted in failure.
#define GECODE_NEVER
Assert that this command is never executed.