Generated on Sat Jul 28 2018 17:14:47 for Gecode by doxygen 1.8.14
extensional.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Mikael Lagerkvist <lagerkvist@gecode.org>
5  * Christian Schulte <schulte@gecode.org>
6  *
7  * Copyright:
8  * Mikael Lagerkvist, 2007
9  * Christian Schulte, 2005
10  *
11  * Last modified:
12  * $Date: 2016-04-19 17:19:45 +0200 (Tue, 19 Apr 2016) $ by $Author: schulte $
13  * $Revision: 14967 $
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 #include "test/int.hh"
41 
42 #include <gecode/minimodel.hh>
43 #include <climits>
44 
45 namespace Test { namespace Int {
46 
48  namespace Extensional {
49 
55  class RegSimpleA : public Test {
57  public:
59  RegSimpleA(void) : Test("Extensional::Reg::Simple::A",4,2,2) {}
61  virtual bool solution(const Assignment& x) const {
62  return (((x[0] == 0) || (x[0] == 2)) &&
63  ((x[1] == -1) || (x[1] == 1)) &&
64  ((x[2] == 0) || (x[2] == 1)) &&
65  ((x[3] == 0) || (x[3] == 1)));
66  }
68  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
69  using namespace Gecode;
70  extensional(home, x,
71  (REG(0) | REG(2)) +
72  (REG(-1) | REG(1)) +
73  (REG(7) | REG(0) | REG(1)) +
74  (REG(0) | REG(1)));
75  }
76  };
77 
79  class RegSimpleB : public Test {
80  public:
82  RegSimpleB(void) : Test("Extensional::Reg::Simple::B",4,2,2) {}
84  virtual bool solution(const Assignment& x) const {
85  return (x[0]<x[1]) && (x[1]<x[2]) && (x[2]<x[3]);
86  }
88  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
89  using namespace Gecode;
90  extensional(home, x,
91  (REG(-2) + REG(-1) + REG(0) + REG(1)) |
92  (REG(-2) + REG(-1) + REG(0) + REG(2)) |
93  (REG(-2) + REG(-1) + REG(1) + REG(2)) |
94  (REG(-2) + REG(0) + REG(1) + REG(2)) |
95  (REG(-1) + REG(0) + REG(1) + REG(2)));
96  }
97  };
98 
100  class RegSimpleC : public Test {
101  public:
103  RegSimpleC(void) : Test("Extensional::Reg::Simple::C",6,0,1) {}
105  virtual bool solution(const Assignment& x) const {
106  int pos = 0;
107  int s = x.size();
108 
109  while (pos < s && x[pos] == 0) ++pos;
110  if (pos + 4 > s) return false;
111 
112  for (int i = 0; i < 2; ++i, ++pos)
113  if (x[pos] != 1) return false;
114  if (pos + 2 > s) return false;
115 
116  for (int i = 0; i < 1; ++i, ++pos)
117  if (x[pos] != 0) return false;
118  while (pos < s && x[pos] == 0) ++pos;
119  if (pos + 1 > s) return false;
120 
121  for (int i = 0; i < 1; ++i, ++pos)
122  if (x[pos] != 1) return false;
123  while (pos < s) if (x[pos++] != 0) return false;
124  return true;
125 
126  }
128  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
129  using namespace Gecode;
130  extensional(home, x,
131  *REG(0) + REG(1)(2,2) + +REG(0) + REG(1)(1,1) + *REG(0));
132  }
133  };
134 
136  class RegDistinct : public Test {
137  public:
139  RegDistinct(void) : Test("Extensional::Reg::Distinct",4,-1,4) {}
141  virtual bool solution(const Assignment& x) const {
142  for (int i=0; i<x.size(); i++) {
143  if ((x[i] < 0) || (x[i] > 3))
144  return false;
145  for (int j=i+1; j<x.size(); j++)
146  if (x[i]==x[j])
147  return false;
148  }
149  return true;
150  }
152  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
153  using namespace Gecode;
154  extensional(home, x,
155  (REG(0)+REG(1)+REG(2)+REG(3)) |
156  (REG(0)+REG(1)+REG(3)+REG(2)) |
157  (REG(0)+REG(2)+REG(1)+REG(3)) |
158  (REG(0)+REG(2)+REG(3)+REG(1)) |
159  (REG(0)+REG(3)+REG(1)+REG(2)) |
160  (REG(0)+REG(3)+REG(2)+REG(1)) |
161  (REG(1)+REG(0)+REG(2)+REG(3)) |
162  (REG(1)+REG(0)+REG(3)+REG(2)) |
163  (REG(1)+REG(2)+REG(0)+REG(3)) |
164  (REG(1)+REG(2)+REG(3)+REG(0)) |
165  (REG(1)+REG(3)+REG(0)+REG(2)) |
166  (REG(1)+REG(3)+REG(2)+REG(0)) |
167  (REG(2)+REG(0)+REG(1)+REG(3)) |
168  (REG(2)+REG(0)+REG(3)+REG(1)) |
169  (REG(2)+REG(1)+REG(0)+REG(3)) |
170  (REG(2)+REG(1)+REG(3)+REG(0)) |
171  (REG(2)+REG(3)+REG(0)+REG(1)) |
172  (REG(2)+REG(3)+REG(1)+REG(0)) |
173  (REG(3)+REG(0)+REG(1)+REG(2)) |
174  (REG(3)+REG(0)+REG(2)+REG(1)) |
175  (REG(3)+REG(1)+REG(0)+REG(2)) |
176  (REG(3)+REG(1)+REG(2)+REG(0)) |
177  (REG(3)+REG(2)+REG(0)+REG(1)) |
178  (REG(3)+REG(2)+REG(1)+REG(0)));
179  }
180  };
181 
183  class RegRoland : public Test {
184  public:
187  : Test("Extensional::Reg::Roland::"+str(n),n,0,1) {}
189  virtual bool solution(const Assignment& x) const {
190  int n = x.size();
191  return
192  ((n > 1) && (x[n-2] == 0)) ||
193  ((n > 0) && (x[n-1] == 0));
194  }
196  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
197  using namespace Gecode;
198  REG r0(0), r1(1);
199  REG r01 = r0 | r1;
200  extensional(home, x, *r01 + r0 + r01(0,1));
201  }
202  };
203 
205  class RegSharedA : public Test {
206  public:
208  RegSharedA(void) : Test("Extensional::Reg::Shared::A",4,2,2) {}
210  virtual bool solution(const Assignment& x) const {
211  return (((x[0] == 0) || (x[0] == 2)) &&
212  ((x[1] == -1) || (x[1] == 1)) &&
213  ((x[2] == 0) || (x[2] == 1)) &&
214  ((x[3] == 0) || (x[3] == 1)));
215  }
217  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
218  using namespace Gecode;
219  IntVarArgs y(8);
220  for (int i=0; i<4; i++)
221  y[i]=y[i+4]=x[i];
222  unshare(home,y);
223  extensional(home, y,
224  ((REG(0) | REG(2)) +
225  (REG(-1) | REG(1)) +
226  (REG(7) | REG(0) | REG(1)) +
227  (REG(0) | REG(1)))(2,2));
228  }
229  };
230 
232  class RegSharedB : public Test {
233  public:
235  RegSharedB(void) : Test("Extensional::Reg::Shared::B",4,2,2) {}
237  virtual bool solution(const Assignment& x) const {
238  return (((x[0] == 0) || (x[0] == 2)) &&
239  ((x[1] == -1) || (x[1] == 1)) &&
240  ((x[2] == 0) || (x[2] == 1)) &&
241  ((x[3] == 0) || (x[3] == 1)));
242  }
244  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
245  using namespace Gecode;
246  IntVarArgs y(12);
247  for (int i=0; i<4; i++)
248  y[i]=y[i+4]=y[i+8]=x[i];
249  unshare(home,y);
250  extensional(home, y,
251  ((REG(0) | REG(2)) +
252  (REG(-1) | REG(1)) +
253  (REG(7) | REG(0) | REG(1)) +
254  (REG(0) | REG(1)))(3,3));
255  }
256  };
257 
259  class RegSharedC : public Test {
260  public:
262  RegSharedC(void) : Test("Extensional::Reg::Shared::C",4,0,1) {}
264  virtual bool solution(const Assignment& x) const {
265  return (x[1]==1) && (x[2]==0) && (x[3]==1);
266  }
268  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
269  using namespace Gecode;
271  for (int i=0; i<4; i++)
272  y[i]=y[i+4]=channel(home,x[i]);
273  unshare(home,y);
274  extensional(home,y,
275  ((REG(0) | REG(1)) + REG(1) + REG(0) + REG(1))(2,2));
276  }
277  };
278 
280  class RegSharedD : public Test {
281  public:
283  RegSharedD(void) : Test("Extensional::Reg::Shared::D",4,0,1) {}
285  virtual bool solution(const Assignment& x) const {
286  return (x[1]==1) && (x[2]==0) && (x[3]==1);
287  }
289  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
290  using namespace Gecode;
292  for (int i=0; i<4; i++)
293  y[i]=y[i+4]=y[i+8]=channel(home,x[i]);
294  unshare(home, y);
295  extensional(home, y,
296  ((REG(0) | REG(1)) + REG(1) + REG(0) + REG(1))(3,3));
297  }
298  };
299 
301  class RegEmptyDFA : public Test {
302  public:
304  RegEmptyDFA(void) : Test("Extensional::Reg::Empty::DFA",1,0,0) {
305  testsearch = false;
306  }
308  virtual bool solution(const Assignment& x) const {
309  (void)x;
310  return false;
311  }
313  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
314  Gecode::DFA d;
315  Gecode::extensional(home, x, d);
316  }
317  };
318 
320  class RegEmptyREG : public Test {
321  public:
323  RegEmptyREG(void) : Test("Extensional::Reg::Empty::REG",1,0,0) {
324  testsearch = false;
325  }
327  virtual bool solution(const Assignment& x) const {
328  (void)x;
329  return false;
330  }
332  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
333  Gecode::REG r;
334  Gecode::extensional(home, x, r);
335  }
336  };
337 
339  class RegOpt : public Test {
340  protected:
342  int n;
343  public:
345  RegOpt(int n0)
346  : Test("Extensional::Reg::Opt::"+str(n0),1,0,15), n(n0) {}
348  virtual bool solution(const Assignment& x) const {
349  return (x[0] < n) && ((x[0] & 1) == 0);
350  }
352  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
353  using namespace Gecode;
355  DFA::Transition* ti = t;
356  int* f = new int[n+1];
357  int* fi = f;
358  for (int i=0; i<n; i++) {
359  ti->i_state = 0;
360  ti->symbol = i;
361  ti->o_state = i+1;
362  ti++;
363  if ((i & 1) == 0) {
364  *fi = i+1; fi++;
365  }
366  }
367  ti->i_state = -1;
368  *fi = -1;
369  DFA d(0, t, f, false);
370  delete [] t;
371  delete [] f;
372  extensional(home, x, d);
373  }
374 
375  };
376 
378  class TupleSetA : public Test {
379  public:
382  : Test("Extensional::TupleSet::A::"+str(ipl0),
383  4,1,5,false,ipl0) {}
385  virtual bool solution(const Assignment& x) const {
386  return ((x[0] == 1 && x[1] == 3 && x[2] == 2 && x[3] == 3) ||
387  (x[0] == 2 && x[1] == 1 && x[2] == 2 && x[3] == 4) ||
388  (x[0] == 2 && x[1] == 2 && x[2] == 1 && x[3] == 4) ||
389  (x[0] == 3 && x[1] == 3 && x[2] == 3 && x[3] == 2) ||
390  (x[0] == 4 && x[1] == 3 && x[2] == 4 && x[3] == 1)
391  );
392  }
394  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
395  using namespace Gecode;
396  TupleSet t;
397  IntArgs t1(4, 2, 1, 2, 4);
398  IntArgs t2(4, 2, 2, 1, 4);
399  IntArgs t3(4, 4, 3, 4, 1);
400  IntArgs t4(4, 1, 3, 2, 3);
401  IntArgs t5(4, 3, 3, 3, 2);
402  t.add(t1);
403  t.add(t1);
404  t.add(t2);
405  t.add(t2);
406  t.add(t3);
407  t.add(t3);
408  t.add(t4);
409  t.add(t4);
410  t.add(t5);
411  t.add(t5);
412  t.add(t5);
413  t.add(t5);
414  t.add(t5);
415  t.add(t5);
416  t.add(t5);
417  t.add(t5);
418  t.finalize();
419 
420  extensional(home, x, t, ipl);
421  }
422  };
423 
425  class TupleSetB : public Test {
426  mutable Gecode::TupleSet t;
427  public:
430  : Test("Extensional::TupleSet::B::"+str(ipl0),
431  4,1,5,false,ipl0) {
432  using namespace Gecode;
433  IntArgs t1 (4, 2, 1, 2, 4);
434  IntArgs t2 (4, 2, 2, 1, 4);
435  IntArgs t3 (4, 4, 3, 4, 1);
436  IntArgs t4 (4, 1, 3, 2, 3);
437  IntArgs t5 (4, 3, 3, 3, 2);
438  IntArgs t6 (4, 5, 1, 4, 4);
439  IntArgs t7 (4, 2, 5, 1, 5);
440  IntArgs t8 (4, 4, 3, 5, 1);
441  IntArgs t9 (4, 1, 5, 2, 5);
442  IntArgs t10(4, 5, 3, 3, 2);
443  t.add(t1);
444  t.add(t2);
445  t.add(t3);
446  t.add(t4);
447  t.add(t5);
448  t.add(t6);
449  t.add(t7);
450  t.add(t8);
451  t.add(t9);
452  t.add(t10);
453  t.finalize();
454  }
456  virtual bool solution(const Assignment& x) const {
457  using namespace Gecode;
458  for (int i = 0; i < t.tuples(); ++i) {
459  TupleSet::Tuple l = t[i];
460  bool same = true;
461  for (int j = 0; j < t.arity() && same; ++j)
462  if (l[j] != x[j]) same = false;
463  if (same) return true;
464  }
465  return false;
466  }
468  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
469  using namespace Gecode;
470  extensional(home, x, t, ipl);
471  }
472  };
473 
474 
475 
477  class TupleSetBool : public Test {
478  mutable Gecode::TupleSet t;
479  public:
482  : Test("Extensional::TupleSet::Bool::"+str(ipl0),
483  5,0,1,false,ipl0) {
484  using namespace Gecode;
485 
486  CpltAssignment ass(5, IntSet(0, 1));
487  while (ass()) {
488  if (Base::rand(100) <= prob*100) {
489  IntArgs tuple(5);
490  for (int i = 5; i--; ) tuple[i] = ass[i];
491  t.add(tuple);
492  }
493  ++ass;
494  }
495  t.finalize();
496  }
498  virtual bool solution(const Assignment& x) const {
499  using namespace Gecode;
500  for (int i = 0; i < t.tuples(); ++i) {
501  TupleSet::Tuple l = t[i];
502  bool same = true;
503  for (int j = 0; j < t.arity() && same; ++j)
504  if (l[j] != x[j]) same = false;
505  if (same) return true;
506  }
507  return false;
508  }
510  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
511  using namespace Gecode;
512  BoolVarArgs y(x.size());
513  for (int i = x.size(); i--; )
514  y[i] = channel(home, x[i]);
515  extensional(home, y, t, ipl);
516  }
517  };
518 
519 
523 
525 
526  RegRoland rr1(1);
527  RegRoland rr2(2);
528  RegRoland rr3(3);
529  RegRoland rr4(4);
530 
535 
538 
539  RegOpt ro0(CHAR_MAX-1);
540  RegOpt ro1(CHAR_MAX);
541  RegOpt ro2(static_cast<int>(UCHAR_MAX-1));
542  RegOpt ro3(static_cast<int>(UCHAR_MAX));
543  RegOpt ro4(SHRT_MAX-1);
544  RegOpt ro5(SHRT_MAX);
545  RegOpt ro6(static_cast<int>(USHRT_MAX-1));
546  RegOpt ro7(static_cast<int>(USHRT_MAX));
547 
550 
553 
557 
558  }
559 }}
560 
561 
562 // STATISTICS: test-int
563 
RegRoland(int n)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test with simple regular expression and shared variables (uses unsharing)
int symbol
symbol
Definition: int.hh:2043
NodeType t
Type of node.
Definition: bool-expr.cpp:234
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
Definition: int.hpp:212
virtual bool solution(const Assignment &x) const
Test whether x is solution
NNF * l
Left subtree.
Definition: bool-expr.cpp:244
RegEmptyREG(void)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: channel.cpp:45
Test for optimizations
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: extensional.cpp:68
TupleSetA tsas(Gecode::IPL_SPEED)
Test with regular expression for distinct constraint
static Gecode::Support::RandomGenerator rand
Random number generator.
Definition: test.hh:138
Regular expressions over integer values.
Definition: minimodel.hh:1393
RegOpt ro3(static_cast< int >(UCHAR_MAX))
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
RegDistinct(void)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
bool pos(const View &x)
Test whether x is postive.
Definition: mult.hpp:45
Test with simple regular expression
Definition: extensional.cpp:79
int * Tuple
Type of a tuple.
Definition: int.hh:2167
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Integer variable array.
Definition: int.hh:744
Test with simple regular expression and shared variables (uses unsharing)
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test with simple regular expression
Computation spaces.
Definition: core.hpp:1748
int i_state
input state
Definition: int.hh:2042
RegOpt ro1(CHAR_MAX)
RegOpt ro0(CHAR_MAX-1)
virtual bool solution(const Assignment &x) const
Test whether x is solution
TupleSetB tsbs(Gecode::IPL_SPEED)
Gecode::IntSet d(v, 7)
TupleSetBool(Gecode::IntPropLevel ipl0, double prob)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
Deterministic finite automaton (DFA)
Definition: int.hh:2034
TupleSetBool tsbools(Gecode::IPL_SPEED, 0.3)
Gecode::IntArgs i(4, 1, 2, 3, 4)
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual bool solution(const Assignment &x) const
Test whether x is solution
RegOpt ro5(SHRT_MAX)
TupleSetBool tsboolm(Gecode::IPL_MEMORY, 0.3)
void extensional(Home home, const IntVarArgs &x, DFA dfa, IntPropLevel)
Post domain consistent propagator for extensional constraint described by a DFA.
Definition: extensional.cpp:45
TupleSetB(Gecode::IntPropLevel ipl0)
Create and register test.
Specification of a DFA transition.
Definition: int.hh:2040
RegSharedB(void)
Create and register test.
RegOpt ro7(static_cast< int >(USHRT_MAX))
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
RegEmptyDFA(void)
Create and register test.
Integer sets.
Definition: int.hh:174
int o_state
output state Default constructor
Definition: int.hh:2044
TupleSetB tsbm(Gecode::IPL_MEMORY)
Prefer speed.
Definition: int.hh:962
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: extensional.cpp:88
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntPropLevel ipl
Propagation level.
Definition: int.hh:238
Passing integer variables.
Definition: int.hh:639
Passing integer arguments.
Definition: int.hh:610
Passing Boolean variables.
Definition: int.hh:693
Prefer to save memory Options: basic versus advanced propagation.
Definition: int.hh:963
Class represeting a set of tuples.
Definition: int.hh:2161
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
RegSharedD(void)
Create and register test.
General test support.
Definition: afc.cpp:43
IntPropLevel
Propagation levels for integer propagators.
Definition: int.hh:955
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:784
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: extensional.cpp:84
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:253
virtual bool solution(const Assignment &x) const
Test whether x is solution
bool testsearch
Whether to perform search test.
Definition: int.hh:242
Region r
Definition: region.cpp:82
Base class for assignments
Definition: int.hh:63
void extensional(Home home, const BoolVarArgs &x, const TupleSet &t, IntPropLevel ipl)
Post propagator for .
Definition: extensional.cpp:98
bool same(const Item &i, const Item &j)
Whether two items are the same.
Definition: propagate.hpp:76
Test with simple regular expression and shared variables (uses unsharing)
virtual bool solution(const Assignment &x) const
Test whether x is solution
RegOpt(int n0)
Create and register test.
Test with simple regular expression from Roland Yap
int n
DFA size characteristic.
RegSimpleC(void)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: extensional.cpp:61
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
ExecStatus unshare(Home home, VarArgArray< Var > &x, IntPropLevel ipl)
Replace unassigned shared variables by fresh, yet equal variables.
Definition: unshare.cpp:106
Gecode toplevel namespace
virtual bool solution(const Assignment &x) const
Test whether x is solution
RegOpt ro4(SHRT_MAX-1)
Test for empty regular expression
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
RegOpt ro6(static_cast< int >(USHRT_MAX-1))
RegOpt ro2(static_cast< int >(UCHAR_MAX-1))
RegSharedA(void)
Create and register test.
Test with bool tuple set
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
RegSharedC(void)
Create and register test.
TupleSetA tsam(Gecode::IPL_MEMORY)
Test with simple regular expression and shared variables (uses unsharing)
TupleSetA(Gecode::IntPropLevel ipl0)
Create and register test.
Generate all assignments.
Definition: int.hh:83
virtual bool solution(const Assignment &x) const
Test whether x is solution
RegSimpleA(void)
Create and register test.
Definition: extensional.cpp:59
RegSimpleB(void)
Create and register test.
Definition: extensional.cpp:82
Test with simple regular expression
Definition: extensional.cpp:56