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_RELOP_HH__
00045 #define __GECODE_SET_RELOP_HH__
00046
00047 #include "gecode/set.hh"
00048 #include "gecode/set/rel.hh"
00049
00050 namespace Gecode { namespace Set { namespace RelOp {
00051
00064 template <class View0, class View1, class View2>
00065 class SuperOfInter :
00066 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00067 View2,PC_SET_CLUB> {
00068 protected:
00069 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00070 View2,PC_SET_CLUB>::x0;
00071 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00072 View2,PC_SET_CLUB>::x1;
00073 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00074 View2,PC_SET_CLUB>::x2;
00076 SuperOfInter(Space* home, bool share,SuperOfInter& p);
00078 SuperOfInter(Space* home,View0, View1, View2);
00079 public:
00081 virtual Actor* copy(Space* home,bool);
00083 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00085 static ExecStatus post(Space* home, View0 x, View1 y, View2 z);
00087 virtual Reflection::ActorSpec spec(const Space* home,
00088 Reflection::VarMap& m) const;
00090 static void post(Space* home, Reflection::VarMap& vars,
00091 const Reflection::ActorSpec& spec);
00093 static Support::Symbol ati(void);
00094 };
00095
00102 template <class View0, class View1, class View2>
00103 class SubOfUnion :
00104 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00105 View2,PC_SET_ANY> {
00106 protected:
00107 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00108 View2,PC_SET_ANY>::x0;
00109 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00110 View2,PC_SET_ANY>::x1;
00111 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00112 View2,PC_SET_ANY>::x2;
00114 SubOfUnion(Space* home, bool share,SubOfUnion& p);
00116 SubOfUnion(Space* home,View0, View1, View2);
00117 public:
00119 virtual Actor* copy(Space* home,bool);
00121 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00123 static ExecStatus post(Space* home,View0 x,View1 y,View2 z);
00125 virtual Reflection::ActorSpec spec(const Space* home,
00126 Reflection::VarMap& m) const;
00128 static void post(Space* home, Reflection::VarMap& vars,
00129 const Reflection::ActorSpec& spec);
00131 static Support::Symbol ati(void);
00132 };
00133
00134
00141 template <class View0, class View1, class View2>
00142 class Intersection:
00143 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00144 View2,PC_SET_ANY> {
00145 protected:
00146 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00147 View2,PC_SET_ANY>::x0;
00148 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00149 View2,PC_SET_ANY>::x1;
00150 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00151 View2,PC_SET_ANY>::x2;
00153 Intersection(Space* home, bool share,Intersection& p);
00155 Intersection(Space* home,View0,View1,View2);
00156 public:
00158 virtual Actor* copy(Space* home,bool);
00160 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00162 static ExecStatus post(Space* home,View0 x,View1 y,View2 z);
00164 virtual Reflection::ActorSpec spec(const Space* home,
00165 Reflection::VarMap& m) const;
00167 static void post(Space* home, Reflection::VarMap& vars,
00168 const Reflection::ActorSpec& spec);
00170 static Support::Symbol ati(void);
00171 };
00172
00179 template <class View0, class View1, class View2>
00180 class Union:
00181 public MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00182 View2,PC_SET_ANY> {
00183 protected:
00184 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00185 View2,PC_SET_ANY>::x0;
00186 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00187 View2,PC_SET_ANY>::x1;
00188 using MixTernaryPropagator<View0,PC_SET_ANY,View1,PC_SET_ANY,
00189 View2,PC_SET_ANY>::x2;
00191 Union(Space* home, bool share,Union& p);
00193 Union(Space* home,View0,View1,View2);
00194 public:
00196 virtual Actor* copy(Space* home,bool);
00198 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00200 static ExecStatus post(Space* home,View0 x,View1 y,View2 z);
00202 virtual Reflection::ActorSpec spec(const Space* home,
00203 Reflection::VarMap& m) const;
00205 static void post(Space* home, Reflection::VarMap& vars,
00206 const Reflection::ActorSpec& spec);
00208 static Support::Symbol ati(void);
00209 };
00210
00217 template <class View0, class View1>
00218 class IntersectionN : public MixNaryOnePropagator<View0,PC_SET_ANY,
00219 View1,PC_SET_ANY> {
00220 protected:
00221 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00222 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00224 bool shared;
00226 LUBndSet intOfDets;
00228 IntersectionN(Space* home, bool share,IntersectionN& p);
00230 IntersectionN(Space* home,ViewArray<View0>&, View1);
00232 IntersectionN(Space* home,ViewArray<View0>&, const IntSet&, View1);
00233 public:
00234 virtual PropCost cost(ModEventDelta med) const;
00236 virtual Actor* copy(Space* home,bool);
00238 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00240 static ExecStatus post(Space* home,ViewArray<View0>& y,View1 x);
00242 static ExecStatus post(Space* home,ViewArray<View0>& y,
00243 const IntSet& z,View1 x);
00245 virtual Reflection::ActorSpec spec(const Space* home,
00246 Reflection::VarMap& m) const;
00248 static void post(Space* home, Reflection::VarMap& vars,
00249 const Reflection::ActorSpec& spec);
00251 static Support::Symbol ati(void);
00252 };
00253
00260 template <class View0, class View1>
00261 class UnionN : public MixNaryOnePropagator<View0,PC_SET_ANY,
00262 View1,PC_SET_ANY> {
00263 protected:
00264 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00265 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00267 bool shared;
00269 GLBndSet unionOfDets;
00271 UnionN(Space* home, bool share,UnionN& p);
00273 UnionN(Space* home,ViewArray<View0>&,View1);
00275 UnionN(Space* home,ViewArray<View0>&,const IntSet&,View1);
00276 public:
00278 virtual Actor* copy(Space* home, bool);
00280 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00281 virtual PropCost cost(ModEventDelta med) const;
00283 static ExecStatus post(Space* home,ViewArray<View0>& y,View1 x);
00285 static ExecStatus post(Space* home,ViewArray<View0>& y,
00286 const IntSet& z,View1 x);
00288 virtual Reflection::ActorSpec spec(const Space* home,
00289 Reflection::VarMap& m) const;
00291 static void post(Space* home, Reflection::VarMap& vars,
00292 const Reflection::ActorSpec& spec);
00294 static Support::Symbol ati(void);
00295 };
00296
00297
00304 template <class View0, class View1>
00305 class PartitionN : public MixNaryOnePropagator<View0,PC_SET_ANY,
00306 View1,PC_SET_ANY> {
00307 protected:
00308 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::x;
00309 using MixNaryOnePropagator<View0,PC_SET_ANY,View1,PC_SET_ANY>::y;
00311 bool shared;
00313 GLBndSet unionOfDets;
00315 PartitionN(Space* home, bool share,PartitionN& p);
00317 PartitionN(Space* home,ViewArray<View0>&, View1);
00319 PartitionN(Space* home,ViewArray<View0>&, const IntSet&, View1);
00320 public:
00322 virtual Actor* copy(Space* home,bool);
00324 virtual ExecStatus propagate(Space* home, ModEventDelta med);
00325 virtual PropCost cost(ModEventDelta med) const;
00327 static ExecStatus post(Space* home,ViewArray<View0>& y,View1 x);
00329 static ExecStatus post(Space* home,ViewArray<View0>& y,
00330 const IntSet& z,View1 x);
00332 virtual Reflection::ActorSpec spec(const Space* home,
00333 Reflection::VarMap& m) const;
00335 static void post(Space* home, Reflection::VarMap& vars,
00336 const Reflection::ActorSpec& spec);
00338 static Support::Symbol ati(void);
00339 };
00340
00341 }}}
00342
00343 #include "gecode/set/rel-op/common.icc"
00344 #include "gecode/set/rel-op/superofinter.icc"
00345 #include "gecode/set/rel-op/subofunion.icc"
00346 #include "gecode/set/rel-op/inter.icc"
00347 #include "gecode/set/rel-op/union.icc"
00348 #include "gecode/set/rel-op/partition.icc"
00349 #include "gecode/set/rel-op/post.icc"
00350
00351 #endif
00352
00353