Generated on Fri Jan 10 2020 11:38:25 for Gecode by doxygen 1.8.16
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 
50 namespace 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;
74  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  };
102  class LayerValues {
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  };
131  class IndexRange {
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>
216  ExecStatus post_lgp(Home home,
217  const VarArgArray<Var>& x, const DFA& dfa);
218 
219 }}}
220 
222 
223 namespace 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 
298 namespace Gecode { namespace Int { namespace Extensional {
299 
301  template<unsigned int _size>
302  class TinyBitSet {
303  template<unsigned int> friend class TinyBitSet;
304  protected:
307  public:
309  TinyBitSet(Space& home, unsigned int n);
311  template<unsigned int largersize>
312  TinyBitSet(Space& home, const TinyBitSet<largersize>& tbs);
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);
338  void nand_with_masks(const BitSetData* a, 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 
355 namespace Gecode { namespace Int { namespace Extensional {
356 
358  typedef TupleSet::Tuple Tuple;
359 
361  template<class View, bool pos>
362  class Compact : public Propagator {
363  protected:
367  class CTAdvisor : public ViewAdvisor<View> {
368  public:
370  protected:
372  const Range* _fst;
374  const Range* _lst;
375  public:
377 
380  const TupleSet& ts, View x0, int i);
382  CTAdvisor(Space& home, CTAdvisor& a);
384  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  class ValidSupports {
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  };
430  class LostSupports {
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  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 
515  using Compact<View,true>::c;
517 
519 
520  enum StatusType {
522  SINGLE = 0,
523  MULTIPLE = 1,
524  NONE = 2,
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 
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 
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
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
void audit(void)
Perform consistency check on data structures.
unsigned int width(void) const
Return the highest active index.
Definition: bit-set.hpp:66
void flush(void)
Make the set empty.
Definition: bit-set.hpp:105
bool empty(void) const
Check whether the table is empty.
const Range * lst
Last range.
Definition: extensional.hh:437
Base class for compact table propagator.
Definition: extensional.hh:362
void clear_mask(BitSetData *mask) const
Clear the first limit words in mask.
Definition: bit-set.hpp:149
Degree o_deg
The out-degree (number of outgoing edges) Initialize with zeroes.
Definition: extensional.hh:73
Post propagator for SetVar x
Definition: set.hh:767
void intersect_with_masks(const BitSetData *a, const BitSetData *b)
Intersect with the "or" of and b.
Definition: bit-set.hpp:191
Compact< View, false >::ValidSupports ValidSupports
Definition: extensional.hh:596
Table table
Current table.
Definition: extensional.hh:608
IndexType _limit
Limit.
Definition: extensional.hh:240
void lshift(int n)
Shift index range by n elements to the left.
Council< CTAdvisor > c
The advisor council.
Definition: extensional.hh:469
Index(Space &home, Propagator &p, Council< Index > &c, int i)
Create index advisor.
int max
Maximal value.
Definition: extensional.hh:402
Advisors for views (by position in array)
Definition: extensional.hh:121
const BitSetData * supports(void) const
Return supports.
Definition: compact.hpp:271
bool full(const Table &table) const
Check whether the table covers the whole Cartedion product.
Definition: compact.hpp:379
IndexRange a_ch
Index range for any change (for compression)
Definition: extensional.hh:170
const unsigned int n_words
Number of words in supports.
Definition: extensional.hh:465
bool i_dec(int i, const Edge &e)
Decrement out degree for in state of edge e for layer i.
int val(void) const
Return supported value.
Compact< View, true >::LostSupports LostSupports
Definition: extensional.hh:509
The propagator is currently running.
Definition: extensional.hh:525
void propagating(void)
Set status to PROPAGATING.
Definition: compact.hpp:449
A single view has been touched.
Definition: extensional.hh:522
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: compact.hpp:547
Gecode::Support::BitSetData BitSetData
Import type.
Definition: extensional.hh:226
bool all(void) const
Whether all variables are assigned.
Definition: compact.hpp:320
unsigned int words(void) const
Return the number of required bit set words.
Definition: bit-set.hpp:54
Compact(Space &home, Compact &p)
Constructor for cloning p.
Definition: compact.hpp:335
bool intersects(const BitSetData *b) const
Check if has a non-empty intersection with the set.
Definition: bit-set.hpp:219
StatusType
Type of status.
Definition: extensional.hh:521
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition: compact.hpp:391
const Range * sr
Support iterator.
Definition: extensional.hh:406
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
Post propagator for views x and table t.
Definition: compact.hpp:522
void add_to_mask(const BitSetData *b, BitSetData *mask) const
Add to mask.
int fst(void) const
Return first position.
ReCompact(Space &home, TableProp &p)
Constructor for cloning p.
Definition: compact.hpp:1005
Council< Index > c
The advisor council.
Definition: extensional.hh:154
const unsigned int n_words
Number of words.
Definition: extensional.hh:400
void nand_with_masks(const BitSetData *a, const BitSetData *b)
Perform "nand" with and the "or" of a and b.
static ExecStatus post(Home home, const VarArgArray< Var > &x, const DFA &dfa)
Post propagator on views x and DFA dfa.
Advisor for updating current table.
Definition: extensional.hh:367
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: compact.hpp:904
unsigned long long int bits(void) const
Return an upper bound on the number of bits.
Definition: bit-set.hpp:247
bool atmostone(void) const
Whether at most one variable is unassigned.
Definition: compact.hpp:326
virtual void reschedule(Space &home)
Schedule function.
Definition: compact.hpp:538
size_t dispose(Space &home)
Delete propagator and return its size.
Definition: compact.hpp:402
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
const Range * range(CTAdvisor &a, int n)
Find range for n.
Definition: compact.hpp:116
int limit(void) const
Get the limit.
Table table
Current table.
Definition: extensional.hh:551
Compact< View, false >::ValidSupports ValidSupports
Definition: extensional.hh:638
void flush(void)
Make the set empty.
Multiple view have been touched.
Definition: extensional.hh:523
unsigned int words(void) const
Return the number of required bit set words.
NodeType t
Type of node.
Definition: bool-expr.cpp:230
void operator++(void)
Move iterator to next value.
Definition: compact.hpp:299
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:1095
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: compact.hpp:615
CtrlView b
Boolean control view.
Definition: extensional.hh:651
ExecStatus post_lgp(Home home, const VarArgArray< Var > &x, const DFA &dfa)
Select small types for the layered graph propagator.
Computation spaces.
Definition: core.hpp:1742
bool operator()(void) const
Whether there are still supports left.
Definition: compact.hpp:266
Compact< View, false >::CTAdvisor CTAdvisor
Definition: extensional.hh:598
const Range * _lst
Last range of support data structure.
Definition: extensional.hh:374
bool empty(void) const
Check whether the set is empty.
Advisor storing a single view
Definition: advisor.hpp:43
Edge * edges
Supporting edges in layered graph.
Definition: extensional.hh:88
Base-class for both propagators and branchers.
Definition: core.hpp:628
IndexType * _index
Indices.
Definition: extensional.hh:242
const BitSetData * supports(void) const
Provide access to corresponding supports.
Definition: compact.hpp:312
const Range * r
Range information.
Definition: extensional.hh:435
StateIdx n_states
Number of states used by outgoing edges.
Definition: extensional.hh:96
void add_to_mask(const BitSetData *b, BitSetData *mask) const
Add to mask.
Definition: bit-set.hpp:159
State & i_state(int i, StateIdx is)
Return in state for layer i and state index is.
Layer * layers
The layers of the graph.
Definition: extensional.hh:158
Compact< View, false >::CTAdvisor CTAdvisor
Definition: extensional.hh:640
CTAdvisor(Space &home, Propagator &p, Council< CTAdvisor > &c, const TupleSet &ts, View x0, int i)
Initialise from parameters.
Definition: compact.hpp:80
Table table
Current table.
Definition: extensional.hh:649
const Range * lst
The last range.
Definition: extensional.hh:408
BitSetData * _bits
Words.
Definition: extensional.hh:244
void init(const Layer &l)
Initialize for support of layer l.
ExecStatus postposcompact(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for positive compact table propagator.
Definition: compact.hpp:685
void dispose(Space &home, Council< CTAdvisor > &c)
Dispose advisor.
Definition: compact.hpp:105
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
Range approximation of which positions have changed.
Definition: extensional.hh:131
ptrdiff_t s
A tagged pointer for storing the status.
Definition: extensional.hh:531
IndexRange i_ch
Index range with in-degree modifications.
Definition: extensional.hh:166
ExecStatus postnegcompact(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for compact table propagator.
Definition: compact.hpp:955
PosCompact(Space &home, TableProp &p)
Constructor for cloning p.
Definition: compact.hpp:460
void intersect_with_mask(const BitSetData *mask)
Intersect with mask, sparse mask if sparse is true.
Status management.
Definition: extensional.hh:528
int val(void) const
Return supported value.
Definition: compact.hpp:277
TupleSet ts
The tuple set.
Definition: extensional.hh:467
Gecode toplevel namespace
Domain consistent negative extensional propagator.
Definition: extensional.hh:594
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition: compact.hpp:743
Support information for a value
Definition: extensional.hh:84
Base-class for propagators.
Definition: core.hpp:1064
void setup(Space &home, Table &table, ViewArray< View > &x)
Setup the actual table.
Definition: compact.hpp:350
Range iterator for integer views.
Definition: view.hpp:54
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
LayerValues(void)
Default constructor.
Val val
Supported value.
Definition: extensional.hh:86
Compact< View, true >::Range Range
Definition: extensional.hh:507
Domain consistent layered graph (regular) propagator.
Definition: extensional.hh:67
int lst(void) const
Return last position.
const BitSetData * s
The value's support.
Definition: extensional.hh:412
ViewRanges< View > xr
Range iterator.
Definition: extensional.hh:404
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Generic domain change information to be supplied to advisors.
Definition: core.hpp:204
Home class for posting propagators
Definition: core.hpp:856
LayeredGraph(Space &home, LayeredGraph< View, Val, Degree, StateIdx > &p)
Constructor for cloning p.
Iterator over lost supports.
Definition: extensional.hh:430
Compact< View, false >::Range Range
Definition: extensional.hh:597
int n
Number of layers (and views)
Definition: extensional.hh:156
unsigned long long int ones(void) const
Return the number of ones.
Gecode::Support::IntTypeTraits< Val >::utype ValSize
Type for support size.
Definition: extensional.hh:91
ValSize size
Number of supported values.
Definition: extensional.hh:97
Iterator for telling variable domains by scanning support.
Definition: extensional.hh:102
bool operator()(void) const
Whether iterator is done.
Definition: compact.hpp:307
const BitSetData * supports(CTAdvisor &a, int n)
Return supports for value n.
Definition: compact.hpp:148
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition: compact.hpp:1014
Iterator over valid supports.
Definition: extensional.hh:397
virtual void reschedule(Space &home)
Schedule function.
Definition: compact.hpp:813
void operator++(void)
Move to next supported value.
int * Tuple
Type of a tuple.
Definition: int.hh:2197
void reset(void)
Reset range to be empty.
ModEventDelta med
A set of modification events (used during propagation)
Definition: core.hpp:1075
Support * support
Supported values.
Definition: extensional.hh:99
unsigned int size(void) const
Return the number of required bit set words.
Definition: bit-set.hpp:60
Compact< View, true >::ValidSupports ValidSupports
Definition: extensional.hh:506
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
Post propagator for views x and table t.
Definition: compact.hpp:798
unsigned int n_states
Total number of states.
Definition: extensional.hh:162
void operator++(void)
Move to next supports.
Definition: compact.hpp:239
Domain consistent reified extensional propagator.
Definition: extensional.hh:636
int h
High value.
Definition: extensional.hh:441
const Range * fst(void) const
Return first range of support data structure.
Definition: compact.hpp:93
virtual void reschedule(Space &home)
Schedule function.
Definition: compact.hpp:1103
StateIdx o_state
Number of out-state.
Definition: extensional.hh:81
void nand_with_mask(const BitSetData *b)
Perform "nand" with b.
Definition: bit-set.hpp:207
const unsigned int n_words
Number of words.
Definition: extensional.hh:433
::Gecode::TupleSet::Tuple Tuple
Import tuple type.
Definition: tuple-set.cpp:44
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition: compact.hpp:1140
friend class BitSet
Definition: extensional.hh:236
void none(void)
Set status to NONE.
Definition: compact.hpp:444
Degree i_deg
The in-degree (number of incoming edges)
Definition: extensional.hh:72
Class represeting a set of tuples.
Definition: int.hh:2191
IndexRange o_ch
Index range with out-degree modifications.
Definition: extensional.hh:168
int i
The position of the view in the view array.
Definition: extensional.hh:124
bool empty(void) const
Check whether the set is empty.
Definition: bit-set.hpp:48
unsigned int limit(void) const
Get the limit.
Definition: bit-set.hpp:42
ValidSupports(const Compact< View, pos > &p, CTAdvisor &a)
Initialize from initialized propagator.
Definition: compact.hpp:209
Status status
Propagator status.
Definition: extensional.hh:549
const BitSetData * s
The lost value's support.
Definition: extensional.hh:443
View x
Integer view.
Definition: extensional.hh:95
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high linear)
StateIdx i_state
Number of in-state.
Definition: extensional.hh:80
int l
Low value.
Definition: extensional.hh:439
StateIdx max_states
Maximal number of states per layer.
Definition: extensional.hh:160
Propagation cost.
Definition: core.hpp:486
Deterministic finite automaton (DFA)
Definition: int.hh:2049
Traits to for information about integer types.
Definition: int-type.hpp:52
bool empty(void) const
Test whether range is empty.
States are described by number of incoming and outgoing edges.
Definition: extensional.hh:70
unsigned long long int ones(void) const
Return the number of ones.
Definition: bit-set.hpp:238
NNF * l
Left subtree.
Definition: bool-expr.cpp:240
unsigned int size(void) const
Return the total number of words.
int n
The value.
Definition: extensional.hh:410
Council of advisors
Definition: core.hpp:155
Tiny bit-set.
Definition: extensional.hh:231
State * states
States used by outgoing edges.
Definition: extensional.hh:98
Gecode::IntSet d(v, 7)
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
Base-class for advisors.
Definition: core.hpp:1292
friend class TinyBitSet
Definition: extensional.hh:303
Domain consistent positive extensional propagator.
Definition: extensional.hh:504
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition: compact.hpp:1109
virtual Actor * copy(Space &home)
Copy propagator during cloning.
BitSetData _bits[_size]
Words.
Definition: extensional.hh:306
Layer for a view in the layered graph
Definition: extensional.hh:93
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
void adjust(void)
Adjust supports.
Definition: compact.hpp:47
TupleSet::Range Range
Range type for supports.
Definition: extensional.hh:365
void find(void)
Find a new value (only for negative case)
Definition: compact.hpp:179
virtual void reschedule(Space &home)
Schedule function.
Status(StatusType t)
Initialize with type t (either NONE or SEVERAL)
Definition: compact.hpp:417
const Range * lst(void) const
Return lasst range of support data structure.
Definition: compact.hpp:99
ExecStatus initialize(Space &home, const VarArgArray< Var > &x, const DFA &dfa)
Initialize layered graph.
unsigned int n_edges
Total number of edges.
Definition: extensional.hh:164
void clear_mask(BitSetData *mask)
Clear the first limit words in mask.
bool intersects(const BitSetData *b)
Check if has a non-empty intersection with the set.
ViewArray< View > y
The views (for rewriting)
Definition: extensional.hh:653
IndexRange(void)
Initialize range as empty.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition: compact.hpp:467
void nand_with_mask(const BitSetData *b)
Perform "nand" with b.
Degree n_edges
Number of supporting edges.
Definition: extensional.hh:87
void intersect_with_masks(const BitSetData *a, const BitSetData *b)
Intersect with the "or" of and b.
size_t dispose(Space &home)
Delete propagator and return its size.
Definition: compact.hpp:531
Date item for bitsets.
Definition: bitset-base.hpp:65
View arrays.
Definition: array.hpp:253
Compact< View, false >::Range Range
Definition: extensional.hh:639
size_t dispose(Space &home)
Delete propagator and return its size.
Definition: compact.hpp:806
ExecStatus postrecompact(Home home, ViewArray< View > &x, const TupleSet &ts, CtrlView b)
Post function for compact table propagator.
Definition: compact.hpp:1192
State & o_state(int i, StateIdx os)
Return out state for layer i and state index os.
No view has been touched.
Definition: extensional.hh:524
Range information.
Definition: int.hh:2201
Edge defined by in-state and out-state
Definition: extensional.hh:78
Bit-set.
Definition: extensional.hh:235
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:234
const Range * _fst
First range of support data structure.
Definition: extensional.hh:372
void init(void)
Argument array for variables.
Definition: array.hpp:79
LostSupports(const Compact< View, pos > &p, CTAdvisor &a, int l, int h)
Initialize iterator for values between l and h.
Definition: compact.hpp:288
bool single(CTAdvisor &a) const
Check whether status is single and equal to a.
Definition: compact.hpp:430
int ModEventDelta
Modification event deltas.
Definition: core.hpp:89
bool o_dec(int i, const Edge &e)
Decrement in degree for out state of edge e for layer i.
Gecode::IntArgs i({1, 2, 3, 4})
unsigned long long int bits(void) const
Return an upper bound on the number of bits.
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:232
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.
bool operator()(void) const
Test whether more values supported.
void add(int i)
Add index i to range.
NegCompact(Space &home, TableProp &p)
Constructor for cloning p.
Definition: compact.hpp:736
Compact< View, true >::CTAdvisor CTAdvisor
Definition: extensional.hh:508
ExecStatus
Definition: core.hpp:472
virtual size_t dispose(Space &home)
Delete propagator and return its size.