Generated on Thu Apr 5 2018 19:44:19 for Gecode by doxygen 1.8.13
compact.hpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Linnea Ingmar <linnea.ingmar@hotmail.com>
5  *
6  * Contributing authors:
7  * Christian Schulte <schulte@gecode.org>
8  *
9  * Copyright:
10  * Linnea Ingmar, 2017
11  * Christian Schulte, 2017
12  *
13  * Last modified:
14  * $Date$ by $Author$
15  * $Revision$
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 #include <algorithm>
43 #include <type_traits>
44 
45 namespace Gecode { namespace Int { namespace Extensional {
46 
47  /*
48  * Advisor
49  *
50  */
51  template<class View>
52  forceinline void
54  {
55  int n = view().min();
56  assert((_fst->min <= n) && (n <= _lst->max));
57  while (n > _fst->max)
58  _fst++;
59  assert((_fst->min <= n) && (n <= _lst->max));
60  }
61  {
62  int n = view().max();
63  assert((_fst->min <= n) && (n <= _lst->max));
64  while (n < _lst->min)
65  _lst--;
66  assert((_fst->min <= n) && (n <= _lst->max));
67  }
68  }
69 
70  template<class View>
73  (Space& home, Propagator& p,
74  Council<CTAdvisor>& c, const TupleSet& ts, View x0, int i)
75  : ViewAdvisor<View>(home,p,c,x0), _fst(ts.fst(i)), _lst(ts.lst(i)) {
76  adjust();
77  }
78 
79  template<class View>
82  : ViewAdvisor<View>(home,a), _fst(a._fst), _lst(a._lst) {}
83 
84  template<class View>
85  forceinline const typename Compact<View>::Range*
87  return _fst;
88  }
89 
90  template<class View>
91  forceinline const typename Compact<View>::Range*
93  return _lst;
94  }
95 
96  template<class View>
97  forceinline void
99  (void) ViewAdvisor<View>::dispose(home,c);
100  }
101 
102 
103  /*
104  * Status
105  *
106  */
107  template<class View>
110  : s(t) {}
111  template<class View>
114  : s(s.s) {}
115  template<class View>
118  return static_cast<StatusType>(s & 3);
119  }
120  template<class View>
121  forceinline bool
123  if (type() != SINGLE)
124  return false;
125  assert(type() == 0);
126  return reinterpret_cast<CTAdvisor*>(s) == &a;
127  }
128  template<class View>
129  forceinline void
131  if (!single(a))
132  s = MULTIPLE;
133  }
134  template<class View>
135  forceinline void
137  s = NONE;
138  }
139  template<class View>
140  forceinline void
142  s = PROPAGATING;
143  }
144 
145 
146 
147  /*
148  * The propagator base class
149  *
150  */
151  template<class View>
152  const typename Compact<View>::Range*
154  assert((n > a.fst()->max) && (n < a.lst()->min));
155  const Range* f=a.fst()+1;
156  const Range* l=a.lst()-1;
157  assert(f<=l);
158  while (f < l) {
159  const Range* m = f + ((l-f) >> 1);
160  if (n < m->min) {
161  l=m-1;
162  } else if (n > m->max) {
163  f=m+1;
164  } else {
165  f=m; break;
166  }
167  }
168  assert((f->min <= n) && (n <= f->max));
169  return f;
170  }
171 
172  template<class View>
173  forceinline const BitSetData*
175  const Range* fnd;
176  const Range* fst=a.fst();
177  const Range* lst=a.lst();
178  if (n <= fst->max) {
179  fnd=fst; goto found;
180  } else if (n >= lst->min) {
181  fnd=lst; goto found;
182  } else {
183  fnd=range(a,n);
184  }
185  found:
186  assert((fnd->min <= n) && (n <= fnd->max));
187  return fnd->supports(n_words,n);
188  }
189 
190  template<class View>
193  CTAdvisor& a)
194  : n_words(p.n_words), max(a.view().max()),
195  xr(a.view()), sr(a.fst()), n(xr.min()) {
196  while (n > sr->max)
197  sr++;
198  s=sr->supports(n_words,n);
199  }
200  template<class View>
203  int i, View x)
204  : n_words(ts.words()), max(x.max()), xr(x), sr(ts.fst(i)), n(xr.min()) {
205  while (n > sr->max)
206  sr++;
207  s=sr->supports(n_words,n);
208  }
209  template<class View>
210  forceinline void
212  n++;
213  if (n <= xr.max()) {
214  assert(n <= sr->max);
215  s += n_words;
216  } else if (n <= max) {
217  while (n > xr.max())
218  ++xr;
219  n = xr.min();
220  while (n > sr->max)
221  sr++;
222  s = sr->supports(n_words,n);
223  assert((xr.min() <= n) && (n <= xr.max()));
224  assert((sr->min <= n) && (n <= sr->max));
225  assert(sr->min <= xr.min());
226  }
227  }
228  template<class View>
229  forceinline bool
231  return n <= max;
232  }
233  template<class View>
234  forceinline const BitSetData*
236  assert(s == sr->supports(n_words,n));
237  return s;
238  }
239  template<class View>
240  forceinline int
242  return n;
243  }
244 
245  /*
246  * Lost supports iterator
247  *
248  */
249  template<class View>
252  (const Compact<View>& p, CTAdvisor& a, int l0, int h0)
253  : n_words(p.n_words), r(a.fst()), l(l0), h(h0) {
254  // Move to first value for which there is support
255  while (l > r->max)
256  r++;
257  l=std::max(l,r->min);
258  s=r->supports(n_words,l);
259  }
260  template<class View>
261  forceinline void
263  l++; s += n_words;
264  while ((l <= h) && (l > r->max)) {
265  r++; l=r->min; s=r->s;
266  }
267  }
268  template<class View>
269  forceinline bool
271  return l<=h;
272  }
273  template<class View>
276  assert((l >= r->min) && (l <= r->max));
277  assert(s == r->supports(n_words,l));
278  return s;
279  }
280 
281  template<class View>
284  : Propagator(home,p), unassigned(p.unassigned), n_words(p.n_words),
285  status(NONE), ts(p.ts) {
286  c.update(home,p.c);
287  }
288 
289  template<class View>
292  const TupleSet& ts0)
293  : Propagator(home), unassigned(x.size()), n_words(ts0.words()),
294  status(MULTIPLE), ts(ts0), c(home) {
295  home.notice(*this, AP_DISPOSE);
296  }
297 
298  template<class View>
299  forceinline size_t
301  home.ignore(*this,AP_DISPOSE);
302  c.dispose(home);
303  ts.~TupleSet();
304  (void) Propagator::dispose(home);
305  return sizeof(*this);
306  }
307 
308 
309  /*
310  * The propagator proper
311  *
312  */
313  template<class View, class Table>
314  template<class TableProp>
317  : Compact<View>(home,p), table(home,p.table) {
318  assert(!table.empty());
319  }
320 
321  template<class View, class Table>
322  Actor*
324  assert((table.words() > 0U) && (table.width() >= table.words()));
325  if (table.words() <= 4U) {
326  switch (table.width()) {
327  case 0U:
328  GECODE_NEVER; break;
329  case 1U:
330  return new (home) CompactTable<View,TinyBitSet<1U>>(home,*this);
331  case 2U:
332  return new (home) CompactTable<View,TinyBitSet<2U>>(home,*this);
333  case 3U:
334  return new (home) CompactTable<View,TinyBitSet<3U>>(home,*this);
335  case 4U:
336  return new (home) CompactTable<View,TinyBitSet<4U>>(home,*this);
337  default:
338  break;
339  }
340  }
341  if (std::is_same<Table,BitSet<unsigned char>>::value) {
342  goto copy_char;
343  } else if (std::is_same<Table,BitSet<unsigned short int>>::value) {
344  switch (Gecode::Support::u_type(table.width())) {
346  goto copy_char;
348  goto copy_short;
350  default:
351  GECODE_NEVER;
352  }
353  } else {
354  switch (Gecode::Support::u_type(table.width())) {
356  goto copy_char;
358  goto copy_short;
360  return new (home) CompactTable<View,BitSet<unsigned int>>(home,*this);
361  default: GECODE_NEVER;
362  }
363  GECODE_NEVER;
364  return nullptr;
365  }
366  copy_char:
367  return new (home) CompactTable<View,BitSet<unsigned char>>(home,*this);
368  copy_short:
369  return new (home) CompactTable<View,BitSet<unsigned short int>>(home,*this);
370  }
371 
372  template<class View,class Table>
375  const TupleSet& ts)
376  : Compact<View>(home,x,ts), table(home,ts.words()) {
377  Region r;
378  BitSetData* mask = r.alloc<BitSetData>(table.size());
379  // Invalidate tuples
380  for (int i = x.size(); i--; ) {
381  table.clear_mask(mask);
382  for (ValidSupports vs(ts,i,x[i]); vs(); ++vs)
383  table.add_to_mask(vs.supports(),mask);
384  table.template intersect_with_mask<false>(mask);
385  if (table.empty())
386  return;
387  }
388  // Post advisors
389  for (int i = x.size(); i--; ) {
390  if (!x[i].assigned())
391  (void) new (home) CTAdvisor(home,*this,c,ts,x[i],i);
392  else
393  unassigned--;
394  }
395  // Schedule propagator
396  if (unassigned < x.size())
397  View::schedule(home,*this,ME_INT_VAL);
398  else
399  View::schedule(home,*this,ME_INT_BND);
400  }
401 
402  template<class View, class Table>
403  forceinline size_t
405  (void) Compact<View>::dispose(home);
406  return sizeof(*this);
407  }
408 
409  template<class View, class Table>
410  PropCost
413  }
414 
415  template<class View, class Table>
416  void
418  // Modified variable, subsumption, or failure
419  if ((status.type() != StatusType::NONE) || (unassigned == 0) || table.empty())
420  View::schedule(home,*this,ME_INT_DOM);
421  }
422 
423  template<class View, class Table>
424  ExecStatus
426  if (table.empty())
427  return ES_FAILED;
428  if (unassigned == 0)
429  return home.ES_SUBSUMED(*this);
430 
431  Status touched(status);
432  // Mark as performing propagation
434 
435  Region r;
436  // Scan all values of all unassigned variables to see if they
437  // are still supported.
438  for (Advisors<CTAdvisor> as(c); as(); ++as) {
439  CTAdvisor& a = as.advisor();
440  View x = a.view();
441 
442  // No point filtering variable if it was the only modified variable
443  if (touched.single(a) || x.assigned())
444  continue;
445 
446  if (x.size() == 2) { // Consider min and max values only
447  if (!table.intersects(supports(a,x.min())))
448  GECODE_ME_CHECK(x.eq(home,x.max()));
449  else if (!table.intersects(supports(a,x.max())))
450  GECODE_ME_CHECK(x.eq(home,x.min()));
451  if (x.assigned())
452  unassigned--;
453  else
454  a.adjust();
455  } else { // x.size() > 2
456  // How many values to remove
457  int* nq = r.alloc<int>(x.size());
458  unsigned int n_nq = 0U;
459  // The initialization is here just to avoid warnings...
460  int last_support = 0;
461  for (ValidSupports vs(*this,a); vs(); ++vs)
462  if (!table.intersects(vs.supports()))
463  nq[n_nq++] = vs.val();
464  else
465  last_support = vs.val();
466  // Remove collected values
467  if (n_nq > 0U) {
468  if (n_nq == 1U) {
469  ModEvent me = x.nq(home,nq[0]);
470  if (me_failed(me)) return ES_FAILED;
471  assert(me != ME_INT_VAL);
472  } else if (n_nq == x.size() - 1U) {
473  GECODE_ME_CHECK(x.eq(home,last_support));
474  unassigned--;
475  goto noadjust;
476  } else {
477  Iter::Values::Array rnq(nq,n_nq);
478  GECODE_ASSUME(n_nq >= 2U);
479  ModEvent me = x.minus_v(home,rnq,false);
480  if (me_failed(me)) return ES_FAILED;
481  assert(me != ME_INT_VAL);
482  }
483  a.adjust();
484  noadjust: ;
485  }
486  r.free();
487  }
488  }
489 
490  // Mark as no touched variable
491  status.none();
492  // Should not be in a failed state
493  assert(!table.empty());
494  // Subsume if there is at most one non-assigned variable
495  return (unassigned <= 1) ? home.ES_SUBSUMED(*this) : ES_FIX;
496  }
497 
498  template<class View, class Table>
501  const TupleSet& ts) {
502  // All variables pruned to correct domain
503  for (int i=x.size(); i--; ) {
504  TupleSet::Ranges r(ts,i);
505  GECODE_ME_CHECK(x[i].inter_r(home, r, false));
506  }
507  if ((x.size() > 1) && (ts.tuples() > 1)) {
508  CompactTable<View,Table>* ct = new (home) CompactTable(home,x,ts);
509  if (ct->table.empty())
510  return ES_FAILED;
511  }
512  return ES_OK;
513  }
514 
515  template<class View, class Table>
516  ExecStatus
518  CTAdvisor& a = static_cast<CTAdvisor&>(a0);
519 
520  // Do not fail a disabled propagator
521  if (table.empty())
522  return Compact<View>::disabled() ? home.ES_NOFIX_DISPOSE(c,a) : ES_FAILED;
523 
524  View x = a.view();
525 
526  /*
527  * Do not schedule if propagator is performing propagation,
528  * and dispose if assigned.
529  */
530  if (status.type() == StatusType::PROPAGATING)
531  return x.assigned() ? home.ES_FIX_DISPOSE(c,a) : ES_FIX;
532 
533  // Update status
534  status.touched(a);
535 
536  if (x.assigned()) {
537  // Variable is assigned -- intersect with its value
538  table.template intersect_with_mask<true>(supports(a,x.val()));
539  unassigned--;
540  return home.ES_NOFIX_DISPOSE(c,a);
541  }
542 
543  if (!x.any(d) && (x.min(d) == x.max(d))) {
544  table.nand_with_mask(supports(a,x.min(d)));
545  a.adjust();
546  } else if (!x.any(d) && (x.width(d) <= x.size())) {
547  // Incremental update, using the removed values
548  for (LostSupports ls(*this,a,x.min(d),x.max(d)); ls(); ++ls) {
549  table.nand_with_mask(ls.supports());
550  if (table.empty())
551  return Compact<View>::disabled() ? home.ES_NOFIX_DISPOSE(c,a) : ES_FAILED;
552  }
553  a.adjust();
554  } else {
555  a.adjust();
556  // Reset-based update, using the values that are left
557  if (x.size() == 2) {
558  table.intersect_with_masks(supports(a,x.min()),
559  supports(a,x.max()));
560  } else {
561  Region r;
562  BitSetData* mask = r.alloc<BitSetData>(table.size());
563  // Collect all tuples to be kept in a temporary mask
564  table.clear_mask(mask);
565  for (ValidSupports vs(*this,a); vs(); ++vs)
566  table.add_to_mask(vs.supports(),mask);
567  table.template intersect_with_mask<false>(mask);
568  }
569  }
570 
571  // Do not fail a disabled propagator
572  if (table.empty())
573  return Compact<View>::disabled() ? home.ES_NOFIX_DISPOSE(c,a) : ES_FAILED;
574 
575  // Schedule propagator
576  return ES_NOFIX;
577  }
578 
579 
580  /*
581  * Post function
582  */
583  template<class View>
584  inline ExecStatus
586  assert(ts.words() > 0U);
587  // All variables pruned to correct domain
588  for (int i=x.size(); i--; ) {
589  TupleSet::Ranges r(ts,i);
590  GECODE_ME_CHECK(x[i].inter_r(home, r, false));
591  }
592  // Choose the right bit set implementation
593  switch (ts.words()) {
594  case 0U:
595  GECODE_NEVER; return ES_OK;
596  case 1U:
597  return CompactTable<View,TinyBitSet<1U>>::post(home,x,ts);
598  case 2U:
599  return CompactTable<View,TinyBitSet<2U>>::post(home,x,ts);
600  case 3U:
601  return CompactTable<View,TinyBitSet<3U>>::post(home,x,ts);
602  case 4U:
603  return CompactTable<View,TinyBitSet<4U>>::post(home,x,ts);
604  default:
605  switch (Gecode::Support::u_type(ts.words())) {
612  default: GECODE_NEVER;
613  }
614  }
615  GECODE_NEVER;
616  return ES_OK;
617  }
618 
619 }}}
620 
621 
622 // STATISTICS: int-prop
void free(void)
Free allocate memory.
Definition: region.hpp:354
CompactTable(Space &home, TableProp &p)
Constructor for cloning p.
Definition: compact.hpp:316
const BitSetData * supports(void) const
Provide access to corresponding supports.
Definition: compact.hpp:275
void dispose(Space &home, Council< A > &c)
Delete advisor.
Definition: advisor.hpp:94
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition: compact.hpp:323
Council of advisors
Definition: core.hpp:156
Status(StatusType t)
Initialize with type t (either NONE or SEVERAL)
Definition: compact.hpp:109
const Range * lst(void) const
Return lasst range of support data structure.
Definition: compact.hpp:92
NodeType t
Type of node.
Definition: bool-expr.cpp:234
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
Definition: core.hpp:4634
TupleSet ts
The tuple set.
Definition: extensional.hh:477
StatusType type(void) const
Return status type.
Definition: compact.hpp:117
NNF * l
Left subtree.
Definition: bool-expr.cpp:244
const Range * range(CTAdvisor &a, int n)
Find range for n.
Definition: compact.hpp:153
ExecStatus ES_SUBSUMED(Propagator &p)
Definition: core.hpp:3433
#define GECODE_ASSUME(p)
Assert certain property.
Definition: macros.hpp:118
const FloatNum max
Largest allowed float value.
Definition: float.hh:848
Actor must always be disposed.
Definition: core.hpp:554
const Range * fst(void) const
Return first range of support data structure.
Definition: compact.hpp:86
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
Definition: region.hpp:384
Value iterator for array of integers
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:53
const unsigned int n_words
Number of words in supports.
Definition: extensional.hh:473
IntType u_type(unsigned int n)
Return type required to represent n.
Definition: int-type.hpp:151
void operator++(void)
Move to next supports.
Definition: compact.hpp:211
int ModEvent
Type for modification events.
Definition: core.hpp:64
Base-class for propagators.
Definition: core.hpp:1016
Compact< View >::CTAdvisor CTAdvisor
Definition: extensional.hh:511
Base-class for advisors.
Definition: core.hpp:1218
ExecStatus ES_NOFIX_DISPOSE(Council< A > &c, A &a)
Advisor a must be disposed and its propagator must be run
Definition: core.hpp:3757
int val(void) const
Return supported value.
Definition: compact.hpp:241
Class to iterate over advisors of a council.
Definition: core.hpp:157
Handle to region.
Definition: region.hpp:57
const BitSetData * supports(void) const
Return supports.
Definition: compact.hpp:235
#define forceinline
Definition: config.hpp:182
Propagation has computed fixpoint.
Definition: core.hpp:469
Computation spaces.
Definition: core.hpp:1668
ViewRanges< View > xr
Range iterator.
Definition: extensional.hh:423
Advisor storing a single view
Definition: advisor.hpp:47
const BitSetData * supports(CTAdvisor &a, int n)
Return supports for value n.
Definition: compact.hpp:174
Base-class for both propagators and branchers.
Definition: core.hpp:620
Iterator over ranges.
Definition: int.hh:2315
Status status
Propagator status.
Definition: extensional.hh:475
Gecode::IntSet d(v, 7)
CTAdvisor(Space &home, Propagator &p, Council< CTAdvisor > &c, const TupleSet &ts, View x0, int i)
Initialise from parameters.
Definition: compact.hpp:73
int tuples(void) const
Number of tuples.
Definition: tuple-set.hpp:189
char integer type
Definition: int-type.hpp:44
View view(void) const
Access view.
Definition: advisor.hpp:83
size_t dispose(Space &home)
Delete propagator and return its size.
Definition: compact.hpp:404
Multiple view have been touched.
Definition: extensional.hh:387
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
Gecode::IntArgs i(4, 1, 2, 3, 4)
Domain consistent extensional propagator.
Definition: extensional.hh:507
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
ExecStatus postcompact(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for compact table propagator.
Definition: compact.hpp:585
Execution has resulted in failure.
Definition: core.hpp:466
A single view has been touched.
Definition: extensional.hh:386
void none(void)
Set status to NONE.
Definition: compact.hpp:136
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable)
Definition: var-type.hpp:56
const Range * lst(int i) const
Return last range for position i.
Definition: tuple-set.hpp:213
LostSupports(const Compact< View > &p, CTAdvisor &a, int l, int h)
Initialize iterator for values between l and h.
Definition: compact.hpp:252
const BitSetData * supports(unsigned int n_words, int n) const
Return the supports for value n.
Definition: tuple-set.hpp:54
int max
Maximum value.
Definition: int.hh:2159
const Gecode::ModEvent ME_INT_BND
Domain operation has changed the minimum or maximum of the domain.
Definition: var-type.hpp:65
size_t size
The size of the propagator (used during subsumption)
Definition: core.hpp:1029
Expensive.
Definition: core.hpp:506
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
Post propagator for views x and table t.
Definition: compact.hpp:500
ExecStatus ES_FIX_DISPOSE(Council< A > &c, A &a)
Advisor a must be disposed
Definition: core.hpp:3750
View arrays.
Definition: array.hpp:228
const Range * _lst
Last range of support data structure.
Definition: extensional.hh:363
bool single(CTAdvisor &a) const
Check whether status is single and equal to a.
Definition: compact.hpp:122
Council< CTAdvisor > c
The advisor council.
Definition: extensional.hh:479
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Definition: macros.hpp:56
size_t dispose(Space &home)
Delete propagator and return its size.
Definition: compact.hpp:300
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Definition: core.hpp:3139
const Range * fst(int i) const
Return first range for position i.
Definition: tuple-set.hpp:209
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: compact.hpp:425
const BitSetData * s
The value&#39;s support.
Definition: extensional.hh:429
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:769
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: compact.hpp:411
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:71
Class represeting a set of tuples.
Definition: int.hh:2144
virtual void reschedule(Space &home)
Schedule function.
Definition: compact.hpp:417
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
Generic domain change information to be supplied to advisors.
Definition: core.hpp:205
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
Definition: core.hpp:3944
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Definition: core.hpp:3172
Propagation cost.
Definition: core.hpp:478
const Range * _fst
First range of support data structure.
Definition: extensional.hh:361
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
Definition: var-type.hpp:72
void dispose(Space &home, Council< CTAdvisor > &c)
Dispose advisor.
Definition: compact.hpp:98
void touched(CTAdvisor &a)
Set status to SINGLE or MULTIPLE depending on a.
Definition: compact.hpp:130
ExecStatus
Definition: core.hpp:464
bool assigned(View x, int v)
Whether x is assigned to value v.
Definition: single.hpp:47
bool operator()(void) const
Whether there are still supports left.
Definition: compact.hpp:230
Compact(Space &home, Compact &p)
Constructor for cloning p.
Definition: compact.hpp:283
Date item for bitsets.
Definition: bitset-base.hpp:69
Advisor for updating current table.
Definition: extensional.hh:356
void adjust(void)
Adjust supports.
Definition: compact.hpp:53
Post propagator for SetVar x
Definition: set.hh:769
Execution is okay.
Definition: core.hpp:468
Propagation has not computed fixpoint.
Definition: core.hpp:467
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: compact.hpp:517
ptrdiff_t s
A tagged pointer for storing the status.
Definition: extensional.hh:395
Gecode toplevel namespace
const unsigned int n_words
Number of words.
Definition: extensional.hh:419
Base class for compact table propagator.
Definition: extensional.hh:351
int unassigned
Number of unassigned views.
Definition: extensional.hh:471
int min
Minimum value.
Definition: int.hh:2157
void operator++(void)
Move iterator to next value.
Definition: compact.hpp:262
bool operator()(void) const
Whether iterator is done.
Definition: compact.hpp:270
int ModEventDelta
Modification event deltas.
Definition: core.hpp:91
int size(void) const
Return size of array (number of elements)
Definition: array.hpp:1203
short integer type
Definition: int-type.hpp:45
void propagating(void)
Set status to PROPAGATING.
Definition: compact.hpp:141
Home class for posting propagators
Definition: core.hpp:846
ValidSupports(const Compact< View > &p, CTAdvisor &a)
Initialize from initialized propagator.
Definition: compact.hpp:192
No view has been touched.
Definition: extensional.hh:388
#define GECODE_NEVER
Assert that this command is never executed.
Definition: macros.hpp:60
The propagator is currently running.
Definition: extensional.hh:389
Range information.
Definition: int.hh:2154
bool me_failed(ModEvent me)
Check whether modification event me is failed.
Definition: modevent.hpp:58
unsigned int words(void) const
Return number of required bit set words.
Definition: tuple-set.hpp:193