00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef __GECODE_SET_REL_HH__
00045 #define __GECODE_SET_REL_HH__
00046
00047 #include "gecode/set.hh"
00048
00049 namespace Gecode { namespace Set { namespace Rel {
00050
00063 template <class View0, class View1>
00064 class SubSet :
00065 public MixBinaryPropagator<View0,PC_SET_CGLB,View1,PC_SET_CLUB> {
00066 protected:
00067 using MixBinaryPropagator<View0,PC_SET_CGLB,View1,PC_SET_CLUB>::x0;
00068 using MixBinaryPropagator<View0,PC_SET_CGLB,View1,PC_SET_CLUB>::x1;
00070 SubSet(Space* home, bool share,SubSet& p);
00072 SubSet(Space* home,View0, View1);
00073 public:
00075 virtual Actor* copy(Space* home,bool);
00077 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00079 static ExecStatus post(Space* home,View0 x,View1 y);
00081 virtual Reflection::ActorSpec spec(const Space* home,
00082 Reflection::VarMap& m) const;
00084 static void post(Space* home, Reflection::VarMap& vars,
00085 const Reflection::ActorSpec& spec);
00087 static Support::Symbol ati(void);
00088 };
00089
00097 template <class View0, class View1>
00098 class NoSubSet :
00099 public MixBinaryPropagator<View0,PC_SET_CLUB,View1,PC_SET_CGLB> {
00100 protected:
00101 using MixBinaryPropagator<View0,PC_SET_CLUB,View1,PC_SET_CGLB>::x0;
00102 using MixBinaryPropagator<View0,PC_SET_CLUB,View1,PC_SET_CGLB>::x1;
00104 NoSubSet(Space* home, bool share,NoSubSet& p);
00106 NoSubSet(Space* home,View0,View1);
00107 public:
00109 virtual Actor* copy(Space* home,bool);
00111 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00113 static ExecStatus post(Space* home,View0 x,View1 y);
00115 virtual Reflection::ActorSpec spec(const Space* home,
00116 Reflection::VarMap& m) const;
00118 static void post(Space* home, Reflection::VarMap& vars,
00119 const Reflection::ActorSpec& spec);
00121 static Support::Symbol ati(void);
00122 };
00123
00130 template <class View0, class View1>
00131 class ReSubset :
00132 public Propagator {
00133 protected:
00134 View0 x0;
00135 View1 x1;
00136 Gecode::Int::BoolView b;
00137
00139 ReSubset(Space* home, bool share,ReSubset&);
00141 ReSubset(Space* home,View0, View1, Gecode::Int::BoolView);
00142 public:
00144 virtual Actor* copy(Space* home,bool);
00146 virtual PropCost cost(ModEventDelta med) const;
00148 virtual size_t dispose(Space* home);
00150 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00152 static ExecStatus post(Space* home,View0 x, View1 y,
00153 Gecode::Int::BoolView b);
00155 virtual Reflection::ActorSpec spec(const Space* home,
00156 Reflection::VarMap& m) const;
00158 static void post(Space* home, Reflection::VarMap& vars,
00159 const Reflection::ActorSpec& spec);
00161 static Support::Symbol ati(void);
00162 };
00163
00171 template <class View0, class View1>
00172 class Eq :
00173 public MixBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY> {
00174 protected:
00175 using MixBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x0;
00176 using MixBinaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x1;
00178 Eq(Space* home, bool share,Eq& p);
00180 Eq(Space* home,View0, View1);
00181 public:
00183 virtual Actor* copy(Space* home,bool);
00185 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00187 static ExecStatus post(Space* home,View0,View1);
00189 virtual Reflection::ActorSpec spec(const Space* home,
00190 Reflection::VarMap& m) const;
00192 static void post(Space* home, Reflection::VarMap& vars,
00193 const Reflection::ActorSpec& spec);
00195 static Support::Symbol ati(void);
00196 };
00197
00204 template <class View0, class View1>
00205 class ReEq :
00206 public Propagator {
00207 protected:
00208 View0 x0;
00209 View1 x1;
00210 Gecode::Int::BoolView b;
00211
00213 ReEq(Space* home, bool share,ReEq&);
00215 ReEq(Space* home,View0, View1, Gecode::Int::BoolView);
00216 public:
00218 virtual Actor* copy(Space* home,bool);
00220 virtual PropCost cost(ModEventDelta med) const;
00222 virtual size_t dispose(Space* home);
00224 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00226 static ExecStatus post(Space* home,View0 x, View1 y,
00227 Gecode::Int::BoolView b);
00229 virtual Reflection::ActorSpec spec(const Space* home,
00230 Reflection::VarMap& m) const;
00232 static void post(Space* home, Reflection::VarMap& vars,
00233 const Reflection::ActorSpec& spec);
00235 static Support::Symbol ati(void);
00236 };
00237
00245 template <class View0, class View1>
00246 class Distinct :
00247 public MixBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL> {
00248 protected:
00249 using MixBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL>::x0;
00250 using MixBinaryPropagator<View0,PC_SET_VAL,View1,PC_SET_VAL>::x1;
00252 Distinct(Space* home, bool share,Distinct& p);
00254 Distinct(Space* home,View0,View1);
00255 public:
00257 virtual Actor* copy(Space* home,bool);
00259 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00261 static ExecStatus post(Space* home,View0,View1);
00263 virtual Reflection::ActorSpec spec(const Space* home,
00264 Reflection::VarMap& m) const;
00266 static void post(Space* home, Reflection::VarMap& vars,
00267 const Reflection::ActorSpec& spec);
00269 static Support::Symbol ati(void);
00270 };
00271
00282 template <class View0>
00283 class DistinctDoit : public UnaryPropagator<View0,PC_SET_ANY> {
00284 protected:
00285 using UnaryPropagator<View0,PC_SET_ANY>::x0;
00287 ConstantView y;
00289 DistinctDoit(Space* home, bool share,DistinctDoit&);
00291 DistinctDoit(Space* home, View0, ConstantView);
00292 public:
00294 virtual Actor* copy(Space* home, bool);
00296 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00298 static ExecStatus post(Space* home, View0, ConstantView);
00300 virtual Reflection::ActorSpec spec(const Space* home,
00301 Reflection::VarMap& m) const;
00303 static void post(Space* home, Reflection::VarMap& vars,
00304 const Reflection::ActorSpec& spec);
00306 static Support::Symbol ati(void);
00307 };
00308
00309 }}}
00310
00311 #include "gecode/set/rel/common.icc"
00312 #include "gecode/set/rel/subset.icc"
00313 #include "gecode/set/rel/nosubset.icc"
00314 #include "gecode/set/rel/re-subset.icc"
00315 #include "gecode/set/rel/eq.icc"
00316 #include "gecode/set/rel/re-eq.icc"
00317 #include "gecode/set/rel/nq.icc"
00318
00319 #endif
00320
00321