38 namespace Gecode {
namespace Int {
namespace Bool {
45 template<
class VX,
class VY>
50 (home,x0[x0.
size()-1],y0[y0.
size()-1]),
x(x0),
y(y0) {
55 template<
class VX,
class VY>
61 template<
class VX,
class VY>
69 template<
class VX,
class VY>
79 x[0]=
x[
i]; n=1;
break;
80 }
else if (
x[
i].zero()) {
94 y[0]=
y[
i]; n=1;
break;
95 }
else if (
y[
i].zero()) {
108 template<
class VX,
class VY>
111 for (
int i=x.
size();
i--; )
114 else if (x[
i].zero())
118 for (
int i=y.
size();
i--; )
121 else if (y[
i].zero())
125 if ((x.
size() == 1) && (y.
size() == 1)) {
127 }
else if (!x.
shared(y)) {
133 template<
class VX,
class VY>
137 return sizeof(*this);
140 template<
class VX,
class VY>
151 }
else if (x[
i].zero()) {
155 if ((
i == 0) && (y.
size() == 0)) {
156 VX
z = x[0]; x.
size(0);
160 x0=x[
i]; x[
i]=x[--
n];
167 for (
int i=y.
size();
i--; )
175 template<
class VX,
class VY>
178 if (
x0.one() ||
x1.one())
195 template<
class VX,
class VY>
201 template<
class VX,
class VY>
206 template<
class VX,
class VY>
216 template<
class VX,
class VY>
234 x[
i]=x[--
n]; n_zero--;
240 template<
class VX,
class VY>
248 template<
class VX,
class VY>
255 for (
int i=x.
size();
i--; )
257 for (
int i=y.
size();
i--; )
261 for (
int i=x.
size();
i--; )
265 }
else if (x[
i].zero()) {
270 for (
int i=y.
size();
i--; )
274 }
else if (y[
i].zero()) {
279 if ((x.
size() == 1) && (y.
size() == 1)) {
289 template<
class VX,
class VY>
295 template<
class VX,
class VY>
303 as.advisor().dispose(home,
c);
309 template<
class VX,
class VY>
314 return sizeof(*this);
318 template<
class VX,
class VY>
323 if ((a.
x && VX::zero(d)) || (!a.
x && VY::zero(d)))
329 template<
class VX,
class VY>
347 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)