00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __GECODE_INT_BOOL_HH__
00025 #define __GECODE_INT_BOOL_HH__
00026
00027 #include "gecode/int.hh"
00028
00034 namespace Gecode { namespace Int { namespace Bool {
00035
00036
00037
00038
00039
00040
00042 template<class BVA, class BVB>
00043 class BoolBinary : public Propagator {
00044 protected:
00045 BVA x0;
00046 BVB x1;
00047
00048 BoolBinary(Space* home, BVA b0, BVB b1);
00050 BoolBinary(Space* home, bool share, BoolBinary& p);
00052 BoolBinary(Space* home, bool share, Propagator& p,
00053 BVA b0, BVB b1);
00054 public:
00056 virtual PropCost cost(void) const;
00058 virtual size_t dispose(Space* home);
00059 };
00060
00062 template<class BVA, class BVB, class BVC>
00063 class BoolTernary : public Propagator {
00064 protected:
00065 BVA x0;
00066 BVB x1;
00067 BVC x2;
00068
00069 BoolTernary(Space* home, BVA b0, BVB b1, BVC b2);
00071 BoolTernary(Space* home, bool share, BoolTernary& p);
00072 public:
00074 BoolTernary(Space* home, bool share, Propagator& p,
00075 BVA b0, BVB b1, BVC b2);
00077 virtual PropCost cost(void) const;
00079 virtual size_t dispose(Space* home);
00080 };
00081
00088 template<class BVA, class BVB>
00089 class Eq : public BoolBinary<BVA,BVB> {
00090 protected:
00091 using BoolBinary<BVA,BVB>::x0;
00092 using BoolBinary<BVA,BVB>::x1;
00094 Eq(Space* home, BVA b0, BVB b1);
00096 Eq(Space* home, bool share, Eq& p);
00097 public:
00099 Eq(Space* home, bool share, Propagator& p,
00100 BVA b0, BVB b1);
00102 virtual Actor* copy(Space* home, bool share);
00104 virtual ExecStatus propagate(Space* home);
00106 static ExecStatus post(Space* home, BVA b0, BVB b1);
00107 };
00108
00109
00116 template<class BVA, class BVB, class BVC>
00117 class And : public BoolTernary<BVA,BVB,BVC> {
00118 protected:
00119 using BoolTernary<BVA,BVB,BVC>::x0;
00120 using BoolTernary<BVA,BVB,BVC>::x1;
00121 using BoolTernary<BVA,BVB,BVC>::x2;
00123 And(Space* home, BVA b0, BVB b1, BVC b2);
00125 And(Space* home, bool share, And& p);
00126 public:
00128 And(Space* home, bool share, Propagator& p,
00129 BVA b0, BVB b1, BVC b2);
00131 virtual Actor* copy(Space* home, bool share);
00133 virtual ExecStatus propagate(Space* home);
00135 static ExecStatus post(Space* home, BVA b0, BVB b1, BVC b2);
00136 };
00137
00144 template<class View>
00145 class NaryAnd : public NaryOnePropagator<View,PC_INT_VAL> {
00146 protected:
00147 using NaryOnePropagator<View,PC_INT_VAL>::x;
00148 using NaryOnePropagator<View,PC_INT_VAL>::y;
00150 NaryAnd(Space* home, ViewArray<View>& b, View c);
00152 NaryAnd(Space* home, bool share, NaryAnd<View>& p);
00153 public:
00155 virtual Actor* copy(Space* home, bool share);
00157 virtual ExecStatus propagate(Space* home);
00159 static ExecStatus post(Space* home, ViewArray<View>& b, View c);
00160 };
00161
00162
00169 template<class BVA, class BVB, class BVC>
00170 class Eqv : public BoolTernary<BVA,BVB,BVC> {
00171 protected:
00172 using BoolTernary<BVA,BVB,BVC>::x0;
00173 using BoolTernary<BVA,BVB,BVC>::x1;
00174 using BoolTernary<BVA,BVB,BVC>::x2;
00176 Eqv(Space* home, bool share, Eqv& p);
00178 Eqv(Space* home, BVA b0 ,BVB b1, BVC b2);
00179 public:
00181 virtual Actor* copy(Space* home, bool share);
00183 virtual ExecStatus propagate(Space* home);
00185 static ExecStatus post(Space* home, BVA b0, BVB b1, BVC b2);
00186 };
00187
00188 }}}
00189
00190 #include "gecode/int/bool/base.icc"
00191 #include "gecode/int/bool/eq.icc"
00192 #include "gecode/int/bool/and.icc"
00193 #include "gecode/int/bool/eqv.icc"
00194
00195 #endif
00196
00197
00198