Generated on for Gecode by doxygen 1.17.0
registry-set.cpp
Go to the documentation of this file.
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Guido Tack <tack@gecode.dev>
5 *
6 * Contributing authors:
7 * Mikael Zayenz Lagerkvist <lagerkvist@gmail.com>
8 *
9 * Copyright:
10 * Guido Tack, 2007
11 * Mikael Zayenz Lagerkvist, 2009
12 *
13 * This file is part of Gecode, the generic constraint
14 * development environment:
15 * http://www.gecode.dev
16 *
17 * Permission is hereby granted, free of charge, to any person obtaining
18 * a copy of this software and associated documentation files (the
19 * "Software"), to deal in the Software without restriction, including
20 * without limitation the rights to use, copy, modify, merge, publish,
21 * distribute, sublicense, and/or sell copies of the Software, and to
22 * permit persons to whom the Software is furnished to do so, subject to
23 * the following conditions:
24 *
25 * The above copyright notice and this permission notice shall be
26 * included in all copies or substantial portions of the Software.
27 *
28 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 *
36 */
37
39#include <gecode/minimodel.hh>
40#ifdef GECODE_HAS_SET_VARS
41#include <gecode/set.hh>
42#endif
43
44namespace Gecode { namespace FlatZinc {
45
46#ifdef GECODE_HAS_SET_VARS
47 namespace {
48 void p_set_OP(FlatZincSpace& s, SetOpType op,
49 const ConExpr& ce, AST::Node *) {
50 rel(s, s.arg2SetVar(ce[0]), op, s.arg2SetVar(ce[1]),
51 SRT_EQ, s.arg2SetVar(ce[2]));
52 }
53 void p_set_union(FlatZincSpace& s, const ConExpr& ce, AST::Node *ann) {
54 p_set_OP(s, SOT_UNION, ce, ann);
55 }
56 void p_set_intersect(FlatZincSpace& s, const ConExpr& ce, AST::Node *ann) {
57 p_set_OP(s, SOT_INTER, ce, ann);
58 }
59 void p_set_diff(FlatZincSpace& s, const ConExpr& ce, AST::Node *ann) {
60 p_set_OP(s, SOT_MINUS, ce, ann);
61 }
62
63 void p_set_symdiff(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
64 SetVar x = s.arg2SetVar(ce[0]);
65 SetVar y = s.arg2SetVar(ce[1]);
66
67 SetVarLubRanges xub(x);
68 IntSet xubs(xub);
69 SetVar x_y(s,IntSet::empty,xubs);
70 rel(s, x, SOT_MINUS, y, SRT_EQ, x_y);
71
72 SetVarLubRanges yub(y);
73 IntSet yubs(yub);
74 SetVar y_x(s,IntSet::empty,yubs);
75 rel(s, y, SOT_MINUS, x, SRT_EQ, y_x);
76
77 rel(s, x_y, SOT_UNION, y_x, SRT_EQ, s.arg2SetVar(ce[2]));
78 }
79
80 void p_array_set_OP(FlatZincSpace& s, SetOpType op,
81 const ConExpr& ce, AST::Node *) {
82 SetVarArgs xs = s.arg2setvarargs(ce[0]);
83 rel(s, op, xs, s.arg2SetVar(ce[1]));
84 }
85 void p_array_set_union(FlatZincSpace& s, const ConExpr& ce, AST::Node *ann) {
86 p_array_set_OP(s, SOT_UNION, ce, ann);
87 }
88 void p_array_set_partition(FlatZincSpace& s, const ConExpr& ce, AST::Node *ann) {
89 p_array_set_OP(s, SOT_DUNION, ce, ann);
90 }
91
92
93 void p_set_rel(FlatZincSpace& s, SetRelType srt, const ConExpr& ce) {
94 rel(s, s.arg2SetVar(ce[0]), srt, s.arg2SetVar(ce[1]));
95 }
96
97 void p_set_eq(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
98 p_set_rel(s, SRT_EQ, ce);
99 }
100 void p_set_ne(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
101 p_set_rel(s, SRT_NQ, ce);
102 }
103 void p_set_subset(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
104 p_set_rel(s, SRT_SUB, ce);
105 }
106 void p_set_superset(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
107 p_set_rel(s, SRT_SUP, ce);
108 }
109 void p_set_le(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
110 p_set_rel(s, SRT_LQ, ce);
111 }
112 void p_set_lt(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
113 p_set_rel(s, SRT_LE, ce);
114 }
115 void p_set_card(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
116 if (!ce[1]->isIntVar()) {
117 cardinality(s, s.arg2SetVar(ce[0]), ce[1]->getInt(),
118 ce[1]->getInt());
119 } else {
120 cardinality(s, s.arg2SetVar(ce[0]), s.arg2IntVar(ce[1]));
121 }
122 }
123 void p_set_in(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
124 if (!ce[1]->isSetVar()) {
125 IntSet d = s.arg2intset(ce[1]);
126 if (ce[0]->isBoolVar()) {
127 IntSetRanges dr(d);
128 Iter::Ranges::Singleton sr(0,1);
129 Iter::Ranges::Inter<IntSetRanges,Iter::Ranges::Singleton> i(dr,sr);
130 IntSet d01(i);
131 if (d01.size() == 0) {
132 s.fail();
133 } else {
134 rel(s, s.arg2BoolVar(ce[0]), IRT_GQ, d01.min());
135 rel(s, s.arg2BoolVar(ce[0]), IRT_LQ, d01.max());
136 }
137 } else {
138 dom(s, s.arg2IntVar(ce[0]), d);
139 }
140 } else {
141 if (!ce[0]->isIntVar()) {
142 dom(s, s.arg2SetVar(ce[1]), SRT_SUP, ce[0]->getInt());
143 } else {
144 rel(s, s.arg2SetVar(ce[1]), SRT_SUP, s.arg2IntVar(ce[0]));
145 }
146 }
147 }
148 void p_set_rel_reif(FlatZincSpace& s, SetRelType srt, const ConExpr& ce) {
149 rel(s, s.arg2SetVar(ce[0]), srt, s.arg2SetVar(ce[1]),
150 s.arg2BoolVar(ce[2]));
151 }
152
153 void p_set_eq_reif(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
154 p_set_rel_reif(s,SRT_EQ,ce);
155 }
156 void p_set_le_reif(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
157 p_set_rel_reif(s,SRT_LQ,ce);
158 }
159 void p_set_lt_reif(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
160 p_set_rel_reif(s,SRT_LE,ce);
161 }
162 void p_set_ne_reif(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
163 p_set_rel_reif(s,SRT_NQ,ce);
164 }
165 void p_set_subset_reif(FlatZincSpace& s, const ConExpr& ce,
166 AST::Node *) {
167 p_set_rel_reif(s,SRT_SUB,ce);
168 }
169 void p_set_superset_reif(FlatZincSpace& s, const ConExpr& ce,
170 AST::Node *) {
171 p_set_rel_reif(s,SRT_SUP,ce);
172 }
173 void p_set_in_reif(FlatZincSpace& s, const ConExpr& ce, AST::Node* ann, ReifyMode rm) {
174 if (!ce[1]->isSetVar()) {
175 if (rm==RM_EQV) {
177 } else {
178 assert(rm==RM_IMP);
180 }
181 } else {
182 if (!ce[0]->isIntVar()) {
183 dom(s, s.arg2SetVar(ce[1]), SRT_SUP, ce[0]->getInt(),
184 Reify(s.arg2BoolVar(ce[2]),rm));
185 } else {
186 rel(s, s.arg2SetVar(ce[1]), SRT_SUP, s.arg2IntVar(ce[0]),
187 Reify(s.arg2BoolVar(ce[2]),rm));
188 }
189 }
190 }
191 void p_set_in_reif(FlatZincSpace& s, const ConExpr& ce, AST::Node* ann) {
192 p_set_in_reif(s,ce,ann,RM_EQV);
193 }
194 void p_set_in_imp(FlatZincSpace& s, const ConExpr& ce, AST::Node* ann) {
195 p_set_in_reif(s,ce,ann,RM_IMP);
196 }
197 void p_set_disjoint(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
198 rel(s, s.arg2SetVar(ce[0]), SRT_DISJ, s.arg2SetVar(ce[1]));
199 }
200
201 void p_link_set_to_booleans(FlatZincSpace& s, const ConExpr& ce,
202 AST::Node *) {
203 SetVar x = s.arg2SetVar(ce[0]);
204 int idx = ce[2]->getInt();
205 assert(idx >= 0);
206 rel(s, x || IntSet(Set::Limits::min,idx-1));
207 BoolVarArgs y = s.arg2boolvarargs(ce[1],idx);
208 unshare(s, y);
209 channel(s, y, x);
210 }
211
212 void p_array_set_element(FlatZincSpace& s, const ConExpr& ce,
213 AST::Node*) {
214 bool isConstant = true;
215 AST::Array* a = ce[1]->getArray();
216 for (int i=a->a.size(); i--;) {
217 if (a->a[i]->isSetVar()) {
218 isConstant = false;
219 break;
220 }
221 }
222 IntVar selector = s.arg2IntVar(ce[0]);
223 rel(s, selector > 0);
224 if (isConstant) {
225 IntSetArgs sv = s.arg2intsetargs(ce[1],1);
226 element(s, sv, selector, s.arg2SetVar(ce[2]));
227 } else {
228 SetVarArgs sv = s.arg2setvarargs(ce[1], 1);
229 element(s, sv, selector, s.arg2SetVar(ce[2]));
230 }
231 }
232
233 void p_array_set_element_op(FlatZincSpace& s, const ConExpr& ce,
234 AST::Node*, SetOpType op,
235 const IntSet& universe =
237 bool isConstant = true;
238 AST::Array* a = ce[1]->getArray();
239 for (int i=a->a.size(); i--;) {
240 if (a->a[i]->isSetVar()) {
241 isConstant = false;
242 break;
243 }
244 }
245 SetVar selector = s.arg2SetVar(ce[0]);
246 dom(s, selector, SRT_DISJ, 0);
247 if (isConstant) {
248 IntSetArgs sv = s.arg2intsetargs(ce[1], 1);
249 element(s, op, sv, selector, s.arg2SetVar(ce[2]), universe);
250 } else {
251 SetVarArgs sv = s.arg2setvarargs(ce[1], 1);
252 element(s, op, sv, selector, s.arg2SetVar(ce[2]), universe);
253 }
254 }
255
256 void p_array_set_element_union(FlatZincSpace& s, const ConExpr& ce,
257 AST::Node* ann) {
258 p_array_set_element_op(s, ce, ann, SOT_UNION);
259 }
260
261 void p_array_set_element_intersect(FlatZincSpace& s, const ConExpr& ce,
262 AST::Node* ann) {
263 p_array_set_element_op(s, ce, ann, SOT_INTER);
264 }
265
266 void p_array_set_element_intersect_in(FlatZincSpace& s,
267 const ConExpr& ce,
268 AST::Node* ann) {
269 IntSet d = s.arg2intset(ce[3]);
270 p_array_set_element_op(s, ce, ann, SOT_INTER, d);
271 }
272
273 void p_array_set_element_partition(FlatZincSpace& s, const ConExpr& ce,
274 AST::Node* ann) {
275 p_array_set_element_op(s, ce, ann, SOT_DUNION);
276 }
277
278 void p_set_convex(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
279 convex(s, s.arg2SetVar(ce[0]));
280 }
281
282 void p_array_set_seq(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
283 SetVarArgs sv = s.arg2setvarargs(ce[0]);
284 if (sv.size() > 0)
285 sequence(s, sv);
286 }
287
288 void p_array_set_seq_union(FlatZincSpace& s, const ConExpr& ce,
289 AST::Node *) {
290 SetVarArgs sv = s.arg2setvarargs(ce[0]);
291 sequence(s, sv, s.arg2SetVar(ce[1]));
292 }
293
294 void p_int_set_channel(FlatZincSpace& s, const ConExpr& ce,
295 AST::Node *) {
296 int xoff=ce[1]->getInt();
297 assert(xoff >= 0);
298 int yoff=ce[3]->getInt();
299 assert(yoff >= 0);
300 IntVarArgs xv = s.arg2intvarargs(ce[0], xoff);
301 SetVarArgs yv = s.arg2setvarargs(ce[2], yoff, 1, IntSet(0, xoff-1));
302 IntSet xd(yoff,yv.size()-1);
303 for (int i=xoff; i<xv.size(); i++) {
304 dom(s, xv[i], xd);
305 }
306 IntSet yd(xoff,xv.size()-1);
307 for (int i=yoff; i<yv.size(); i++) {
308 dom(s, yv[i], SRT_SUB, yd);
309 }
310 channel(s,xv,yv);
311 }
312
313 void p_range(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
314 int xoff=ce[1]->getInt();
315 assert(xoff >= 0);
316 IntVarArgs xv = s.arg2intvarargs(ce[0],xoff);
317 element(s, SOT_UNION, xv, s.arg2SetVar(ce[2]), s.arg2SetVar(ce[3]));
318 }
319
320 void p_weights(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
321 IntArgs e = s.arg2intargs(ce[0]);
322 IntArgs w = s.arg2intargs(ce[1]);
323 SetVar x = s.arg2SetVar(ce[2]);
324 IntVar y = s.arg2IntVar(ce[3]);
325 weights(s,e,w,x,y);
326 }
327
328 void p_inverse_set(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
329 int xoff = ce[2]->getInt();
330 int yoff = ce[3]->getInt();
331 SetVarArgs x = s.arg2setvarargs(ce[0],xoff);
332 SetVarArgs y = s.arg2setvarargs(ce[1],yoff);
333 channel(s, x, y);
334 }
335
336 void p_precede_set(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
337 SetVarArgs x = s.arg2setvarargs(ce[0]);
338 int p_s = ce[1]->getInt();
339 int p_t = ce[2]->getInt();
340 precede(s,x,p_s,p_t);
341 }
342
343
344 SetRelType set_relation(AST::Node* arg) {
345 switch (arg->getInt()) {
346 case 1: return SRT_EQ;
347 case 2: return SRT_NQ;
348 case 3: return SRT_SUB;
349 case 4: return SRT_SUP;
350 case 5: return SRT_DISJ;
351 case 6: return SRT_CMPL;
352 case 7: return SRT_LQ;
353 case 8: return SRT_LE;
354 case 9: return SRT_GQ;
355 case 10: return SRT_GR;
356 default: throw FlatZinc::Error("Registry", "invalid set relation");
357 }
358 }
359 void p_set_ite(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
360 ite(s, s.arg2BoolVar(ce[0]), s.arg2SetVar(ce[1]), s.arg2SetVar(ce[2]),
361 s.arg2SetVar(ce[3]));
362 }
363 void p_set_convex_hull(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
364 convex(s, s.arg2SetVar(ce[0]), s.arg2SetVar(ce[1]));
365 }
366 void p_set_atmost_one(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
367 int cardinality = ce[1]->getInt();
368 if (cardinality < 0)
369 throw FlatZinc::Error("Registry", "set cardinality must be nonnegative");
370 SetVarArgs x = s.arg2setvarargs(ce[0]);
371 if ((x.size() < 2) || (cardinality <= 1)) {
372 // The intersection bound is trivial here. atmostOne skips cardinality
373 // for fewer than two sets, and its filter divides by cardinality - 1.
374 for (int i=0; i<x.size(); i++)
376 } else {
377 atmostOne(s, x, static_cast<unsigned int>(cardinality));
378 }
379 }
380 void p_set_channel_sorted(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
381 channelSorted(s, s.arg2intvarargs(ce[0]), s.arg2SetVar(ce[1]));
382 }
383 void p_array_set_intersect(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
384 rel(s, SOT_INTER, s.arg2setvarargs(ce[0]), s.arg2SetVar(ce[1]));
385 }
386 void p_set_element2d(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
387 SetVarArgs x = s.arg2setvarargs(ce[0]);
388 int width = ce[2]->getInt(), height = ce[4]->getInt();
389 if ((width <= 0) || (height <= 0) ||
390 (static_cast<long long>(width)*height != x.size()))
391 throw FlatZinc::Error("Registry", "invalid set matrix dimensions");
392 element(s, x, s.arg2IntVar(ce[1]), width,
393 s.arg2IntVar(ce[3]), height, s.arg2SetVar(ce[5]));
394 }
395
396 void p_set_min(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
397 min(s, s.arg2SetVar(ce[0]), s.arg2IntVar(ce[1]));
398 }
399 template<ReifyMode mode>
400 void p_set_min_reif(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
401 min(s, s.arg2SetVar(ce[0]), s.arg2IntVar(ce[1]),
402 Reify(s.arg2BoolVar(ce[2]), mode));
403 }
404
405 void p_set_max(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
406 max(s, s.arg2SetVar(ce[0]), s.arg2IntVar(ce[1]));
407 }
408 template<ReifyMode mode>
409 void p_set_max_reif(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
410 max(s, s.arg2SetVar(ce[0]), s.arg2IntVar(ce[1]),
411 Reify(s.arg2BoolVar(ce[2]), mode));
412 }
413
414
415
416 void p_set_rel_imp(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
417 rel(s, s.arg2SetVar(ce[0]), set_relation(ce[1]), s.arg2SetVar(ce[2]),
418 Reify(s.arg2BoolVar(ce[3]), RM_IMP));
419 }
420
421 }
422
423 namespace RegistryDetail {
424
426 r.add("set_eq", &p_set_eq);
427 r.add("set_le", &p_set_le);
428 r.add("set_lt", &p_set_lt);
429 r.add("equal", &p_set_eq);
430 r.add("set_ne", &p_set_ne);
431 r.add("set_union", &p_set_union);
432 r.add("array_set_element", &p_array_set_element);
433 r.add("array_var_set_element", &p_array_set_element);
434 r.add("set_intersect", &p_set_intersect);
435 r.add("set_diff", &p_set_diff);
436 r.add("set_symdiff", &p_set_symdiff);
437 r.add("set_subset", &p_set_subset);
438 r.add("set_superset", &p_set_superset);
439 r.add("set_card", &p_set_card);
440 r.add("set_in", &p_set_in);
441 r.add("set_eq_reif", &p_set_eq_reif);
442 r.add("set_le_reif", &p_set_le_reif);
443 r.add("set_lt_reif", &p_set_lt_reif);
444 r.add("equal_reif", &p_set_eq_reif);
445 r.add("set_ne_reif", &p_set_ne_reif);
446 r.add("set_subset_reif", &p_set_subset_reif);
447 r.add("set_superset_reif", &p_set_superset_reif);
448 r.add("set_in_reif", &p_set_in_reif);
449 r.add("set_in_imp", &p_set_in_imp);
450 r.add("disjoint", &p_set_disjoint);
451 r.add("gecode_link_set_to_booleans",
452 &p_link_set_to_booleans);
453
454 r.add("array_set_union", &p_array_set_union);
455 r.add("array_set_partition", &p_array_set_partition);
456 r.add("set_convex", &p_set_convex);
457 r.add("array_set_seq", &p_array_set_seq);
458 r.add("array_set_seq_union", &p_array_set_seq_union);
459 r.add("gecode_array_set_element_union",
460 &p_array_set_element_union);
461 r.add("gecode_array_set_element_intersect",
462 &p_array_set_element_intersect);
463 r.add("gecode_array_set_element_intersect_in",
464 &p_array_set_element_intersect_in);
465 r.add("gecode_array_set_element_partition",
466 &p_array_set_element_partition);
467 r.add("gecode_int_set_channel",
468 &p_int_set_channel);
469 r.add("gecode_range",
470 &p_range);
471 r.add("gecode_set_weights",
472 &p_weights);
473 r.add("gecode_inverse_set", &p_inverse_set);
474 r.add("gecode_precede_set", &p_precede_set);
475 r.add("gecode_set_rel_imp_fzn", &p_set_rel_imp);
476 r.add("gecode_set_ite", &p_set_ite);
477 r.add("gecode_set_convex_hull", &p_set_convex_hull);
478 r.add("gecode_set_atmost_one", &p_set_atmost_one);
479 r.add("gecode_set_channel_sorted", &p_set_channel_sorted);
480 r.add("gecode_array_set_intersect", &p_array_set_intersect);
481 r.add("gecode_set_element2d", &p_set_element2d);
482 r.add("gecode_set_min", &p_set_min);
483 r.add("gecode_set_min_reif", &p_set_min_reif<RM_EQV>);
484 r.add("gecode_set_min_imp", &p_set_min_reif<RM_IMP>);
485 r.add("gecode_set_max", &p_set_max);
486 r.add("gecode_set_max_reif", &p_set_max_reif<RM_EQV>);
487 r.add("gecode_set_max_imp", &p_set_max_reif<RM_IMP>);
488 }
489
490 }
491#endif
492
493}}
494
495// STATISTICS: flatzinc-any
int size(void) const
Return size of array (number of elements).
Definition array.hpp:1606
A node in a FlatZinc abstract syntax tree.
Definition ast.hh:67
Abstract representation of a constraint.
Definition conexpr.hh:43
A space that can be initialized with a FlatZinc model.
Definition flatzinc.hh:424
Map from constraint identifier to constraint posting functions.
Definition registry.hh:44
FloatNum size(void) const
Return size of float value (distance between maximum and minimum).
Definition val.hpp:78
static const IntSet empty
Empty set.
Definition int.hh:302
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
Definition rel.cpp:68
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition bool.cpp:39
void precede(Home home, const IntVarArgs &x, int s, int t, IntPropLevel=IPL_DEF)
Post propagator that s precedes t in x.
Definition precede.cpp:43
ReifyMode
Mode for reification.
Definition int.hh:1148
@ IRT_GQ
Greater or equal ( ).
Definition int.hh:1230
@ IRT_LQ
Less or equal ( ).
Definition int.hh:1228
@ RM_IMP
Implication for reification.
Definition int.hh:1162
@ RM_EQV
Equivalence for reification (default).
Definition int.hh:1155
void weights(Home home, IntSharedArray elements, IntSharedArray weights, SetVar x, IntVar y)
Post propagator for .
Definition int.cpp:292
SetOpType
Common operations for sets.
Definition set.hh:667
SetRelType
Common relation types for sets.
Definition set.hh:650
@ SOT_MINUS
Difference.
Definition set.hh:671
@ SOT_DUNION
Disjoint union.
Definition set.hh:669
@ SOT_UNION
Union.
Definition set.hh:668
@ SOT_INTER
Intersection
Definition set.hh:670
@ SRT_GQ
Greater or equal ( ).
Definition set.hh:659
@ SRT_CMPL
Complement.
Definition set.hh:656
@ SRT_GR
Greater ( ).
Definition set.hh:660
@ SRT_LQ
Less or equal ( ).
Definition set.hh:657
@ SRT_NQ
Disequality ( ).
Definition set.hh:652
@ SRT_LE
Less ( ).
Definition set.hh:658
@ SRT_EQ
Equality ( ).
Definition set.hh:651
@ SRT_SUP
Superset ( ).
Definition set.hh:654
@ SRT_DISJ
Disjoint ( ).
Definition set.hh:655
@ SRT_SUB
Subset ( ).
Definition set.hh:653
void post_int_in_imp(FlatZincSpace &s, const ConExpr &ce, AST::Node *ann)
Definition registry.cpp:882
void post_int_in_reif(FlatZincSpace &s, const ConExpr &ce, AST::Node *ann)
Definition registry.cpp:862
Interpreter for the FlatZinc language.
const int min
Smallest allowed integer in integer set.
Definition set.hh:99
const int max
Largest allowed integer in integer set.
Definition set.hh:97
Gecode toplevel namespace
ArgArray< IntSet > IntSetArgs
Passing set arguments.
Definition int.hh:644
void atmostOne(Home home, const SetVarArgs &x, unsigned int c)
Post propagator for and .
Definition distinct.cpp:41
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition channel.cpp:41
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel ipl=IPL_DEF)
Post propagator for .
Definition sequence.cpp:47
void channelSorted(Home home, const IntVarArgs &x, SetVar y)
Post propagator for and .
Definition channel.cpp:45
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition dom.cpp:40
void element(Home home, IntSharedArray n, IntVar x0, IntVar x1, IntPropLevel ipl=IPL_DEF)
Post domain consistent propagator for .
Definition element.cpp:39
void convex(Home home, SetVar x)
Post propagator that propagates that x is convex.
Definition convex.cpp:41
void unshare(Home home, IntVarArgs &x, IntPropLevel ipl=IPL_DEF)
Replace multiple variable occurrences in x by fresh variables.
Definition unshare.cpp:136
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
LinIntExpr cardinality(const SetExpr &)
Cardinality of set expression.
Definition set-expr.cpp:817
Gecode::FloatVal a(-8, 5)
Gecode::IntArgs i({1, 2, 3, 4})
Gecode::IntSet d(v, 7)