bool.cpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 2005
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include "test/int.hh"
#include <gecode/minimodel.hh>
namespace Test { namespace Int {
namespace Bool {
inline int
check(int x0, Gecode::BoolOpType op, int x1) {
switch (op) {
case Gecode::BOT_AND: return x0 & x1;
case Gecode::BOT_OR: return x0 | x1;
case Gecode::BOT_IMP: return (!x0) | x1;
case Gecode::BOT_EQV: return x0 == x1;
case Gecode::BOT_XOR: return x0 != x1;
default: GECODE_NEVER;
}
GECODE_NEVER;
return 0;
}
class BinXYZ : public Test {
protected:
Gecode::BoolOpType op;
public:
BinXYZ(Gecode::BoolOpType op0)
: Test("Bool::Bin::XYZ::"+str(op0),3,0,1), op(op0) {}
virtual bool solution(const Assignment& x) const {
return check(x[0],op,x[1]) == x[2];
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
rel(home,
channel(home,x[0]), op, channel(home,x[1]),
channel(home,x[2]));
}
};
class BinXXY : public Test {
protected:
Gecode::BoolOpType op;
public:
BinXXY(Gecode::BoolOpType op0)
: Test("Bool::Bin::XXY::"+str(op0),2,0,1), op(op0) {}
virtual bool solution(const Assignment& x) const {
return check(x[0],op,x[0]) == x[1];
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
BoolVar b = channel(home,x[0]);
rel(home, b, op, b, channel(home,x[1]));
}
};
class BinXYX : public Test {
protected:
Gecode::BoolOpType op;
public:
BinXYX(Gecode::BoolOpType op0)
: Test("Bool::Bin::XYX::"+str(op0),2,0,1), op(op0) {}
virtual bool solution(const Assignment& x) const {
return check(x[0],op,x[1]) == x[0];
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
BoolVar b = channel(home,x[0]);
rel(home, b, op, channel(home,x[1]), b);
}
};
class BinXYY : public Test {
protected:
Gecode::BoolOpType op;
public:
BinXYY(Gecode::BoolOpType op0)
: Test("Bool::Bin::XYY::"+str(op0),2,0,1), op(op0) {}
virtual bool solution(const Assignment& x) const {
return check(x[0],op,x[1]) == x[1];
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
BoolVar b = channel(home,x[1]);
rel(home, channel(home,x[0]), op, b, b);
}
};
class BinXXX : public Test {
protected:
Gecode::BoolOpType op;
public:
BinXXX(Gecode::BoolOpType op0)
: Test("Bool::Bin::XXX::"+str(op0),1,0,1), op(op0) {}
virtual bool solution(const Assignment& x) const {
return check(x[0],op,x[0]) == x[0];
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
BoolVar b = channel(home,x[0]);
rel(home, b, op, b, b);
}
};
class BinConstXY : public Test {
protected:
Gecode::BoolOpType op;
int c;
public:
BinConstXY(Gecode::BoolOpType op0, int c0)
: Test("Bool::Bin::XY::"+str(op0)+"::"+str(c0),2,0,1),
op(op0), c(c0) {}
virtual bool solution(const Assignment& x) const {
return check(x[0],op,x[1]) == c;
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
rel(home, channel(home,x[0]), op, channel(home,x[1]), c);
}
};
class BinConstXX : public Test {
protected:
Gecode::BoolOpType op;
int c;
public:
BinConstXX(Gecode::BoolOpType op0, int c0)
: Test("Bool::Bin::XX::"+str(op0)+"::"+str(c0),1,0,1),
op(op0), c(c0) {}
virtual bool solution(const Assignment& x) const {
return check(x[0],op,x[0]) == c;
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
BoolVar b = channel(home,x[0]);
rel(home, b, op, b, c);
}
};
class Nary : public Test {
protected:
Gecode::BoolOpType op;
public:
Nary(Gecode::BoolOpType op0, int n)
: Test("Bool::Nary::"+str(op0)+"::"+str(n),n+1,0,1), op(op0) {}
virtual bool solution(const Assignment& x) const {
int n = x.size()-1;
int b = check(x[n-2],op,x[n-1]);
for (int i=0; i<n-2; i++)
b = check(x[i],op,b);
return b == x[n];
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
BoolVarArgs b(x.size()-1);
for (int i=x.size()-1; i--; )
b[i]=channel(home,x[i]);
rel(home, op, b, channel(home,x[x.size()-1]));
}
};
class NaryShared : public Test {
protected:
Gecode::BoolOpType op;
public:
NaryShared(Gecode::BoolOpType op0, int n)
: Test("Bool::Nary::Shared::"+str(op0)+"::"+str(n),n,0,1),
op(op0) {
if ((op == Gecode::BOT_EQV) || (op == Gecode::BOT_XOR))
testfix = false;
}
virtual bool solution(const Assignment& x) const {
int n = x.size();
int b = check(x[n-2],op,x[n-1]);
for (int i=0; i<n-2; i++)
b = check(x[i],op,b);
return b == x[n-1];
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
BoolVarArgs b(x.size());
for (int i=x.size(); i--; )
b[i]=channel(home,x[i]);
rel(home, op, b, b[x.size()-1]);
}
};
class NaryConst : public Test {
protected:
Gecode::BoolOpType op;
int c;
public:
NaryConst(Gecode::BoolOpType op0, int n, int c0)
: Test("Bool::Nary::"+str(op0)+"::"+str(n)+"::"+str(c0),n,0,1),
op(op0), c(c0) {}
virtual bool solution(const Assignment& x) const {
int n = x.size();
int b = check(x[n-2],op,x[n-1]);
for (int i=0; i<n-2; i++)
b = check(x[i],op,b);
return b == c;
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
BoolVarArgs b(x.size());
for (int i=x.size(); i--; )
b[i]=channel(home,x[i]);
rel(home, op, b, c);
}
};
class ClauseXYZ : public Test {
protected:
Gecode::BoolOpType op;
public:
ClauseXYZ(Gecode::BoolOpType op0, int n)
: Test("Bool::Clause::XYZ::"+str(op0)+"::"+str(n),n+1,0,1), op(op0) {}
virtual bool solution(const Assignment& x) const {
int n = (x.size()-1) / 2;
int b;
if (n == 1) {
b = check(x[0],op,!x[1]);
} else {
b = check(x[0],op,!x[n]);
for (int i=1; i<n; i++)
b = check(b,op,check(x[i],op,!x[n+i]));
}
return b == x[x.size()-1];
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
int n = (x.size()-1) / 2;
BoolVarArgs a(n), b(n);
for (int i=n; i--; ) {
a[i]=channel(home,x[i]);
b[i]=channel(home,x[i+n]);
}
clause(home, op, a, b, channel(home,x[x.size()-1]));
}
};
class ClauseXXYYX : public Test {
protected:
Gecode::BoolOpType op;
public:
ClauseXXYYX(Gecode::BoolOpType op0, int n)
: Test("Bool::Clause::XXYYX::"+str(op0)+"::"+str(n),n,0,1),
op(op0) {}
virtual bool solution(const Assignment& x) const {
int n = x.size() / 2;
int b;
if (n == 1) {
b = check(x[0],op,!x[1]);
} else {
b = check(x[0],op,!x[n]);
for (int i=1; i<n; i++)
b = check(b,op,check(x[i],op,!x[n+i]));
}
return b == x[0];
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
int n = x.size() / 2;
BoolVarArgs a(2*n), b(2*n);
for (int i=n; i--; ) {
a[i]=a[i+n]=channel(home,x[i]);
b[i]=b[i+n]=channel(home,x[i+n]);
}
clause(home, op, a, b, a[0]);
}
};
class ClauseXXY : public Test {
protected:
Gecode::BoolOpType op;
public:
ClauseXXY(Gecode::BoolOpType op0, int n)
: Test("Bool::Clause::XXY::"+str(op0)+"::"+str(n),n,0,1),
op(op0) {}
virtual bool solution(const Assignment& x) const {
return (x[0] == 1) == (op == Gecode::BOT_OR);
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
int n = x.size() / 2;
BoolVarArgs a(2*n), b(2*n);
for (int i=n; i--; ) {
a[i]=b[i+n]=channel(home,x[i]);
b[i]=a[i+n]=channel(home,x[i+n]);
}
clause(home, op, a, b, a[0]);
}
};
class ClauseConst : public Test {
protected:
Gecode::BoolOpType op;
int c;
public:
ClauseConst(Gecode::BoolOpType op0, int n, int c0)
: Test("Bool::Clause::"+str(op0)+"::"+str(n)+"::"+str(c0),n,0,1),
op(op0), c(c0) {}
virtual bool solution(const Assignment& x) const {
int n = x.size() / 2;
int b;
if (n == 1) {
b = check(x[0],op,!x[1]);
} else {
b = check(x[0],op,!x[n]);
for (int i=1; i<n; i++)
b = check(b,op,check(x[i],op,!x[n+i]));
}
return b == c;
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
int n = x.size() / 2;
BoolVarArgs a(n), b(n);
for (int i=n; i--; ) {
a[i]=channel(home,x[i]);
b[i]=channel(home,x[i+n]);
}
clause(home, op, a, b, c);
}
};
class ITEInt : public Test {
public:
ITEInt(Gecode::IntPropLevel ipl)
: Test("ITE::Int::"+str(ipl),4,-4,4,false,ipl) {}
virtual bool solution(const Assignment& x) const {
if ((x[0] < 0) || (x[0] > 1))
return false;
if (x[0] == 1)
return x[1] == x[3];
else
return x[2] == x[3];
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
if (Base::rand(2) != 0)
ite(home,channel(home,x[0]),x[1],x[2],x[3]);
else
rel(home, ite(channel(home,x[0]),x[1],x[2]) == x[3]);
}
};
class ITEBool : public Test {
public:
ITEBool(void)
: Test("ITE::Bool",4,0,1,false) {}
virtual bool solution(const Assignment& x) const {
if (x[0] == 1)
return x[1] == x[3];
else
return x[2] == x[3];
}
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
using namespace Gecode;
ite(home,channel(home,x[0]),channel(home,x[1]),
channel(home,x[2]),channel(home,x[3]));
}
};
class Create {
public:
Create(void) {
using namespace Gecode;
for (BoolOpTypes bots; bots(); ++bots) {
(void) new BinXYZ(bots.bot());
(void) new BinXXY(bots.bot());
(void) new BinXYX(bots.bot());
(void) new BinXYY(bots.bot());
(void) new BinXXX(bots.bot());
(void) new BinConstXY(bots.bot(),0);
(void) new BinConstXY(bots.bot(),1);
(void) new BinConstXX(bots.bot(),0);
(void) new BinConstXX(bots.bot(),1);
(void) new Nary(bots.bot(),2);
(void) new Nary(bots.bot(),6);
(void) new Nary(bots.bot(),10);
(void) new NaryShared(bots.bot(),2);
(void) new NaryShared(bots.bot(),6);
(void) new NaryShared(bots.bot(),10);
(void) new NaryConst(bots.bot(),2,0);
(void) new NaryConst(bots.bot(),6,0);
(void) new NaryConst(bots.bot(),10,0);
(void) new NaryConst(bots.bot(),2,1);
(void) new NaryConst(bots.bot(),6,1);
(void) new NaryConst(bots.bot(),10,1);
if ((bots.bot() == BOT_AND) || (bots.bot() == BOT_OR)) {
(void) new ClauseXYZ(bots.bot(),2);
(void) new ClauseXYZ(bots.bot(),6);
(void) new ClauseXYZ(bots.bot(),10);
(void) new ClauseXXYYX(bots.bot(),2);
(void) new ClauseXXYYX(bots.bot(),6);
(void) new ClauseXXYYX(bots.bot(),10);
(void) new ClauseXXY(bots.bot(),2);
(void) new ClauseXXY(bots.bot(),6);
(void) new ClauseXXY(bots.bot(),10);
(void) new ClauseConst(bots.bot(),2,0);
(void) new ClauseConst(bots.bot(),6,0);
(void) new ClauseConst(bots.bot(),10,0);
(void) new ClauseConst(bots.bot(),2,1);
(void) new ClauseConst(bots.bot(),6,1);
(void) new ClauseConst(bots.bot(),10,1);
}
}
}
};
Create c;
ITEInt itebnd(Gecode::IPL_BND);
ITEInt itedom(Gecode::IPL_DOM);
ITEBool itebool;
}
}}
// STATISTICS: test-int
Gecode::BoolVarArgs
Passing Boolean variables.
Definition int.hh:712
Gecode::BoolVar
Boolean integer variables.
Definition int.hh:512
Gecode::IntVarArray
Integer variable array.
Definition int.hh:763
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Gecode::VarArray::size
int size(void) const
Return size of array (number of elements).
Definition array.hpp:926
Test::Base::rand
static Gecode::Support::RandomGenerator rand
Random number generator.
Definition test.hh:134
Test::Int::Assignment
Base class for assignments
Definition int.hh:59
Test::Int::Assignment::size
int size(void) const
Return number of variables.
Definition int.hpp:46
Test::Int::BoolOpTypes
Iterator for Boolean operation types.
Definition int.hh:388
Test::Int::Bool::BinConstXX
Test for binary Boolean operation with shared variables and constant
Definition bool.cpp:192
Test::Int::Bool::BinConstXX::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:204
Test::Int::Bool::BinConstXX::c
int c
Integer constant.
Definition bool.cpp:197
Test::Int::Bool::BinConstXX::BinConstXX
BinConstXX(Gecode::BoolOpType op0, int c0)
Construct and register test.
Definition bool.cpp:200
Test::Int::Bool::BinConstXX::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:195
Test::Int::Bool::BinConstXX::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:208
Test::Int::Bool::BinConstXY
Test for binary Boolean operation with constant
Definition bool.cpp:169
Test::Int::Bool::BinConstXY::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:181
Test::Int::Bool::BinConstXY::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:185
Test::Int::Bool::BinConstXY::c
int c
Integer constant.
Definition bool.cpp:174
Test::Int::Bool::BinConstXY::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:172
Test::Int::Bool::BinConstXY::BinConstXY
BinConstXY(Gecode::BoolOpType op0, int c0)
Construct and register test.
Definition bool.cpp:177
Test::Int::Bool::BinXXX
Test for binary Boolean operation with shared variables
Definition bool.cpp:148
Test::Int::Bool::BinXXX::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:151
Test::Int::Bool::BinXXX::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:157
Test::Int::Bool::BinXXX::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:161
Test::Int::Bool::BinXXX::BinXXX
BinXXX(Gecode::BoolOpType op0)
Construct and register test.
Definition bool.cpp:154
Test::Int::Bool::BinXXY
Test for binary Boolean operation with shared variables
Definition bool.cpp:85
Test::Int::Bool::BinXXY::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:98
Test::Int::Bool::BinXXY::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:88
Test::Int::Bool::BinXXY::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:94
Test::Int::Bool::BinXXY::BinXXY
BinXXY(Gecode::BoolOpType op0)
Construct and register test.
Definition bool.cpp:91
Test::Int::Bool::BinXYX
Test for binary Boolean operation with shared variables
Definition bool.cpp:106
Test::Int::Bool::BinXYX::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:119
Test::Int::Bool::BinXYX::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:115
Test::Int::Bool::BinXYX::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:109
Test::Int::Bool::BinXYX::BinXYX
BinXYX(Gecode::BoolOpType op0)
Construct and register test.
Definition bool.cpp:112
Test::Int::Bool::BinXYY
Test for binary Boolean operation with shared variables
Definition bool.cpp:127
Test::Int::Bool::BinXYY::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:130
Test::Int::Bool::BinXYY::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:140
Test::Int::Bool::BinXYY::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:136
Test::Int::Bool::BinXYY::BinXYY
BinXYY(Gecode::BoolOpType op0)
Construct and register test.
Definition bool.cpp:133
Test::Int::Bool::BinXYZ
Test for binary Boolean operation
Definition bool.cpp:63
Test::Int::Bool::BinXYZ::BinXYZ
BinXYZ(Gecode::BoolOpType op0)
Construct and register test.
Definition bool.cpp:69
Test::Int::Bool::BinXYZ::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:66
Test::Int::Bool::BinXYZ::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:72
Test::Int::Bool::BinXYZ::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:76
Test::Int::Bool::ClauseConst
Test for Clause Boolean operation with constant
Definition bool.cpp:403
Test::Int::Bool::ClauseConst::ClauseConst
ClauseConst(Gecode::BoolOpType op0, int n, int c0)
Construct and register test.
Definition bool.cpp:411
Test::Int::Bool::ClauseConst::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:406
Test::Int::Bool::ClauseConst::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:415
Test::Int::Bool::ClauseConst::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:428
Test::Int::Bool::ClauseConst::c
int c
Integer constant.
Definition bool.cpp:408
Test::Int::Bool::ClauseXXYYX
Test for Clause Boolean operation
Definition bool.cpp:340
Test::Int::Bool::ClauseXXYYX::ClauseXXYYX
ClauseXXYYX(Gecode::BoolOpType op0, int n)
Construct and register test.
Definition bool.cpp:346
Test::Int::Bool::ClauseXXYYX::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:350
Test::Int::Bool::ClauseXXYYX::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:363
Test::Int::Bool::ClauseXXYYX::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:343
Test::Int::Bool::ClauseXXY
Test for Clause Boolean operation
Definition bool.cpp:376
Test::Int::Bool::ClauseXXY::ClauseXXY
ClauseXXY(Gecode::BoolOpType op0, int n)
Construct and register test.
Definition bool.cpp:382
Test::Int::Bool::ClauseXXY::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:390
Test::Int::Bool::ClauseXXY::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:379
Test::Int::Bool::ClauseXXY::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:386
Test::Int::Bool::ClauseXYZ
Test for Clause Boolean operation
Definition bool.cpp:305
Test::Int::Bool::ClauseXYZ::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:308
Test::Int::Bool::ClauseXYZ::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:314
Test::Int::Bool::ClauseXYZ::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:327
Test::Int::Bool::ClauseXYZ::ClauseXYZ
ClauseXYZ(Gecode::BoolOpType op0, int n)
Construct and register test.
Definition bool.cpp:311
Test::Int::Bool::Create
Help class to create and register tests.
Definition bool.cpp:487
Test::Int::Bool::Create::Create
Create(void)
Perform creation and registration.
Definition bool.cpp:490
Test::Int::Bool::ITEBool
Test for if-then-else-constraint
Definition bool.cpp:466
Test::Int::Bool::ITEBool::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:472
Test::Int::Bool::ITEBool::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:479
Test::Int::Bool::ITEBool::ITEBool
ITEBool(void)
Construct and register test.
Definition bool.cpp:469
Test::Int::Bool::ITEInt
Test for if-then-else-constraint
Definition bool.cpp:441
Test::Int::Bool::ITEInt::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:456
Test::Int::Bool::ITEInt::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:447
Test::Int::Bool::ITEInt::ITEInt
ITEInt(Gecode::IntPropLevel ipl)
Construct and register test.
Definition bool.cpp:444
Test::Int::Bool::NaryConst
Test for Nary Boolean operation with constant
Definition bool.cpp:274
Test::Int::Bool::NaryConst::c
int c
Integer constant.
Definition bool.cpp:279
Test::Int::Bool::NaryConst::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:277
Test::Int::Bool::NaryConst::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:286
Test::Int::Bool::NaryConst::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:294
Test::Int::Bool::NaryConst::NaryConst
NaryConst(Gecode::BoolOpType op0, int n, int c0)
Construct and register test.
Definition bool.cpp:282
Test::Int::Bool::NaryShared
Test for Nary Boolean operation
Definition bool.cpp:243
Test::Int::Bool::NaryShared::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:256
Test::Int::Bool::NaryShared::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:264
Test::Int::Bool::NaryShared::NaryShared
NaryShared(Gecode::BoolOpType op0, int n)
Construct and register test.
Definition bool.cpp:249
Test::Int::Bool::NaryShared::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:246
Test::Int::Bool::Nary
Test for Nary Boolean operation
Definition bool.cpp:216
Test::Int::Bool::Nary::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition bool.cpp:233
Test::Int::Bool::Nary::op
Gecode::BoolOpType op
Boolean operation type for test.
Definition bool.cpp:219
Test::Int::Bool::Nary::solution
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition bool.cpp:225
Test::Int::Bool::Nary::Nary
Nary(Gecode::BoolOpType op0, int n)
Construct and register test.
Definition bool.cpp:222
Test::Int::Test::testfix
bool testfix
Whether to perform fixpoint test.
Definition int.hh:240
Test::Int::Test::ipl
Gecode::IntPropLevel ipl
Propagation level.
Definition int.hh:234
Test::Int::Test::str
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
Definition int.hpp:209
Gecode::rel
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
Definition rel.cpp:68
Gecode::ite
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition bool.cpp:39
Gecode::clause
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...
Definition bool.cpp:955
Gecode::BoolOpType
BoolOpType
Operation types for Booleans.
Definition int.hh:950
Gecode::IntPropLevel
IntPropLevel
Propagation levels for integer propagators.
Definition int.hh:974
Gecode::BOT_OR
@ BOT_OR
Disjunction.
Definition int.hh:952
Gecode::BOT_EQV
@ BOT_EQV
Equivalence.
Definition int.hh:954
Gecode::BOT_IMP
@ BOT_IMP
Implication.
Definition int.hh:953
Gecode::BOT_XOR
@ BOT_XOR
Exclusive or.
Definition int.hh:955
Gecode::BOT_AND
@ BOT_AND
Conjunction.
Definition int.hh:951
Gecode::IPL_DOM
@ IPL_DOM
Domain propagation Options: basic versus advanced propagation.
Definition int.hh:979
Gecode::IPL_BND
@ IPL_BND
Bounds propagation.
Definition int.hh:978
minimodel.hh
Gecode
Gecode toplevel namespace
Gecode::channel
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition channel.cpp:41
Test::Int::Bool
Tests for Boolean constraints
Definition bool.cpp:41
Test::Int::Bool::c
Create c
Definition bool.cpp:535
Test::Int::Bool::check
int check(int x0, Gecode::BoolOpType op, int x1)
Definition bool.cpp:44
Test::Int::Bool::itebnd
ITEInt itebnd(Gecode::IPL_BND)
Test::Int::Bool::itedom
ITEInt itedom(Gecode::IPL_DOM)
Test::Int::Bool::itebool
ITEBool itebool
Definition bool.cpp:538
Test::Int
Testing finite domain integers.
Definition int.cpp:40
Test
General test support.
Definition afc.cpp:39
GECODE_NEVER
#define GECODE_NEVER
Assert that this command is never executed.
Definition macros.hpp:56
int.hh