Generated on Thu Jul 21 2022 00:00:00 for Gecode by doxygen 1.9.5
extensional.hh
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 * Mikael Lagerkvist <lagerkvist@gecode.org>
6 * Christian Schulte <schulte@gecode.org>
7 *
8 * Copyright:
9 * Linnea Ingmar, 2017
10 * Mikael Lagerkvist, 2007
11 * Christian Schulte, 2004
12 *
13 * This file is part of Gecode, the generic constraint
14 * development environment:
15 * http://www.gecode.org
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
38#ifndef __GECODE_INT_EXTENSIONAL_HH__
39#define __GECODE_INT_EXTENSIONAL_HH__
40
41#include <gecode/int.hh>
42
43#include <gecode/int/rel.hh>
44
50namespace Gecode { namespace Int { namespace Extensional {
51
66 template<class View, class Val, class Degree, class StateIdx>
67 class LayeredGraph : public Propagator {
68 protected:
70 class State {
71 public:
72 Degree i_deg;
73 Degree o_deg;
75 void init(void);
76 };
78 class Edge {
79 public:
80 StateIdx i_state;
81 StateIdx o_state;
82 };
84 class Support {
85 public:
86 Val val;
87 Degree n_edges;
89 };
93 class Layer {
94 public:
95 View x;
96 StateIdx n_states;
100 };
103 private:
104 const Support* s1;
105 const Support* s2;
106 public:
108 LayerValues(void);
110 LayerValues(const Layer& l);
112 void init(const Layer& l);
114 bool operator ()(void) const;
116 void operator ++(void);
118 int val(void) const;
119 };
121 class Index : public Advisor {
122 public:
124 int i;
126 Index(Space& home, Propagator& p, Council<Index>& c, int i);
128 Index(Space& home, Index& a);
129 };
132 private:
133 int _fst;
134 int _lst;
135 public:
137 IndexRange(void);
139 void reset(void);
141 void add(int i);
143 void add(const IndexRange& ir);
145 void lshift(int n);
147 bool empty(void) const;
149 int fst(void) const;
151 int lst(void) const;
152 };
156 int n;
160 StateIdx max_states;
162 unsigned int n_states;
164 unsigned int n_edges;
172 State& i_state(int i, StateIdx is);
174 State& i_state(int i, const Edge& e);
176 bool i_dec(int i, const Edge& e);
178 State& o_state(int i, StateIdx os);
180 State& o_state(int i, const Edge& e);
182 bool o_dec(int i, const Edge& e);
184 void audit(void);
186 template<class Var>
188 const VarArgArray<Var>& x, const DFA& dfa);
191 public:
193 template<class Var>
194 LayeredGraph(Home home,
195 const VarArgArray<Var>& x, const DFA& dfa);
197 virtual Actor* copy(Space& home);
199 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
201 virtual void reschedule(Space& home);
203 virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
205 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
207 virtual size_t dispose(Space& home);
209 template<class Var>
210 static ExecStatus post(Home home,
211 const VarArgArray<Var>& x, const DFA& dfa);
212 };
213
215 template<class Var>
217 const VarArgArray<Var>& x, const DFA& dfa);
218
219}}}
220
222
223namespace Gecode { namespace Int { namespace Extensional {
224
227
228 /*
229 * Forward declarations
230 */
231 template<unsigned int size> class TinyBitSet;
232
234 template<class IndexType>
235 class BitSet {
236 template<class> friend class BitSet;
237 template<unsigned int> friend class TinyBitSet;
238 protected:
240 IndexType _limit;
242 IndexType* _index;
246 void replace_and_decrease(IndexType i, BitSetData w);
247 public:
249 BitSet(Space& home, unsigned int n);
251 template<class OldIndexType>
252 BitSet(Space& home, const BitSet<OldIndexType>& bs);
254 BitSet(Space& home, const TinyBitSet<1U>& tbs);
256 BitSet(Space& home, const TinyBitSet<2U>& tbs);
258 BitSet(Space& home, const TinyBitSet<3U>& tbs);
260 BitSet(Space& home, const TinyBitSet<4U>& tbs);
262 unsigned int limit(void) const;
264 bool empty(void) const;
266 void flush(void);
268 unsigned int width(void) const;
270 void clear_mask(BitSetData* mask) const;
272 void add_to_mask(const BitSetData* b, BitSetData* mask) const;
274 template<bool sparse>
275 void intersect_with_mask(const BitSetData* mask);
277 void intersect_with_masks(const BitSetData* a, const BitSetData* b);
279 bool intersects(const BitSetData* b) const;
281 void nand_with_mask(const BitSetData* b);
283 unsigned long long int ones(void) const;
285 unsigned long long int ones(const BitSetData* b) const;
287 unsigned long long int bits(void) const;
289 unsigned int words(void) const;
291 unsigned int size(void) const;
292 };
293
294}}}
295
297
298namespace Gecode { namespace Int { namespace Extensional {
299
301 template<unsigned int _size>
303 template<unsigned int> friend class TinyBitSet;
304 protected:
307 public:
309 TinyBitSet(Space& home, unsigned int n);
311 template<unsigned int largersize>
314 template<class IndexType>
315 TinyBitSet(Space& home, const BitSet<IndexType>& bs);
317 int limit(void) const;
319 bool empty(void) const;
321 void flush(void);
323 unsigned int width(void) const;
325 void clear_mask(BitSetData* mask);
327 void add_to_mask(const BitSetData* b, BitSetData* mask) const;
329 template<bool sparse>
330 void intersect_with_mask(const BitSetData* mask);
332 void intersect_with_masks(const BitSetData* a, const BitSetData* b);
334 bool intersects(const BitSetData* b);
336 void nand_with_mask(const BitSetData* b);
340 unsigned long long int ones(void) const;
342 unsigned long long int ones(const BitSetData* b) const;
344 unsigned long long int bits(void) const;
346 unsigned int words(void) const;
348 unsigned int size(void) const;
349 };
350
351}}}
352
354
355namespace Gecode { namespace Int { namespace Extensional {
356
359
361 template<class View, bool pos>
362 class Compact : public Propagator {
363 protected:
367 class CTAdvisor : public ViewAdvisor<View> {
368 public:
369 using ViewAdvisor<View>::view;
370 protected:
372 const Range* _fst;
374 const Range* _lst;
375 public:
377
378
380 const TupleSet& ts, View x0, int i);
382 CTAdvisor(Space& home, CTAdvisor& a);
384
385 void adjust(void);
387 const Range* fst(void) const;
389 const Range* lst(void) const;
391 void dispose(Space& home, Council<CTAdvisor>& c);
392 };
394
396
398 protected:
400 const unsigned int n_words;
402 int max;
406 const Range* sr;
408 const Range* lst;
410 int n;
412 const BitSetData* s;
414 void find(void);
415 public:
419 ValidSupports(const TupleSet& ts, int i, View x);
421 void operator ++(void);
423 bool operator ()(void) const;
425 const BitSetData* supports(void) const;
427 int val(void) const;
428 };
431 protected:
433 const unsigned int n_words;
435 const Range* r;
437 const Range* lst;
439 int l;
441 int h;
443 const BitSetData* s;
444 public:
447 int l, int h);
449 void operator ++(void);
451 bool operator ()(void) const;
453 const BitSetData* supports(void) const;
454 };
456
458
459 bool all(void) const;
461 bool atmostone(void) const;
463 protected:
465 const unsigned int n_words;
471 Compact(Space& home, Compact& p);
473 Compact(Home home, const TupleSet& ts);
475 template<class Table>
476 void setup(Space& home, Table& table, ViewArray<View>& x);
478 template<class Table>
479 bool full(const Table& table) const;
481 const Range* range(CTAdvisor& a, int n);
483 const BitSetData* supports(CTAdvisor& a, int n);
484 public:
486 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
488 size_t dispose(Space& home);
489 };
490
503 template<class View, class Table>
504 class PosCompact : public Compact<View,true> {
505 public:
510
511 using Compact<View,true>::setup;
512 using Compact<View,true>::supports;
513 using Compact<View,true>::all;
514 using Compact<View,true>::atmostone;
515 using Compact<View,true>::c;
516 using Compact<View,true>::ts;
517
519
520
522 SINGLE = 0,
524 NONE = 2,
525 PROPAGATING = 3
526 };
528 class Status {
529 protected:
531 ptrdiff_t s;
532 public:
536 Status(const Status& s);
538 StatusType type(void) const;
540 bool single(CTAdvisor& a) const;
542 void touched(CTAdvisor& a);
544 void none(void);
546 void propagating(void);
547 };
551 Table table;
553 bool empty(void) const;
555 template<class TableProp>
556 PosCompact(Space& home, TableProp& p);
558 PosCompact(Home home, ViewArray<View>& x, const TupleSet& ts);
559 public:
561 virtual void reschedule(Space& home);
563 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
565 virtual Actor* copy(Space& home);
567 static ExecStatus post(Home home, ViewArray<View>& x, const TupleSet& ts);
569 size_t dispose(Space& home);
571 virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
572 };
573
575 template<class View>
577
593 template<class View, class Table>
594 class NegCompact : public Compact<View,false> {
595 public:
599
600 using Compact<View,false>::setup;
601 using Compact<View,false>::full;
602 using Compact<View,false>::supports;
603 using Compact<View,false>::atmostone;
604 using Compact<View,false>::c;
605 using Compact<View,false>::ts;
606
608 Table table;
610 template<class TableProp>
611 NegCompact(Space& home, TableProp& p);
613 NegCompact(Home home, ViewArray<View>& x, const TupleSet& ts);
614 public:
616 virtual void reschedule(Space& home);
618 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
620 virtual Actor* copy(Space& home);
622 static ExecStatus post(Home home, ViewArray<View>& x, const TupleSet& ts);
624 size_t dispose(Space& home);
626 virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
627 };
628
630 template<class View>
632
633
635 template<class View, class Table, class CtrlView, ReifyMode rm>
636 class ReCompact : public Compact<View,false> {
637 public:
641
642 using Compact<View,false>::setup;
643 using Compact<View,false>::full;
644 using Compact<View,false>::supports;
645 using Compact<View,false>::c;
646 using Compact<View,false>::ts;
647
649 Table table;
651 CtrlView b;
655 template<class TableProp>
656 ReCompact(Space& home, TableProp& p);
658 ReCompact(Home home, ViewArray<View>& x, const TupleSet& ts, CtrlView b);
659 public:
661 virtual void reschedule(Space& home);
663 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
665 virtual Actor* copy(Space& home);
667 static ExecStatus post(Home home, ViewArray<View>& x, const TupleSet& ts,
668 CtrlView b);
670 size_t dispose(Space& home);
672 virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
673 };
674
676 template<class View, class CtrlView, ReifyMode rm>
678 CtrlView b);
679
680}}}
681
683
684#endif
685
686// STATISTICS: int-prop
NNF * l
Left subtree.
Definition: bool-expr.cpp:240
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
NodeType t
Type of node.
Definition: bool-expr.cpp:230
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:232
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:234
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Base-class for both propagators and branchers.
Definition: core.hpp:628
Base-class for advisors.
Definition: core.hpp:1292
Council of advisors
Definition: core.hpp:1241
Deterministic finite automaton (DFA)
Definition: int.hh:2049
Generic domain change information to be supplied to advisors.
Definition: core.hpp:204
Home class for posting propagators
Definition: core.hpp:856
unsigned long long int bits(void) const
Return an upper bound on the number of bits.
Definition: bit-set.hpp:247
void intersect_with_mask(const BitSetData *mask)
Intersect with mask, sparse mask if sparse is true.
Definition: bit-set.hpp:168
unsigned int width(void) const
Return the highest active index.
Definition: bit-set.hpp:66
void replace_and_decrease(IndexType i, BitSetData w)
Replace the i th word with w, decrease limit if w is zero.
Definition: bit-set.hpp:133
unsigned long long int ones(void) const
Return the number of ones.
Definition: bit-set.hpp:238
bool intersects(const BitSetData *b) const
Check if has a non-empty intersection with the set.
Definition: bit-set.hpp:219
void intersect_with_masks(const BitSetData *a, const BitSetData *b)
Intersect with the "or" of and b.
Definition: bit-set.hpp:191
void add_to_mask(const BitSetData *b, BitSetData *mask) const
Add to mask.
Definition: bit-set.hpp:159
unsigned int size(void) const
Return the number of required bit set words.
Definition: bit-set.hpp:60
unsigned int limit(void) const
Get the limit.
Definition: bit-set.hpp:42
void clear_mask(BitSetData *mask) const
Clear the first limit words in mask.
Definition: bit-set.hpp:149
bool empty(void) const
Check whether the set is empty.
Definition: bit-set.hpp:48
unsigned int words(void) const
Return the number of required bit set words.
Definition: bit-set.hpp:54
void flush(void)
Make the set empty.
Definition: bit-set.hpp:105
void nand_with_mask(const BitSetData *b)
Perform "nand" with b.
Definition: bit-set.hpp:207
Advisor for updating current table.
Definition: extensional.hh:367
const Range * lst(void) const
Return lasst range of support data structure.
Definition: compact.hpp:99
const Range * _lst
Last range of support data structure.
Definition: extensional.hh:374
const Range * fst(void) const
Return first range of support data structure.
Definition: compact.hpp:93
void adjust(void)
Adjust supports.
Definition: compact.hpp:47
void dispose(Space &home, Council< CTAdvisor > &c)
Dispose advisor.
Definition: compact.hpp:105
const Range * _fst
First range of support data structure.
Definition: extensional.hh:372
const BitSetData * s
The lost value's support.
Definition: extensional.hh:443
bool operator()(void) const
Whether iterator is done.
Definition: compact.hpp:307
const BitSetData * supports(void) const
Provide access to corresponding supports.
Definition: compact.hpp:312
void operator++(void)
Move iterator to next value.
Definition: compact.hpp:299
const unsigned int n_words
Number of words.
Definition: extensional.hh:433
bool operator()(void) const
Whether there are still supports left.
Definition: compact.hpp:266
const BitSetData * supports(void) const
Return supports.
Definition: compact.hpp:271
void operator++(void)
Move to next supports.
Definition: compact.hpp:239
ViewRanges< View > xr
Range iterator.
Definition: extensional.hh:404
void find(void)
Find a new value (only for negative case)
Definition: compact.hpp:179
const BitSetData * s
The value's support.
Definition: extensional.hh:412
const unsigned int n_words
Number of words.
Definition: extensional.hh:400
int val(void) const
Return supported value.
Definition: compact.hpp:277
Base class for compact table propagator.
Definition: extensional.hh:362
size_t dispose(Space &home)
Delete propagator and return its size.
Definition: compact.hpp:402
TupleSet ts
The tuple set.
Definition: extensional.hh:467
const BitSetData * supports(CTAdvisor &a, int n)
Return supports for value n.
Definition: compact.hpp:148
bool full(const Table &table) const
Check whether the table covers the whole Cartedion product.
Definition: compact.hpp:379
void setup(Space &home, Table &table, ViewArray< View > &x)
Setup the actual table.
Definition: compact.hpp:350
const unsigned int n_words
Number of words in supports.
Definition: extensional.hh:465
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: compact.hpp:391
bool all(void) const
Whether all variables are assigned.
Definition: compact.hpp:320
const Range * range(CTAdvisor &a, int n)
Find range for n.
Definition: compact.hpp:116
bool atmostone(void) const
Whether at most one variable is unassigned.
Definition: compact.hpp:326
TupleSet::Range Range
Range type for supports.
Definition: extensional.hh:365
Council< CTAdvisor > c
The advisor council.
Definition: extensional.hh:469
Edge defined by in-state and out-state
Definition: extensional.hh:78
StateIdx o_state
Number of out-state.
Definition: extensional.hh:81
StateIdx i_state
Number of in-state.
Definition: extensional.hh:80
Range approximation of which positions have changed.
Definition: extensional.hh:131
void reset(void)
Reset range to be empty.
void add(const IndexRange &ir)
Add index range ir to range.
int fst(void) const
Return first position.
void lshift(int n)
Shift index range by n elements to the left.
int lst(void) const
Return last position.
bool empty(void) const
Test whether range is empty.
Advisors for views (by position in array)
Definition: extensional.hh:121
int i
The position of the view in the view array.
Definition: extensional.hh:124
Iterator for telling variable domains by scanning support.
Definition: extensional.hh:102
bool operator()(void) const
Test whether more values supported.
void operator++(void)
Move to next supported value.
int val(void) const
Return supported value.
Layer for a view in the layered graph
Definition: extensional.hh:93
State * states
States used by outgoing edges.
Definition: extensional.hh:98
ValSize size
Number of supported values.
Definition: extensional.hh:97
StateIdx n_states
Number of states used by outgoing edges.
Definition: extensional.hh:96
States are described by number of incoming and outgoing edges.
Definition: extensional.hh:70
Degree o_deg
The out-degree (number of outgoing edges) Initialize with zeroes.
Definition: extensional.hh:73
Degree i_deg
The in-degree (number of incoming edges)
Definition: extensional.hh:72
Support information for a value
Definition: extensional.hh:84
Edge * edges
Supporting edges in layered graph.
Definition: extensional.hh:88
Degree n_edges
Number of supporting edges.
Definition: extensional.hh:87
Domain consistent layered graph (regular) propagator.
Definition: extensional.hh:67
ExecStatus initialize(Space &home, const VarArgArray< Var > &x, const DFA &dfa)
Initialize layered graph.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
unsigned int n_edges
Total number of edges.
Definition: extensional.hh:164
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Gecode::Support::IntTypeTraits< Val >::utype ValSize
Type for support size.
Definition: extensional.hh:91
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high linear)
StateIdx max_states
Maximal number of states per layer.
Definition: extensional.hh:160
unsigned int n_states
Total number of states.
Definition: extensional.hh:162
State & o_state(int i, const Edge &e)
Return state for layer i and out state of edge e.
bool i_dec(int i, const Edge &e)
Decrement out degree for in state of edge e for layer i.
int n
Number of layers (and views)
Definition: extensional.hh:156
IndexRange o_ch
Index range with out-degree modifications.
Definition: extensional.hh:168
IndexRange a_ch
Index range for any change (for compression)
Definition: extensional.hh:170
virtual size_t dispose(Space &home)
Delete propagator and return its size.
void audit(void)
Perform consistency check on data structures.
IndexRange i_ch
Index range with in-degree modifications.
Definition: extensional.hh:166
Council< Index > c
The advisor council.
Definition: extensional.hh:154
static ExecStatus post(Home home, const VarArgArray< Var > &x, const DFA &dfa)
Post propagator on views x and DFA dfa.
State & i_state(int i, const Edge &e)
Return in state for layer i and in state of edge e.
State & o_state(int i, StateIdx os)
Return out state for layer i and state index os.
bool o_dec(int i, const Edge &e)
Decrement in degree for out state of edge e for layer i.
State & i_state(int i, StateIdx is)
Return in state for layer i and state index is.
virtual void reschedule(Space &home)
Schedule function.
Layer * layers
The layers of the graph.
Definition: extensional.hh:158
Domain consistent negative extensional propagator.
Definition: extensional.hh:594
Compact< View, false >::ValidSupports ValidSupports
Definition: extensional.hh:596
Compact< View, false >::CTAdvisor CTAdvisor
Definition: extensional.hh:598
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition: compact.hpp:743
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: compact.hpp:904
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: compact.hpp:819
size_t dispose(Space &home)
Delete propagator and return its size.
Definition: compact.hpp:806
virtual void reschedule(Space &home)
Schedule function.
Definition: compact.hpp:813
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
Post propagator for views x and table t.
Definition: compact.hpp:798
Compact< View, false >::Range Range
Definition: extensional.hh:597
void none(void)
Set status to NONE.
Definition: compact.hpp:444
ptrdiff_t s
A tagged pointer for storing the status.
Definition: extensional.hh:531
bool single(CTAdvisor &a) const
Check whether status is single and equal to a.
Definition: compact.hpp:430
void touched(CTAdvisor &a)
Set status to SINGLE or MULTIPLE depending on a.
Definition: compact.hpp:438
StatusType type(void) const
Return status type.
Definition: compact.hpp:425
void propagating(void)
Set status to PROPAGATING.
Definition: compact.hpp:449
Domain consistent positive extensional propagator.
Definition: extensional.hh:504
size_t dispose(Space &home)
Delete propagator and return its size.
Definition: compact.hpp:531
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition: compact.hpp:467
Compact< View, true >::ValidSupports ValidSupports
Definition: extensional.hh:506
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: compact.hpp:615
Compact< View, true >::Range Range
Definition: extensional.hh:507
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: compact.hpp:547
Compact< View, true >::CTAdvisor CTAdvisor
Definition: extensional.hh:508
Status status
Propagator status.
Definition: extensional.hh:549
@ NONE
No view has been touched.
Definition: extensional.hh:524
@ PROPAGATING
The propagator is currently running.
Definition: extensional.hh:525
@ SINGLE
A single view has been touched.
Definition: extensional.hh:522
@ MULTIPLE
Multiple view have been touched.
Definition: extensional.hh:523
Compact< View, true >::LostSupports LostSupports
Definition: extensional.hh:509
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
Post propagator for views x and table t.
Definition: compact.hpp:522
virtual void reschedule(Space &home)
Schedule function.
Definition: compact.hpp:538
bool empty(void) const
Check whether the table is empty.
Domain consistent reified extensional propagator.
Definition: extensional.hh:636
Compact< View, false >::Range Range
Definition: extensional.hh:639
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition: compact.hpp:1014
ViewArray< View > y
The views (for rewriting)
Definition: extensional.hh:653
Compact< View, false >::CTAdvisor CTAdvisor
Definition: extensional.hh:640
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: compact.hpp:1140
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: compact.hpp:1109
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts, CtrlView b)
Post propagator for views x and table t.
Definition: compact.hpp:1077
CtrlView b
Boolean control view.
Definition: extensional.hh:651
Compact< View, false >::ValidSupports ValidSupports
Definition: extensional.hh:638
virtual void reschedule(Space &home)
Schedule function.
Definition: compact.hpp:1103
size_t dispose(Space &home)
Delete propagator and return its size.
Definition: compact.hpp:1095
TinyBitSet(Space &home, const TinyBitSet< largersize > &tbs)
Initialize during cloning.
void intersect_with_mask(const BitSetData *mask)
Intersect with mask, sparse mask if sparse is true.
unsigned int words(void) const
Return the number of required bit set words.
unsigned int width(void) const
Return the highest active index.
bool intersects(const BitSetData *b)
Check if has a non-empty intersection with the set.
void add_to_mask(const BitSetData *b, BitSetData *mask) const
Add to mask.
int limit(void) const
Get the limit.
unsigned long long int bits(void) const
Return an upper bound on the number of bits.
void nand_with_masks(const BitSetData *a, const BitSetData *b)
Perform "nand" with and the "or" of a and b.
unsigned long long int ones(void) const
Return the number of ones.
unsigned int size(void) const
Return the total number of words.
bool empty(void) const
Check whether the set is empty.
BitSetData _bits[_size]
Words.
Definition: extensional.hh:306
void intersect_with_masks(const BitSetData *a, const BitSetData *b)
Intersect with the "or" of and b.
void flush(void)
Make the set empty.
void nand_with_mask(const BitSetData *b)
Perform "nand" with b.
void clear_mask(BitSetData *mask)
Clear the first limit words in mask.
Range iterator for integer views.
Definition: view.hpp:54
Propagation cost.
Definition: core.hpp:486
Base-class for propagators.
Definition: core.hpp:1064
ModEventDelta med
A set of modification events (used during propagation)
Definition: core.hpp:1075
Computation spaces.
Definition: core.hpp:1742
Date item for bitsets.
Definition: bitset-base.hpp:65
Traits to for information about integer types.
Definition: int-type.hpp:52
Range information.
Definition: int.hh:2201
Class represeting a set of tuples.
Definition: int.hh:2191
int * Tuple
Type of a tuple.
Definition: int.hh:2197
Argument array for variables.
Definition: array.hpp:774
Advisor storing a single view
Definition: advisor.hpp:43
View view(void) const
Access view.
Definition: advisor.hpp:79
View arrays.
Definition: array.hpp:253
int ModEventDelta
Modification event deltas.
Definition: core.hpp:89
TupleSet::Tuple Tuple
Tuple type.
Definition: extensional.hh:358
ExecStatus postnegcompact(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for compact table propagator.
Definition: compact.hpp:955
ExecStatus postposcompact(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for positive compact table propagator.
Definition: compact.hpp:685
Gecode::Support::BitSetData BitSetData
Import type.
Definition: extensional.hh:226
ExecStatus postrecompact(Home home, ViewArray< View > &x, const TupleSet &ts, CtrlView b)
Post function for compact table propagator.
Definition: compact.hpp:1192
ExecStatus post_lgp(Home home, const VarArgArray< Var > &x, const DFA &dfa)
Select small types for the layered graph propagator.
Gecode toplevel namespace
ExecStatus
Definition: core.hpp:472
Post propagator for SetVar x
Definition: set.hh:767