Generated on Thu Mar 22 10:39:32 2012 for Gecode by doxygen 1.6.3

int.hh

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Christian Schulte <schulte@gecode.org>
00005  *     Guido Tack <tack@gecode.org>
00006  *
00007  *  Contributing authors:
00008  *     Mikael Lagerkvist <lagerkvist@gecode.org>
00009  *     David Rijsman <David.Rijsman@quintiq.com>
00010  *
00011  *  Copyright:
00012  *     David Rijsman, 2009
00013  *     Mikael Lagerkvist, 2006
00014  *     Christian Schulte, 2002
00015  *     Guido Tack, 2004
00016  *
00017  *  Last modified:
00018  *     $Date: 2012-02-22 06:04:20 +0100 (Wed, 22 Feb 2012) $ by $Author: tack $
00019  *     $Revision: 12537 $
00020  *
00021  *  This file is part of Gecode, the generic constraint
00022  *  development environment:
00023  *     http://www.gecode.org
00024  *
00025  *  Permission is hereby granted, free of charge, to any person obtaining
00026  *  a copy of this software and associated documentation files (the
00027  *  "Software"), to deal in the Software without restriction, including
00028  *  without limitation the rights to use, copy, modify, merge, publish,
00029  *  distribute, sublicense, and/or sell copies of the Software, and to
00030  *  permit persons to whom the Software is furnished to do so, subject to
00031  *  the following conditions:
00032  *
00033  *  The above copyright notice and this permission notice shall be
00034  *  included in all copies or substantial portions of the Software.
00035  *
00036  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00037  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00038  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00039  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00040  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00041  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00042  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00043  *
00044  */
00045 
00046 #ifndef __GECODE_INT_HH__
00047 #define __GECODE_INT_HH__
00048 
00049 #include <climits>
00050 #include <cfloat>
00051 #include <iostream>
00052 
00053 #include <vector>
00054 
00055 #include <gecode/kernel.hh>
00056 #include <gecode/iter.hh>
00057 
00058 /*
00059  * Configure linking
00060  *
00061  */
00062 #if !defined(GECODE_STATIC_LIBS) && \
00063     (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
00064 
00065 #ifdef GECODE_BUILD_INT
00066 #define GECODE_INT_EXPORT __declspec( dllexport )
00067 #else
00068 #define GECODE_INT_EXPORT __declspec( dllimport )
00069 #endif
00070 
00071 #else
00072 
00073 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
00074 #define GECODE_INT_EXPORT __attribute__ ((visibility("default")))
00075 #else
00076 #define GECODE_INT_EXPORT
00077 #endif
00078 
00079 #endif
00080 
00081 // Configure auto-linking
00082 #ifndef GECODE_BUILD_INT
00083 #define GECODE_LIBRARY_NAME "Int"
00084 #include <gecode/support/auto-link.hpp>
00085 #endif
00086 
00098 #include <gecode/int/exception.hpp>
00099 
00100 namespace Gecode { namespace Int {
00101 
00109   namespace Limits {
00111     const int max =  INT_MAX - 1;
00113     const int min = -max;
00115     const int infinity = max + 1;
00117     bool valid(int n);
00119     bool valid(double n);
00121     void check(int n, const char* l);
00123     void check(double n, const char* l);
00125     void positive(int n, const char* l);
00127     void positive(double n, const char* l);
00129     void nonnegative(int n, const char* l);
00131     void nonnegative(double n, const char* l);
00133     const double double_max = 9007199254740991.0;
00135     const double double_min = -9007199254740991.0;
00137     void double_check(double n, const char* l);
00139     const double double_infinity = DBL_MAX;
00140   }
00141 
00142 }}
00143 
00144 #include <gecode/int/limits.hpp>
00145 
00146 namespace Gecode {
00147 
00148   class IntSetRanges;
00149 
00150   template<class I> class IntSetInit;
00151   
00159   class IntSet : public SharedHandle {
00160     friend class IntSetRanges;
00161     template<class I> friend class IntSetInit;
00162   private:
00164     class Range {
00165     public:
00166       int min, max;
00167     };
00168     class IntSetObject : public SharedHandle::Object {
00169     public:
00171       unsigned int size;
00173       int n;
00175       Range* r;
00177       GECODE_INT_EXPORT static IntSetObject* allocate(int m);
00179       GECODE_INT_EXPORT SharedHandle::Object* copy(void) const;
00181       GECODE_INT_EXPORT bool in(int n) const;
00183       GECODE_INT_EXPORT virtual ~IntSetObject(void);
00184     };
00186     class MinInc;
00188     GECODE_INT_EXPORT void normalize(Range* r, int n);
00190     GECODE_INT_EXPORT void init(int n, int m);
00192     GECODE_INT_EXPORT void init(const int r[], int n);
00194     GECODE_INT_EXPORT void init(const int r[][2], int n);
00195   public:
00197 
00198 
00199     IntSet(void);
00204     IntSet(int n, int m);
00206     IntSet(const int r[],   int n);
00212     IntSet(const int r[][2], int n);
00214     template<class I>
00215     explicit IntSet(I& i);
00217 
00219 
00220 
00221     int ranges(void) const;
00223     int min(int i) const;
00225     int max(int i) const;
00227     unsigned int width(int i) const;
00229 
00231 
00232 
00233     bool in(int n) const;
00235     unsigned int size(void) const;
00237     unsigned int width(void) const;
00239     int min(void) const;
00241     int max(void) const;
00243 
00245 
00246 
00247     GECODE_INT_EXPORT static const IntSet empty;
00249   };
00250 
00256   class IntSetRanges {
00257   private:
00259     const IntSet::Range* i;
00261     const IntSet::Range* e;
00262   public:
00264 
00265 
00266     IntSetRanges(void);
00268     IntSetRanges(const IntSet& s);
00270     void init(const IntSet& s);
00272 
00274 
00275 
00276     bool operator ()(void) const;
00278     void operator ++(void);
00280 
00282 
00283 
00284     int min(void) const;
00286     int max(void) const;
00288     unsigned int width(void) const;
00290   };
00291 
00297   class IntSetValues : public Iter::Ranges::ToValues<IntSetRanges> {
00298   public:
00300 
00301 
00302     IntSetValues(void);
00304     IntSetValues(const IntSet& s);
00306     void init(const IntSet& s);
00308   };
00309 
00314   template<class Char, class Traits>
00315   std::basic_ostream<Char,Traits>&
00316   operator <<(std::basic_ostream<Char,Traits>& os, const IntSet& s);
00317 
00318 }
00319 
00320 #include <gecode/int/int-set-1.hpp>
00321 
00322 #include <gecode/int/var-imp.hpp>
00323 
00324 namespace Gecode {
00325 
00326   namespace Int {
00327     class IntView;
00328   }
00329 
00335   class IntVar : public VarImpVar<Int::IntVarImp> {
00336     friend class IntVarArray;
00337     friend class IntVarArgs;
00338   private:
00339     using VarImpVar<Int::IntVarImp>::x;
00346     void _init(Space& home, int min, int max);
00353     void _init(Space& home, const IntSet& d);
00354   public:
00356 
00357 
00358     IntVar(void);
00360     IntVar(const IntVar& y);
00362     IntVar(const Int::IntView& y);
00374     GECODE_INT_EXPORT IntVar(Space& home, int min, int max);
00386     GECODE_INT_EXPORT IntVar(Space& home, const IntSet& d);
00388 
00390 
00391 
00392     int min(void) const;
00394     int max(void) const;
00396     int med(void) const;
00404     int val(void) const;
00405 
00407     unsigned int size(void) const;
00409     unsigned int width(void) const;
00411     unsigned int regret_min(void) const;
00413     unsigned int regret_max(void) const;
00415 
00417 
00418 
00419     bool range(void) const;
00421     bool in(int n) const;
00423   };
00424 
00429   template<class Char, class Traits>
00430   std::basic_ostream<Char,Traits>&
00431   operator <<(std::basic_ostream<Char,Traits>& os, const IntVar& x);
00432 
00437   class IntVarRanges : public Int::IntVarImpFwd {
00438   public:
00440 
00441 
00442     IntVarRanges(void);
00444     IntVarRanges(const IntVar& x);
00446     void init(const IntVar& x);
00448   };
00449 
00454   class IntVarValues : public Iter::Ranges::ToValues<IntVarRanges> {
00455   public:
00457 
00458 
00459     IntVarValues(void);
00461     IntVarValues(const IntVar& x);
00463     void init(const IntVar& x);
00465   };
00466 
00467   namespace Int {
00468     class BoolView;
00469   }
00470 
00476   class BoolVar : public VarImpVar<Int::BoolVarImp> {
00477     friend class BoolVarArray;
00478     friend class BoolVarArgs;
00479   private:
00480     using VarImpVar<Int::BoolVarImp>::x;
00487     void _init(Space& home, int min, int max);
00488   public:
00490 
00491 
00492     BoolVar(void);
00494     BoolVar(const BoolVar& y);
00496     BoolVar(const Int::BoolView& y);
00508     GECODE_INT_EXPORT BoolVar(Space& home, int min, int max);
00510 
00512 
00513 
00514     int min(void) const;
00516     int max(void) const;
00518     int med(void) const;
00526     int val(void) const;
00527 
00529     unsigned int size(void) const;
00531     unsigned int width(void) const;
00533     unsigned int regret_min(void) const;
00535     unsigned int regret_max(void) const;
00537 
00539 
00540 
00541     bool range(void) const;
00543     bool in(int n) const;
00545 
00547 
00548 
00549     bool zero(void) const;
00551     bool one(void) const;
00553     bool none(void) const;
00555   };
00556 
00561   template<class Char, class Traits>
00562   std::basic_ostream<Char,Traits>&
00563   operator <<(std::basic_ostream<Char,Traits>& os, const BoolVar& x);
00564 
00565 }
00566 
00567 
00568 #include <gecode/int/view.hpp>
00569 #include <gecode/int/propagator.hpp>
00570 
00571 namespace Gecode {
00572 
00582 
00583   typedef ArgArray<IntSet> IntSetArgs;
00584 
00585 }
00586 
00587 #include <gecode/int/array-traits.hpp>
00588 
00589 namespace Gecode {
00590 
00592   class IntArgs : public PrimArgArray<int> {
00593   public:
00595 
00596 
00597     IntArgs(void);
00599     explicit IntArgs(int n);
00601     IntArgs(const SharedArray<int>& x);
00603     IntArgs(const std::vector<int>& x);
00605     GECODE_INT_EXPORT
00606     IntArgs(int n, int e0, ...);
00608     IntArgs(int n, const int* e);
00610     IntArgs(const PrimArgArray<int>& a);
00611 
00613     static IntArgs create(int n, int start, int inc=1);
00615   };
00616 
00618   class IntVarArgs : public VarArgArray<IntVar> {
00619   public:
00621 
00622 
00623     IntVarArgs(void) {}
00625     explicit IntVarArgs(int n) : VarArgArray<IntVar>(n) {}
00627     IntVarArgs(const IntVarArgs& a) : VarArgArray<IntVar>(a) {}
00629     IntVarArgs(const VarArray<IntVar>& a) : VarArgArray<IntVar>(a) {}
00641     GECODE_INT_EXPORT
00642     IntVarArgs(Space& home, int n, int min, int max);
00654     GECODE_INT_EXPORT
00655     IntVarArgs(Space& home, int n, const IntSet& s);
00657   };
00666   class BoolVarArgs : public VarArgArray<BoolVar> {
00667   public:
00669 
00670 
00671     BoolVarArgs(void) {}
00673     explicit BoolVarArgs(int n) : VarArgArray<BoolVar>(n) {}
00675     BoolVarArgs(const BoolVarArgs& a) : VarArgArray<BoolVar>(a) {}
00677     BoolVarArgs(const VarArray<BoolVar>& a)
00678      : VarArgArray<BoolVar>(a) {}
00690     GECODE_INT_EXPORT
00691     BoolVarArgs(Space& home, int n, int min, int max);
00693   };
00695 
00711   class IntVarArray : public VarArray<IntVar> {
00712   public:
00714 
00715 
00716     IntVarArray(void);
00718     IntVarArray(Space& home, int n);
00720     IntVarArray(const IntVarArray& a);
00722     IntVarArray(Space& home, const IntVarArgs& a);
00734     GECODE_INT_EXPORT
00735     IntVarArray(Space& home, int n, int min, int max);
00747     GECODE_INT_EXPORT
00748     IntVarArray(Space& home, int n, const IntSet& s);
00750   };
00751 
00756   class BoolVarArray : public VarArray<BoolVar> {
00757   public:
00759 
00760 
00761     BoolVarArray(void);
00763     BoolVarArray(Space& home, int n);
00765     BoolVarArray(const BoolVarArray& a);
00767     BoolVarArray(Space& home, const BoolVarArgs& a);
00779     GECODE_INT_EXPORT
00780     BoolVarArray(Space& home, int n, int min, int max);
00782   };
00783 
00784 }
00785 
00786 #include <gecode/int/int-set-2.hpp>
00787 
00788 #include <gecode/int/array.hpp>
00789 
00790 namespace Gecode {
00791 
00796   enum IntRelType {
00797     IRT_EQ, 
00798     IRT_NQ, 
00799     IRT_LQ, 
00800     IRT_LE, 
00801     IRT_GQ, 
00802     IRT_GR  
00803   };
00804 
00809   enum BoolOpType {
00810     BOT_AND, 
00811     BOT_OR,  
00812     BOT_IMP, 
00813     BOT_EQV, 
00814     BOT_XOR  
00815   };
00816 
00830   enum IntConLevel {
00831     ICL_VAL, 
00832     ICL_BND, 
00833     ICL_DOM, 
00834     ICL_DEF  
00835   };
00836 
00842   enum TaskType {
00843     TT_FIXP, //< Task with fixed processing time
00844     TT_FIXS, //< Task with fixed start time
00845     TT_FIXE  //< Task with fixed end time
00846   };
00847 
00853   typedef PrimArgArray<TaskType> TaskTypeArgs;
00854 
00856   template<>
00857   class ArrayTraits<PrimArgArray<TaskType> > {
00858   public:
00859     typedef TaskTypeArgs StorageType;
00860     typedef TaskType     ValueType;
00861     typedef TaskTypeArgs ArgsType;
00862   };
00863 
00864 
00872 
00873   GECODE_INT_EXPORT void
00874   dom(Home home, IntVar x, int n,
00875       IntConLevel icl=ICL_DEF);
00877   GECODE_INT_EXPORT void
00878   dom(Home home, const IntVarArgs& x, int n,
00879       IntConLevel icl=ICL_DEF);
00880 
00882   GECODE_INT_EXPORT void
00883   dom(Home home, IntVar x, int l, int m,
00884       IntConLevel icl=ICL_DEF);
00886   GECODE_INT_EXPORT void
00887   dom(Home home, const IntVarArgs& x, int l, int m,
00888       IntConLevel icl=ICL_DEF);
00889 
00891   GECODE_INT_EXPORT void
00892   dom(Home home, IntVar x, const IntSet& s,
00893       IntConLevel icl=ICL_DEF);
00895   GECODE_INT_EXPORT void
00896   dom(Home home, const IntVarArgs& x, const IntSet& s,
00897       IntConLevel icl=ICL_DEF);
00898 
00900   GECODE_INT_EXPORT void
00901   dom(Home home, IntVar x, int n, BoolVar b,
00902       IntConLevel icl=ICL_DEF);
00904   GECODE_INT_EXPORT void
00905   dom(Home home, IntVar x, int l, int m, BoolVar b,
00906       IntConLevel icl=ICL_DEF);
00908   GECODE_INT_EXPORT void
00909   dom(Home home, IntVar x, const IntSet& s, BoolVar b,
00910       IntConLevel icl=ICL_DEF);
00912 
00913 
00924   GECODE_INT_EXPORT void
00925   rel(Home home, IntVar x0, IntRelType r, IntVar x1,
00926       IntConLevel icl=ICL_DEF);
00933   GECODE_INT_EXPORT void
00934   rel(Home home, const IntVarArgs& x, IntRelType r, IntVar y,
00935       IntConLevel icl=ICL_DEF);
00939   GECODE_INT_EXPORT void
00940   rel(Home home, IntVar x, IntRelType r, int c,
00941       IntConLevel icl=ICL_DEF);
00945   GECODE_INT_EXPORT void
00946   rel(Home home, const IntVarArgs& x, IntRelType r, int c,
00947       IntConLevel icl=ICL_DEF);
00954   GECODE_INT_EXPORT void
00955   rel(Home home, IntVar x0, IntRelType r, IntVar x1, BoolVar b,
00956       IntConLevel icl=ICL_DEF);
00963   GECODE_INT_EXPORT void
00964   rel(Home home, IntVar x, IntRelType r, int c, BoolVar b,
00965       IntConLevel icl=ICL_DEF);
00980   GECODE_INT_EXPORT void
00981   rel(Home home, const IntVarArgs& x, IntRelType r,
00982       IntConLevel icl=ICL_DEF);
00997   GECODE_INT_EXPORT void
00998   rel(Home home, const IntVarArgs& x, IntRelType r, const IntVarArgs& y,
00999       IntConLevel icl=ICL_DEF);
01000 
01008   GECODE_INT_EXPORT void
01009   rel(Home home, BoolVar x0, IntRelType r, BoolVar x1,
01010       IntConLevel icl=ICL_DEF);
01014   GECODE_INT_EXPORT void
01015   rel(Home home, BoolVar x0, IntRelType r, BoolVar x1, BoolVar b,
01016       IntConLevel icl=ICL_DEF);
01020   GECODE_INT_EXPORT void
01021   rel(Home home, const BoolVarArgs& x, IntRelType r, BoolVar y,
01022       IntConLevel icl=ICL_DEF);
01030   GECODE_INT_EXPORT void
01031   rel(Home home, BoolVar x, IntRelType r, int n,
01032       IntConLevel icl=ICL_DEF);
01040   GECODE_INT_EXPORT void
01041   rel(Home home, BoolVar x, IntRelType r, int n, BoolVar b,
01042       IntConLevel icl=ICL_DEF);
01050   GECODE_INT_EXPORT void
01051   rel(Home home, const BoolVarArgs& x, IntRelType r, int n,
01052       IntConLevel icl=ICL_DEF);
01062   GECODE_INT_EXPORT void
01063   rel(Home home, const BoolVarArgs& x, IntRelType r, const BoolVarArgs& y,
01064       IntConLevel icl=ICL_DEF);
01075   GECODE_INT_EXPORT void
01076   rel(Home home, const BoolVarArgs& x, IntRelType r,
01077       IntConLevel icl=ICL_DEF);
01083   GECODE_INT_EXPORT void
01084   rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, BoolVar x2,
01085       IntConLevel icl=ICL_DEF);
01094   GECODE_INT_EXPORT void
01095   rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, int n,
01096       IntConLevel icl=ICL_DEF);
01106   GECODE_INT_EXPORT void
01107   rel(Home home, BoolOpType o, const BoolVarArgs& x, BoolVar y,
01108       IntConLevel icl=ICL_DEF);
01121   GECODE_INT_EXPORT void
01122   rel(Home home, BoolOpType o, const BoolVarArgs& x, int n,
01123       IntConLevel icl=ICL_DEF);
01134   GECODE_INT_EXPORT void
01135   clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
01136          BoolVar z, IntConLevel icl=ICL_DEF);
01150   GECODE_INT_EXPORT void
01151   clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
01152          int n, IntConLevel icl=ICL_DEF);
01153 
01154 
01166   GECODE_INT_EXPORT void
01167   precede(Home home, const IntVarArgs& x, int s, int t,
01168           IntConLevel=ICL_DEF);
01176   GECODE_INT_EXPORT void
01177   precede(Home home, const IntVarArgs& x, const IntArgs& c,
01178           IntConLevel=ICL_DEF);
01179 
01180 
01186 
01187   GECODE_INT_EXPORT void
01188   member(Home home, const IntVarArgs& x, IntVar y,
01189          IntConLevel icl=ICL_DEF);
01191   GECODE_INT_EXPORT void
01192   member(Home home, const BoolVarArgs& x, BoolVar y,
01193          IntConLevel icl=ICL_DEF);
01195   GECODE_INT_EXPORT void
01196   member(Home home, const IntVarArgs& x, IntVar y, BoolVar b,
01197          IntConLevel icl=ICL_DEF);
01199   GECODE_INT_EXPORT void
01200   member(Home home, const BoolVarArgs& x, BoolVar y, BoolVar b,
01201          IntConLevel icl=ICL_DEF);
01203 
01204 
01211 
01212   typedef SharedArray<int> IntSharedArray;
01218   GECODE_INT_EXPORT void
01219   element(Home home, IntSharedArray n, IntVar x0, IntVar x1,
01220           IntConLevel icl=ICL_DEF);
01226   GECODE_INT_EXPORT void
01227   element(Home home, IntSharedArray n, IntVar x0, BoolVar x1,
01228           IntConLevel icl=ICL_DEF);
01234   GECODE_INT_EXPORT void
01235   element(Home home, IntSharedArray n, IntVar x0, int x1,
01236           IntConLevel icl=ICL_DEF);
01242   GECODE_INT_EXPORT void
01243   element(Home home, const IntVarArgs& x, IntVar y0, IntVar y1,
01244           IntConLevel icl=ICL_DEF);
01250   GECODE_INT_EXPORT void
01251   element(Home home, const IntVarArgs& x, IntVar y0, int y1,
01252           IntConLevel icl=ICL_DEF);
01254   GECODE_INT_EXPORT void
01255   element(Home home, const BoolVarArgs& x, IntVar y0, BoolVar y1,
01256           IntConLevel icl=ICL_DEF);
01258   GECODE_INT_EXPORT void
01259   element(Home home, const BoolVarArgs& x, IntVar y0, int y1,
01260           IntConLevel icl=ICL_DEF);
01261 
01274   GECODE_INT_EXPORT void
01275   element(Home home, IntSharedArray a, 
01276           IntVar x, int w, IntVar y, int h, IntVar z,
01277           IntConLevel icl=ICL_DEF);
01290   GECODE_INT_EXPORT void
01291   element(Home home, IntSharedArray a, 
01292           IntVar x, int w, IntVar y, int h, BoolVar z,
01293           IntConLevel icl=ICL_DEF);
01309   GECODE_INT_EXPORT void
01310   element(Home home, const IntVarArgs& a, 
01311           IntVar x, int w, IntVar y, int h, IntVar z,
01312           IntConLevel icl=ICL_DEF);
01325   GECODE_INT_EXPORT void
01326   element(Home home, const BoolVarArgs& a, 
01327           IntVar x, int w, IntVar y, int h, BoolVar z,
01328           IntConLevel icl=ICL_DEF);
01330 
01331 
01346   GECODE_INT_EXPORT void
01347   distinct(Home home, const IntVarArgs& x,
01348            IntConLevel icl=ICL_DEF);
01361   GECODE_INT_EXPORT void
01362   distinct(Home home, const IntArgs& n, const IntVarArgs& x,
01363            IntConLevel icl=ICL_DEF);
01365 
01366 
01384   GECODE_INT_EXPORT void
01385   channel(Home home, const IntVarArgs& x, const IntVarArgs& y,
01386           IntConLevel icl=ICL_DEF);
01387 
01401   GECODE_INT_EXPORT void
01402   channel(Home home, const IntVarArgs& x, int xoff,
01403           const IntVarArgs& y, int yoff,
01404           IntConLevel icl=ICL_DEF);
01405 
01407   GECODE_INT_EXPORT void
01408   channel(Home home, BoolVar x0, IntVar x1,
01409           IntConLevel icl=ICL_DEF);
01411   forceinline void
01412   channel(Home home, IntVar x0, BoolVar x1,
01413           IntConLevel icl=ICL_DEF) {
01414     channel(home,x1,x0,icl);
01415   }
01421   GECODE_INT_EXPORT void
01422   channel(Home home, const BoolVarArgs& x, IntVar y, int o=0,
01423           IntConLevel icl=ICL_DEF);
01425 
01426 
01443   GECODE_INT_EXPORT void
01444   sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
01445          IntConLevel icl=ICL_DEF);
01446 
01458   GECODE_INT_EXPORT void
01459   sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
01460          const IntVarArgs& z,
01461          IntConLevel icl=ICL_DEF);
01463 
01464 
01483   GECODE_INT_EXPORT void
01484   count(Home home, const IntVarArgs& x, int n, IntRelType r, int m,
01485         IntConLevel icl=ICL_DEF);
01490   GECODE_INT_EXPORT void
01491   count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType r, int m,
01492         IntConLevel icl=ICL_DEF);
01500   GECODE_INT_EXPORT void
01501   count(Home home, const IntVarArgs& x, IntVar y, IntRelType r, int m,
01502         IntConLevel icl=ICL_DEF);
01510   GECODE_INT_EXPORT void
01511   count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType r, int m,
01512         IntConLevel icl=ICL_DEF);
01517   GECODE_INT_EXPORT void
01518   count(Home home, const IntVarArgs& x, int n, IntRelType r, IntVar z,
01519         IntConLevel icl=ICL_DEF);
01524   GECODE_INT_EXPORT void
01525   count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType r, IntVar z,
01526         IntConLevel icl=ICL_DEF);
01534   GECODE_INT_EXPORT void
01535   count(Home home, const IntVarArgs& x, IntVar y, IntRelType r, IntVar z,
01536         IntConLevel icl=ICL_DEF);
01544   GECODE_INT_EXPORT void
01545   count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType r, IntVar z,
01546         IntConLevel icl=ICL_DEF);
01547 
01561   GECODE_INT_EXPORT void
01562   count(Home home, const IntVarArgs& x, const IntVarArgs& c,
01563         IntConLevel icl=ICL_DEF);
01564 
01578   GECODE_INT_EXPORT void
01579   count(Home home, const IntVarArgs& x, const IntSetArgs& c,
01580         IntConLevel icl=ICL_DEF);
01581 
01598   GECODE_INT_EXPORT void
01599   count(Home home, const IntVarArgs& x,
01600         const IntVarArgs& c, const IntArgs& v,
01601         IntConLevel icl=ICL_DEF);
01602 
01619   GECODE_INT_EXPORT void
01620   count(Home home, const IntVarArgs& x,
01621         const IntSetArgs& c, const IntArgs& v,
01622         IntConLevel icl=ICL_DEF);
01623 
01640   GECODE_INT_EXPORT void
01641   count(Home home, const IntVarArgs& x,
01642         const IntSet& c, const IntArgs& v,
01643         IntConLevel icl=ICL_DEF);
01644 
01646 
01661   GECODE_INT_EXPORT void
01662   nvalues(Home home, const IntVarArgs& x, IntRelType r, int y,
01663           IntConLevel icl=ICL_DEF);
01667   GECODE_INT_EXPORT void
01668   nvalues(Home home, const IntVarArgs& x, IntRelType r, IntVar y,
01669           IntConLevel icl=ICL_DEF);
01673   GECODE_INT_EXPORT void
01674   nvalues(Home home, const BoolVarArgs& x, IntRelType r, int y,
01675           IntConLevel icl=ICL_DEF);
01679   GECODE_INT_EXPORT void
01680   nvalues(Home home, const BoolVarArgs& x, IntRelType r, IntVar y,
01681           IntConLevel icl=ICL_DEF);
01683 
01704   GECODE_INT_EXPORT void
01705   sequence(Home home, const IntVarArgs& x, const IntSet& s, 
01706            int q, int l, int u, IntConLevel icl=ICL_DEF); 
01707   
01722   GECODE_INT_EXPORT void
01723   sequence(Home home, const BoolVarArgs& x, const IntSet& s, 
01724            int q, int l, int u, IntConLevel icl=ICL_DEF); 
01725 
01727 
01740 
01748   class DFA : public SharedHandle {
01749   private:
01751     class DFAI;
01752   public:
01754     class Transition {
01755     public:
01756       int i_state; 
01757       int symbol;  
01758       int o_state; 
01759     };
01761     class Transitions {
01762     private:
01764       const Transition* c_trans;
01766       const Transition* e_trans;
01767     public:
01769       Transitions(const DFA& d);
01771       Transitions(const DFA& d, int n);
01773       bool operator ()(void) const;
01775       void operator ++(void);
01777       int i_state(void) const;
01779       int symbol(void) const;
01781       int o_state(void) const;
01782     };
01784     class Symbols {
01785     private:
01787       const Transition* c_trans;
01789       const Transition* e_trans;
01790     public:
01792       Symbols(const DFA& d);
01794       bool operator ()(void) const;
01796       void operator ++(void);
01798       int val(void) const;
01799     };
01800   public:
01801     friend class Transitions;
01803     DFA(void);
01815     GECODE_INT_EXPORT
01816     DFA(int s, Transition t[], int f[], bool minimize=true);
01818     DFA(const DFA& d);
01820     int n_states(void) const;
01822     int n_transitions(void) const;
01824     unsigned int n_symbols(void) const;
01826     unsigned int max_degree(void) const;
01828     int final_fst(void) const;
01830     int final_lst(void) const;
01832     int symbol_min(void) const;
01834     int symbol_max(void) const;
01835   };
01836 
01837 
01845   enum ExtensionalPropKind {
01846     EPK_DEF,    
01847     EPK_SPEED,  
01848     EPK_MEMORY  
01849   };
01850 
01861   GECODE_INT_EXPORT void
01862   extensional(Home home, const IntVarArgs& x, DFA d,
01863               IntConLevel icl=ICL_DEF);
01864 
01875   GECODE_INT_EXPORT void
01876   extensional(Home home, const BoolVarArgs& x, DFA d,
01877               IntConLevel icl=ICL_DEF);
01878 
01885   class TupleSet : public SharedHandle {
01886   public:
01891     typedef int* Tuple;
01892 
01897     class GECODE_VTABLE_EXPORT TupleSetI
01898       : public SharedHandle::Object {
01899     public:
01901       int arity;
01903       int size;
01905       Tuple** tuples;
01907       Tuple* tuple_data;
01909       int* data;
01911       int excess;
01913       int min, max;
01915       unsigned int domsize;
01917       Tuple** last;
01919       Tuple* nullpointer;
01920 
01922       template<class T>
01923       void add(T t);
01925       GECODE_INT_EXPORT void finalize(void);
01927       GECODE_INT_EXPORT void resize(void);
01929       bool finalized(void) const;
01931       TupleSetI(void);
01933       GECODE_INT_EXPORT virtual ~TupleSetI(void);
01935       GECODE_INT_EXPORT virtual SharedHandle::Object* copy(void) const;
01936     };
01937     
01939     TupleSetI* implementation(void);
01940 
01942     TupleSet(void);
01944     TupleSet(const TupleSet& d);
01945 
01947     void add(const IntArgs& tuple);
01949     void finalize(void);
01951     bool finalized(void) const;
01953     int arity(void) const;
01955     int tuples(void) const;
01957     Tuple operator [](int i) const;
01959     int min(void) const;
01961     int max(void) const;
01962   };
01963 
01982   GECODE_INT_EXPORT void
01983   extensional(Home home, const IntVarArgs& x, const TupleSet& t,
01984               ExtensionalPropKind epk=EPK_DEF, IntConLevel icl=ICL_DEF);
01985 
01996   GECODE_INT_EXPORT void
01997   extensional(Home home, const BoolVarArgs& x, const TupleSet& t,
01998               ExtensionalPropKind epk=EPK_DEF, IntConLevel icl=ICL_DEF);
02000 
02001 }
02002 
02003 #include <gecode/int/extensional/dfa.hpp>
02004 #include <gecode/int/extensional/tuple-set.hpp>
02005 
02006 namespace Gecode {
02007 
02019   GECODE_INT_EXPORT void
02020   min(Home home, IntVar x0, IntVar x1, IntVar x2,
02021       IntConLevel icl=ICL_DEF);
02029   GECODE_INT_EXPORT void
02030   min(Home home, const IntVarArgs& x, IntVar y,
02031       IntConLevel icl=ICL_DEF);
02037   GECODE_INT_EXPORT void
02038   max(Home home, IntVar x0, IntVar x1, IntVar x2,
02039       IntConLevel icl=ICL_DEF);
02047   GECODE_INT_EXPORT void
02048   max(Home home, const IntVarArgs& x, IntVar y,
02049       IntConLevel icl=ICL_DEF);
02050 
02056   GECODE_INT_EXPORT void
02057   abs(Home home, IntVar x0, IntVar x1,
02058       IntConLevel icl=ICL_DEF);
02059 
02065   GECODE_INT_EXPORT void
02066   mult(Home home, IntVar x0, IntVar x1, IntVar x2,
02067        IntConLevel icl=ICL_DEF);
02068 
02074   GECODE_INT_EXPORT void
02075   sqr(Home home, IntVar x0, IntVar x1,
02076       IntConLevel icl=ICL_DEF);
02077 
02083   GECODE_INT_EXPORT void
02084   sqrt(Home home, IntVar x0, IntVar x1,
02085        IntConLevel icl=ICL_DEF);
02086 
02091   GECODE_INT_EXPORT void
02092   divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
02093          IntConLevel icl=ICL_DEF);
02094 
02099   GECODE_INT_EXPORT void
02100   div(Home home, IntVar x0, IntVar x1, IntVar x2,
02101       IntConLevel icl=ICL_DEF);
02102 
02107   GECODE_INT_EXPORT void
02108   mod(Home home, IntVar x0, IntVar x1, IntVar x2,
02109       IntConLevel icl=ICL_DEF);
02111 
02143   GECODE_INT_EXPORT void
02144   linear(Home home, const IntVarArgs& x,
02145          IntRelType r, int c,
02146          IntConLevel icl=ICL_DEF);
02150   GECODE_INT_EXPORT void
02151   linear(Home home, const IntVarArgs& x,
02152          IntRelType r, IntVar y,
02153          IntConLevel icl=ICL_DEF);
02157   GECODE_INT_EXPORT void
02158   linear(Home home, const IntVarArgs& x,
02159          IntRelType r, int c, BoolVar b,
02160          IntConLevel icl=ICL_DEF);
02164   GECODE_INT_EXPORT void
02165   linear(Home home, const IntVarArgs& x,
02166          IntRelType r, IntVar y, BoolVar b,
02167          IntConLevel icl=ICL_DEF);
02174   GECODE_INT_EXPORT void
02175   linear(Home home, const IntArgs& a, const IntVarArgs& x,
02176          IntRelType r, int c,
02177          IntConLevel icl=ICL_DEF);
02184   GECODE_INT_EXPORT void
02185   linear(Home home, const IntArgs& a, const IntVarArgs& x,
02186          IntRelType r, IntVar y,
02187          IntConLevel icl=ICL_DEF);
02194   GECODE_INT_EXPORT void
02195   linear(Home home, const IntArgs& a, const IntVarArgs& x,
02196          IntRelType r, int c, BoolVar b,
02197          IntConLevel icl=ICL_DEF);
02204   GECODE_INT_EXPORT void
02205   linear(Home home, const IntArgs& a, const IntVarArgs& x,
02206          IntRelType r, IntVar y, BoolVar b,
02207          IntConLevel icl=ICL_DEF);
02208 
02209 
02237   GECODE_INT_EXPORT void
02238   linear(Home home, const BoolVarArgs& x,
02239          IntRelType r, int c,
02240          IntConLevel icl=ICL_DEF);
02244   GECODE_INT_EXPORT void
02245   linear(Home home, const BoolVarArgs& x,
02246          IntRelType r, int c, BoolVar b,
02247          IntConLevel icl=ICL_DEF);
02251   GECODE_INT_EXPORT void
02252   linear(Home home, const BoolVarArgs& x,
02253          IntRelType r, IntVar y,
02254          IntConLevel icl=ICL_DEF);
02258   GECODE_INT_EXPORT void
02259   linear(Home home, const BoolVarArgs& x,
02260          IntRelType r, IntVar y, BoolVar b,
02261          IntConLevel icl=ICL_DEF);
02268   GECODE_INT_EXPORT void
02269   linear(Home home, const IntArgs& a, const BoolVarArgs& x,
02270          IntRelType r, int c,
02271          IntConLevel icl=ICL_DEF);
02278   GECODE_INT_EXPORT void
02279   linear(Home home, const IntArgs& a, const BoolVarArgs& x,
02280          IntRelType r, int c, BoolVar b,
02281          IntConLevel icl=ICL_DEF);
02288   GECODE_INT_EXPORT void
02289   linear(Home home, const IntArgs& a, const BoolVarArgs& x,
02290          IntRelType r, IntVar y,
02291          IntConLevel icl=ICL_DEF);
02298   GECODE_INT_EXPORT void
02299   linear(Home home, const IntArgs& a, const BoolVarArgs& x,
02300          IntRelType r, IntVar y, BoolVar b,
02301          IntConLevel icl=ICL_DEF);
02302 
02303 
02330   GECODE_INT_EXPORT void
02331   binpacking(Home home, 
02332              const IntVarArgs& l, 
02333              const IntVarArgs& b, const IntArgs& s,
02334              IntConLevel icl=ICL_DEF);
02354   GECODE_INT_EXPORT void
02355   nooverlap(Home home, 
02356             const IntVarArgs& x, const IntArgs& w,
02357             const IntVarArgs& y, const IntArgs& h,
02358             IntConLevel icl=ICL_DEF);
02374   GECODE_INT_EXPORT void
02375   nooverlap(Home home, 
02376             const IntVarArgs& x, const IntArgs& w,
02377             const IntVarArgs& y, const IntArgs& h,
02378             const BoolVarArgs& o,
02379             IntConLevel icl=ICL_DEF);
02398   GECODE_INT_EXPORT void
02399   nooverlap(Home home, 
02400             const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
02401             const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
02402             IntConLevel icl=ICL_DEF);
02422   GECODE_INT_EXPORT void
02423   nooverlap(Home home, 
02424             const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
02425             const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
02426             const BoolVarArgs& o,
02427             IntConLevel icl=ICL_DEF);
02428 
02429 
02435 
02478   GECODE_INT_EXPORT void
02479   cumulatives(Home home, const IntVarArgs& m,
02480               const IntVarArgs& s, const IntVarArgs& p,
02481               const IntVarArgs& e, const IntVarArgs& u,
02482               const IntArgs& c, bool at_most,
02483               IntConLevel icl=ICL_DEF);
02488   GECODE_INT_EXPORT void
02489   cumulatives(Home home, const IntArgs& m,
02490               const IntVarArgs& s, const IntVarArgs& p,
02491               const IntVarArgs& e, const IntVarArgs& u,
02492               const IntArgs& c, bool at_most,
02493               IntConLevel icl=ICL_DEF);
02498   GECODE_INT_EXPORT void
02499   cumulatives(Home home, const IntVarArgs& m,
02500               const IntVarArgs& s, const IntArgs& p,
02501               const IntVarArgs& e, const IntVarArgs& u,
02502               const IntArgs& c, bool at_most,
02503               IntConLevel icl=ICL_DEF);
02508   GECODE_INT_EXPORT void
02509   cumulatives(Home home, const IntArgs& m,
02510               const IntVarArgs& s, const IntArgs& p,
02511               const IntVarArgs& e, const IntVarArgs& u,
02512               const IntArgs& c, bool at_most,
02513               IntConLevel icl=ICL_DEF);
02518   GECODE_INT_EXPORT void
02519   cumulatives(Home home, const IntVarArgs& m,
02520               const IntVarArgs& s, const IntVarArgs& p,
02521               const IntVarArgs& e, const IntArgs& u,
02522               const IntArgs& c, bool at_most,
02523               IntConLevel icl=ICL_DEF);
02528   GECODE_INT_EXPORT void
02529   cumulatives(Home home, const IntArgs& m,
02530               const IntVarArgs& s, const IntVarArgs& p,
02531               const IntVarArgs& e, const IntArgs& u,
02532               const IntArgs& c, bool at_most,
02533               IntConLevel icl=ICL_DEF);
02538   GECODE_INT_EXPORT void
02539   cumulatives(Home home, const IntVarArgs& m,
02540               const IntVarArgs& s, const IntArgs& p,
02541               const IntVarArgs& e, const IntArgs& u,
02542               const IntArgs& c, bool at_most,
02543               IntConLevel icl=ICL_DEF);
02548   GECODE_INT_EXPORT void
02549   cumulatives(Home home, const IntArgs& m,
02550               const IntVarArgs& s, const IntArgs& p,
02551               const IntVarArgs& e, const IntArgs& u,
02552               const IntArgs& c, bool at_most,
02553               IntConLevel icl=ICL_DEF);
02554 
02573   GECODE_INT_EXPORT void
02574   unary(Home home, const IntVarArgs& s, const IntArgs& p,
02575         IntConLevel icl=ICL_DEF);
02576 
02597   GECODE_INT_EXPORT void
02598   unary(Home home, const IntVarArgs& s, const IntArgs& p, 
02599         const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
02600 
02629   GECODE_INT_EXPORT void
02630   unary(Home home, const TaskTypeArgs& t,
02631         const IntVarArgs& flex, const IntArgs& fix, IntConLevel icl=ICL_DEF);
02632 
02663   GECODE_INT_EXPORT void
02664   unary(Home home, const TaskTypeArgs& t,
02665         const IntVarArgs& flex, const IntArgs& fix,
02666         const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
02667 
02687   GECODE_INT_EXPORT void
02688   unary(Home home, const IntVarArgs& s, const IntVarArgs& p, 
02689         const IntVarArgs& e, IntConLevel icl=ICL_DEF);
02690 
02712   GECODE_INT_EXPORT void
02713   unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
02714         const IntVarArgs& e, const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
02715 
02750   GECODE_INT_EXPORT void
02751   cumulative(Home home, int c, const TaskTypeArgs& t,
02752              const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
02753              IntConLevel icl=ICL_DEF);
02754 
02755   
02760   GECODE_INT_EXPORT void
02761   cumulative(Home home, IntVar c, const TaskTypeArgs& t,
02762              const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
02763              IntConLevel icl=ICL_DEF);
02764 
02801   GECODE_INT_EXPORT void
02802   cumulative(Home home, int c, const TaskTypeArgs& t,
02803              const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
02804              const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
02805 
02809   GECODE_INT_EXPORT void
02810   cumulative(Home home, IntVar c, const TaskTypeArgs& t,
02811              const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
02812              const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
02813 
02838   GECODE_INT_EXPORT void
02839   cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
02840              const IntArgs& u, IntConLevel icl=ICL_DEF);
02841 
02845   GECODE_INT_EXPORT void
02846   cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
02847              const IntArgs& u, IntConLevel icl=ICL_DEF);
02848 
02875   GECODE_INT_EXPORT void
02876   cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p, 
02877              const IntArgs& u, const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
02878 
02882   GECODE_INT_EXPORT void
02883   cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p, 
02884              const IntArgs& u, const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
02885 
02914   GECODE_INT_EXPORT void
02915   cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
02916              const IntVarArgs& e, const IntArgs& u, IntConLevel icl=ICL_DEF);
02917 
02921   GECODE_INT_EXPORT void
02922   cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
02923              const IntVarArgs& e, const IntArgs& u, IntConLevel icl=ICL_DEF);
02924 
02955   GECODE_INT_EXPORT void
02956   cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p, 
02957              const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m, 
02958              IntConLevel icl=ICL_DEF);
02959 
02963   GECODE_INT_EXPORT void
02964   cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p, 
02965              const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m, 
02966              IntConLevel icl=ICL_DEF);
02968 
02969 
02989   GECODE_INT_EXPORT void
02990   circuit(Home home, const IntVarArgs& x,
02991           IntConLevel icl=ICL_DEF);
03007   GECODE_INT_EXPORT void
03008   circuit(Home home, int offset, const IntVarArgs& x,
03009           IntConLevel icl=ICL_DEF);
03031   GECODE_INT_EXPORT void
03032   circuit(Home home, 
03033           const IntArgs& c,
03034           const IntVarArgs& x, const IntVarArgs& y, IntVar z,
03035           IntConLevel icl=ICL_DEF);
03058   GECODE_INT_EXPORT void
03059   circuit(Home home, 
03060           const IntArgs& c, int offset,
03061           const IntVarArgs& x, const IntVarArgs& y, IntVar z,
03062           IntConLevel icl=ICL_DEF);
03081   GECODE_INT_EXPORT void
03082   circuit(Home home, 
03083           const IntArgs& c,
03084           const IntVarArgs& x, IntVar z,
03085           IntConLevel icl=ICL_DEF);
03106   GECODE_INT_EXPORT void
03107   circuit(Home home, 
03108           const IntArgs& c, int offset,
03109           const IntVarArgs& x, IntVar z,
03110           IntConLevel icl=ICL_DEF);
03126   GECODE_INT_EXPORT void
03127   path(Home home, const IntVarArgs& x, IntVar s, IntVar e,
03128        IntConLevel icl=ICL_DEF);
03146   GECODE_INT_EXPORT void
03147   path(Home home, int offset, const IntVarArgs& x, IntVar s, IntVar e,
03148        IntConLevel icl=ICL_DEF);
03171   GECODE_INT_EXPORT void
03172   path(Home home, 
03173        const IntArgs& c,
03174        const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
03175        IntConLevel icl=ICL_DEF);
03200   GECODE_INT_EXPORT void
03201   path(Home home, 
03202        const IntArgs& c, int offset,
03203        const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
03204        IntConLevel icl=ICL_DEF);
03225   GECODE_INT_EXPORT void
03226   path(Home home, 
03227        const IntArgs& c,
03228        const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
03229        IntConLevel icl=ICL_DEF);
03252   GECODE_INT_EXPORT void
03253   path(Home home, 
03254        const IntArgs& c, int offset,
03255        const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
03256        IntConLevel icl=ICL_DEF);
03258 
03259 
03260 
03269 
03270   GECODE_INT_EXPORT void
03271   wait(Home home, IntVar x, void (*c)(Space& home),
03272        IntConLevel icl=ICL_DEF);
03274   GECODE_INT_EXPORT void
03275   wait(Home home, BoolVar x, void (*c)(Space& home),
03276        IntConLevel icl=ICL_DEF);
03278   GECODE_INT_EXPORT void
03279   wait(Home home, const IntVarArgs& x, void (*c)(Space& home),
03280        IntConLevel icl=ICL_DEF);
03282   GECODE_INT_EXPORT void
03283   wait(Home home, const BoolVarArgs& x, void (*c)(Space& home),
03284        IntConLevel icl=ICL_DEF);
03286   GECODE_INT_EXPORT void
03287   when(Home home, BoolVar x, 
03288        void (*t)(Space& home), void (*e)(Space& home)= NULL,
03289        IntConLevel icl=ICL_DEF);
03291 
03292 
03317   GECODE_INT_EXPORT void
03318   unshare(Home home, IntVarArgs& x,
03319           IntConLevel icl=ICL_DEF);
03321   GECODE_INT_EXPORT void
03322   unshare(Home home, BoolVarArgs& x,
03323           IntConLevel icl=ICL_DEF);
03325 
03326 
03332 
03333   enum IntVarBranch {
03334     INT_VAR_NONE = 0,        
03335     INT_VAR_RND,             
03336     INT_VAR_DEGREE_MIN,      
03337     INT_VAR_DEGREE_MAX,      
03338     INT_VAR_AFC_MIN,         
03339     INT_VAR_AFC_MAX,         
03340     INT_VAR_MIN_MIN,         
03341     INT_VAR_MIN_MAX,         
03342     INT_VAR_MAX_MIN,         
03343     INT_VAR_MAX_MAX,         
03344     INT_VAR_SIZE_MIN,        
03345     INT_VAR_SIZE_MAX,        
03346     INT_VAR_SIZE_DEGREE_MIN, 
03347     INT_VAR_SIZE_DEGREE_MAX, 
03348     INT_VAR_SIZE_AFC_MIN,    
03349     INT_VAR_SIZE_AFC_MAX,    
03350 
03355     INT_VAR_REGRET_MIN_MIN,
03361     INT_VAR_REGRET_MIN_MAX,
03367     INT_VAR_REGRET_MAX_MIN,
03373     INT_VAR_REGRET_MAX_MAX
03374   };
03375 
03377   enum IntValBranch {
03378     INT_VAL_MIN,       
03379     INT_VAL_MED,       
03380     INT_VAL_MAX,       
03381     INT_VAL_RND,       
03382     INT_VAL_SPLIT_MIN, 
03383     INT_VAL_SPLIT_MAX, 
03384     INT_VAL_RANGE_MIN, 
03385     INT_VAL_RANGE_MAX, 
03386     INT_VALUES_MIN,    
03387     INT_VALUES_MAX     
03388   };
03389 
03391   GECODE_INT_EXPORT void
03392   branch(Home home, const IntVarArgs& x,
03393          IntVarBranch vars, IntValBranch vals,
03394          const VarBranchOptions& o_vars = VarBranchOptions::def,
03395          const ValBranchOptions& o_vals = ValBranchOptions::def);
03397   GECODE_INT_EXPORT void
03398   branch(Home home, const IntVarArgs& x,
03399          const TieBreakVarBranch<IntVarBranch>& vars, IntValBranch vals,
03400          const TieBreakVarBranchOptions& o_vars = TieBreakVarBranchOptions::def,
03401          const ValBranchOptions& o_vals = ValBranchOptions::def);
03403   GECODE_INT_EXPORT void
03404   branch(Home home, IntVar x, IntValBranch vals,
03405          const ValBranchOptions& o_vals = ValBranchOptions::def);
03407   GECODE_INT_EXPORT void
03408   branch(Home home, const BoolVarArgs& x,
03409          IntVarBranch vars, IntValBranch vals,
03410          const VarBranchOptions& o_vars = VarBranchOptions::def,
03411          const ValBranchOptions& o_vals = ValBranchOptions::def);
03413   GECODE_INT_EXPORT void
03414   branch(Home home, const BoolVarArgs& x,
03415          const TieBreakVarBranch<IntVarBranch>& vars, IntValBranch vals,
03416          const TieBreakVarBranchOptions& o_vars = TieBreakVarBranchOptions::def,
03417          const ValBranchOptions& o_vals = ValBranchOptions::def);
03419   GECODE_INT_EXPORT void
03420   branch(Home home, BoolVar x, IntValBranch vals,
03421          const ValBranchOptions& o_vals = ValBranchOptions::def);
03422 
03424 
03430 
03431   enum IntAssign {
03432     INT_ASSIGN_MIN, 
03433     INT_ASSIGN_MED, 
03434     INT_ASSIGN_MAX, 
03435     INT_ASSIGN_RND  
03436   };
03437 
03439   GECODE_INT_EXPORT void
03440   assign(Home home, const IntVarArgs& x, IntAssign vals,
03441          const ValBranchOptions& o_vals = ValBranchOptions::def);
03443   GECODE_INT_EXPORT void
03444   assign(Home home, IntVar x, IntAssign vals,
03445          const ValBranchOptions& o_vals = ValBranchOptions::def);
03447   GECODE_INT_EXPORT void
03448   assign(Home home, const BoolVarArgs& x, IntAssign vals,
03449          const ValBranchOptions& o_vals = ValBranchOptions::def);
03451   GECODE_INT_EXPORT void
03452   assign(Home home, BoolVar x, IntAssign vals,
03453          const ValBranchOptions& o_vals = ValBranchOptions::def);
03454 
03456 
03460   template<class Char, class Traits>
03461   std::basic_ostream<Char,Traits>&
03462   operator <<(std::basic_ostream<Char,Traits>& os, const DFA& d);
03463 
03467   template<class Char, class Traits>
03468   std::basic_ostream<Char,Traits>&
03469   operator <<(std::basic_ostream<Char,Traits>& os, const TupleSet& ts);
03470 
03471 }
03472 
03473 #endif
03474 
03475 // IFDEF: GECODE_HAS_INT_VARS
03476 // STATISTICS: int-post
03477