Generated on Thu Mar 16 2017 03:24:16 for Gecode by doxygen 1.8.13
lq-le.hpp
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  * Gabor Szokoli <szokoli@gecode.org>
6  *
7  * Copyright:
8  * Christian Schulte, 2003
9  * Gabor Szokoli, 2003
10  *
11  * Last modified:
12  * $Date: 2016-08-17 14:21:02 +0200 (Wed, 17 Aug 2016) $ by $Author: schulte $
13  * $Revision: 15151 $
14  *
15  * This file is part of Gecode, the generic constraint
16  * development environment:
17  * http://www.gecode.org
18  *
19  * Permission is hereby granted, free of charge, to any person obtaining
20  * a copy of this software and associated documentation files (the
21  * "Software"), to deal in the Software without restriction, including
22  * without limitation the rights to use, copy, modify, merge, publish,
23  * distribute, sublicense, and/or sell copies of the Software, and to
24  * permit persons to whom the Software is furnished to do so, subject to
25  * the following conditions:
26  *
27  * The above copyright notice and this permission notice shall be
28  * included in all copies or substantial portions of the Software.
29  *
30  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
34  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
35  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
36  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37  *
38  */
39 
40 namespace Gecode { namespace Int { namespace Rel {
41 
42  /*
43  * Less or equal propagator
44  *
45  */
46 
47  template<class View>
49  Lq<View>::Lq(Home home, View x0, View x1)
50  : BinaryPropagator<View,PC_INT_BND>(home,x0,x1) {}
51 
52  template<class View>
54  Lq<View>::post(Home home, View x0, View x1) {
55  GECODE_ME_CHECK(x0.lq(home,x1.max()));
56  GECODE_ME_CHECK(x1.gq(home,x0.min()));
57  if (!same(x0,x1) && (x0.max() > x1.min()))
58  (void) new (home) Lq<View>(home,x0,x1);
59  return ES_OK;
60  }
61 
62  template<class View>
64  Lq<View>::Lq(Space& home, bool share, Lq<View>& p)
65  : BinaryPropagator<View,PC_INT_BND>(home,share,p) {}
66 
67  template<class View>
68  Actor*
69  Lq<View>::copy(Space& home, bool share) {
70  return new (home) Lq<View>(home,share,*this);
71  }
72 
73  template<class View>
76  GECODE_ME_CHECK(x0.lq(home,x1.max()));
77  GECODE_ME_CHECK(x1.gq(home,x0.min()));
78  return (x0.max() <= x1.min()) ? home.ES_SUBSUMED(*this) : ES_FIX;
79  }
80 
81 
82 
83 
84  /*
85  * Less propagator
86  *
87  */
88  template<class View>
90  Le<View>::Le(Home home, View x0, View x1)
91  : BinaryPropagator<View,PC_INT_BND>(home,x0,x1) {}
92 
93  template<class View>
95  Le<View>::post(Home home, View x0, View x1) {
96  if (same(x0,x1))
97  return ES_FAILED;
98  GECODE_ME_CHECK(x0.le(home,x1.max()));
99  GECODE_ME_CHECK(x1.gr(home,x0.min()));
100  if (x0.max() >= x1.min())
101  (void) new (home) Le<View>(home,x0,x1);
102  return ES_OK;
103  }
104 
105  template<class View>
107  Le<View>::Le(Space& home, bool share, Le<View>& p)
108  : BinaryPropagator<View,PC_INT_BND>(home,share,p) {}
109 
110  template<class View>
111  Actor*
112  Le<View>::copy(Space& home, bool share) {
113  return new (home) Le<View>(home,share,*this);
114  }
115 
116  template<class View>
117  ExecStatus
119  GECODE_ME_CHECK(x0.le(home,x1.max()));
120  GECODE_ME_CHECK(x1.gr(home,x0.min()));
121  return (x0.max() < x1.min()) ? home.ES_SUBSUMED(*this) : ES_FIX;
122  }
123 
124 
125 
126  /*
127  * Nary less and less or equal propagator
128  *
129  */
130 
131  template<class View, int o>
134  Council<Index>& c, int i0)
135  : Advisor(home,p,c), i(i0) {}
136 
137  template<class View, int o>
140  : Advisor(home,share,a), i(a.i) {}
141 
142 
143 
144  template<class View, int o>
147  : FreeList(n), p(p0) {}
148 
149  template<class View, int o>
152  return static_cast<Pos*>(FreeList::next());
153  }
154 
155  template<class View, int o>
156  forceinline void
158 
159  template<class View, int o>
160  forceinline void
162  GECODE_NEVER;
163  }
164 
165  template<class View, int o>
166  forceinline void*
168  return home.fl_alloc<sizeof(Pos)>();
169  }
170 
171  template<class View, int o>
172  forceinline void
174  home.fl_dispose<sizeof(Pos)>(this,this);
175  }
176 
177 
178  template<class View, int o>
179  forceinline bool
181  return pos == NULL;
182  }
183  template<class View, int o>
184  forceinline void
186  // Try to avoid entering same position twice
187  if ((pos != NULL) && (pos->p == p))
188  return;
189  pos = new (home) Pos(p,pos);
190  }
191  template<class View, int o>
192  forceinline int
194  Pos* t = pos;
195  int p = t->p;
196  pos = pos->next();
197  t->dispose(home);
198  return p;
199  }
200 
201  template<class View, int o>
204  : NaryPropagator<View,PC_INT_NONE>(home,x),
205  c(home), pos(NULL), run(false), n_subsumed(0) {
206  for (int i=x.size(); i--; )
207  x[i].subscribe(home, *new (home) Index(home,*this,c,i));
208  }
209 
210  template<class View, int o>
211  ExecStatus
213  assert((o == 0) || (o == 1));
214  // Check for sharing
215  if (x.same(home)) {
216  if (o == 1)
217  return ES_FAILED;
218  /*
219  * Eliminate sharing: if a view occurs twice, all views in between
220  * must be equal.
221  */
222  int n = x.size();
223  for (int i=0; i<n; i++)
224  for (int j=n-1; j>i; j--)
225  if (same(x[i],x[j])) {
226  if (i+1 != j) {
227  // Create equality propagator for elements i+1 ... j
228  ViewArray<View> y(home,j-i);
229  for (int k=j-i; k--; )
230  y[k] = x[i+1+k];
232  }
233  for (int k=0; k<n-1-j-1+1; k++)
234  x[i+1+k]=x[j+1+k];
235  n -= j-i;
236  break;
237  }
238  x.size(n);
239  }
240 
241  // Propagate one round
242  for (int i=1; i<x.size(); i++)
243  GECODE_ME_CHECK(x[i].gq(home,x[i-1].min()+o));
244  for (int i=x.size()-1; i--;)
245  GECODE_ME_CHECK(x[i].lq(home,x[i+1].max()-o));
246  // Eliminate redundant variables
247  {
248  // Eliminate at beginning
249  {
250  int i=0;
251  while ((i+1 < x.size()) && (x[i].max()+o <= x[i+1].min()))
252  i++;
253  x.drop_fst(i);
254  }
255  // Eliminate at end
256  {
257  int i=x.size()-1;
258  while ((i > 0) && (x[i-1].max()+o <= x[i].min()))
259  i--;
260  x.drop_lst(i);
261  }
262  // Eliminate in the middle
263  if (x.size() > 1) {
264  int j=1;
265  for (int i=1; i+1<x.size(); i++)
266  if ((x[j-1].max()+o > x[i].min()) ||
267  (x[i].max()+o > x[i+1].min()))
268  x[j++]=x[i];
269  x[j++]=x[x.size()-1];
270  x.size(j);
271  }
272  }
273  if (x.size() == 2) {
274  if (o == 0)
275  return Lq<View>::post(home,x[0],x[1]);
276  else
277  return Le<View>::post(home,x[0],x[1]);
278  } else if (x.size() >= 2) {
279  (void) new (home) NaryLqLe<View,o>(home,x);
280  }
281  return ES_OK;
282  }
283 
284  template<class View, int o>
287  : NaryPropagator<View,PC_INT_NONE>(home,share,p),
288  pos(NULL), run(false), n_subsumed(p.n_subsumed) {
289  assert(p.pos == NULL);
290  c.update(home, share, p.c);
291  }
292 
293  template<class View, int o>
294  Actor*
295  NaryLqLe<View,o>::copy(Space& home, bool share) {
296  if (n_subsumed > n_threshold) {
297  Region r(home);
298  // Record for which views there is an advisor
299  Support::BitSet<Region> a(r,static_cast<unsigned int>(x.size()));
300  for (Advisors<Index> as(c); as(); ++as)
301  a.set(static_cast<unsigned int>(as.advisor().i));
302  // Compact view array and compute map for advisors
303  int* m = r.alloc<int>(x.size());
304  int j=0;
305  for (int i=0; i<x.size(); i++)
306  if (a.get(static_cast<unsigned int>(i))) {
307  m[i] = j; x[j++] = x[i];
308  }
309  x.size(j);
310  // Remap advisors
311  for (Advisors<Index> as(c); as(); ++as)
312  as.advisor().i = m[as.advisor().i];
313 
314  n_subsumed = 0;
315  }
316  return new (home) NaryLqLe<View,o>(home,share,*this);
317  }
318 
319  template<class View, int o>
320  PropCost
323  }
324 
325  template<class View, int o>
326  forceinline size_t
328  for (Advisors<Index> as(c); as(); ++as)
329  x[as.advisor().i].cancel(home,as.advisor());
330  c.dispose(home);
331  while (!empty())
332  (void) pop(home);
334  return sizeof(*this);
335  }
336 
337 
338  template<class View, int o>
339  ExecStatus
341  Index& a = static_cast<Index&>(_a);
342  const int i = a.i;
343  switch (View::modevent(d)) {
344  case ME_INT_VAL:
345  a.dispose(home,c);
346  n_subsumed++;
347  break;
348  case ME_INT_BND:
349  if (((i == 0) || (x[i-1].max()+o <= x[i].min())) &&
350  ((i == x.size()-1) || (x[i].max()+o <= x[i+1].min()))) {
351  x[i].cancel(home,a);
352  a.dispose(home,c);
353  n_subsumed++;
354  return (run || (n_subsumed + 1 < x.size())) ? ES_FIX : ES_NOFIX;
355  }
356  break;
357  default:
358  return ES_FIX;
359  }
360  if (run)
361  return ES_FIX;
362  if (((i < x.size()-1) && (x[i+1].min() < x[i].min()+o)) ||
363  ((i > 0) && (x[i-1].max() > x[i].max()-o))) {
364  push(home,i);
365  return ES_NOFIX;
366  }
367  return (n_subsumed+1 >= x.size()) ? ES_NOFIX : ES_FIX;
368  }
369 
370  template<class View, int o>
371  void
373  View::schedule(home, *this, ME_INT_BND);
374  }
375 
376  template<class View, int o>
377  ExecStatus
379  run = true;
380  int n = x.size();
381  while (!empty()) {
382  int p = pop(home);
383  for (int i=p; i<n-1; i++) {
384  ModEvent me = x[i+1].gq(home,x[i].min()+o);
385  if (me_failed(me))
386  return ES_FAILED;
387  if (!me_modified(me))
388  break;
389  }
390  for (int i=p; i>0; i--) {
391  ModEvent me = x[i-1].lq(home,x[i].max()-o);
392  if (me_failed(me))
393  return ES_FAILED;
394  if (!me_modified(me))
395  break;
396  }
397  }
398 #ifdef GECODE_AUDIT
399  for (int i=0; i<n-1; i++)
400  assert(!me_modified(x[i+1].gq(home,x[i].min()+o)));
401  for (int i=n-1; i>0; i--)
402  assert(!me_modified(x[i-1].lq(home,x[i].max()-o)));
403 #endif
404  if (n_subsumed+1 >= n)
405  return home.ES_SUBSUMED(*this);
406  run = false;
407  return ES_FIX;
408  }
409 
410 
411 
412  /*
413  * Reified less or equal propagator
414  *
415  */
416 
417  template<class View, class CtrlView, ReifyMode rm>
419  ReLq<View,CtrlView,rm>::ReLq(Home home, View x0, View x1, CtrlView b)
420  : ReBinaryPropagator<View,PC_INT_BND,CtrlView>(home,x0,x1,b) {}
421 
422  template<class View, class CtrlView, ReifyMode rm>
423  ExecStatus
424  ReLq<View,CtrlView,rm>::post(Home home, View x0, View x1, CtrlView b) {
425  if (b.one()) {
426  if (rm == RM_PMI)
427  return ES_OK;
428  return Lq<View>::post(home,x0,x1);
429  }
430  if (b.zero()) {
431  if (rm == RM_IMP)
432  return ES_OK;
433  return Le<View>::post(home,x1,x0);
434  }
435  if (!same(x0,x1)) {
436  switch (rtest_lq(x0,x1)) {
437  case RT_TRUE:
438  if (rm != RM_IMP)
439  GECODE_ME_CHECK(b.one_none(home));
440  break;
441  case RT_FALSE:
442  if (rm != RM_PMI)
443  GECODE_ME_CHECK(b.zero_none(home));
444  break;
445  case RT_MAYBE:
446  (void) new (home) ReLq<View,CtrlView,rm>(home,x0,x1,b);
447  break;
448  default: GECODE_NEVER;
449  }
450  } else if (rm != RM_IMP) {
451  GECODE_ME_CHECK(b.one_none(home));
452  }
453  return ES_OK;
454  }
455 
456  template<class View, class CtrlView, ReifyMode rm>
459  : ReBinaryPropagator<View,PC_INT_BND,CtrlView>(home,share,p) {}
460 
461  template<class View, class CtrlView, ReifyMode rm>
462  Actor*
463  ReLq<View,CtrlView,rm>::copy(Space& home, bool share) {
464  return new (home) ReLq<View,CtrlView,rm>(home,share,*this);
465  }
466 
467  template<class View, class CtrlView, ReifyMode rm>
468  ExecStatus
470  if (b.one()) {
471  if (rm != RM_PMI)
472  GECODE_REWRITE(*this,Lq<View>::post(home(*this),x0,x1));
473  } else if (b.zero()) {
474  if (rm != RM_IMP)
475  GECODE_REWRITE(*this,Le<View>::post(home(*this),x1,x0));
476  } else {
477  switch (rtest_lq(x0,x1)) {
478  case RT_TRUE:
479  if (rm != RM_IMP)
480  GECODE_ME_CHECK(b.one_none(home));
481  break;
482  case RT_FALSE:
483  if (rm != RM_PMI)
484  GECODE_ME_CHECK(b.zero_none(home));
485  break;
486  case RT_MAYBE:
487  return ES_FIX;
488  default: GECODE_NEVER;
489  }
490  }
491  return home.ES_SUBSUMED(*this);
492  }
493 
494  /*
495  * Reified less or equal propagator involving one variable
496  *
497  */
498 
499  template<class View, class CtrlView, ReifyMode rm>
501  ReLqInt<View,CtrlView,rm>::ReLqInt(Home home, View x, int c0, CtrlView b)
502  : ReUnaryPropagator<View,PC_INT_BND,CtrlView>(home,x,b), c(c0) {}
503 
504  template<class View, class CtrlView, ReifyMode rm>
505  ExecStatus
506  ReLqInt<View,CtrlView,rm>::post(Home home, View x, int c, CtrlView b) {
507  if (b.one()) {
508  if (rm != RM_PMI)
509  GECODE_ME_CHECK(x.lq(home,c));
510  } else if (b.zero()) {
511  if (rm != RM_IMP)
512  GECODE_ME_CHECK(x.gr(home,c));
513  } else {
514  switch (rtest_lq(x,c)) {
515  case RT_TRUE:
516  if (rm != RM_IMP)
517  GECODE_ME_CHECK(b.one_none(home));
518  break;
519  case RT_FALSE:
520  if (rm != RM_PMI)
521  GECODE_ME_CHECK(b.zero_none(home));
522  break;
523  case RT_MAYBE:
524  (void) new (home) ReLqInt<View,CtrlView,rm>(home,x,c,b);
525  break;
526  default: GECODE_NEVER;
527  }
528  }
529  return ES_OK;
530  }
531 
532 
533  template<class View, class CtrlView, ReifyMode rm>
536  : ReUnaryPropagator<View,PC_INT_BND,CtrlView>(home,share,p), c(p.c) {}
537 
538  template<class View, class CtrlView, ReifyMode rm>
539  Actor*
541  return new (home) ReLqInt<View,CtrlView,rm>(home,share,*this);
542  }
543 
544  template<class View, class CtrlView, ReifyMode rm>
545  ExecStatus
547  if (b.one()) {
548  if (rm != RM_PMI)
549  GECODE_ME_CHECK(x0.lq(home,c));
550  } else if (b.zero()) {
551  if (rm != RM_IMP)
552  GECODE_ME_CHECK(x0.gr(home,c));
553  } else {
554  switch (rtest_lq(x0,c)) {
555  case RT_TRUE:
556  if (rm != RM_IMP)
557  GECODE_ME_CHECK(b.one_none(home));
558  break;
559  case RT_FALSE:
560  if (rm != RM_PMI)
561  GECODE_ME_CHECK(b.zero_none(home));
562  break;
563  case RT_MAYBE:
564  return ES_FIX;
565  default: GECODE_NEVER;
566  }
567  }
568  return home.ES_SUBSUMED(*this);
569  }
570 
571 }}}
572 
573 // STATISTICS: int-prop
574 
bool get(unsigned int i) const
Access value at bit i.
bool empty(void) const
Whether no more positions must be propagated.
Definition: lq-le.hpp:180
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: lq-le.hpp:118
Council of advisors
Definition: core.hpp:228
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
Definition: macros.hpp:120
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: lq-le.hpp:295
Relation may hold or not.
Definition: view.hpp:1616
NodeType t
Type of node.
Definition: bool-expr.cpp:234
Inverse implication for reification.
Definition: int.hh:848
ExecStatus ES_SUBSUMED(Propagator &p)
Definition: core.hpp:3484
Lq(Space &home, bool share, Lq &p)
Constructor for cloning p.
Definition: lq-le.hpp:64
Reified unary propagator.
Definition: propagator.hpp:58
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: lq-le.hpp:463
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
Definition: region.hpp:326
static ExecStatus post(Home home, ViewArray< View > &x)
Post propagator for .
Definition: lq-le.hpp:212
FreeList * next(void) const
Return next freelist object.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:57
int n_subsumed
Number of already subsumed advisors (or views)
Definition: rel.hh:291
Reified binary propagator.
Definition: propagator.hpp:91
int c
Integer constant to check.
Definition: rel.hh:587
void push(Space &home, int p)
Push a new position p to be propagated.
Definition: lq-le.hpp:185
int ModEvent
Type for modification events.
Definition: core.hpp:142
int p
Position of view in view array.
Definition: rel.hh:253
ViewArray< View > x
Array of views.
Definition: propagator.hpp:152
Reified less or equal with integer propagator.
Definition: rel.hh:581
bool same(const Space &home) const
Test whether array has multiple occurence of the same view.
Definition: array.hpp:1475
Base-class for propagators.
Definition: core.hpp:1012
Base-class for advisors.
Definition: core.hpp:1212
Class to iterate over advisors of a council.
Definition: core.hpp:229
Handle to region.
Definition: region.hpp:61
Propagation has computed fixpoint.
Definition: core.hpp:541
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
Definition: lq-le.hpp:54
Computation spaces.
Definition: core.hpp:1672
ReLq(Space &home, bool share, ReLq &p)
Constructor for cloning p.
Definition: lq-le.hpp:458
Base-class for both propagators and branchers.
Definition: core.hpp:682
Gecode::IntSet d(v, 7)
bool run
Whether the propagator is currently running.
Definition: rel.hh:289
Reified less or equal propagator.
Definition: rel.hh:554
Index(Space &home, Propagator &p, Council< Index > &c, int i)
Create index advisor.
Definition: lq-le.hpp:133
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Definition: macros.hpp:95
RelTest rtest_lq(VX x, VY y)
Test whether view x is less or equal than view y.
Definition: rel-test.hpp:168
bool same(const CachedView< View > &x, const CachedView< View > &y)
Definition: cached.hpp:389
Gecode::FloatVal c(-8, 8)
Single _a(2, 3)
struct Gecode::@554::NNF::@60::@62 a
For atomic nodes.
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
Gecode::IntArgs i(4, 1, 2, 3, 4)
void drop_lst(int i)
Drop views from positions i+1 to size()-1 from array.
Definition: array.hpp:1308
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
const Gecode::PropCond PC_INT_NONE
Propagation condition to be ignored (convenience)
Definition: var-type.hpp:74
Execution has resulted in failure.
Definition: core.hpp:538
NNF * r
Right subtree.
Definition: bool-expr.cpp:246
Binary propagator.
Definition: propagator.hpp:89
Council< Index > c
The advisor council.
Definition: rel.hh:248
Relation does not hold.
Definition: view.hpp:1615
Pos * next(void) const
Return next position.
Definition: lq-le.hpp:151
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Definition: var-type.hpp:91
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable)
Definition: var-type.hpp:56
void subscribe(Space &home, Propagator &p, IntSet &y)
Definition: rel.hpp:75
int pop(Space &home)
Pop a position to be propagated and return it.
Definition: lq-le.hpp:193
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: lq-le.hpp:378
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: lq-le.hpp:112
Less or equal propagator.
Definition: rel.hh:497
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
Definition: lq-le.hpp:95
static ExecStatus post(Home home, View x, int c, CtrlView b)
Post propagator for .
Definition: lq-le.hpp:506
const Gecode::ModEvent ME_INT_BND
Domain operation has changed the minimum or maximum of the domain.
Definition: var-type.hpp:65
n-ary propagator
Definition: propagator.hpp:149
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: lq-le.hpp:321
void set(unsigned int i)
Set bit i.
Expensive.
Definition: core.hpp:578
virtual void reschedule(Space &home)
Schedule function.
Definition: lq-le.hpp:372
View arrays.
Definition: array.hpp:234
void drop_fst(int i)
Drop views from positions 0 to i-1 from array.
Definition: array.hpp:1301
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: lq-le.hpp:540
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: lq-le.hpp:75
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Definition: macros.hpp:56
n-ary less and less or equal propagator
Definition: rel.hh:234
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:75
static ExecStatus post(Home home, View x0, View x1, CtrlView b)
Post propagator for .
Definition: lq-le.hpp:424
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:253
Generic domain change information to be supplied to advisors.
Definition: core.hpp:277
void dispose(Space &home)
Free memory for this position.
Definition: lq-le.hpp:173
ReLqInt(Space &home, bool share, ReLqInt &p)
Constructor for cloning p.
Definition: lq-le.hpp:535
void dispose(Space &home, Council< A > &c)
Dispose the advisor.
Definition: core.hpp:3783
Propagation cost.
Definition: core.hpp:550
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: lq-le.hpp:327
ExecStatus
Definition: core.hpp:536
#define forceinline
Definition: config.hpp:173
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
Definition: modevent.hpp:63
Base-class for freelist-managed objects.
void fl_dispose(FreeList *f, FreeList *l)
Return freelist-managed memory to freelist.
Definition: core.hpp:2773
Execution is okay.
Definition: core.hpp:540
Propagation has not computed fixpoint.
Definition: core.hpp:539
NaryLqLe(Space &home, bool share, NaryLqLe< View, o > &p)
Constructor for cloning p.
Definition: lq-le.hpp:286
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: lq-le.hpp:69
Positions in view array that have to be propagated.
Definition: rel.hh:250
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: lq-le.hpp:340
n-ary bounds consistent equality propagator
Definition: rel.hh:200
static const int n_threshold
Compact during cloning when more advisors than that are subsumed.
Definition: rel.hh:293
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: lq-le.hpp:546
int i
The position of the view in the view array.
Definition: rel.hh:241
Gecode toplevel namespace
Pos(int p, Pos *n)
Initialize with position p and next position n.
Definition: lq-le.hpp:146
Implication for reification.
Definition: int.hh:841
Le(Space &home, bool share, Le &p)
Constructor for cloning p.
Definition: lq-le.hpp:107
Advisors for views (by position in array)
Definition: rel.hh:238
struct Gecode::@554::NNF::@60::@61 b
For binary nodes (and, or, eqv)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: lq-le.hpp:469
Less propagator.
Definition: rel.hh:522
int size(void) const
Return size of array (number of elements)
Definition: array.hpp:1215
int ModEventDelta
Modification event deltas.
Definition: core.hpp:169
Home class for posting propagators
Definition: core.hpp:905
static PropCost binary(PropCost::Mod m)
Two variables for modifier pcm.
Definition: core.hpp:4590
#define GECODE_NEVER
Assert that this command is never executed.
Definition: macros.hpp:60
Relation does hold.
Definition: view.hpp:1617
Pos * pos
Stack of positions.
Definition: rel.hh:281
bool me_failed(ModEvent me)
Check whether modification event me is failed.
Definition: modevent.hpp:58