34 namespace Gecode {
namespace Int {
namespace Bool {
41 template<
class VX,
class VY>
46 (home,x0[x0.
size()-1],y0[y0.
size()-1]),
x(x0),
y(y0) {
51 template<
class VX,
class VY>
57 template<
class VX,
class VY>
65 template<
class VX,
class VY>
75 x[0]=
x[
i]; n=1;
break;
76 }
else if (
x[
i].zero()) {
90 y[0]=
y[
i]; n=1;
break;
91 }
else if (
y[
i].zero()) {
104 template<
class VX,
class VY>
107 for (
int i=x.
size();
i--; )
110 else if (x[
i].zero())
114 for (
int i=y.
size();
i--; )
117 else if (y[
i].zero())
121 if ((x.
size() == 1) && (y.
size() == 1)) {
123 }
else if (!x.
shared(y)) {
129 template<
class VX,
class VY>
133 return sizeof(*this);
136 template<
class VX,
class VY>
147 }
else if (x[
i].zero()) {
151 if ((
i == 0) && (y.
size() == 0)) {
152 VX
z = x[0]; x.
size(0);
156 x0=x[
i]; x[
i]=x[--
n];
163 for (
int i=y.
size();
i--; )
171 template<
class VX,
class VY>
174 if (
x0.one() ||
x1.one())
191 template<
class VX,
class VY>
197 template<
class VX,
class VY>
202 template<
class VX,
class VY>
212 template<
class VX,
class VY>
230 x[
i]=x[--
n]; n_zero--;
236 template<
class VX,
class VY>
244 template<
class VX,
class VY>
251 for (
int i=x.
size();
i--; )
253 for (
int i=y.
size();
i--; )
257 for (
int i=x.
size();
i--; )
261 }
else if (x[
i].zero()) {
266 for (
int i=y.
size();
i--; )
270 }
else if (y[
i].zero()) {
275 if ((x.
size() == 1) && (y.
size() == 1)) {
285 template<
class VX,
class VY>
291 template<
class VX,
class VY>
299 as.advisor().dispose(home,
c);
305 template<
class VX,
class VY>
310 return sizeof(*this);
314 template<
class VX,
class VY>
319 if ((a.
x && VX::zero(d)) || (!a.
x && VY::zero(d)))
325 template<
class VX,
class VY>
343 template<
class VX,
class VY>
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
Boolean clause propagator (disjunctive, true)
ViewArray< VY > y
Positive views (origin from negative variables)
void update(Space &home, ViewArray< View > &a)
Update array to be a clone of array a.
ExecStatus ES_SUBSUMED(Propagator &p)
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low unary)
ExecStatus resubscribe(Space &home, Propagator &p, VX &x0, ViewArray< VX > &x, VY &x1, ViewArray< VY > &y)
Clause(Home home, ViewArray< VX > &x, ViewArray< VY > &y, VX z)
Constructor for posting.
Base-class for propagators.
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to variable.
Boolean clause propagator (disjunctive)
static ExecStatus post(Home home, BVA b0, BVB b1, BVC b2)
Post propagator .
Class to iterate over advisors of a council.
ViewArray< VX > x
Positive views.
Propagation has computed fixpoint.
static PropCost unary(PropCost::Mod m)
Single variable for modifier pcm.
Base-class for both propagators and branchers.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary)
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
int n
Number of negative literals for node type.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
static ExecStatus post(Home home, ViewArray< VX > &x, ViewArray< VY > &y, VX z)
Post propagator .
ViewArray< VX > x
Views not yet subscribed to.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
unsigned int size(I &i)
Size of all ranges of range iterator i.
void cancel(Space &home)
Cancel subscriptions.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
ViewArray< VY > y
Views not yet subscribed to (origin from negative variables)
Council< Tagged > c
The advisor council.
bool shared(void) const
Test whether array contains shared views.
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
int n_zero
The number of views assigned to zero in x and y.
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to all views.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
void move_lst(int i)
Move view from position size()-1 to position i (truncate array by one)
Boolean n-ary disjunction propagator (true)
static ExecStatus post(Home home, BVA b0, BVB b1)
Post propagator .
Post propagator for SetVar SetOpType SetVar y
static ExecStatus post(Home home, ViewArray< VX > &x, ViewArray< VY > &y)
Post propagator .
Generic domain change information to be supplied to advisors.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Boolean n-ary disjunction propagator.
Binary Boolean disjunction propagator (true)
void eliminate_zero(ViewArray< VX > &x, int &n_zero)
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Post propagator for SetVar x
Propagation has not computed fixpoint.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Tagged(Space &home, Propagator &p, Council< Tagged > &c, bool x)
Create tagged advisor.
Gecode toplevel namespace
Advisors for views (tagged whether for x or y)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int ModEventDelta
Modification event deltas.
int size(void) const
Return size of array (number of elements)
Home class for posting propagators
virtual void reschedule(Space &home)
Schedule function.
static PropCost binary(PropCost::Mod m)
Two variables for modifier pcm.
const bool x
Whether advises a view for x or y.
ClauseTrue(Home home, ViewArray< VX > &x, ViewArray< VY > &y)
Constructor for posting.
const Gecode::PropCond PC_BOOL_VAL
Propagate when a view becomes assigned (single value)
const Gecode::ModEvent ME_BOOL_VAL
Domain operation has resulted in a value (assigned variable)