Generated on Sat Apr 10 2021 00:00:00 for Gecode by doxygen 1.9.1
minimodel.hh
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christian Schulte <schulte@gecode.org>
5  * Guido Tack <tack@gecode.org>
6  * Matthias Balzer <matthias.balzer@itwm.fraunhofer.de>
7  * Mikael Lagerkvist <lagerkvist@gecode.org>
8  * Vincent Barichard <Vincent.Barichard@univ-angers.fr>
9  *
10  * Copyright:
11  * Christian Schulte, 2004
12  * Fraunhofer ITWM, 2017
13  * Guido Tack, 2004
14  * Mikael Lagerkvist, 2005
15  * Vincent Barichard, 2012
16  *
17  * This file is part of Gecode, the generic constraint
18  * development environment:
19  * http://www.gecode.org
20  *
21  * Permission is hereby granted, free of charge, to any person obtaining
22  * a copy of this software and associated documentation files (the
23  * "Software"), to deal in the Software without restriction, including
24  * without limitation the rights to use, copy, modify, merge, publish,
25  * distribute, sublicense, and/or sell copies of the Software, and to
26  * permit persons to whom the Software is furnished to do so, subject to
27  * the following conditions:
28  *
29  * The above copyright notice and this permission notice shall be
30  * included in all copies or substantial portions of the Software.
31  *
32  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
33  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
35  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
36  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
37  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
38  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39  *
40  */
41 
42 #ifndef __GECODE_MINIMODEL_HH__
43 #define __GECODE_MINIMODEL_HH__
44 
45 #include <gecode/kernel.hh>
46 #include <gecode/int.hh>
47 #ifdef GECODE_HAS_SET_VARS
48 #include <gecode/set.hh>
49 #endif
50 #ifdef GECODE_HAS_FLOAT_VARS
51 #include <gecode/float.hh>
52 #endif
53 
54 #include <iostream>
55 
56 /*
57  * Support for DLLs under Windows
58  *
59  */
60 
61 #if !defined(GECODE_STATIC_LIBS) && \
62  (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
63 
64 #ifdef GECODE_BUILD_MINIMODEL
65 #define GECODE_MINIMODEL_EXPORT __declspec( dllexport )
66 #else
67 #define GECODE_MINIMODEL_EXPORT __declspec( dllimport )
68 #endif
69 
70 #else
71 
72 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
73 
74 #define GECODE_MINIMODEL_EXPORT __attribute__ ((visibility("default")))
75 
76 #else
77 
78 #define GECODE_MINIMODEL_EXPORT
79 
80 #endif
81 #endif
82 
83 // Configure auto-linking
84 #ifndef GECODE_BUILD_MINIMODEL
85 #define GECODE_LIBRARY_NAME "MiniModel"
87 #endif
88 
89 namespace Gecode {
90 
92  namespace MiniModel {}
93 
94 }
95 
97 
98 namespace Gecode {
99 
102  protected:
119  public:
122 
124  IntPropLevel linear2(void) const;
128  IntPropLevel linear(void) const;
131 
133  IntPropLevel abs(void) const;
136 
138  IntPropLevel max2(void) const;
142  IntPropLevel max(void) const;
146  IntPropLevel min2(void) const;
150  IntPropLevel min(void) const;
153 
155  IntPropLevel mult(void) const;
159  IntPropLevel div(void) const;
163  IntPropLevel mod(void) const;
166 
168  IntPropLevel sqr(void) const;
172  IntPropLevel sqrt(void) const;
175 
177  IntPropLevel pow(void) const;
181  IntPropLevel nroot(void) const;
184 
186  IntPropLevel element(void) const;
189 
191  IntPropLevel ite(void) const;
194 
197  static const IntPropLevels def;
198  };
199 
200 }
201 
202 #include <gecode/minimodel/ipl.hpp>
203 
204 namespace Gecode {
205 
206  class LinIntRel;
207 #ifdef GECODE_HAS_SET_VARS
208  class SetExpr;
209 #endif
210 #ifdef GECODE_HAS_FLOAT_VARS
211  class LinFloatExpr;
212 #endif
213 
216  public:
218  virtual IntVar post(Home home, IntVar* ret,
219  const IntPropLevels& ipls) const = 0;
221  virtual void post(Home home, IntRelType irt, int c,
222  const IntPropLevels& ipls) const = 0;
224  virtual void post(Home home, IntRelType irt, int c,
225  BoolVar b, const IntPropLevels& ipls) const = 0;
227  virtual ~NonLinIntExpr(void);
229  static IntVar result(Home home, IntVar* x);
231  static IntVar result(Home home, IntVar* x, IntVar y);
233  void* operator new(size_t s);
235  void operator delete(void* p, size_t s);
236  };
237 
238 }
239 
241 
242 namespace Gecode {
243 
245  class LinIntExpr {
246  friend class LinIntRel;
247 #ifdef GECODE_HAS_SET_VARS
248  friend class SetExpr;
249 #endif
250 #ifdef GECODE_HAS_FLOAT_VARS
251  friend class LinFloatExpr;
252 #endif
253  public:
255  enum NodeType {
264  NT_MUL
265  };
266  private:
268  class Node;
270  Node* n;
271  public:
274  LinIntExpr(void);
277  LinIntExpr(int c);
280  LinIntExpr(const IntVar& x, int a=1);
283  LinIntExpr(const BoolVar& x, int a=1);
286  explicit LinIntExpr(const IntVarArgs& x);
289  LinIntExpr(const IntArgs& a, const IntVarArgs& x);
292  explicit LinIntExpr(const BoolVarArgs& x);
295  LinIntExpr(const IntArgs& a, const BoolVarArgs& x);
298  LinIntExpr(const LinIntExpr& e);
301  LinIntExpr(const LinIntExpr& e0, NodeType t, const LinIntExpr& e1);
304  LinIntExpr(const LinIntExpr& e0, NodeType t, int c);
307  LinIntExpr(int a, const LinIntExpr& e);
310  explicit LinIntExpr(NonLinIntExpr* e);
313  const LinIntExpr& operator =(const LinIntExpr& e);
316  void post(Home home, IntRelType irt, const IntPropLevels& ipls) const;
319  void post(Home home, IntRelType irt, const BoolVar& b,
320  const IntPropLevels& ipls) const;
323  IntVar post(Home home, const IntPropLevels& ipls) const;
326  NonLinIntExpr* nle(void) const;
329  ~LinIntExpr(void);
330  };
331 
332  class BoolExpr;
333 
335  class LinIntRel {
336  friend class BoolExpr;
337  private:
339  LinIntExpr e;
341  IntRelType irt;
343  static IntRelType neg(IntRelType irt);
345  LinIntRel(void);
346  public:
348  LinIntRel(const LinIntExpr& l, IntRelType irt, const LinIntExpr& r);
350  LinIntRel(const LinIntExpr& l, IntRelType irt, int r);
352  LinIntRel(int l, IntRelType irt, const LinIntExpr& r);
354  void post(Home home, bool t, const IntPropLevels& ipls) const;
356  void post(Home home, const BoolVar& b, bool t, const IntPropLevels& ipls) const;
357  };
358 
379  operator +(int, const IntVar&);
382  operator +(int, const BoolVar&);
385  operator +(int, const LinIntExpr&);
388  operator +(const IntVar&, int);
391  operator +(const BoolVar&, int);
394  operator +(const LinIntExpr&, int);
397  operator +(const IntVar&, const IntVar&);
400  operator +(const IntVar&, const BoolVar&);
403  operator +(const BoolVar&, const IntVar&);
406  operator +(const BoolVar&, const BoolVar&);
409  operator +(const IntVar&, const LinIntExpr&);
412  operator +(const BoolVar&, const LinIntExpr&);
415  operator +(const LinIntExpr&, const IntVar&);
418  operator +(const LinIntExpr&, const BoolVar&);
421  operator +(const LinIntExpr&, const LinIntExpr&);
422 
425  operator -(int, const IntVar&);
428  operator -(int, const BoolVar&);
431  operator -(int, const LinIntExpr&);
434  operator -(const IntVar&, int);
437  operator -(const BoolVar&, int);
440  operator -(const LinIntExpr&, int);
443  operator -(const IntVar&, const IntVar&);
446  operator -(const IntVar&, const BoolVar&);
449  operator -(const BoolVar&, const IntVar&);
452  operator -(const BoolVar&, const BoolVar&);
455  operator -(const IntVar&, const LinIntExpr&);
458  operator -(const BoolVar&, const LinIntExpr&);
461  operator -(const LinIntExpr&, const IntVar&);
464  operator -(const LinIntExpr&, const BoolVar&);
467  operator -(const LinIntExpr&, const LinIntExpr&);
468 
471  operator -(const IntVar&);
474  operator -(const BoolVar&);
477  operator -(const LinIntExpr&);
478 
481  operator *(int, const IntVar&);
484  operator *(int, const BoolVar&);
487  operator *(const IntVar&, int);
490  operator *(const BoolVar&, int);
493  operator *(const LinIntExpr&, int);
496  operator *(int, const LinIntExpr&);
497 
500  sum(const IntVarArgs& x);
503  sum(const IntArgs& a, const IntVarArgs& x);
506  sum(const BoolVarArgs& x);
509  sum(const IntArgs& a, const BoolVarArgs& x);
512  sum(const IntArgs& args);
513 
516  operator ==(int l, const IntVar& r);
519  operator ==(int l, const BoolVar& r);
522  operator ==(int l, const LinIntExpr& r);
525  operator ==(const IntVar& l, int r);
528  operator ==(const BoolVar& l, int r);
531  operator ==(const LinIntExpr& l, int r);
534  operator ==(const IntVar& l, const IntVar& r);
537  operator ==(const IntVar& l, const BoolVar& r);
540  operator ==(const BoolVar& l, const IntVar& r);
543  operator ==(const BoolVar& l, const BoolVar& r);
546  operator ==(const IntVar& l, const LinIntExpr& r);
549  operator ==(const BoolVar& l, const LinIntExpr& r);
552  operator ==(const LinIntExpr& l, const IntVar& r);
555  operator ==(const LinIntExpr& l, const BoolVar& r);
558  operator ==(const LinIntExpr& l, const LinIntExpr& r);
559 
562  operator !=(int l, const IntVar& r);
565  operator !=(int l, const BoolVar& r);
568  operator !=(int l, const LinIntExpr& r);
571  operator !=(const IntVar& l, int r);
574  operator !=(const BoolVar& l, int r);
577  operator !=(const LinIntExpr& l, int r);
580  operator !=(const IntVar& l, const IntVar& r);
583  operator !=(const IntVar& l, const BoolVar& r);
586  operator !=(const BoolVar& l, const IntVar& r);
589  operator !=(const BoolVar& l, const BoolVar& r);
592  operator !=(const IntVar& l, const LinIntExpr& r);
595  operator !=(const BoolVar& l, const LinIntExpr& r);
598  operator !=(const LinIntExpr& l, const IntVar& r);
601  operator !=(const LinIntExpr& l, const BoolVar& r);
604  operator !=(const LinIntExpr& l, const LinIntExpr& r);
605 
608  operator <(int l, const IntVar& r);
611  operator <(int l, const BoolVar& r);
614  operator <(int l, const LinIntExpr& r);
617  operator <(const IntVar& l, int r);
620  operator <(const BoolVar& l, int r);
623  operator <(const LinIntExpr& l, int r);
626  operator <(const IntVar& l, const IntVar& r);
629  operator <(const IntVar& l, const BoolVar& r);
632  operator <(const BoolVar& l, const IntVar& r);
635  operator <(const BoolVar& l, const BoolVar& r);
638  operator <(const IntVar& l, const LinIntExpr& r);
641  operator <(const BoolVar& l, const LinIntExpr& r);
644  operator <(const LinIntExpr& l, const IntVar& r);
647  operator <(const LinIntExpr& l, const BoolVar& r);
650  operator <(const LinIntExpr& l, const LinIntExpr& r);
651 
654  operator <=(int l, const IntVar& r);
657  operator <=(int l, const BoolVar& r);
660  operator <=(int l, const LinIntExpr& r);
663  operator <=(const IntVar& l, int r);
666  operator <=(const BoolVar& l, int r);
669  operator <=(const LinIntExpr& l, int r);
672  operator <=(const IntVar& l, const IntVar& r);
675  operator <=(const IntVar& l, const BoolVar& r);
678  operator <=(const BoolVar& l, const IntVar& r);
681  operator <=(const BoolVar& l, const BoolVar& r);
684  operator <=(const IntVar& l, const LinIntExpr& r);
687  operator <=(const BoolVar& l, const LinIntExpr& r);
690  operator <=(const LinIntExpr& l, const IntVar& r);
693  operator <=(const LinIntExpr& l, const BoolVar& r);
696  operator <=(const LinIntExpr& l, const LinIntExpr& r);
697 
700  operator >(int l, const IntVar& r);
703  operator >(int l, const BoolVar& r);
706  operator >(int l, const LinIntExpr& r);
709  operator >(const IntVar& l, int r);
712  operator >(const BoolVar& l, int r);
715  operator >(const LinIntExpr& l, int r);
718  operator >(const IntVar& l, const IntVar& r);
721  operator >(const IntVar& l, const BoolVar& r);
724  operator >(const BoolVar& l, const IntVar& r);
727  operator >(const BoolVar& l, const BoolVar& r);
730  operator >(const IntVar& l, const LinIntExpr& r);
733  operator >(const BoolVar& l, const LinIntExpr& r);
736  operator >(const LinIntExpr& l, const IntVar& r);
739  operator >(const LinIntExpr& l, const BoolVar& r);
742  operator >(const LinIntExpr& l, const LinIntExpr& r);
743 
746  operator >=(int l, const IntVar& r);
749  operator >=(int l, const BoolVar& r);
752  operator >=(int l, const LinIntExpr& r);
755  operator >=(const IntVar& l, int r);
758  operator >=(const BoolVar& l, int r);
761  operator >=(const LinIntExpr& l, int r);
764  operator >=(const IntVar& l, const IntVar& r);
767  operator >=(const IntVar& l, const BoolVar& r);
770  operator >=(const BoolVar& l, const IntVar& r);
773  operator >=(const BoolVar& l, const BoolVar& r);
776  operator >=(const IntVar& l, const LinIntExpr& r);
779  operator >=(const BoolVar& l, const LinIntExpr& r);
782  operator >=(const LinIntExpr& l, const IntVar& r);
785  operator >=(const LinIntExpr& l, const BoolVar& r);
788  operator >=(const LinIntExpr& l, const LinIntExpr& r);
790 
791 #ifdef GECODE_HAS_FLOAT_VARS
792 
795  public:
797  virtual FloatVar post(Home home, FloatVar* ret) const = 0;
799  virtual void post(Home home, FloatRelType frt, FloatVal c) const = 0;
801  virtual void post(Home home, FloatRelType frt, FloatVal c,
802  BoolVar b) const = 0;
804  virtual ~NonLinFloatExpr(void);
806  static FloatVar result(Home home, FloatVar* x);
808  static FloatVar result(Home home, FloatVar* x, FloatVar y);
810  void* operator new(size_t s);
812  void operator delete(void* p, size_t s);
813  };
814 
815 }
816 
818 
819 namespace Gecode {
820 
822  class LinFloatExpr {
823  friend class LinFloatRel;
824  public:
826  enum NodeType {
833  NT_MUL
834  };
835  private:
837  class Node;
838  Node* n;
839  public:
842  LinFloatExpr(void);
845  LinFloatExpr(const FloatVal& c);
848  LinFloatExpr(const FloatVar& x);
851  LinFloatExpr(const FloatVar& x, FloatVal a);
854  explicit LinFloatExpr(const FloatVarArgs& x);
857  LinFloatExpr(const FloatValArgs& a, const FloatVarArgs& x);
860  LinFloatExpr(const LinFloatExpr& e);
863  LinFloatExpr(const LinFloatExpr& e0, NodeType t, const LinFloatExpr& e1);
866  LinFloatExpr(const LinFloatExpr& e0, NodeType t, const FloatVal& c);
869  LinFloatExpr(FloatVal a, const LinFloatExpr& e);
872  explicit LinFloatExpr(NonLinFloatExpr* e);
875  const LinFloatExpr& operator =(const LinFloatExpr& e);
878  void post(Home home, FloatRelType frt) const;
881  void post(Home home, FloatRelType frt, const BoolVar& b) const;
884  FloatVar post(Home home) const;
887  NonLinFloatExpr* nlfe(void) const;
890  ~LinFloatExpr(void);
891  };
892 
893  class BoolExpr;
894 
896  class LinFloatRel {
897  friend class BoolExpr;
898  private:
900  LinFloatExpr e;
902  FloatRelType frt;
904  static FloatRelType neg(FloatRelType frt);
906  LinFloatRel(void);
907  public:
909  LinFloatRel(const LinFloatExpr& l, FloatRelType frt, const LinFloatExpr& r);
915  void post(Home home, bool t) const;
917  void post(Home home, const BoolVar& b, bool t) const;
918  };
919 
935  operator +(const FloatVal&, const FloatVar&);
938  operator +(const FloatVal&, const LinFloatExpr&);
941  operator +(const FloatVar&, const FloatVal&);
944  operator +(const LinFloatExpr&, const FloatVal&);
947  operator +(const FloatVar&, const FloatVar&);
950  operator +(const FloatVar&, const LinFloatExpr&);
953  operator +(const LinFloatExpr&, const FloatVar&);
956  operator +(const LinFloatExpr&, const LinFloatExpr&);
957 
960  operator -(const FloatVal&, const FloatVar&);
963  operator -(const FloatVal&, const LinFloatExpr&);
966  operator -(const FloatVar&, const FloatVal&);
969  operator -(const LinFloatExpr&, const FloatVal&);
972  operator -(const FloatVar&, const FloatVar&);
975  operator -(const FloatVar&, const LinFloatExpr&);
978  operator -(const LinFloatExpr&, const FloatVar&);
981  operator -(const LinFloatExpr&, const LinFloatExpr&);
982 
985  operator -(const FloatVar&);
988  operator -(const LinFloatExpr&);
989 
992  operator *(const FloatVal&, const FloatVar&);
995  operator *(const FloatVar&, const FloatVal&);
998  operator *(const LinFloatExpr&, const FloatVal&);
1001  operator *(const FloatVal&, const LinFloatExpr&);
1002 
1005  sum(const FloatVarArgs& x);
1008  sum(const FloatValArgs& a, const FloatVarArgs& x);
1009 
1012  operator ==(const FloatVal& l, const FloatVar& r);
1015  operator ==(const FloatVal& l, const LinFloatExpr& r);
1018  operator ==(const FloatVar& l, const FloatVal& r);
1021  operator ==(const LinFloatExpr& l, const FloatVal& r);
1024  operator ==(const FloatVar& l, const FloatVar& r);
1027  operator ==(const FloatVar& l, const LinFloatExpr& r);
1030  operator ==(const LinFloatExpr& l, const FloatVar& r);
1033  operator ==(const LinFloatExpr& l, const LinFloatExpr& r);
1034 
1037  operator !=(const FloatVal& l, const FloatVar& r);
1040  operator !=(const FloatVal& l, const LinFloatExpr& r);
1043  operator !=(const FloatVar& l, const FloatVal& r);
1046  operator !=(const LinFloatExpr& l, const FloatVal& r);
1049  operator !=(const FloatVar& l, const FloatVar& r);
1052  operator !=(const FloatVar& l, const LinFloatExpr& r);
1055  operator !=(const LinFloatExpr& l, const FloatVar& r);
1058  operator !=(const LinFloatExpr& l, const LinFloatExpr& r);
1059 
1062  operator <(const FloatVal& l, const FloatVar& r);
1065  operator <(const FloatVal& l, const LinFloatExpr& r);
1068  operator <(const FloatVar& l, const FloatVal& r);
1071  operator <(const LinFloatExpr& l, const FloatVal& r);
1074  operator <(const FloatVar& l, const FloatVar& r);
1077  operator <(const FloatVar& l, const LinFloatExpr& r);
1080  operator <(const LinFloatExpr& l, const FloatVar& r);
1083  operator <(const LinFloatExpr& l, const LinFloatExpr& r);
1084 
1087  operator <=(const FloatVal& l, const FloatVar& r);
1090  operator <=(const FloatVal& l, const LinFloatExpr& r);
1093  operator <=(const FloatVar& l, const FloatVal& r);
1096  operator <=(const LinFloatExpr& l, const FloatVal& r);
1099  operator <=(const FloatVar& l, const FloatVar& r);
1102  operator <=(const FloatVar& l, const LinFloatExpr& r);
1105  operator <=(const LinFloatExpr& l, const FloatVar& r);
1108  operator <=(const LinFloatExpr& l, const LinFloatExpr& r);
1109 
1112  operator >(const FloatVal& l, const FloatVar& r);
1115  operator >(const FloatVal& l, const LinFloatExpr& r);
1118  operator >(const FloatVar& l, const FloatVal& r);
1121  operator >(const LinFloatExpr& l, const FloatVal& r);
1124  operator >(const FloatVar& l, const FloatVar& r);
1127  operator >(const FloatVar& l, const LinFloatExpr& r);
1130  operator >(const LinFloatExpr& l, const FloatVar& r);
1133  operator >(const LinFloatExpr& l, const LinFloatExpr& r);
1134 
1137  operator >=(const FloatVal& l, const FloatVar& r);
1140  operator >=(const FloatVal& l, const LinFloatExpr& r);
1143  operator >=(const FloatVar& l, const FloatVal& r);
1146  operator >=(const LinFloatExpr& l, const FloatVal& r);
1149  operator >=(const FloatVar& l, const FloatVar& r);
1152  operator >=(const FloatVar& l, const LinFloatExpr& r);
1155  operator >=(const LinFloatExpr& l, const FloatVar& r);
1158  operator >=(const LinFloatExpr& l, const LinFloatExpr& r);
1160 #endif
1161 
1162 #ifdef GECODE_HAS_SET_VARS
1164  class SetExpr {
1165  public:
1167  enum NodeType {
1174  NT_DUNION
1175  };
1177  class Node;
1178  private:
1180  Node* n;
1181  public:
1183  SetExpr(void);
1186  SetExpr(const SetExpr& e);
1189  SetExpr(const SetExpr& l, NodeType t, const SetExpr& r);
1192  SetExpr(const SetVar& x);
1195  explicit SetExpr(const LinIntExpr& x);
1198  SetExpr(const IntSet& s);
1201  SetExpr(const SetExpr& e, NodeType t);
1204  SetVar post(Home home) const;
1207  void post(Home home, SetRelType srt, const SetExpr& e) const;
1210  void post(Home home, BoolVar b, bool t,
1211  SetRelType srt, const SetExpr& e) const;
1214  const SetExpr& operator =(const SetExpr& e);
1217  ~SetExpr(void);
1218  };
1219 
1221  class SetCmpRel {
1222  public:
1230  SetCmpRel(const SetExpr& l, SetRelType srt, const SetExpr& r);
1231  };
1232 
1234  class SetRel {
1235  private:
1237  SetExpr _e0;
1239  SetRelType _srt;
1241  SetExpr _e1;
1242  public:
1244  SetRel(void);
1246  SetRel(const SetExpr& e0, SetRelType srt, const SetExpr& e1);
1248  SetRel(const SetCmpRel& r);
1250  void post(Home home, bool t) const;
1252  void post(Home home, BoolVar b, bool t) const;
1253  };
1254 
1267  singleton(const LinIntExpr&);
1270  operator -(const SetExpr&);
1273  operator &(const SetExpr&, const SetExpr&);
1276  operator |(const SetExpr&, const SetExpr&);
1279  operator +(const SetExpr&, const SetExpr&);
1282  operator -(const SetExpr&, const SetExpr&);
1283 
1286  inter(const SetVarArgs&);
1289  setunion(const SetVarArgs&);
1292  setdunion(const SetVarArgs&);
1293 
1296  cardinality(const SetExpr&);
1299  min(const SetExpr&);
1302  max(const SetExpr&);
1303 
1306  operator ==(const SetExpr&, const SetExpr&);
1309  operator !=(const SetExpr&, const SetExpr&);
1312  operator <=(const SetExpr&, const SetExpr&);
1315  operator <=(const SetCmpRel&, const SetExpr&);
1318  operator >=(const SetExpr&, const SetExpr&);
1321  operator >=(const SetCmpRel&, const SetExpr&);
1324  operator ||(const SetExpr&, const SetExpr&);
1326 #endif
1327 
1329  class BoolExpr {
1330  public:
1332  enum NodeType {
1341  NT_MISC
1342  };
1345  public:
1347  Misc(void);
1352  virtual void post(Home home, BoolVar b, bool neg,
1353  const IntPropLevels& ipls) = 0;
1355  virtual GECODE_MINIMODEL_EXPORT ~Misc(void);
1356  };
1358  class Node;
1359  private:
1361  Node* n;
1362  public:
1365  BoolExpr(void);
1368  BoolExpr(const BoolExpr& e);
1371  BoolExpr(const BoolExpr& l, NodeType t, const BoolExpr& r);
1374  BoolExpr(const BoolVar& x);
1377  BoolExpr(const BoolExpr& e, NodeType t);
1380  BoolExpr(const LinIntRel& rl);
1381 #ifdef GECODE_HAS_FLOAT_VARS
1384  BoolExpr(const LinFloatRel& rfl);
1385 #endif
1386 #ifdef GECODE_HAS_SET_VARS
1389  BoolExpr(const SetRel& rs);
1392  BoolExpr(const SetCmpRel& rs);
1393 #endif
1396  explicit BoolExpr(Misc* m);
1399  BoolVar expr(Home home, const IntPropLevels& ipls) const;
1402  void rel(Home home, const IntPropLevels& ipls) const;
1405  const BoolExpr& operator =(const BoolExpr& e);
1408  ~BoolExpr(void);
1409  };
1410 
1423  operator !(const BoolExpr&);
1426  operator &&(const BoolExpr&, const BoolExpr&);
1429  operator ||(const BoolExpr&, const BoolExpr&);
1432  operator ^(const BoolExpr&, const BoolExpr&);
1433 
1436  operator !=(const BoolExpr&, const BoolExpr&);
1439  operator ==(const BoolExpr&, const BoolExpr&);
1442  operator >>(const BoolExpr&, const BoolExpr&);
1445  operator <<(const BoolExpr&, const BoolExpr&);
1446 
1448 
1458  dom(const IntVar& x, int n);
1461  dom(const IntVar& x, int l, int m);
1464  dom(const IntVar& x, const IntSet& s);
1465 
1466 #ifdef GECODE_HAS_SET_VARS
1469  dom(const SetVar& x, SetRelType rt, int i);
1472  dom(const SetVar& x, SetRelType rt, int i, int j);
1475  dom(const SetVar& x, SetRelType rt, const IntSet& s);
1476 #endif
1477 
1478 #ifdef GECODE_HAS_FLOAT_VARS
1481  dom(const FloatVar& x, const FloatVal& n);
1484  dom(const FloatVar& x, FloatNum l, FloatNum u);
1485 #endif
1487 
1495 #ifdef GECODE_HAS_SET_VARS
1498  operator ==(const SetExpr& s, const LinIntExpr& x);
1501  operator ==(const LinIntExpr& x, const SetExpr& s);
1503  BoolExpr
1504  operator ==(const LinIntExpr&, IntSet) = delete;
1506  BoolExpr
1507  operator ==(IntSet, const LinIntExpr&) = delete;
1508 
1511  operator !=(const SetExpr& s, const LinIntExpr& x);
1514  operator !=(const LinIntExpr& x, const SetExpr& s);
1516  BoolExpr
1517  operator !=(const LinIntExpr&, IntSet) = delete;
1519  BoolExpr
1520  operator !=(IntSet, const LinIntExpr&) = delete;
1521 
1524  operator <=(const SetExpr& s, const LinIntExpr& x);
1527  operator <=(const LinIntExpr& x, const SetExpr& s);
1530  operator <=(const LinIntExpr&, IntSet) = delete;
1533  operator <=(IntSet, const LinIntExpr&) = delete;
1534 
1537  operator <(const SetExpr& s, const LinIntExpr& x);
1540  operator <(const LinIntExpr& x, const SetExpr& s);
1543  operator <(const LinIntExpr&, IntSet) = delete;
1546  operator <(IntSet, const LinIntExpr&) = delete;
1547 
1550  operator >=(const SetExpr& s, const LinIntExpr& x);
1553  operator >=(const LinIntExpr& x, const SetExpr& s);
1555  BoolExpr
1556  operator >=(const LinIntExpr&, IntSet) = delete;
1558  BoolExpr
1559  operator >=(IntSet, const LinIntExpr&) = delete;
1560 
1563  operator >(const SetExpr& s, const LinIntExpr& x);
1566  operator >(const LinIntExpr& x, const SetExpr& s);
1568  BoolExpr
1569  operator >(const LinIntExpr&, IntSet) = delete;
1571  BoolExpr
1572  operator >(IntSet, const LinIntExpr&) = delete;
1573 #endif
1575 
1584  expr(Home home, const LinIntExpr& e,
1585  const IntPropLevels& ipls=IntPropLevels::def);
1586 #ifdef GECODE_HAS_FLOAT_VARS
1589  expr(Home home, const LinFloatExpr& e);
1590 #endif
1591 #ifdef GECODE_HAS_SET_VARS
1594  expr(Home home, const SetExpr& e);
1595 #endif
1598  expr(Home home, const BoolExpr& e,
1599  const IntPropLevels& ipls=IntPropLevels::def);
1602  rel(Home home, const BoolExpr& e,
1603  const IntPropLevels& ipls=IntPropLevels::def);
1605 
1606 }
1607 
1613 
1614 namespace Gecode {
1615 
1616  namespace MiniModel {
1617  class ExpInfo;
1618  }
1619 
1626  friend class MiniModel::ExpInfo;
1627  private:
1629  class Exp;
1631  Exp* e;
1633  REG(Exp* e);
1635  std::string toString(void) const;
1636  public:
1638  REG(void);
1640  REG(int s);
1647  REG(const IntArgs& x);
1648 
1650  REG(const REG& r);
1652  const REG& operator =(const REG& r);
1653 
1655  REG operator +(const REG& r);
1657  REG& operator +=(const REG& r);
1659  REG operator |(const REG& r);
1661  REG& operator |=(const REG& r);
1663  REG operator *(void);
1665  REG operator +(void);
1667  REG operator ()(unsigned int n, unsigned int m);
1669  REG operator ()(unsigned int n);
1671  template<class Char, class Traits>
1672  std::basic_ostream<Char,Traits>&
1673  print(std::basic_ostream<Char,Traits>& os) const;
1675  operator DFA(void);
1677  ~REG(void);
1678  };
1679 
1683  template<class Char, class Traits>
1684  std::basic_ostream<Char,Traits>&
1685  operator <<(std::basic_ostream<Char,Traits>& os, const REG& r);
1686 
1687 }
1688 
1689 #include <gecode/minimodel/reg.hpp>
1690 
1691 namespace Gecode {
1692 
1700  GECODE_MINIMODEL_EXPORT LinIntExpr
1701  operator *(const LinIntExpr& x, const LinIntExpr& y);
1703  GECODE_MINIMODEL_EXPORT LinIntExpr
1704  operator /(const LinIntExpr& x, const LinIntExpr& y);
1706  GECODE_MINIMODEL_EXPORT LinIntExpr
1707  operator %(const LinIntExpr& x, const LinIntExpr& y);
1709  GECODE_MINIMODEL_EXPORT LinIntExpr
1710  abs(const LinIntExpr& e);
1712  GECODE_MINIMODEL_EXPORT LinIntExpr
1713  min(const LinIntExpr& x, const LinIntExpr& y);
1715  GECODE_MINIMODEL_EXPORT LinIntExpr
1716  min(const IntVarArgs& x);
1718  GECODE_MINIMODEL_EXPORT LinIntExpr
1719  max(const LinIntExpr& x, const LinIntExpr& y);
1721  GECODE_MINIMODEL_EXPORT LinIntExpr
1722  max(const IntVarArgs& x);
1724  GECODE_MINIMODEL_EXPORT LinIntExpr
1725  sqr(const LinIntExpr& x);
1727  GECODE_MINIMODEL_EXPORT LinIntExpr
1728  sqrt(const LinIntExpr& x);
1730  GECODE_MINIMODEL_EXPORT LinIntExpr
1731  pow(const LinIntExpr& x, int n);
1733  GECODE_MINIMODEL_EXPORT LinIntExpr
1734  nroot(const LinIntExpr& x, int n);
1736  GECODE_MINIMODEL_EXPORT LinIntExpr
1737  element(const IntVarArgs& x, const LinIntExpr& y);
1739  GECODE_MINIMODEL_EXPORT BoolExpr
1740  element(const BoolVarArgs& x, const LinIntExpr& y);
1742  GECODE_MINIMODEL_EXPORT LinIntExpr
1743  element(const IntArgs& x, const LinIntExpr& y);
1745  GECODE_MINIMODEL_EXPORT LinIntExpr
1746  ite(const BoolExpr& b, const LinIntExpr& x, const LinIntExpr& y);
1748 
1749 #ifdef GECODE_HAS_FLOAT_VARS
1751  GECODE_MINIMODEL_EXPORT LinFloatExpr
1752  operator *(const FloatVar&, const FloatVar&);
1754  GECODE_MINIMODEL_EXPORT LinFloatExpr
1755  operator *(const FloatVar&, const LinFloatExpr&);
1757  GECODE_MINIMODEL_EXPORT LinFloatExpr
1758  operator *(const LinFloatExpr&, const FloatVar&);
1760  GECODE_MINIMODEL_EXPORT LinFloatExpr
1761  abs(const LinFloatExpr& e);
1763  GECODE_MINIMODEL_EXPORT LinFloatExpr
1764  min(const LinFloatExpr& x, const LinFloatExpr& y);
1766  GECODE_MINIMODEL_EXPORT LinFloatExpr
1767  min(const FloatVarArgs& x);
1769  GECODE_MINIMODEL_EXPORT LinFloatExpr
1770  max(const LinFloatExpr& x, const LinFloatExpr& y);
1772  GECODE_MINIMODEL_EXPORT LinFloatExpr
1773  max(const FloatVarArgs& x);
1775  GECODE_MINIMODEL_EXPORT LinFloatExpr
1776  operator *(const LinFloatExpr& x, const LinFloatExpr& y);
1778  GECODE_MINIMODEL_EXPORT LinFloatExpr
1779  operator /(const LinFloatExpr& x, const LinFloatExpr& y);
1781  GECODE_MINIMODEL_EXPORT LinFloatExpr
1782  sqr(const LinFloatExpr& x);
1784  GECODE_MINIMODEL_EXPORT LinFloatExpr
1785  sqrt(const LinFloatExpr& x);
1787  GECODE_MINIMODEL_EXPORT LinFloatExpr
1788  pow(const LinFloatExpr& x, int n);
1790  GECODE_MINIMODEL_EXPORT LinFloatExpr
1791  nroot(const LinFloatExpr& x, int n);
1793 
1794 #ifdef GECODE_HAS_MPFR
1802  GECODE_MINIMODEL_EXPORT LinFloatExpr
1803  exp(const LinFloatExpr& x);
1805  GECODE_MINIMODEL_EXPORT LinFloatExpr
1806  log(const LinFloatExpr& x);
1808 
1816  GECODE_MINIMODEL_EXPORT LinFloatExpr
1817  asin(const LinFloatExpr& x);
1819  GECODE_MINIMODEL_EXPORT LinFloatExpr
1820  sin(const LinFloatExpr& x);
1822  GECODE_MINIMODEL_EXPORT LinFloatExpr
1823  acos(const LinFloatExpr& x);
1825  GECODE_MINIMODEL_EXPORT LinFloatExpr
1826  cos(const LinFloatExpr& x);
1828  GECODE_MINIMODEL_EXPORT LinFloatExpr
1829  atan(const LinFloatExpr& x);
1831  GECODE_MINIMODEL_EXPORT LinFloatExpr
1832  tan(const LinFloatExpr& x);
1834 #endif
1835 #endif
1836 
1837 }
1838 
1839 namespace Gecode {
1840 
1848  BoolVar
1849  channel(Home home, IntVar x, IntPropLevel ipl=IPL_DEF);
1851  IntVar
1852  channel(Home home, BoolVar b, IntPropLevel ipl=IPL_DEF);
1853 #ifdef GECODE_HAS_FLOAT_VARS
1855  IntVar
1856  channel(Home home, FloatVar f);
1857 #endif
1858 #ifdef GECODE_HAS_SET_VARS
1860  SetVar
1861  channel(Home home, const IntVarArgs& x, IntPropLevel ipl=IPL_DEF);
1862 #endif
1864 
1865 }
1866 
1868 
1869 namespace Gecode {
1870 
1885  void
1886  atmost(Home home, const IntVarArgs& x, int n, int m,
1887  IntPropLevel ipl=IPL_DEF);
1892  void
1893  atmost(Home home, const IntVarArgs& x, IntVar y, int m,
1894  IntPropLevel ipl=IPL_DEF);
1902  void
1903  atmost(Home home, const IntVarArgs& x, const IntArgs& y, int m,
1904  IntPropLevel ipl=IPL_DEF);
1909  void
1910  atmost(Home home, const IntVarArgs& x, int n, IntVar z,
1911  IntPropLevel ipl=IPL_DEF);
1916  void
1917  atmost(Home home, const IntVarArgs& x, IntVar y, IntVar z,
1918  IntPropLevel ipl=IPL_DEF);
1926  void
1927  atmost(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
1928  IntPropLevel ipl=IPL_DEF);
1929 
1934  void
1935  atleast(Home home, const IntVarArgs& x, int n, int m,
1936  IntPropLevel ipl=IPL_DEF);
1941  void
1942  atleast(Home home, const IntVarArgs& x, IntVar y, int m,
1943  IntPropLevel ipl=IPL_DEF);
1951  void
1952  atleast(Home home, const IntVarArgs& x, const IntArgs& y, int m,
1953  IntPropLevel ipl=IPL_DEF);
1958  void
1959  atleast(Home home, const IntVarArgs& x, int n, IntVar z,
1960  IntPropLevel ipl=IPL_DEF);
1965  void
1966  atleast(Home home, const IntVarArgs& x, IntVar y, IntVar z,
1967  IntPropLevel ipl=IPL_DEF);
1975  void
1976  atleast(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
1977  IntPropLevel ipl=IPL_DEF);
1978 
1983  void
1984  exactly(Home home, const IntVarArgs& x, int n, int m,
1985  IntPropLevel ipl=IPL_DEF);
1990  void
1991  exactly(Home home, const IntVarArgs& x, IntVar y, int m,
1992  IntPropLevel ipl=IPL_DEF);
2000  void
2001  exactly(Home home, const IntVarArgs& x, const IntArgs& y, int m,
2002  IntPropLevel ipl=IPL_DEF);
2007  void
2008  exactly(Home home, const IntVarArgs& x, int n, IntVar z,
2009  IntPropLevel ipl=IPL_DEF);
2014  void
2015  exactly(Home home, const IntVarArgs& x, IntVar y, IntVar z,
2016  IntPropLevel ipl=IPL_DEF);
2024  void
2025  exactly(Home home, const IntVarArgs& x, const IntArgs& y, IntVar z,
2026  IntPropLevel ipl=IPL_DEF);
2027 
2030  void
2031  lex(Home home, const IntVarArgs& x, IntRelType r, const IntVarArgs& y,
2032  IntPropLevel ipl=IPL_DEF);
2035  void
2036  lex(Home home, const BoolVarArgs& x, IntRelType r, const BoolVarArgs& y,
2037  IntPropLevel ipl=IPL_DEF);
2038 
2041  void
2042  values(Home home, const IntVarArgs& x, IntSet y,
2043  IntPropLevel ipl=IPL_DEF);
2045 
2046 #ifdef GECODE_HAS_SET_VARS
2062  void
2063  channel(Home home, const IntVarArgs& x, SetVar y);
2064 
2067  void
2068  range(Home home, const IntVarArgs& x, SetVar y, SetVar z);
2069 
2075  void
2076  roots(Home home, const IntVarArgs& x, SetVar y, SetVar z);
2078 
2079 #endif
2080 
2081 }
2082 
2084 
2085 namespace Gecode {
2086 
2087  template<class> class Matrix;
2088 
2096  template<class A>
2097  class Slice {
2098  public:
2101  private:
2102  ArgsType _r;
2103  int _fc,
2104  _tc,
2105  _fr,
2106  _tr;
2107  public:
2109  Slice(const Matrix<A>& a, int fc, int tc, int fr, int tr);
2113  Slice& reverse(void);
2115  operator ArgsType(void);
2117  operator Matrix<ArgsType>(void);
2118 
2120  operator const ArgsType(void) const;
2122  operator const Matrix<ArgsType>(void) const;
2123  };
2124 
2126  template<class A>
2127  typename Slice<A>::ArgsType
2128  operator+(const Slice<A>& x, const Slice<A>& y);
2129 
2131  template<class A>
2132  typename Slice<A>::ArgsType
2133  operator+(const Slice<A>& x, const typename ArrayTraits<A>::ArgsType& y);
2134 
2136  template<class A>
2137  typename Slice<A>::ArgsType
2138  operator+(const typename ArrayTraits<A>::ArgsType& x, const Slice<A>& y);
2139 
2141  template<class A>
2142  typename Slice<A>::ArgsType
2143  operator+(const Slice<A>& x, const typename ArrayTraits<A>::ValueType& y);
2144 
2146  template<class A>
2147  typename Slice<A>::ArgsType
2148  operator+(const typename ArrayTraits<A>::ValueType& x, const Slice<A>& y);
2149 
2160  template<class A>
2161  class Matrix {
2162  public:
2167 
2168  private:
2170  typedef typename ArrayTraits<A>::StorageType StorageType;
2171  StorageType _a;
2172  int _w;
2173  int _h;
2174 
2175  public:
2188  Matrix(A a, int w, int h);
2189 
2202  Matrix(A a, int n);
2203 
2205  int width(void) const;
2207  int height(void) const;
2209  ArgsType const get_array(void) const;
2210 
2216  ValueType& operator ()(int c, int r);
2217 
2223  const ValueType& operator ()(int c, int r) const;
2224 
2234  Slice<A> slice(int fc, int tc, int fr, int tr) const;
2235 
2237  Slice<A> row(int r) const;
2238 
2240  Slice<A> col(int c) const;
2241  };
2242 
2246  template<class Char, class Traits, class A>
2247  std::basic_ostream<Char,Traits>&
2248  operator <<(std::basic_ostream<Char,Traits>& os, const Matrix<A>& m);
2249 
2253  template<class Char, class Traits, class A>
2254  std::basic_ostream<Char,Traits>&
2255  operator <<(std::basic_ostream<Char,Traits>& os, const Slice<A>& s);
2256 
2263  void element(Home home, const Matrix<IntArgs>& m, IntVar x, IntVar y,
2264  IntVar z, IntPropLevel ipl=IPL_DEF);
2271  void element(Home home, const Matrix<IntArgs>& m, IntVar x, IntVar y,
2272  BoolVar z, IntPropLevel ipl=IPL_DEF);
2279  void element(Home home, const Matrix<IntVarArgs>& m, IntVar x, IntVar y,
2280  IntVar z, IntPropLevel ipl=IPL_DEF);
2287  void element(Home home, const Matrix<BoolVarArgs>& m, IntVar x, IntVar y,
2288  BoolVar z, IntPropLevel ipln=IPL_DEF);
2289 #ifdef GECODE_HAS_SET_VARS
2296  void element(Home home, const Matrix<IntSetArgs>& m, IntVar x, IntVar y,
2297  SetVar z);
2304  void element(Home home, const Matrix<SetVarArgs>& m, IntVar x, IntVar y,
2305  SetVar z);
2306 #endif
2307 
2311  template<class A>
2316  template<class A>
2321  template<class A>
2326  template<class A>
2333  template<class A>
2335 }
2336 
2337 #include <gecode/minimodel/matrix.hpp>
2338 #include <gecode/minimodel/ldsb.hpp>
2339 
2344 namespace Gecode {
2345 
2347  GECODE_MINIMODEL_EXPORT LinIntExpr
2348  sum(const Slice<IntArgs>& slice);
2350  GECODE_MINIMODEL_EXPORT LinIntExpr
2351  sum(const Matrix<IntArgs>& matrix);
2352 
2353 }
2356 namespace Gecode {
2357 
2372  public:
2374  IntMinimizeSpace(void);
2379  virtual void constrain(const Space& best);
2381  virtual IntVar cost(void) const = 0;
2382  };
2383 
2389  public:
2391  IntMaximizeSpace(void);
2396  virtual void constrain(const Space& best);
2398  virtual IntVar cost(void) const = 0;
2399  };
2400 
2406  public:
2408  IntLexMinimizeSpace(void);
2413  virtual void constrain(const Space& best);
2415  virtual IntVarArgs cost(void) const = 0;
2416  };
2417 
2423  public:
2425  IntLexMaximizeSpace(void);
2430  virtual void constrain(const Space& best);
2432  virtual IntVarArgs cost(void) const = 0;
2433  };
2434 
2435 #ifdef GECODE_HAS_FLOAT_VARS
2436 
2447  protected:
2450  public:
2457  virtual void constrain(const Space& best);
2459  virtual FloatVar cost(void) const = 0;
2460  };
2461 
2472  protected:
2475  public:
2482  virtual void constrain(const Space& best);
2484  virtual FloatVar cost(void) const = 0;
2485  };
2486 
2487 #endif
2488 
2489 }
2490 
2492 
2493 #endif
2494 
2495 // IFDEF: GECODE_HAS_INT_VARS
2496 // STATISTICS: minimodel-any
2497 
void lex(Home home, const IntVarArgs &x, IntRelType r, const IntVarArgs &y, IntPropLevel ipl)
Post lexical order between x and y.
Definition: aliases.hpp:132
void atmost(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl)
Post constraint .
Definition: aliases.hpp:39
void atleast(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl)
Post constraint .
Definition: aliases.hpp:70
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
Definition: aliases.hpp:158
void roots(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
Definition: aliases.hpp:163
void values(Home home, const IntVarArgs &x, IntSet y, IntPropLevel ipl)
Post constraint .
Definition: aliases.hpp:143
void exactly(Home home, const IntVarArgs &x, int n, int m, IntPropLevel ipl)
Post constraint .
Definition: aliases.hpp:101
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
NNF * l
Left subtree.
Definition: bool-expr.cpp:240
NodeType t
Type of node.
Definition: bool-expr.cpp:230
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:232
union Gecode::@602::NNF::@65 u
Union depending on nodetype t.
BoolVar expr(Home home, const BoolExpr &e, const IntPropLevels &ipls)
Post Boolean expression and return its value.
Definition: bool-expr.cpp:629
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:234
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:249
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
NNF * r
Right subtree.
Definition: bool-expr.cpp:242
bool neg
Is atomic formula negative.
Definition: bool-expr.cpp:247
Traits of arrays in Gecode.
Definition: array.hpp:94
Miscealloneous Boolean expressions.
Definition: minimodel.hh:1344
virtual void post(Home home, BoolVar b, bool neg, const IntPropLevels &ipls)=0
Node for Boolean expression
Definition: bool-expr.cpp:43
Boolean expressions.
Definition: minimodel.hh:1329
BoolExpr(void)
Default constructor.
Definition: bool-expr.cpp:114
NodeType
Type of Boolean expression.
Definition: minimodel.hh:1332
@ NT_RLINFLOAT
Reified linear relation.
Definition: minimodel.hh:1339
@ NT_AND
Conjunction.
Definition: minimodel.hh:1335
@ NT_EQV
Equivalence.
Definition: minimodel.hh:1337
@ NT_RLIN
Reified linear relation.
Definition: minimodel.hh:1338
@ NT_VAR
Variable.
Definition: minimodel.hh:1333
@ NT_OR
Disjunction.
Definition: minimodel.hh:1336
@ NT_MISC
Other Boolean expression.
Definition: minimodel.hh:1341
@ NT_NOT
Negation.
Definition: minimodel.hh:1334
@ NT_RSET
Reified set relation.
Definition: minimodel.hh:1340
const BoolExpr & operator=(const BoolExpr &e)
Assignment operator.
Definition: bool-expr.cpp:206
BoolVar expr(Home home, const IntPropLevels &ipls) const
Post propagators for expression.
Definition: bool-expr.cpp:574
~BoolExpr(void)
Destructor.
Definition: bool-expr.cpp:218
void rel(Home home, const IntPropLevels &ipls) const
Post propagators for relation.
Definition: bool-expr.cpp:580
Passing Boolean variables.
Definition: int.hh:712
Boolean integer variables.
Definition: int.hh:512
Deterministic finite automaton (DFA)
Definition: int.hh:2049
Class for maximizing float cost.
Definition: minimodel.hh:2471
FloatNum step
Step by which a next solution has to have lower cost.
Definition: minimodel.hh:2474
virtual FloatVar cost(void) const =0
Return variable with current cost.
Class for minimizing float cost.
Definition: minimodel.hh:2446
virtual FloatVar cost(void) const =0
Return variable with current cost.
FloatNum step
Step by which a next solution has to have lower cost.
Definition: minimodel.hh:2449
Passing float arguments.
Definition: float.hh:950
Float value type.
Definition: float.hh:334
Passing float variables.
Definition: float.hh:979
Float variables.
Definition: float.hh:870
Base class for heap allocated objects.
Definition: heap.hpp:340
Home class for posting propagators
Definition: core.hpp:856
Passing integer arguments.
Definition: int.hh:628
Class for lexicographically maximizing integer costs.
Definition: minimodel.hh:2422
virtual IntVarArgs cost(void) const =0
Return variables with current costs.
Class for lexicographically minimizing integer costs.
Definition: minimodel.hh:2405
virtual IntVarArgs cost(void) const =0
Return variables with current costs.
Class for maximizing integer cost.
Definition: minimodel.hh:2388
virtual IntVar cost(void) const =0
Return variable with current cost.
Class for minimizing integer cost.
Definition: minimodel.hh:2371
virtual IntVar cost(void) const =0
Return variable with current cost.
Class for specifying integer propagation levels used by minimodel.
Definition: minimodel.hh:101
IntPropLevel _linear
For n-ary linear.
Definition: minimodel.hh:104
IntPropLevel div(void) const
Return integer propagation level for division constraints.
Definition: ipl.hpp:114
IntPropLevel element(void) const
Return integer propagation level for element constraints.
Definition: ipl.hpp:164
IntPropLevel _sqr
For square.
Definition: minimodel.hh:113
IntPropLevel mod(void) const
Return integer propagation level for modulo constraints.
Definition: ipl.hpp:122
IntPropLevel linear(void) const
Return integer propagation level for non-binary linear constraints.
Definition: ipl.hpp:55
IntPropLevel max2(void) const
Return integer propagation level for binary maximum constraints.
Definition: ipl.hpp:73
IntPropLevel _mult
For multiplication.
Definition: minimodel.hh:110
IntPropLevel _mod
For modulo.
Definition: minimodel.hh:112
IntPropLevel ite(void) const
Return integer propagation level for if-then-else constraints.
Definition: ipl.hpp:173
IntPropLevel mult(void) const
Return integer propagation level for multiplication constraints.
Definition: ipl.hpp:106
IntPropLevel min(void) const
Return integer propagation level for non-binary minimum constraints.
Definition: ipl.hpp:97
IntPropLevel _sqrt
For square root.
Definition: minimodel.hh:114
IntPropLevel _ite
For if-then-else.
Definition: minimodel.hh:118
IntPropLevel nroot(void) const
Return integer propagation level for root constraints.
Definition: ipl.hpp:155
IntPropLevel abs(void) const
Return integer propagation level for absolute value constraints.
Definition: ipl.hpp:64
IntPropLevel _max
For n-ary maximum.
Definition: minimodel.hh:107
IntPropLevel _nroot
For root.
Definition: minimodel.hh:116
IntPropLevel _pow
For power.
Definition: minimodel.hh:115
IntPropLevel _element
For element.
Definition: minimodel.hh:117
IntPropLevel _div
For division.
Definition: minimodel.hh:111
IntPropLevel _abs
For absolute value.
Definition: minimodel.hh:105
IntPropLevel sqrt(void) const
Return integer propagation level for square root constraints.
Definition: ipl.hpp:139
IntPropLevels(IntPropLevel ipl=IPL_DEF)
Initialize with default propagation level.
Definition: ipl.hpp:37
static const IntPropLevels def
Default propagation levels for all constraints.
Definition: minimodel.hh:197
IntPropLevel linear2(void) const
Return integer propagation level for binary linear constraints.
Definition: ipl.hpp:47
IntPropLevel min2(void) const
Return integer propagation level for binary minimum constraints.
Definition: ipl.hpp:89
IntPropLevel _min2
For binary minimum.
Definition: minimodel.hh:108
IntPropLevel pow(void) const
Return integer propagation level for power constraints.
Definition: ipl.hpp:147
IntPropLevel _min
For minimum.
Definition: minimodel.hh:109
IntPropLevel _linear2
For binary linear.
Definition: minimodel.hh:103
IntPropLevel _max2
For binary maximum.
Definition: minimodel.hh:106
IntPropLevel max(void) const
Return integer propagation level for non-binary maximum constraints.
Definition: ipl.hpp:81
IntPropLevel sqr(void) const
Return integer propagation level for square constraints.
Definition: ipl.hpp:131
Integer sets.
Definition: int.hh:174
Passing integer variables.
Definition: int.hh:656
Integer variables.
Definition: int.hh:371
Float expressions
Definition: minimodel.hh:822
NonLinFloatExpr * nlfe(void) const
Return non-linear expression inside, or null if not non-linear.
Definition: float-expr.cpp:138
LinFloatExpr(void)
Default constructor.
Definition: float-expr.cpp:226
const LinFloatExpr & operator=(const LinFloatExpr &e)
Assignment operator.
Definition: float-expr.cpp:328
~LinFloatExpr(void)
Destructor.
Definition: float-expr.cpp:337
void post(Home home, FloatRelType frt) const
Post propagator.
Definition: float-expr.cpp:152
NodeType
Type of linear expression.
Definition: minimodel.hh:826
@ NT_VAR
Linear term with variable.
Definition: minimodel.hh:828
@ NT_CONST
Float value constant.
Definition: minimodel.hh:827
@ NT_SUM
Sum of float variables.
Definition: minimodel.hh:830
@ NT_NONLIN
Non-linear expression.
Definition: minimodel.hh:829
@ NT_ADD
Addition of linear terms.
Definition: minimodel.hh:831
@ NT_MUL
Multiplication by coefficient.
Definition: minimodel.hh:833
@ NT_SUB
Subtraction of linear terms.
Definition: minimodel.hh:832
Linear relations.
Definition: minimodel.hh:896
void post(Home home, bool t) const
Post propagator for relation (if t is false for negated relation)
Definition: float-rel.hpp:72
Linear expressions over integer variables.
Definition: minimodel.hh:245
NodeType
Type of linear expression.
Definition: minimodel.hh:255
@ NT_CONST
Integer constant.
Definition: minimodel.hh:256
@ NT_SUB
Subtraction of linear terms.
Definition: minimodel.hh:263
@ NT_SUM_BOOL
Sum of Boolean variables.
Definition: minimodel.hh:261
@ NT_ADD
Addition of linear terms.
Definition: minimodel.hh:262
@ NT_SUM_INT
Sum of integer variables.
Definition: minimodel.hh:260
@ NT_VAR_BOOL
Linear term with Boolean variable.
Definition: minimodel.hh:258
@ NT_MUL
Multiplication by coefficient.
Definition: minimodel.hh:264
@ NT_NONLIN
Non-linear expression.
Definition: minimodel.hh:259
@ NT_VAR_INT
Linear term with integer variable.
Definition: minimodel.hh:257
LinIntExpr(void)
Default constructor.
Definition: int-expr.cpp:363
~LinIntExpr(void)
Destructor.
Definition: int-expr.cpp:514
void post(Home home, IntRelType irt, const IntPropLevels &ipls) const
Post propagator.
Definition: int-expr.cpp:156
const LinIntExpr & operator=(const LinIntExpr &e)
Assignment operator.
Definition: int-expr.cpp:505
NonLinIntExpr * nle(void) const
Return non-linear expression inside, or null if not non-linear.
Definition: int-expr.cpp:359
Linear relations over integer variables.
Definition: minimodel.hh:335
void post(Home home, bool t, const IntPropLevels &ipls) const
Post propagator for relation (if t is false for negated relation)
Definition: int-rel.hpp:70
Matrix-interface for arrays.
Definition: minimodel.hh:2161
int width(void) const
Return the width of the matrix.
Definition: matrix.hpp:143
ValueType & operator()(int c, int r)
Access element (c, r) of the matrix.
Definition: matrix.hpp:155
Slice< A > slice(int fc, int tc, int fr, int tr) const
Access slice of the matrix.
Definition: matrix.hpp:171
Slice< A > col(int c) const
Access column c.
Definition: matrix.hpp:183
ArrayTraits< A >::ValueType ValueType
The type of elements of this array.
Definition: minimodel.hh:2164
Slice< A > row(int r) const
Access row r.
Definition: matrix.hpp:177
ArgsType const get_array(void) const
Return an Args-array of the contents of the matrix.
Definition: matrix.hpp:149
Matrix(A a, int w, int h)
Basic constructor.
Definition: matrix.hpp:127
ArrayTraits< A >::ArgsType ArgsType
The type of the Args-array type for ValueType values.
Definition: minimodel.hh:2166
int height(void) const
Return the height of the matrix.
Definition: matrix.hpp:146
Expression information.
Definition: reg.cpp:534
Base class for non-linear float expressions.
Definition: minimodel.hh:794
virtual void post(Home home, FloatRelType frt, FloatVal c) const =0
Post expression to be in relation frt with c.
static FloatVar result(Home home, FloatVar *x)
Return fresh variable if x is null, x otherwise.
Definition: float-expr.hpp:40
virtual ~NonLinFloatExpr(void)
Destructor.
Definition: float-expr.hpp:37
virtual void post(Home home, FloatRelType frt, FloatVal c, BoolVar b) const =0
Post reified expression to be in relation frt with c.
virtual FloatVar post(Home home, FloatVar *ret) const =0
Return variable constrained to be equal to the expression.
Base class for non-linear expressions over integer variables.
Definition: minimodel.hh:215
virtual void post(Home home, IntRelType irt, int c, BoolVar b, const IntPropLevels &ipls) const =0
Post reified expression to be in relation irt with c.
static IntVar result(Home home, IntVar *x)
Return fresh variable if x is null, x otherwise.
Definition: int-expr.hpp:40
virtual void post(Home home, IntRelType irt, int c, const IntPropLevels &ipls) const =0
Post expression to be in relation irt with c.
virtual IntVar post(Home home, IntVar *ret, const IntPropLevels &ipls) const =0
Return variable constrained to be equal to the expression.
virtual ~NonLinIntExpr(void)
Destructor.
Definition: int-expr.hpp:37
Implementation of the actual expression tree.
Definition: reg.cpp:52
Regular expressions over integer values.
Definition: minimodel.hh:1625
Comparison relation (for two-sided comparisons)
Definition: minimodel.hh:1221
SetRelType srt
Which relation.
Definition: minimodel.hh:1228
SetExpr l
Left side of relation.
Definition: minimodel.hh:1224
SetExpr r
Right side of relation.
Definition: minimodel.hh:1226
SetCmpRel(const SetExpr &l, SetRelType srt, const SetExpr &r)
Constructor.
Definition: set-rel.hpp:43
Set expressions
Definition: minimodel.hh:1164
SetExpr(void)
Default constructor.
Definition: set-expr.hpp:44
SetVar post(Home home) const
Post propagators for expression.
Definition: set-expr.cpp:649
~SetExpr(void)
Destructor.
Definition: set-expr.cpp:639
NodeType
Type of set expression.
Definition: minimodel.hh:1167
@ NT_CMPL
Complement.
Definition: minimodel.hh:1171
@ NT_INTER
Intersection.
Definition: minimodel.hh:1172
@ NT_DUNION
Disjoint union.
Definition: minimodel.hh:1174
@ NT_UNION
Union.
Definition: minimodel.hh:1173
@ NT_VAR
Variable.
Definition: minimodel.hh:1168
@ NT_LEXP
Linear expression.
Definition: minimodel.hh:1170
@ NT_CONST
Constant.
Definition: minimodel.hh:1169
const SetExpr & operator=(const SetExpr &e)
Assignment operator.
Definition: set-expr.cpp:629
Set relations
Definition: minimodel.hh:1234
void post(Home home, bool t) const
Post propagators for relation (or negated relation if t is false)
Definition: set-rel.hpp:58
SetRel(void)
Default constructor.
Definition: set-rel.hpp:47
Passing set variables.
Definition: set.hh:488
Set variables
Definition: set.hh:127
A slice of a matrix.
Definition: minimodel.hh:2097
Slice(const Matrix< A > &a, int fc, int tc, int fr, int tr)
Construct slice.
Definition: matrix.hpp:43
Slice & reverse(void)
Reverses the contents of the slice, and returns a reference to it.
Definition: matrix.hpp:62
ArrayTraits< A >::ArgsType ArgsType
The type of the Args-array type for ValueType values.
Definition: minimodel.hh:2100
Computation spaces.
Definition: core.hpp:1742
A reference-counted pointer to a SymmetryObject.
Definition: int.hh:5255
LinFloatExpr sum(const FloatVarArgs &x)
Construct linear float expression as sum of float variables.
Definition: float-expr.cpp:546
FloatVal operator+(const FloatVal &x)
Definition: val.hpp:164
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: channel.cpp:41
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition: dom.cpp:40
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
Definition: element.cpp:39
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:43
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition: bool.cpp:39
double FloatNum
Floating point number base type.
Definition: float.hh:106
FloatRelType
Relation types for floats.
Definition: float.hh:1068
IntRelType
Relation types for integers.
Definition: int.hh:925
IntPropLevel
Propagation levels for integer propagators.
Definition: int.hh:974
@ _IPL_BITS
Number of bits required (internal)
Definition: int.hh:984
@ IPL_DEF
Simple propagation levels.
Definition: int.hh:976
SetRelType
Common relation types for sets.
Definition: set.hh:643
void print(const Search::Statistics &stat, bool restart)
Print statistics.
Definition: job-shop.cpp:606
SymmetryHandle rows_reflect(const Matrix< A > &m)
Reflect rows symmetry specification.
Definition: ldsb.hpp:62
SymmetryHandle columns_reflect(const Matrix< A > &m)
Reflect columns symmetry specification.
Definition: ldsb.hpp:85
SymmetryHandle rows_interchange(const Matrix< A > &m)
Interchangeable rows symmetry specification.
Definition: ldsb.hpp:40
SymmetryHandle diagonal_reflect(const Matrix< A > &m)
Reflect around main diagonal symmetry specification.
Definition: ldsb.hpp:108
SymmetryHandle columns_interchange(const Matrix< A > &m)
Interchangeable columns symmetry specification.
Definition: ldsb.hpp:51
#define GECODE_MINIMODEL_EXPORT
Definition: minimodel.hh:78
const FloatNum max
Largest allowed float value.
Definition: float.hh:844
const FloatNum min
Smallest allowed float value.
Definition: float.hh:846
const unsigned int slice
Size of a slice in a portfolio and scale factor for restarts(in number of failures)
Definition: search.hh:128
Gecode::FloatVal c(-8, 8)
Gecode::IntArgs i({1, 2, 3, 4})
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const Dictionary &d)
Print statistics summary.
Definition: scowl.hpp:13625
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
Definition: set-expr.cpp:696
SetExpr setdunion(const SetVarArgs &x)
Disjoint union of set variables.
Definition: set-expr.cpp:714
SetExpr setunion(const SetVarArgs &x)
Union of set variables.
Definition: set-expr.cpp:705
SetExpr singleton(const LinIntExpr &e)
Singleton expression.
Definition: set-expr.cpp:691
LinIntExpr cardinality(const SetExpr &e)
Cardinality of set expression.
Definition: set-expr.cpp:817
#define GECODE_VTABLE_EXPORT
Definition: support.hh:72