38template <
typename A1,
typename R,
typename T>
45template <
typename A1,
typename R,
typename T>
55template <
typename A1,
typename A2,
typename R,
typename T>
62template <
typename A1,
typename A2,
typename R,
typename T>
105template <
typename T,
typename std::decay<
decltype(
106 std::declval<T>().is_equal(std::declval<T>()))>
::type =
true>
109 return a.is_equal(
b);
111template <
typename T,
typename std::decay<
decltype(
112 std::declval<T>().plain_is_equal(std::declval<T>()))>
::type =
true>
115 return a.plain_is_equal(
b);
120#define THROW_INVALID(msg) \
121 isl::exception::throw_error(isl_error_invalid, msg, __FILE__, __LINE__)
129 const std::vector<unary_prop> &
tests)
134 std::ostringstream ss;
139 ss <<
name <<
"(" <<
test.arg <<
") = "
140 << std::boolalpha <<
res <<
"\n"
151template <
typename R,
typename T>
153 const std::vector<unary> &
tests)
159 std::ostringstream ss;
164 ss <<
name <<
"(" <<
test.arg <<
") =\n"
176template <
typename R,
typename T,
typename A1>
178 const std::vector<binary> &
tests)
185 std::ostringstream ss;
190 ss <<
name <<
"(" <<
test.arg1 <<
", " <<
test.arg2 <<
") =\n"
202template <
typename R,
typename T,
typename A1,
typename A2,
typename F>
204 const std::string &
name,
const std::vector<ternary> &
tests)
212 std::ostringstream ss;
217 ss <<
name <<
"(" <<
test.arg1 <<
", " <<
test.arg2 <<
", "
218 <<
test.arg3 <<
") =\n"
232template <
typename R,
typename T,
typename A1,
typename A2>
234 const std::string &
name,
const std::vector<ternary> &
tests)
246template <
typename R,
typename T,
typename A1,
typename A2>
248 const std::string &
name,
const std::vector<ternary> &
tests)
250 const auto &
wrap = [&] (
const T &o,
const A1 &
arg1,
const A2 &
arg2) {
259#define C(FN, ...) test(ctx, FN, #FN, __VA_ARGS__)
266 {
"{ A[] -> B[] }",
"{ A[] }" },
267 {
"{ A[C[] -> D[]] -> B[E[] -> F[]] }",
"{ A[C[] -> D[]] }" },
271 {
"{ A[] -> B[] }",
"{ B[] }" },
272 {
"{ A[C[] -> D[]] -> B[E[] -> F[]] }",
"{ B[E[] -> F[]] }" },
276 {
"{ A[] -> B[] }",
"{ : }" },
277 {
"{ A[C[] -> D[]] -> B[E[] -> F[]] }",
"{ : }" },
286 return fn.gist(
domain).isa_multi_aff();
313 {
"[N=0:] -> { [] }",
314 "[N=0:] -> { [] }" },
318 {
"[n] -> { [] : n >= 0 } ",
319 "[n] -> { [] : n >= 0 } " },
323 {
"{ [a] -> [a//2] : "
324 "exists (e0: 8*floor((-a + e0)/8) <= -8 - a + 8e0) }",
326 "exists (e0: 8*floor((-a + e0)/8) <= -8 - a + 8e0) }" },
327 {
"{ [a, b] -> [(2*floor((a)/8) + floor((b)/6))] }",
328 "{ [a, b] -> [(2*floor((a)/8) + floor((b)/6))] }" },
332 {
"[s=0:23] -> { A[(s//4)%3, s%4, s//12] }",
true },
336 {
"{ [a] -> [a//2] : "
337 "exists (e0: 8*floor((-a + e0)/8) <= -8 - a + 8e0) }",
339 {
"{ [s=0:23, t] -> B[((s+1+2t)//4)%3, 2+(s+1+2t)%4, (s+1+2t)//12] }",
341 {
"{ [a=0:31] -> [b=0:3, c] : 4c = 28 - a + b }",
true },
350 {
"{ B[i,j] : 0 <= i < 10 and 0 <= j < 100 }",
351 "{ A[j,i] -> B[i,j] }",
352 "{ A[j,i] : 0 <= i < 10 and 0 <= j < 100 }" },
353 {
"{ rat: B[i,j] : 0 <= i, j and 3 i + 5 j <= 100 }",
354 "{ A[a,b] -> B[a/2,b/6] }",
355 "{ rat: A[a,b] : 0 <= a, b and 9 a + 5 b <= 600 }" },
356 {
"{ B[i,j] : 0 <= i, j and 3 i + 5 j <= 100 }",
357 "{ A[a,b] -> B[a/2,b/6] }",
358 "{ A[a,b] : 0 <= a, b and 9 a + 5 b <= 600 and "
359 "exists i,j : a = 2 i and b = 6 j }" },
360 {
"[n] -> { S[i] : 0 <= i <= 100 }",
"[n] -> { S[n] }",
361 "[n] -> { : 0 <= n <= 100 }" },
362 {
"{ B[i] : 0 <= i < 100 and exists a : i = 4 a }",
364 "{ A[a] : 0 <= a < 50 and exists b : a = 2 b }" },
365 {
"{ B[i] : 0 <= i < 100 and exists a : i = 4 a }",
366 "{ A[a] -> B[([a/2])] }",
367 "{ A[a] : 0 <= a < 200 and exists b : [a/2] = 4 b }" },
368 {
"{ B[i,j,k] : 0 <= i,j,k <= 100 }",
369 "{ A[a] -> B[a,a,a/3] }",
370 "{ A[a] : 0 <= a <= 100 and exists b : a = 3 b }" },
371 {
"{ B[i,j] : j = [(i)/2] } ",
"{ A[i,j] -> B[i/3,j] }",
372 "{ A[i,j] : j = [(i)/6] and exists a : i = 3 a }" },
376 {
"{ B[i,j] : 0 <= i < 10 and 0 <= j < 100 }",
377 "{ A[j,i] -> B[i,j] : false }",
378 "{ A[j,i] : false }" },
382 {
"{ B[i,j] -> C[2i + 3j] : 0 <= i < 10 and 0 <= j < 100 }",
383 "{ A[j,i] -> B[i,j] }",
384 "{ A[j,i] -> C[2i + 3j] : 0 <= i < 10 and 0 <= j < 100 }" },
385 {
"{ B[i] -> C[i]; D[i] -> E[i] }",
386 "{ A[i] -> B[i + 1] }",
387 "{ A[i] -> C[i + 1] }" },
388 {
"{ B[i] -> C[i]; B[i] -> E[i] }",
389 "{ A[i] -> B[i + 1] }",
390 "{ A[i] -> C[i + 1]; A[i] -> E[i + 1] }" },
391 {
"{ B[i] -> C[([i/2])] }",
393 "{ A[i] -> C[i] }" },
394 {
"{ B[i,j] -> C[([i/2]), ([(i+j)/3])] }",
395 "{ A[i] -> B[([i/5]), ([i/7])] }",
396 "{ A[i] -> C[([([i/5])/2]), ([(([i/5])+([i/7]))/3])] }" },
397 {
"[N] -> { B[i] -> C[([N/2]), i, ([N/3])] }",
398 "[N] -> { A[] -> B[([N/5])] }",
399 "[N] -> { A[] -> C[([N/2]), ([N/5]), ([N/3])] }" },
400 {
"{ B[i] -> C[i] : exists a : i = 5 a }",
402 "{ A[i] -> C[2i] : exists a : 2i = 5 a }" },
403 {
"{ B[i] -> C[i] : exists a : i = 2 a; "
404 "B[i] -> D[i] : exists a : i = 2 a + 1 }",
406 "{ A[i] -> C[2i] }" },
407 {
"{ A[i] -> B[i] }",
"{ C[i] -> A[(i + floor(i/3))/2] }",
408 "{ C[i] -> B[j] : 2j = i + floor(i/3) }" },
412 {
"[M] -> { A[a] -> B[a] }",
"[M] -> { C[] -> B[floor(M/2)] }",
413 "[M] -> { A[floor(M/2)] -> C[] }" },
422 {
"{ [i] -> [i + 1] }",
"23",
423 "{ [i] -> [i + 23] }" },
424 {
"{ [a = 0:1, b = 0:15, c = 0:1, d = 0:1, 0] -> [a, b, c, d, 1]; "
425 "[a = 0:1, b = 0:15, c = 0:1, 0, 1] -> [a, b, c, 1, 0]; "
426 "[a = 0:1, b = 0:15, 0, 1, 1] -> [a, b, 1, 0, 0]; "
427 "[a = 0:1, b = 0:14, 1, 1, 1] -> [a, 1 + b, 0, 0, 0]; "
428 "[0, 15, 1, 1, 1] -> [1, 0, 0, 0, 0] }",
430 "{ [0, b = 0:15, c = 0:1, d = 0:1, e = 0:1] -> [1, b, c, d, e] }" },
439 {
"[n] -> { A[x] -> B[y] }",
"[n] -> { : n >= 0 }",
440 "[n] -> { A[x] -> B[y] : n >= 0 }" },
444 {
"{ [A[x] -> B[y]] -> C[z]; [D[x] -> A[y]] -> E[z] }",
446 "{ [A[0] -> B[y]] -> C[z] }" },
447 {
"{ C[z] -> [A[x] -> B[y]]; E[z] -> [D[x] -> A[y]] }",
450 {
"{ T[A[x] -> B[y]] -> C[z]; [D[x] -> A[y]] -> E[z] }",
452 "{ T[A[0] -> B[y]] -> C[z] }" },
456 {
"{ [A[x] -> B[y]] -> C[z]; [D[x] -> A[y]] -> E[z] }",
459 {
"{ C[z] -> [A[x] -> B[y]]; E[z] -> [D[x] -> A[y]] }",
461 "{ C[z] -> [A[0] -> B[y]] }" },
462 {
"{ C[z] -> T[A[x] -> B[y]]; E[z] -> [D[x] -> A[y]] }",
464 "{ C[z] -> T[A[0] -> B[y]] }" },
486 {
"{ [a=0:11] -> [b] : -1 + b <= 2*floor((a)/6) <= b }",
true },
487 {
"{ [a=0:11] -> [b=0:3] : -1 + b <= 2*floor((a)/6) <= b }",
true },
489 {
"{ [a = 0:2, b = 0:1] -> [c = 0:9, d = (-a + b) mod 3] : "
490 "10a + 5b - 3c <= 5d <= 12 + 10a + 5b - 3c }",
true },
491 {
"{ [a=0:71] -> [(a//3)%8] }",
true },
492 {
"{ [a=0:71] -> [b=0:7] : (a - 3 * b + 21) % 24 >= 21 }",
true },
493 {
"{ [a=0:71] -> [b=0:7] : (a - 3 * b + 21) % 24 >= 20 }",
false },
494 {
"{ [a=0:71] -> [b=0:7] : (a - 3 * b + 21) % 24 >= 22 }",
true },
495 {
"{ [a=0:71] -> [b=-7:0] : (a + 3 * b + 21) % 24 >= 21 }",
true },
496 {
"{ [a=0:71] -> [b=-7:0] : (a + 3 * b + 21) % 24 >= 20 }",
false },
497 {
"{ [a=0:71] -> [b=-7:0] : (a + 3 * b + 21) % 24 >= 22 }",
true },
505 {
"{ [a=0:3] -> [b=a//2] : 0 <= b <= 1 }",
506 "{ [a=0:3] -> [(floor((a)/2))] }" },
507 {
"{ [a] -> [b=a//2] : 0 <= b <= 1 }",
508 "{ [a=0:3] -> [(floor((a)/2))] }" },
510 {
"{ [a = 0:2, b = 0:1] -> [c = 0:9, d = (-a + b) mod 3] : "
511 "10a + 5b - 3c <= 5d <= 12 + 10a + 5b - 3c }",
512 "{ [a = 0:2, b = 0:1] -> [5*(2a + b)//3, (2a + b) mod 3] }" },
513 {
"{ [a=0:71] -> [(a//3)%8] }",
514 "{ [a=0:71] -> [(a//3)%8] }" },
515 {
"{ [a=0:71] -> [b=0:7] : (a - 3 * b + 21) % 24 >= 21 }",
516 "{ [a=0:71] -> [(a//3)%8] }" },
517 {
"{ [a=0:71] -> [b=0:7] : (a - 3 * b + 21) % 24 >= 22 }",
518 "{ [a=0:71] -> [(a//3)%8] : a % 3 > 0 }" },
519 {
"{ [a=0:71] -> [b=-7:0] : (a + 3 * b + 21) % 24 >= 21 }",
520 "{ [a=0:71] -> [(-7 + (-1 - floor((a)/3)) mod 8)] }" },
524 {
"[a] -> { [b=a//2] : 0 <= b <= 1 }",
525 "[a=0:3] -> { [(floor((a)/2))] }" },
526 {
"[a=0:71] -> { [(a//3)%8] }",
527 "[a=0:71] -> { [(a//3)%8] }" },
528 {
"[a=0:71] -> { [b=0:7] : (a - 3 * b + 21) % 24 >= 21 }",
529 "[a=0:71] -> { [(a//3)%8] }" },
545 std::ostringstream ss;
546 ss <<
"gist changed " << copy <<
" into " <<
obj;
550 std::ostringstream ss;
551 ss <<
"inconsistent "
560#define TWO(x) (x), (x)
571 {
TWO(
"{ [i=100:] }"),
572 "{ [i] : exists a, b: 2b > 2i - 5a > 8b -3 i and 3b > 2a }",
575 "{ [i] : exists a, b: 2b > 2i - 5a > 8b -3 i and 3b > 2a }",
577 {
TWO(
"{ [i] : exists (e0, e1: 3e1 >= 1 + 2e0 and "
578 "8e1 <= -1 + 5i - 5e0 and 2e1 >= 1 + 2i - 5e0) }"),
580 "{ [i] : exists (e0, e1: 3e1 >= 1 + 2e0 and "
581 "8e1 <= -1 + 5i - 5e0 and 2e1 >= 1 + 2i - 5e0) }" },
582 {
TWO(
"{ [i=0:10] : exists a, b: 2b > 2i - 5a > 8b -3 i and 3b > 2a }"),
584 "{ [i] : exists a, b: 2b > 2i - 5a > 8b -3 i and 3b > 2a }" },
588 {
TWO(
"{ [1, -1, 3] }"),
589 "{ [1, b, 2 - b] : -1 <= b <= 2 }",
591 {
TWO(
"{ [a, b, c] : a <= 15 and a >= 1 }"),
592 "{ [a, b, c] : exists (e0 = floor((-1 + a)/16): a >= 1 and "
593 "c <= 30 and 32e0 >= -62 + 2a + 2b - c and b >= 0) }",
594 "{ [a, b, c] : a <= 15 }" },
595 {
TWO(
"{ : }"),
"{ : 1 = 0 }",
"{ : }" },
596 {
TWO(
"{ : 1 = 0 }"),
"{ : 1 = 0 }",
"{ : }" },
597 {
TWO(
"[M] -> { [x] : exists (e0 = floor((-2 + x)/3): 3e0 = -2 + x) }"),
598 "[M] -> { [3M] }" ,
"[M] -> { [x] : 1 = 0 }" },
599 {
TWO(
"{ [m, n, a, b] : a <= 2147 + n }"),
600 "{ [m, n, a, b] : (m >= 1 and n >= 1 and a <= 2148 - m and "
601 "b <= 2148 - n and b >= 0 and b >= 2149 - n - a) or "
602 "(n >= 1 and a >= 0 and b <= 2148 - n - a and "
604 "{ [m, n, ku, kl] }" },
605 {
TWO(
"{ [a, a, b] : a >= 10 }"),
606 "{ [a, b, c] : c >= a and c <= b and c >= 2 }",
607 "{ [a, a, b] : a >= 10 }" },
608 {
TWO(
"{ [i, j] : i >= 0 and i + j >= 0 }"),
"{ [i, j] : i <= 0 }",
609 "{ [0, j] : j >= 0 }" },
611 {
TWO(
"[t1] -> { [i4, i6] : exists (e0 = floor((1530 - 4t1 - 5i4)/20): "
612 "20e0 <= 1530 - 4t1 - 5i4 and 20e0 >= 1511 - 4t1 - 5i4 and "
613 "5e0 <= 381 - t1 and i4 <= 1) }"),
614 "[t1] -> { [i4, i6] : exists (e0 = floor((-t1 + i6)/5): "
615 "5e0 = -t1 + i6 and i6 <= 6 and i6 >= 3) }",
616 "[t1] -> { [i4, i6] : exists (e0 = floor((1530 - 4t1 - 5i4)/20): "
617 "i4 <= 1 and 5e0 <= 381 - t1 and 20e0 <= 1530 - 4t1 - 5i4 and "
618 "20e0 >= 1511 - 4t1 - 5i4) }" },
620 {
TWO(
"[t1, t2] -> { [i4, i5, i6] : exists (e0 = floor((1 + i4)/2), "
621 "e1 = floor((1530 - 4t1 - 5i4)/20), "
622 "e2 = floor((-4t1 - 5i4 + 10*floor((1 + i4)/2))/20), "
623 "e3 = floor((-1 + i4)/2): t2 = 0 and 2e3 = -1 + i4 and "
624 "20e2 >= -19 - 4t1 - 5i4 + 10e0 and 5e2 <= 1 - t1 and "
625 "2e0 <= 1 + i4 and 2e0 >= i4 and "
626 "20e1 <= 1530 - 4t1 - 5i4 and "
627 "20e1 >= 1511 - 4t1 - 5i4 and i4 <= 1 and "
628 "5e1 <= 381 - t1 and 20e2 <= -4t1 - 5i4 + 10e0) }"),
629 "[t1, t2] -> { [i4, i5, i6] : exists (e0 = floor((-17 + i4)/2), "
630 "e1 = floor((-t1 + i6)/5): 5e1 = -t1 + i6 and "
631 "2e0 <= -17 + i4 and 2e0 >= -18 + i4 and "
632 "10e0 <= -91 + 5i4 + 4i6 and "
633 "10e0 >= -105 + 5i4 + 4i6) }",
634 "[t1, t2] -> { [i4, i5, i6] : exists (e0 = floor((381 - t1)/5), "
635 "e1 = floor((-1 + i4)/2): t2 = 0 and 2e1 = -1 + i4 and "
636 "i4 <= 1 and 5e0 <= 381 - t1 and 20e0 >= 1511 - 4t1 - 5i4) }" },
637 {
TWO(
"{ [0, 0, q, p] : -5 <= q <= 5 and p >= 0 }"),
638 "{ [a, b, q, p] : b >= 1 + a }",
639 "{ [a, b, q, p] : false }" },
640 {
TWO(
"[n] -> { [x] : x = n && x mod 32 = 0 }"),
641 "[n] -> { [x] : x mod 32 = 0 }",
642 "[n] -> { [x = n] }" },
643 {
TWO(
"{ [x] : x mod 6 = 0 }"),
"{ [x] : x mod 3 = 0 }",
644 "{ [x] : x mod 2 = 0 }" },
645 {
TWO(
"{ [x] : x mod 3200 = 0 }"),
"{ [x] : x mod 10000 = 0 }",
646 "{ [x] : x mod 128 = 0 }" },
647 {
TWO(
"{ [x] : x mod 3200 = 0 }"),
"{ [x] : x mod 10 = 0 }",
648 "{ [x] : x mod 3200 = 0 }" },
649 {
TWO(
"{ [a, b, c] : a mod 2 = 0 and a = c }"),
650 "{ [a, b, c] : b mod 2 = 0 and b = c }",
651 "{ [a, b, c = a] }" },
652 {
TWO(
"{ [a, b, c] : a mod 6 = 0 and a = c }"),
653 "{ [a, b, c] : b mod 2 = 0 and b = c }",
654 "{ [a, b, c = a] : a mod 3 = 0 }" },
655 {
TWO(
"{ [x] : 0 <= x <= 4 or 6 <= x <= 9 }"),
656 "{ [x] : 1 <= x <= 3 or 7 <= x <= 8 }",
658 {
TWO(
"{ [x,y] : x < 0 and 0 <= y <= 4 or "
659 "x >= -2 and -x <= y <= 10 + x }"),
660 "{ [x,y] : 1 <= y <= 3 }",
665 {
"{ [x] -> [x] : x != 0 }",
"{ [x] : x < -1 or x > 1 }",
670 {
"[N] -> { D[x] -> [x] : N >= 0; D[x] -> [0] : N < 0 }",
671 "[N] -> { : N >= 0 }",
672 "[N] -> { D[x] -> [x] }" },
676 {
"{ A[i] -> B[i, i] }",
"{ A[0] }",
677 "{ A[i] -> B[0, 0] }" },
678 {
"[N] -> { A[i] -> B[i, N] }",
"[N] -> { A[0] : N = 5 }",
679 "[N] -> { A[i] -> B[0, 5] }" },
680 {
"[N] -> { B[N + 1, N] }",
"[N] -> { : N = 5 }",
681 "[N] -> { B[6, 5] }" },
682 {
"[N] -> { A[i] -> B[] }",
"[N] -> { A[0] : N = 5 }",
683 "[N] -> { A[i] -> B[] }" },
684 {
"[N] -> { B[] }",
"[N] -> { : N = 5 }",
689 {
"[N] -> { A[i] -> B[i, N] }",
"[N] -> { : N = 5 }",
690 "[N] -> { A[i] -> B[i, 5] }" },
691 {
"[N] -> { B[N + 1, N] }",
"[N] -> { : N = 5 }",
692 "[N] -> { B[6, 5] }" },
693 {
"[N] -> { A[i] -> B[] }",
"[N] -> { : N = 5 }",
694 "[N] -> { A[i] -> B[] }" },
695 {
"[N] -> { B[] }",
"[N] -> { : N = 5 }",
700 {
"{ A[i] -> B[i, i] : i >= 0 }",
"{ A[0] }",
701 "{ A[i] -> B[0, 0] }" },
702 {
"[N] -> { A[i] -> B[i, N] : N >= 0 }",
"[N] -> { A[0] : N = 5 }",
703 "[N] -> { A[i] -> B[0, 5] }" },
704 {
"[N] -> { B[N + 1, N] }",
"[N] -> { : N = 5 }",
705 "[N] -> { B[6, 5] }" },
706 {
"[N] -> { A[i] -> B[] }",
"[N] -> { A[0] : N = 5 }",
707 "[N] -> { A[i] -> B[] }" },
708 {
"[N] -> { B[] }",
"[N] -> { : N = 5 }",
710 {
"{ A[i=0:10] -> B[i] }",
"{ A[5] }",
711 "{ A[i] -> B[5] }" },
712 {
"{ A[0:10] -> B[] }",
"{ A[0:10] }",
714 {
"[N] -> { A[i] -> B[] : N >= 0 }",
"[N] -> { A[0] : N = 5 }",
715 "[N] -> { A[i] -> B[] }" },
716 {
"[N] -> { B[] : N >= 0 }",
"[N] -> { : N = 5 }",
718 {
"[N] -> { B[] : N = 5 }",
"[N] -> { : N >= 0 }",
719 "[N] -> { B[] : N = 5 }" },
723 {
"[N] -> { A[i] -> B[i, N] : N >= 0 }",
"[N] -> { : N = 5 }",
724 "[N] -> { A[i] -> B[i, 5] }" },
725 {
"[N] -> { B[N + 1, N] }",
"[N] -> { : N = 5 }",
726 "[N] -> { B[6, 5] }" },
727 {
"[N] -> { A[i] -> B[] : N >= 0 }",
"[N] -> { : N = 5 }",
728 "[N] -> { A[i] -> B[] }" },
729 {
"[N] -> { B[] : N >= 0 }",
"[N] -> { : N = 5 }",
731 {
"[N] -> { B[] : N >= 5 }",
"[N] -> { : N >= 0 }",
732 "[N] -> { B[] : N >= 5 }" },
736 {
"C[{ B[i,i] -> [3i] }]",
"{ B[i,i] }",
737 "C[{ B[i,j] -> [3i] }]" },
738 {
"(C[] : { B[i,i] })",
"{ B[i,i] }",
739 "(C[] : { B[i,j] })" },
740 {
"[N] -> (C[] : { B[N,N] })",
"[N] -> { B[N,N] }",
741 "[N] -> (C[] : { B[i,j] })" },
742 {
"C[]",
"{ B[i,i] }",
744 {
"[N] -> (C[] : { B[i,i] : N >= 0 })",
"{ B[i,i] }",
745 "[N] -> (C[] : { B[i,j] : N >= 0 })" },
746 {
"[N] -> (C[] : { : N >= 0 })",
"{ B[i,i] }",
747 "[N] -> (C[] : { : N >= 0 })" },
748 {
"[N] -> (C[] : { : N >= 0 })",
"[N] -> { B[i,i] : N >= 0 }",
753 {
"[N] -> C[{ B[i,i] -> [3i + N] }]",
"[N] -> { : N = 1 }",
754 "[N] -> C[{ B[i,i] -> [3i + 1] }]" },
755 {
"C[{ B[i,i] -> [3i] }]",
"[N] -> { : N >= 0 }",
756 "[N] -> C[{ B[i,i] -> [3i] }]" },
757 {
"[N] -> C[{ B[i,i] -> [3i] : N >= 0 }]",
"[N] -> { : N >= 0 }",
758 "[N] -> C[{ B[i,i] -> [3i] }]" },
759 {
"[N] -> C[{ B[i,i] -> [3i] : N >= 1 }]",
"[N] -> { : N >= 0 }",
760 "[N] -> C[{ B[i,i] -> [3i] : N >= 1 }]" },
761 {
"[N] -> (C[] : { B[i,i] : N >= 0 })",
"[N] -> { : N >= 0 }",
762 "[N] -> (C[] : { B[i,i] })" },
763 {
"[N] -> (C[] : { : N >= 0 })",
"[N] -> { : N >= 0 }",
765 {
"C[{ B[i,i] -> [3i] }]",
"[N] -> { : N >= 0 }",
766 "[N] -> C[{ B[i,i] -> [3i] }]" },
775 {
"[N] -> { D[i] -> A[0:N-1]; D[i] -> B[i] }",
"N",
776 "{ D[i] -> A[0:]; D[i] -> B[i] }" },
777 {
"[N] -> { D[i] -> A[0:N-1]; D[i] -> B[i] }",
"M",
778 "[N] -> { D[i] -> A[0:N-1]; D[i] -> B[i] }" },
782 {
"[M, N, O] -> { D[i] -> A[j] : i <= j < M, N, O }",
"(M, N)",
783 "[O] -> { D[i] -> A[j] : i <= j < O }" },
792 {
"{ T[A[] -> B[*]] -> [0] }",
793 "{ [B[*] -> A[]] -> [0] }" },
794 {
"{ T[A[] -> A[]] -> [0] }",
795 "{ T[A[] -> A[]] -> [0] }" },
796 {
"{ [A[x] -> B[y]] -> [5*(x // 2) + 7*(y // 3)] }",
797 "{ [B[y] -> A[x]] -> [5*(x // 2) + 7*(y // 3)] }" },
801 {
"{ [A[x] -> B[y]] -> [5*(x // 2) + 7*(y // 3)] }",
802 "{ [B[y] -> A[x]] -> [5*(x // 2) + 7*(y // 3)] }" },
803 {
"{ [A[x] -> B[y]] -> T[5*(x // 2) + 7*(y // 3), 0] }",
804 "{ [B[y] -> A[x]] -> T[5*(x // 2) + 7*(y // 3), 0] }" },
808 {
"{ T[A[] -> B[*]] }",
809 "{ [B[*] -> A[]] }" },
810 {
"{ T[A[] -> A[]] }",
811 "{ T[A[] -> A[]] }" },
812 {
"{ [A[x] -> B[2x]] }",
813 "{ [B[y] -> A[x]] : y = 2x }" },
817 {
"{ [A[x] -> B[y]] -> [5*(x // 2) + 7*(y // 3)] }",
818 "{ [B[y] -> A[x]] -> [5*(x // 2) + 7*(y // 3)] }" },
819 {
"{ [A[x] -> B[y]] -> [5*(x // 2) + 7*(y // 3)] : x > y }",
820 "{ [B[y] -> A[x]] -> [5*(x // 2) + 7*(y // 3)] : x > y }" },
821 {
"{ [A[i] -> B[i + 1]] -> [i + 2] }",
822 "{ [B[i] -> A[i - 1]] -> [i + 1] }" },
826 {
"{ [A[x] -> B[y]] -> T[5*(x // 2) + 7*(y // 3), 0] : x > y }",
827 "{ [B[y] -> A[x]] -> T[5*(x // 2) + 7*(y // 3), 0] : x > y }" },
828 {
"{ [A[i] -> B[i + 1]] -> T[0, i + 2] }",
829 "{ [B[i] -> A[i - 1]] -> T[0, i + 1] }" },
833 {
"{ [A[x] -> B[y]] -> T[5*(x // 2) + 7*(y // 3) : x > y, 0] }",
834 "{ [B[y] -> A[x]] -> T[5*(x // 2) + 7*(y // 3) : x > y, 0] }" },
838 {
"{ [A[] -> B[]] -> [C[] -> D[]] }",
839 "{ [B[] -> A[]] -> [C[] -> D[]] }" },
840 {
"{ N[B[] -> C[]] -> A[] }",
841 "{ [C[] -> B[]] -> A[] }" },
842 {
"{ N[B[x] -> B[y]] -> A[] }",
843 "{ N[B[*] -> B[*]] -> A[] }" },
847 {
"{ [A[] -> B[]] -> [C[] -> D[]] }",
848 "{ [B[] -> A[]] -> [C[] -> D[]] }" },
849 {
"{ A[] -> [B[] -> C[]]; A[] -> B[]; A[0] -> N[B[1] -> B[2]] }",
851 {
"{ N[B[] -> C[]] -> A[] }",
852 "{ [C[] -> B[]] -> A[] }" },
853 {
"{ N[B[x] -> B[y]] -> A[] }",
854 "{ N[B[*] -> B[*]] -> A[] }" },
858 {
"{ A[] -> [B[] -> C[]]; A[] -> B[]; A[0] -> N[B[1] -> B[2]] }",
859 "{ A[] -> [C[] -> B[]]; A[0] -> N[B[2] -> B[1]] }" },
860 {
"{ A[] -> N[B[] -> C[]] }",
861 "{ A[] -> [C[] -> B[]] }" },
862 {
"{ A[] -> N[B[x] -> B[y]] }",
863 "{ A[] -> N[B[*] -> B[*]] }" },
872 {
"{ A[a] -> B[a, a + 1, a - 1] : a >= 0 }",
"{ B[2, 7, 0] }",
873 "{ A[a] -> B[2a, 7a + 7, 0] : a >= 0 }" },
876 {
"{ A[a] -> B[1, a - 1] : a >= 0 }",
"{ B[1/2, 7] }",
877 "{ A[a] -> B[1/2, 7a - 7] : a >= 0 }" },
881 {
"{ A[a] -> B[a, a + 1] : a >= 0 }",
"{ B[2, 7] }",
882 "{ A[a] -> B[a/2, (a + 1)/7] : a >= 0 }" },
885 {
"{ A[a] -> B[a, a - 1] : a >= 0 }",
"{ B[2, 1/7] }",
886 "{ A[a] -> B[a/2, 7a - 7] : a >= 0 }" },
897 {
"{ a: b }",
"a",
"b",
899 {
"{ a: c }",
"a",
"b",
901 {
"{ a: b }",
"b",
"a",
903 {
"{ a: b }",
"b",
"a",
929 int ret = EXIT_SUCCESS;
933 options = isl_options_new_with_defaults();
939 for (
const auto &
f :
tests) {
940 std::cout <<
f.first <<
"\n";
944 std::cerr << e.what() <<
"\n";
isl::aff domain_reverse() const
isl::basic_map intersect_params(isl::basic_set bset) const
isl::id_to_id set(isl::id key, isl::id val) const
isl::pw_multi_aff as_pw_multi_aff() const
isl::map domain_reverse() const
isl::map fixed_power(isl::val exp) const
isl::pw_multi_aff lexmin_pw_multi_aff() const
isl::multi_aff gist_params(isl::set context) const
isl::multi_aff domain_reverse() const
isl::multi_aff gist(isl::set context) const
isl::multi_pw_aff gist(isl::set set) const
isl::multi_pw_aff gist_params(isl::set set) const
isl::multi_pw_aff domain_reverse() const
isl::multi_union_pw_aff gist_params(isl::set context) const
isl::multi_union_pw_aff gist(isl::union_set context) const
isl::pw_aff domain_reverse() const
isl::pw_aff gist_params(isl::set context) const
isl::pw_aff gist(isl::set context) const
isl::pw_multi_aff scale_down(isl::multi_val mv) const
isl::pw_multi_aff domain_reverse() const
isl::pw_multi_aff scale(isl::multi_val mv) const
isl::pw_multi_aff lexmin_pw_multi_aff() const
isl::set wrapped_reverse() const
isl::set preimage(isl::multi_aff ma) const
isl::pw_multi_aff as_pw_multi_aff() const
isl::space params() const
isl::space domain() const
isl::union_map preimage_domain(isl::multi_aff ma) const
isl::union_map domain_reverse() const
isl::union_map intersect_domain_wrapped_domain(isl::union_set domain) const
isl::union_map preimage_range(isl::multi_aff ma) const
isl::union_map range_reverse() const
isl::union_map project_out_param(isl::id id) const
isl::union_map intersect_range_wrapped_domain(isl::union_set domain) const
isl_ctx * isl_ctx_alloc_with_options(struct isl_args *args, __isl_take void *opt)
void isl_ctx_free(isl_ctx *ctx)
isl_stat isl_stat(* fn)(__isl_take ISL_KEY *key, __isl_take ISL_VAL *val, void *user)
isl_bool isl_bool(* test)(__isl_keep ISL_KEY *key, __isl_keep ISL_VAL *val, void *user)
static void test_preimage(isl::ctx ctx)
R(T::*)(A1, A2) const ternary_fn
static void test_id_to_id(isl::ctx ctx)
R(T::*)(A1) const binary_fn
static void test_project(isl::ctx ctx)
#define THROW_INVALID(msg)
static void test_gist(isl::ctx ctx)
static bool has_single_cell_pma(const T &obj)
static void test_intersect(isl::ctx ctx)
static bool is_equal(const T &a, const T &b)
static bool has_single_cell(const isl::pw_multi_aff &fn)
static bool lexmin_has_single_cell(const T &obj)
static void test_scale(isl::ctx ctx)
static void test_lexmin(isl::ctx ctx)
static void test_space(isl::ctx ctx)
static void test_conversion(isl::ctx ctx)
static void test_ternary(isl::ctx ctx, const F &fn, const std::string &name, const std::vector< ternary > &tests)
static void test_fixed_power(isl::ctx ctx)
static void test_reverse(isl::ctx ctx)
static int test_lexmin(struct isl_ctx *ctx)
static int test_gist(struct isl_ctx *ctx)
struct @221223354274216223320306321046225142311132162156 tests[]
static int test_conversion(isl_ctx *ctx)
static int test_intersect(isl_ctx *ctx)