3
* Christian Schulte <schulte@gecode.org>
6
* Christian Schulte, 2002
9
* $Date: 2005-10-27 18:45:00 +0200 (Thu, 27 Oct 2005) $ by $Author: schulte $
12
* This file is part of Gecode, the generic constraint
13
* development environment:
14
* http://www.gecode.org
16
* See the file "LICENSE" for information on usage and
17
* redistribution of this file, and for a
18
* DISCLAIMER OF ALL WARRANTIES.
22
#include "int/bool.hh"
29
bool_not(Space* home, BoolVar b0, BoolVar b1, IntConLevel) {
30
if (home->failed()) return;
32
if (Bool::Eq<BoolView,NegBoolView>::post(home,b0,n1) == ES_FAILED)
36
bool_eq(Space* home, BoolVar b0, BoolVar b1, IntConLevel) {
37
if (home->failed()) return;
38
if (Bool::Eq<BoolView,BoolView>::post(home,b0,b1) == ES_FAILED)
42
bool_and(Space* home, BoolVar b0, BoolVar b1, BoolVar b2, IntConLevel) {
43
if (home->failed()) return;
44
if (Bool::And<BoolView,BoolView,BoolView>::post(home,b0,b1,b2)
49
bool_or(Space* home, BoolVar b0, BoolVar b1, BoolVar b2, IntConLevel) {
50
if (home->failed()) return;
51
NegBoolView n0(b0); NegBoolView n1(b1); NegBoolView n2(b2);
52
if (Bool::And<NegBoolView,NegBoolView,NegBoolView>::post(home,n0,n1,n2)
57
bool_imp(Space* home, BoolVar b0, BoolVar b1, BoolVar b2, IntConLevel) {
58
if (home->failed()) return;
59
NegBoolView n1(b1); NegBoolView n2(b2);
60
if (Bool::And<BoolView,NegBoolView,NegBoolView>::post(home,b0,n1,n2)
65
bool_eqv(Space* home, BoolVar b0, BoolVar b1, BoolVar b2, IntConLevel) {
66
if (home->failed()) return;
67
if (Bool::Eqv<BoolView,BoolView,BoolView>::post(home,b0,b1,b2)
72
bool_xor(Space* home, BoolVar b0, BoolVar b1, BoolVar b2, IntConLevel) {
73
if (home->failed()) return;
75
if (Bool::Eqv<BoolView,BoolView,NegBoolView>::post(home,b0,b1,n2)
80
bool_and(Space* home, const BoolVarArgs& b, BoolVar c, IntConLevel) {
81
if (home->failed()) return;
82
ViewArray<BoolView> x(home,b);
83
GECODE_ES_FAIL(home,Bool::NaryAnd<BoolView>::post(home,x,c));
86
bool_or(Space* home, const BoolVarArgs& b, BoolVar c, IntConLevel) {
87
if (home->failed()) return;
88
ViewArray<NegBoolView> x(home,b.size());
89
for (int i=b.size(); i--; ) {
90
NegBoolView nb(b[i]); x[i]=nb;
93
GECODE_ES_FAIL(home,Bool::NaryAnd<NegBoolView>::post(home,x,nc));
99
// STATISTICS: int-post