Generated on Sat Feb 7 2015 02:01:17 for Gecode by doxygen 1.8.9.1
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: 2012-09-07 17:31:22 +0200 (Fri, 07 Sep 2012) $ by $Author: schulte $
13  * $Revision: 13068 $
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  }
237  x.size(n);
238  }
239 
240  // Propagate one round
241  for (int i=1; i<x.size(); i++)
242  GECODE_ME_CHECK(x[i].gq(home,x[i-1].min()+o));
243  for (int i=x.size()-1; i--;)
244  GECODE_ME_CHECK(x[i].lq(home,x[i+1].max()-o));
245  // Eliminate redundant variables
246  {
247  // Eliminate at beginning
248  {
249  int i=0;
250  while ((i+1 < x.size()) && (x[i].max()+o <= x[i+1].min()))
251  i++;
252  x.drop_fst(i);
253  }
254  // Eliminate at end
255  {
256  int i=x.size()-1;
257  while ((i > 0) && (x[i-1].max()+o <= x[i].min()))
258  i--;
259  x.drop_lst(i);
260  }
261  // Eliminate in the middle
262  if (x.size() > 1) {
263  int j=1;
264  for (int i=1; i+1<x.size(); i++)
265  if ((x[j-1].max()+o > x[i].min()) ||
266  (x[i].max()+o > x[i+1].min()))
267  x[j++]=x[i];
268  x[j++]=x[x.size()-1];
269  x.size(j);
270  }
271  }
272  if (x.size() == 2) {
273  if (o == 0)
274  return Lq<View>::post(home,x[0],x[1]);
275  else
276  return Le<View>::post(home,x[0],x[1]);
277  } else if (x.size() >= 2) {
278  (void) new (home) NaryLqLe<View,o>(home,x);
279  }
280  return ES_OK;
281  }
282 
283  template<class View, int o>
286  : NaryPropagator<View,PC_INT_NONE>(home,share,p),
287  pos(NULL), run(false), n_subsumed(p.n_subsumed) {
288  assert(p.pos == NULL);
289  c.update(home, share, p.c);
290  }
291 
292  template<class View, int o>
293  Actor*
294  NaryLqLe<View,o>::copy(Space& home, bool share) {
295  if (n_subsumed > n_threshold) {
296  Region r(home);
297  // Record for which views there is an advisor
298  Support::BitSet<Region> a(r,static_cast<unsigned int>(x.size()));
299  for (Advisors<Index> as(c); as(); ++as)
300  a.set(static_cast<unsigned int>(as.advisor().i));
301  // Compact view array and compute map for advisors
302  int* m = r.alloc<int>(x.size());
303  int j=0;
304  for (int i=0; i<x.size(); i++)
305  if (a.get(static_cast<unsigned int>(i))) {
306  m[i] = j; x[j++] = x[i];
307  }
308  x.size(j);
309  // Remap advisors
310  for (Advisors<Index> as(c); as(); ++as)
311  as.advisor().i = m[as.advisor().i];
312 
313  n_subsumed = 0;
314  }
315  return new (home) NaryLqLe<View,o>(home,share,*this);
316  }
317 
318  template<class View, int o>
319  PropCost
322  }
323 
324  template<class View, int o>
325  forceinline size_t
327  for (Advisors<Index> as(c); as(); ++as)
328  x[as.advisor().i].cancel(home,as.advisor());
329  c.dispose(home);
330  while (!empty())
331  (void) pop(home);
333  return sizeof(*this);
334  }
335 
336 
337  template<class View, int o>
338  ExecStatus
340  Index& a = static_cast<Index&>(_a);
341  const int i = a.i;
342  switch (View::modevent(d)) {
343  case ME_INT_VAL:
344  a.dispose(home,c);
345  n_subsumed++;
346  break;
347  case ME_INT_BND:
348  if (((i == 0) || (x[i-1].max()+o <= x[i].min())) &&
349  ((i == x.size()-1) || (x[i].max()+o <= x[i+1].min()))) {
350  x[i].cancel(home,a);
351  a.dispose(home,c);
352  n_subsumed++;
353  return (run || (n_subsumed + 1 < x.size())) ? ES_FIX : ES_NOFIX;
354  }
355  break;
356  default:
357  return ES_FIX;
358  }
359  if (run)
360  return ES_FIX;
361  if (((i < x.size()-1) && (x[i+1].min() < x[i].min()+o)) ||
362  ((i > 0) && (x[i-1].max() > x[i].max()-o))) {
363  push(home,i);
364  return ES_NOFIX;
365  }
366  return (n_subsumed+1 >= x.size()) ? ES_NOFIX : ES_FIX;
367  }
368 
369  template<class View, int o>
370  ExecStatus
372  run = true;
373  int n = x.size();
374  while (!empty()) {
375  int p = pop(home);
376  for (int i=p; i<n-1; i++) {
377  ModEvent me = x[i+1].gq(home,x[i].min()+o);
378  if (me_failed(me))
379  return ES_FAILED;
380  if (!me_modified(me))
381  break;
382  }
383  for (int i=p; i>0; i--) {
384  ModEvent me = x[i-1].lq(home,x[i].max()-o);
385  if (me_failed(me))
386  return ES_FAILED;
387  if (!me_modified(me))
388  break;
389  }
390  }
391 #ifdef GECODE_AUDIT
392  for (int i=0; i<n-1; i++)
393  assert(!me_modified(x[i+1].gq(home,x[i].min()+o)));
394  for (int i=n-1; i>0; i--)
395  assert(!me_modified(x[i-1].lq(home,x[i].max()-o)));
396 #endif
397  if (n_subsumed+1 >= n)
398  return home.ES_SUBSUMED(*this);
399  run = false;
400  return ES_FIX;
401  }
402 
403 
404 
405  /*
406  * Reified less or equal propagator
407  *
408  */
409 
410  template<class View, class CtrlView, ReifyMode rm>
412  ReLq<View,CtrlView,rm>::ReLq(Home home, View x0, View x1, CtrlView b)
413  : ReBinaryPropagator<View,PC_INT_BND,CtrlView>(home,x0,x1,b) {}
414 
415  template<class View, class CtrlView, ReifyMode rm>
416  ExecStatus
417  ReLq<View,CtrlView,rm>::post(Home home, View x0, View x1, CtrlView b) {
418  if (b.one()) {
419  if (rm == RM_PMI)
420  return ES_OK;
421  return Lq<View>::post(home,x0,x1);
422  }
423  if (b.zero()) {
424  if (rm == RM_IMP)
425  return ES_OK;
426  return Le<View>::post(home,x1,x0);
427  }
428  if (!same(x0,x1)) {
429  switch (rtest_lq(x0,x1)) {
430  case RT_TRUE:
431  if (rm != RM_IMP)
432  GECODE_ME_CHECK(b.one_none(home));
433  break;
434  case RT_FALSE:
435  if (rm != RM_PMI)
436  GECODE_ME_CHECK(b.zero_none(home));
437  break;
438  case RT_MAYBE:
439  (void) new (home) ReLq<View,CtrlView,rm>(home,x0,x1,b);
440  break;
441  default: GECODE_NEVER;
442  }
443  } else if (rm != RM_IMP) {
444  GECODE_ME_CHECK(b.one_none(home));
445  }
446  return ES_OK;
447  }
448 
449  template<class View, class CtrlView, ReifyMode rm>
452  : ReBinaryPropagator<View,PC_INT_BND,CtrlView>(home,share,p) {}
453 
454  template<class View, class CtrlView, ReifyMode rm>
455  Actor*
456  ReLq<View,CtrlView,rm>::copy(Space& home, bool share) {
457  return new (home) ReLq<View,CtrlView,rm>(home,share,*this);
458  }
459 
460  template<class View, class CtrlView, ReifyMode rm>
461  ExecStatus
463  if (b.one()) {
464  if (rm != RM_PMI)
465  GECODE_REWRITE(*this,Lq<View>::post(home(*this),x0,x1));
466  } else if (b.zero()) {
467  if (rm != RM_IMP)
468  GECODE_REWRITE(*this,Le<View>::post(home(*this),x1,x0));
469  } else {
470  switch (rtest_lq(x0,x1)) {
471  case RT_TRUE:
472  if (rm != RM_IMP)
473  GECODE_ME_CHECK(b.one_none(home));
474  break;
475  case RT_FALSE:
476  if (rm != RM_PMI)
477  GECODE_ME_CHECK(b.zero_none(home));
478  break;
479  case RT_MAYBE:
480  return ES_FIX;
481  default: GECODE_NEVER;
482  }
483  }
484  return home.ES_SUBSUMED(*this);
485  }
486 
487  /*
488  * Reified less or equal propagator involving one variable
489  *
490  */
491 
492  template<class View, class CtrlView, ReifyMode rm>
494  ReLqInt<View,CtrlView,rm>::ReLqInt(Home home, View x, int c0, CtrlView b)
495  : ReUnaryPropagator<View,PC_INT_BND,CtrlView>(home,x,b), c(c0) {}
496 
497  template<class View, class CtrlView, ReifyMode rm>
498  ExecStatus
499  ReLqInt<View,CtrlView,rm>::post(Home home, View x, int c, CtrlView b) {
500  if (b.one()) {
501  if (rm != RM_PMI)
502  GECODE_ME_CHECK(x.lq(home,c));
503  } else if (b.zero()) {
504  if (rm != RM_IMP)
505  GECODE_ME_CHECK(x.gr(home,c));
506  } else {
507  switch (rtest_lq(x,c)) {
508  case RT_TRUE:
509  if (rm != RM_IMP)
510  GECODE_ME_CHECK(b.one_none(home));
511  break;
512  case RT_FALSE:
513  if (rm != RM_PMI)
514  GECODE_ME_CHECK(b.zero_none(home));
515  break;
516  case RT_MAYBE:
517  (void) new (home) ReLqInt<View,CtrlView,rm>(home,x,c,b);
518  break;
519  default: GECODE_NEVER;
520  }
521  }
522  return ES_OK;
523  }
524 
525 
526  template<class View, class CtrlView, ReifyMode rm>
529  : ReUnaryPropagator<View,PC_INT_BND,CtrlView>(home,share,p), c(p.c) {}
530 
531  template<class View, class CtrlView, ReifyMode rm>
532  Actor*
534  return new (home) ReLqInt<View,CtrlView,rm>(home,share,*this);
535  }
536 
537  template<class View, class CtrlView, ReifyMode rm>
538  ExecStatus
540  if (b.one()) {
541  if (rm != RM_PMI)
542  GECODE_ME_CHECK(x0.lq(home,c));
543  } else if (b.zero()) {
544  if (rm != RM_IMP)
545  GECODE_ME_CHECK(x0.gr(home,c));
546  } else {
547  switch (rtest_lq(x0,c)) {
548  case RT_TRUE:
549  if (rm != RM_IMP)
550  GECODE_ME_CHECK(b.one_none(home));
551  break;
552  case RT_FALSE:
553  if (rm != RM_PMI)
554  GECODE_ME_CHECK(b.zero_none(home));
555  break;
556  case RT_MAYBE:
557  return ES_FIX;
558  default: GECODE_NEVER;
559  }
560  }
561  return home.ES_SUBSUMED(*this);
562  }
563 
564 }}}
565 
566 // STATISTICS: int-prop
567 
bool get(unsigned int i) const
Access value at bit i.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: lq-le.hpp:118
Council of advisors
Definition: core.hpp:226
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
Definition: macros.hpp:109
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: lq-le.hpp:294
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:847
ExecStatus ES_SUBSUMED(Propagator &p)
Definition: core.hpp:2973
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:456
Pos * next(void) const
Return next position.
Definition: lq-le.hpp:151
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
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:261
Reified binary propagator.
Definition: propagator.hpp:89
bool pos(const View &x)
Test whether x is postive.
Definition: mult.hpp:45
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:146
int p
Position of view in view array.
Definition: rel.hh:223
ViewArray< View > x
Array of views.
Definition: propagator.hpp:146
Reified less or equal with integer propagator.
Definition: rel.hh:549
Base-class for propagators.
Definition: core.hpp:755
Expensive.
Definition: core.hpp:564
FreeList * next(void) const
Return next freelist object.
Base-class for advisors.
Definition: core.hpp:926
Class to iterate over advisors of a council.
Definition: core.hpp:227
Handle to region.
Definition: region.hpp:61
Propagation has computed fixpoint.
Definition: core.hpp:528
bool empty(void) const
Whether no more positions must be propagated.
Definition: lq-le.hpp:180
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
Definition: lq-le.hpp:54
Computation spaces.
Definition: core.hpp:1362
ReLq(Space &home, bool share, ReLq &p)
Constructor for cloning p.
Definition: lq-le.hpp:451
Base-class for both propagators and branchers.
Definition: core.hpp:666
Gecode::IntSet d(v, 7)
bool run
Whether the propagator is currently running.
Definition: rel.hh:259
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: lq-le.hpp:320
Reified less or equal propagator.
Definition: rel.hh:522
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:84
bool same(const CachedView< View > &x, const CachedView< View > &y)
Definition: cached.hpp:389
Gecode::FloatVal c(-8, 8)
Single _a(2, 3)
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:525
NNF * r
Right subtree.
Definition: bool-expr.cpp:246
Binary propagator.
Definition: propagator.hpp:87
Council< Index > c
The advisor council.
Definition: rel.hh:218
Relation does not hold.
Definition: view.hpp:1615
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:74
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:371
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Definition: lq-le.hpp:112
Less or equal propagator.
Definition: rel.hh:465
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:499
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:143
void set(unsigned int i)
Set bit i.
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:533
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:45
n-ary less and less or equal propagator
Definition: rel.hh:204
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:417
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:275
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:528
void dispose(Space &home, Council< A > &c)
Dispose the advisor.
Definition: core.hpp:3267
Propagation cost.
Definition: core.hpp:537
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition: lq-le.hpp:326
ExecStatus
Definition: core.hpp:523
#define forceinline
Definition: config.hpp:132
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
Definition: modevent.hpp:63
bool same(const Space &home) const
Test whether array has multiple occurence of the same view.
Definition: array.hpp:1468
Base-class for freelist-managed objects.
void fl_dispose(FreeList *f, FreeList *l)
Return freelist-managed memory to freelist.
Definition: core.hpp:2387
Execution is okay.
Definition: core.hpp:527
Propagation has not computed fixpoint.
Definition: core.hpp:526
NaryLqLe(Space &home, bool share, NaryLqLe< View, o > &p)
Constructor for cloning p.
Definition: lq-le.hpp:285
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:220
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: lq-le.hpp:339
n-ary bounds consistent equality propagator
Definition: rel.hh:170
int size(void) const
Return size of array (number of elements)
Definition: array.hpp:1215
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: lq-le.hpp:539
int i
The position of the view in the view array.
Definition: rel.hh:211
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
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:840
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:208
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: lq-le.hpp:462
Less propagator.
Definition: rel.hh:490
int ModEventDelta
Modification event deltas.
Definition: core.hpp:173
Home class for posting propagators
Definition: core.hpp:717
static PropCost binary(PropCost::Mod m)
Two variables for modifier pcm.
Definition: core.hpp:4054
#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:251
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
bool me_failed(ModEvent me)
Check whether modification event me is failed.
Definition: modevent.hpp:58
RelTest rtest_lq(View x, int n)
Test whether view x is less or equal than integer n.
Definition: rel-test.hpp:166