70 :
Test(
"Bool::Bin::XYZ::"+
str(op0),3,0,1),
op(op0) {}
73 return check(x[0],
op,x[1]) == x[2];
92 :
Test(
"Bool::Bin::XXY::"+
str(op0),2,0,1),
op(op0) {}
95 return check(x[0],
op,x[0]) == x[1];
113 :
Test(
"Bool::Bin::XYX::"+
str(op0),2,0,1),
op(op0) {}
116 return check(x[0],
op,x[1]) == x[0];
134 :
Test(
"Bool::Bin::XYY::"+
str(op0),2,0,1),
op(op0) {}
137 return check(x[0],
op,x[1]) == x[1];
155 :
Test(
"Bool::Bin::XXX::"+
str(op0),1,0,1),
op(op0) {}
158 return check(x[0],
op,x[0]) == x[0];
164 rel(home, b,
op, b, b);
178 :
Test(
"Bool::Bin::XY::"+
str(op0)+
"::"+
str(c0),2,0,1),
201 :
Test(
"Bool::Bin::XX::"+
str(op0)+
"::"+
str(c0),1,0,1),
223 :
Test(
"Bool::Nary::"+
str(op0)+
"::"+
str(n),n+1,0,1),
op(op0) {}
227 int b =
check(x[n-2],
op,x[n-1]);
228 for (
int i=0; i<n-2; i++)
236 for (
int i=x.
size()-1; i--; )
250 :
Test(
"Bool::Nary::Shared::"+
str(op0)+
"::"+
str(n),n,0,1),
258 int b =
check(x[n-2],
op,x[n-1]);
259 for (
int i=0; i<n-2; i++)
267 for (
int i=x.
size(); i--; )
283 :
Test(
"Bool::Nary::"+
str(op0)+
"::"+
str(n)+
"::"+
str(c0),n,0,1),
288 int b =
check(x[n-2],
op,x[n-1]);
289 for (
int i=0; i<n-2; i++)
297 for (
int i=x.
size(); i--; )
312 :
Test(
"Bool::Clause::XYZ::"+
str(op0)+
"::"+
str(n),n+1,0,1),
op(op0) {}
315 int n = (x.
size()-1) / 2;
321 for (
int i=1; i<n; i++)
324 return b == x[x.
size()-1];
329 int n = (x.
size()-1) / 2;
331 for (
int i=n; i--; ) {
347 :
Test(
"Bool::Clause::XXYYX::"+
str(op0)+
"::"+
str(n),n,0,1),
351 int n = x.
size() / 2;
357 for (
int i=1; i<n; i++)
365 int n = x.
size() / 2;
367 for (
int i=n; i--; ) {
368 a[i]=a[i+n]=
channel(home,x[i]);
369 b[i]=b[i+n]=
channel(home,x[i+n]);
383 :
Test(
"Bool::Clause::XXY::"+
str(op0)+
"::"+
str(n),n,0,1),
392 int n = x.
size() / 2;
394 for (
int i=n; i--; ) {
395 a[i]=b[i+n]=
channel(home,x[i]);
396 b[i]=a[i+n]=
channel(home,x[i+n]);
412 :
Test(
"Bool::Clause::"+
str(op0)+
"::"+
str(n)+
"::"+
str(c0),n,0,1),
416 int n = x.
size() / 2;
422 for (
int i=1; i<n; i++)
430 int n = x.
size() / 2;
432 for (
int i=n; i--; ) {
448 if ((x[0] < 0) || (x[0] > 1))
470 :
Test(
"ITE::Bool",4,0,1,false) {}
493 (void)
new BinXYZ(bots.bot());
494 (void)
new BinXXY(bots.bot());
495 (void)
new BinXYX(bots.bot());
496 (void)
new BinXYY(bots.bot());
497 (void)
new BinXXX(bots.bot());
502 (void)
new Nary(bots.bot(),2);
503 (void)
new Nary(bots.bot(),6);
504 (void)
new Nary(bots.bot(),10);
Passing Boolean variables.
Boolean integer variables.
int size(void) const
Return size of array (number of elements).
static Gecode::Support::RandomGenerator rand
Random number generator.
Base class for assignments
int size(void) const
Return number of variables.
Iterator for Boolean operation types.
Test for binary Boolean operation with shared variables and constant
virtual bool solution(const Assignment &x) const
Check whether x is solution.
BinConstXX(Gecode::BoolOpType op0, int c0)
Construct and register test.
Gecode::BoolOpType op
Boolean operation type for test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Test for binary Boolean operation with constant
virtual bool solution(const Assignment &x) const
Check whether x is solution.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Gecode::BoolOpType op
Boolean operation type for test.
BinConstXY(Gecode::BoolOpType op0, int c0)
Construct and register test.
Test for binary Boolean operation with shared variables
Gecode::BoolOpType op
Boolean operation type for test.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
BinXXX(Gecode::BoolOpType op0)
Construct and register test.
Test for binary Boolean operation with shared variables
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Gecode::BoolOpType op
Boolean operation type for test.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
BinXXY(Gecode::BoolOpType op0)
Construct and register test.
Test for binary Boolean operation with shared variables
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Gecode::BoolOpType op
Boolean operation type for test.
BinXYX(Gecode::BoolOpType op0)
Construct and register test.
Test for binary Boolean operation with shared variables
Gecode::BoolOpType op
Boolean operation type for test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
BinXYY(Gecode::BoolOpType op0)
Construct and register test.
Test for binary Boolean operation
BinXYZ(Gecode::BoolOpType op0)
Construct and register test.
Gecode::BoolOpType op
Boolean operation type for test.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Test for Clause Boolean operation with constant
ClauseConst(Gecode::BoolOpType op0, int n, int c0)
Construct and register test.
Gecode::BoolOpType op
Boolean operation type for test.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Test for Clause Boolean operation
ClauseXXYYX(Gecode::BoolOpType op0, int n)
Construct and register test.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Gecode::BoolOpType op
Boolean operation type for test.
Test for Clause Boolean operation
ClauseXXY(Gecode::BoolOpType op0, int n)
Construct and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Gecode::BoolOpType op
Boolean operation type for test.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Test for Clause Boolean operation
Gecode::BoolOpType op
Boolean operation type for test.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
ClauseXYZ(Gecode::BoolOpType op0, int n)
Construct and register test.
Help class to create and register tests.
Create(void)
Perform creation and registration.
Test for if-then-else-constraint
virtual bool solution(const Assignment &x) const
Check whether x is solution.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
ITEBool(void)
Construct and register test.
Test for if-then-else-constraint
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
ITEInt(Gecode::IntPropLevel ipl)
Construct and register test.
Test for Nary Boolean operation with constant
Gecode::BoolOpType op
Boolean operation type for test.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
NaryConst(Gecode::BoolOpType op0, int n, int c0)
Construct and register test.
Test for Nary Boolean operation
virtual bool solution(const Assignment &x) const
Check whether x is solution.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
NaryShared(Gecode::BoolOpType op0, int n)
Construct and register test.
Gecode::BoolOpType op
Boolean operation type for test.
Test for Nary Boolean operation
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Gecode::BoolOpType op
Boolean operation type for test.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Nary(Gecode::BoolOpType op0, int n)
Construct and register test.
bool testfix
Whether to perform fixpoint test.
Gecode::IntPropLevel ipl
Propagation level.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
void clause(Home home, BoolOpType o, const BoolVarArgs &x, const BoolVarArgs &y, BoolVar z, IntPropLevel ipl=IPL_DEF)
Post domain consistent propagator for Boolean clause with positive variables x and negative variables...
BoolOpType
Operation types for Booleans.
IntPropLevel
Propagation levels for integer propagators.
@ IPL_DOM
Domain propagation Options: basic versus advanced propagation.
@ IPL_BND
Bounds propagation.
Gecode toplevel namespace
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Tests for Boolean constraints
int check(int x0, Gecode::BoolOpType op, int x1)
ITEInt itebnd(Gecode::IPL_BND)
ITEInt itedom(Gecode::IPL_DOM)
Testing finite domain integers.
#define GECODE_NEVER
Assert that this command is never executed.