45 namespace Test {
namespace Int {
48 namespace Extensional {
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)));
69 using namespace Gecode;
85 return (x[0]<x[1]) && (x[1]<x[2]) && (x[2]<x[3]);
89 using namespace Gecode;
109 while (pos < s && x[pos] == 0) ++
pos;
110 if (pos + 4 > s)
return false;
112 for (
int i = 0;
i < 2; ++
i, ++
pos)
113 if (x[pos] != 1)
return false;
114 if (pos + 2 > s)
return false;
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;
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;
129 using namespace Gecode;
142 for (
int i=0;
i<x.
size();
i++) {
143 if ((x[
i] < 0) || (x[
i] > 3))
145 for (
int j=
i+1; j<x.
size(); j++)
153 using namespace Gecode;
187 :
Test(
"Extensional::Reg::Roland::"+
str(n),n,0,1) {}
192 ((n > 1) && (x[n-2] == 0)) ||
193 ((n > 0) && (x[n-1] == 0));
197 using namespace Gecode;
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)));
218 using namespace Gecode;
220 for (
int i=0;
i<4;
i++)
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)));
245 using namespace Gecode;
247 for (
int i=0;
i<4;
i++)
248 y[
i]=y[
i+4]=y[
i+8]=x[
i];
265 return (x[1]==1) && (x[2]==0) && (x[3]==1);
269 using namespace Gecode;
271 for (
int i=0;
i<4;
i++)
286 return (x[1]==1) && (x[2]==0) && (x[3]==1);
290 using namespace Gecode;
292 for (
int i=0;
i<4;
i++)
346 :
Test(
"Extensional::Reg::Opt::"+
str(n0),1,0,15),
n(n0) {}
349 return (x[0] <
n) && ((x[0] & 1) == 0);
353 using namespace Gecode;
356 int* f =
new int[
n+1];
358 for (
int i=0;
i<
n;
i++) {
369 DFA d(0,
t, f,
false);
385 :
Test(
"Extensional::TupleSet::A::"+
str(epk0),
386 4,1,5,false,Gecode::
ICL_DOM), epk(epk0) {}
389 return ((x[0] == 1 && x[1] == 3 && x[2] == 2 && x[3] == 3) ||
390 (x[0] == 2 && x[1] == 1 && x[2] == 2 && x[3] == 4) ||
391 (x[0] == 2 && x[1] == 2 && x[2] == 1 && x[3] == 4) ||
392 (x[0] == 3 && x[1] == 3 && x[2] == 3 && x[3] == 2) ||
393 (x[0] == 4 && x[1] == 3 && x[2] == 4 && x[3] == 1)
398 using namespace Gecode;
436 :
Test(
"Extensional::TupleSet::B::"+
str(epk0),
437 4,1,5,false,Gecode::
ICL_DOM), epk(epk0) {
438 using namespace Gecode;
463 using namespace Gecode;
464 for (
int i = 0;
i <
t.tuples(); ++
i) {
467 for (
int j = 0; j <
t.arity() &&
same; ++j)
468 if (l[j] != x[j]) same =
false;
469 if (same)
return true;
475 using namespace Gecode;
491 :
Test(
"Extensional::TupleSet::Bool::"+
str(epk0),
492 5,0,1,false,Gecode::
ICL_DOM), epk(epk0) {
493 using namespace Gecode;
499 for (
int i = 5;
i--; ) tuple[
i] = ass[
i];
508 using namespace Gecode;
509 for (
int i = 0;
i <
t.tuples(); ++
i) {
512 for (
int j = 0; j <
t.arity() &&
same; ++j)
513 if (l[j] != x[j]) same =
false;
514 if (same)
return true;
520 using namespace Gecode;
549 RegOpt ro2(static_cast<int>(UCHAR_MAX-1));
553 RegOpt ro6(static_cast<int>(USHRT_MAX-1));