42 namespace Test {
namespace Int {
66 class BinXYZ :
public Test {
74 :
Test(
"Bool::Bin::XYZ::"+
str(op0),3,0,1), op(op0) {}
77 return check(x[0],op,x[1]) == x[2];
96 :
Test(
"Bool::Bin::XXY::"+
str(op0),2,0,1), op(op0) {}
99 return check(x[0],op,x[0]) == x[1];
117 :
Test(
"Bool::Bin::XYX::"+
str(op0),2,0,1), op(op0) {}
120 return check(x[0],op,x[1]) == x[0];
138 :
Test(
"Bool::Bin::XYY::"+
str(op0),2,0,1), op(op0) {}
141 return check(x[0],op,x[1]) == x[1];
159 :
Test(
"Bool::Bin::XXX::"+
str(op0),1,0,1), op(op0) {}
162 return check(x[0],op,x[0]) == x[0];
168 rel(home, b, op, b, b);
182 :
Test(
"Bool::Bin::XY::"+
str(op0)+
"::"+
str(c0),2,0,1),
186 return check(x[0],op,x[1]) ==
c;
205 :
Test(
"Bool::Bin::XX::"+
str(op0)+
"::"+
str(c0),1,0,1),
209 return check(x[0],op,x[0]) ==
c;
215 rel(home, b, op, b, c);
227 :
Test(
"Bool::Nary::"+
str(op0)+
"::"+
str(n),n+1,0,1), op(op0) {}
231 int b =
check(x[n-2],op,x[n-1]);
232 for (
int i=0;
i<n-2;
i++)
240 for (
int i=x.
size()-1;
i--; )
254 :
Test(
"Bool::Nary::Shared::"+
str(op0)+
"::"+
str(n),n,0,1),
262 int b =
check(x[n-2],op,x[n-1]);
263 for (
int i=0;
i<n-2;
i++)
271 for (
int i=x.
size();
i--; )
287 :
Test(
"Bool::Nary::"+
str(op0)+
"::"+
str(n)+
"::"+
str(c0),n,0,1),
292 int b =
check(x[n-2],op,x[n-1]);
293 for (
int i=0;
i<n-2;
i++)
301 for (
int i=x.
size();
i--; )
316 :
Test(
"Bool::Clause::XYZ::"+
str(op0)+
"::"+
str(n),n+1,0,1), op(op0) {}
319 int n = (x.
size()-1) / 2;
322 b =
check(x[0],op,!x[1]);
324 b =
check(x[0],op,!x[n]);
325 for (
int i=1;
i<
n;
i++)
328 return b == x[x.
size()-1];
333 int n = (x.
size()-1) / 2;
335 for (
int i=n;
i--; ) {
351 :
Test(
"Bool::Clause::XXYYX::"+
str(op0)+
"::"+
str(n),n,0,1),
355 int n = x.
size() / 2;
358 b =
check(x[0],op,!x[1]);
360 b =
check(x[0],op,!x[n]);
361 for (
int i=1;
i<
n;
i++)
369 int n = x.
size() / 2;
371 for (
int i=n;
i--; ) {
387 :
Test(
"Bool::Clause::XXY::"+
str(op0)+
"::"+
str(n),n,0,1),
396 int n = x.
size() / 2;
398 for (
int i=n;
i--; ) {
416 :
Test(
"Bool::Clause::"+
str(op0)+
"::"+
str(n)+
"::"+
str(c0),n,0,1),
420 int n = x.
size() / 2;
423 b =
check(x[0],op,!x[1]);
425 b =
check(x[0],op,!x[n]);
426 for (
int i=1;
i<
n;
i++)
434 int n = x.
size() / 2;
436 for (
int i=n;
i--; ) {
449 :
Test(
"ITE::"+
str(icl),4,-4,4,false,icl) {}
452 if ((x[0] < 0) || (x[0] > 1))
476 (void)
new BinXYZ(bots.bot());
477 (void)
new BinXXY(bots.bot());
478 (void)
new BinXYX(bots.bot());
479 (void)
new BinXYY(bots.bot());
480 (void)
new BinXXX(bots.bot());
485 (void)
new Nary(bots.bot(),2);
486 (void)
new Nary(bots.bot(),6);
487 (void)
new Nary(bots.bot(),10);
BinConstXY(Gecode::BoolOpType op0, int c0)
Construct and register test.
Test for Clause Boolean operation
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Gecode::BoolOpType op
Boolean operation type for test.
int check(int x0, Gecode::BoolOpType op, int x1)
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Gecode::BoolOpType op
Boolean operation type for test.
IntConLevel
Consistency levels for integer propagators.
BinConstXX(Gecode::BoolOpType op0, int c0)
Construct and register test.
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Test for binary Boolean operation with shared variables
Test for binary Boolean operation with shared variables
static Gecode::Support::RandomGenerator rand
Random number generator.
Test for Nary Boolean operation with constant
BoolOpType
Operation types for Booleans.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Nary(Gecode::BoolOpType op0, int n)
Construct and register test.
BinXYX(Gecode::BoolOpType op0)
Construct and register test.
Test for Clause Boolean operation
virtual bool solution(const Assignment &x) const
Check whether x is solution.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Test for binary Boolean operation with constant
Test for Nary Boolean operation
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Create(void)
Perform creation and registration.
Gecode::BoolOpType op
Boolean operation type for test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
NaryShared(Gecode::BoolOpType op0, int n)
Construct and register test.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
NaryConst(Gecode::BoolOpType op0, int n, int c0)
Construct and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Gecode::BoolOpType op
Boolean operation type for test.
void clause(Home home, BoolOpType o, const BoolVarArgs &x, const BoolVarArgs &y, BoolVar z, IntConLevel)
Post domain consistent propagator for Boolean clause with positive variables x and negative variables...
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
static std::string str(Gecode::ExtensionalPropKind epk)
Map extensional propagation kind to string.
ITE(Gecode::IntConLevel icl)
Construct and register test.
ITE itebnd(Gecode::ICL_BND)
ClauseConst(Gecode::BoolOpType op0, int n, int c0)
Construct and register test.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Gecode::IntConLevel icl
Consistency level.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Test for binary Boolean operation with shared variables
Gecode::BoolOpType op
Boolean operation type for test.
BinXYZ(Gecode::BoolOpType op0)
Construct and register test.
Test for if-the-else-constraint
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Gecode::BoolOpType op
Boolean operation type for test.
BinXYY(Gecode::BoolOpType op0)
Construct and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Test for Nary Boolean operation
ITE itedom(Gecode::ICL_DOM)
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
void ite(Home home, BoolVar b, IntVar x, IntVar y, IntVar z, IntConLevel icl)
Post propagator for if-then-else constraint.
Passing Boolean variables.
Gecode::BoolOpType op
Boolean operation type for test.
Gecode::BoolOpType op
Boolean operation type for test.
Boolean integer variables.
bool testfix
Whether to perform fixpoint test.
Gecode::BoolOpType op
Boolean operation type for test.
BinXXY(Gecode::BoolOpType op0)
Construct and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Test for Clause Boolean operation
Node * x
Pointer to corresponding Boolean expression node.
ClauseXYZ(Gecode::BoolOpType op0, int n)
Construct and register test.
Base class for assignments
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
Help class to create and register tests.
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 void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
BinXXX(Gecode::BoolOpType op0)
Construct and register test.
Bounds propagation or consistency.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Test for binary Boolean operation with shared variables and constant
Iterator for Boolean operation types.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
virtual bool solution(const Assignment &x) const
Check whether x is solution.
ClauseXXY(Gecode::BoolOpType op0, int n)
Construct and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
ClauseXXYYX(Gecode::BoolOpType op0, int n)
Construct and register test.
Gecode::BoolOpType op
Boolean operation type for test.
void rel(Home home, BoolOpType o, const BoolVarArgs &x, int n, IntConLevel)
Post domain consistent propagator for Boolean operation on x.
Gecode::BoolOpType op
Boolean operation type for test.
Gecode::BoolOpType op
Boolean operation type for test.
int size(void) const
Return size of array (number of elements)
#define GECODE_NEVER
Assert that this command is never executed.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
int size(void) const
Return number of variables.
Gecode::BoolOpType op
Boolean operation type for test.
Domain propagation or consistency.