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 "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);
00051 public:
00053 virtual PropCost cost(void) const;
00055 virtual ~BoolBinary(void);
00056 };
00057
00059 template<class BVA, class BVB, class BVC>
00060 class BoolTernary : public Propagator {
00061 protected:
00062 BVA x0;
00063 BVB x1;
00064 BVC x2;
00065
00066 BoolTernary(Space* home, BVA b0, BVB b1, BVC b2);
00068 BoolTernary(Space* home, bool share, BoolTernary& p);
00069 public:
00071 virtual PropCost cost(void) const;
00073 virtual ~BoolTernary(void);
00074 };
00075
00082 template<class BVA, class BVB>
00083 class Eq : public BoolBinary<BVA,BVB> {
00084 protected:
00085 using BoolBinary<BVA,BVB>::x0;
00086 using BoolBinary<BVA,BVB>::x1;
00088 Eq(Space* home, BVA b0, BVB b1);
00090 Eq(Space* home, bool share, Eq& p);
00091 public:
00093 virtual Actor* copy(Space* home, bool share);
00095 virtual ExecStatus propagate(Space* home);
00097 static ExecStatus post(Space* home, BVA b0, BVB b1);
00098 };
00099
00100
00107 template<class BVA, class BVB, class BVC>
00108 class And : public BoolTernary<BVA,BVB,BVC> {
00109 protected:
00110 using BoolTernary<BVA,BVB,BVC>::x0;
00111 using BoolTernary<BVA,BVB,BVC>::x1;
00112 using BoolTernary<BVA,BVB,BVC>::x2;
00114 And(Space* home, BVA b0, BVB b1, BVC b2);
00116 And(Space* home, bool share, And& p);
00117 public:
00119 virtual Actor* copy(Space* home, bool share);
00121 virtual ExecStatus propagate(Space* home);
00123 static ExecStatus post(Space* home, BVA b0, BVB b1, BVC b2);
00124 };
00125
00132 template<class View>
00133 class NaryAnd : public NaryOnePropagator<View,PC_INT_VAL> {
00134 protected:
00135 using NaryOnePropagator<View,PC_INT_VAL>::x;
00136 using NaryOnePropagator<View,PC_INT_VAL>::y;
00138 NaryAnd(Space* home, ViewArray<View>& b, View c);
00140 NaryAnd(Space* home, bool share, NaryAnd<View>& p);
00141 public:
00143 virtual Actor* copy(Space* home, bool share);
00145 virtual ExecStatus propagate(Space* home);
00147 static ExecStatus post(Space* home, ViewArray<View>& b, View c);
00148 };
00149
00150
00157 template<class BVA, class BVB, class BVC>
00158 class Eqv : public BoolTernary<BVA,BVB,BVC> {
00159 protected:
00160 using BoolTernary<BVA,BVB,BVC>::x0;
00161 using BoolTernary<BVA,BVB,BVC>::x1;
00162 using BoolTernary<BVA,BVB,BVC>::x2;
00164 Eqv(Space* home, bool share, Eqv& p);
00166 Eqv(Space* home, BVA b0 ,BVB b1, BVC b2);
00167 public:
00169 virtual Actor* copy(Space* home, bool share);
00171 virtual ExecStatus propagate(Space* home);
00173 static ExecStatus post(Space* home, BVA b0, BVB b1, BVC b2);
00174 };
00175
00176 }}}
00177
00178 #include "int/bool/base.icc"
00179 #include "int/bool/eq.icc"
00180 #include "int/bool/and.icc"
00181 #include "int/bool/eqv.icc"
00182
00183 #endif
00184
00185
00186