34namespace 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()) {
98 if ((
x.size() == 0) && (
y.size() == 0))
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)) {
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=0; 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=0; i<
x.size(); i++)
253 for (
int i=0; 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>
296 x.cancel(home,as.advisor());
298 y.cancel(home,as.advisor());
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)))
320 if (++n_zero <
x.size() +
y.size())
325 template<
class VX,
class VY>
329 if (n_zero ==
x.size() +
y.size())
331 for (
int i=0; i<
x.size(); i++)
336 for (
int i=0; i<
y.size(); i++)
343 template<
class VX,
class VY>
349 for (
int i=0; i<
x.size(); i++)
351 for (
int i=0; i<
y.size(); i++)
354 }
else if (n_zero ==
x.size() +
y.size()) {
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Base-class for both propagators and branchers.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Class to iterate over advisors of a council.
Generic domain change information to be supplied to advisors.
Home class for posting propagators
Binary Boolean disjunction propagator (true)
static ExecStatus post(Home home, BVA b0, BVB b1)
Post propagator .
Boolean clause propagator (disjunctive, true)
static ExecStatus post(Home home, ViewArray< VX > &x, ViewArray< VY > &y)
Post propagator .
ClauseTrue(Home home, ViewArray< VX > &x, ViewArray< VY > &y)
Constructor for posting.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low binary)
ViewArray< VX > x
Views not yet subscribed to.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ViewArray< VY > y
Views not yet subscribed to (origin from negative variables)
Advisors for views (tagged whether for x or y)
Tagged(Space &home, Propagator &p, Council< Tagged > &c, bool x)
Create tagged advisor.
Boolean clause propagator (disjunctive)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, ViewArray< VX > &x, ViewArray< VY > &y, VX z)
Post propagator .
ViewArray< VX > x
Positive views.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual void reschedule(Space &home)
Schedule function.
int n_zero
The number of views assigned to zero in x and y.
Clause(Home home, ViewArray< VX > &x, ViewArray< VY > &y, VX z)
Constructor for posting.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Council< Tagged > c
The advisor council.
ViewArray< VY > y
Positive views (origin from negative variables)
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low unary)
void cancel(Space &home)
Cancel subscriptions.
Boolean n-ary disjunction propagator (true)
static ExecStatus post(Home home, ViewArray< BV > &b)
Post propagator .
static ExecStatus post(Home home, ViewArray< VX > &x, VY y)
Post propagator .
static ExecStatus post(Home home, BVA b0, BVB b1, BVC b2)
Post propagator .
static PropCost unary(PropCost::Mod m)
Single variable for modifier pcm.
static PropCost binary(PropCost::Mod m)
Two variables for modifier pcm.
Base-class for propagators.
struct Gecode::Space::@61::@63 c
Data available only during copying.
void update(Space &home, ViewArray< View > &a)
Update array to be a clone of array a.
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to variable.
int size(void) const
Return size of array (number of elements)
ExecStatus ES_SUBSUMED(Propagator &p)
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
ExecStatus resubscribe(Space &home, Propagator &p, VX &x0, ViewArray< VX > &x, VY &x1, ViewArray< VY > &y)
void eliminate_zero(ViewArray< VX > &x, int &n_zero)
const Gecode::ModEvent ME_BOOL_VAL
Domain operation has resulted in a value (assigned variable)
const Gecode::PropCond PC_BOOL_VAL
Propagate when a view becomes assigned (single value)
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Post propagator for SetVar SetOpType SetVar y
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_NOFIX
Propagation has not computed fixpoint.
bool shared(ViewArray< ViewX > x, ViewArray< ViewY > y)
Post propagator for SetVar x