From 7986f7ab451427319bcfe5d01c89433bde46d72d Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 13 Feb 2010 21:15:40 +0100 Subject: [PATCH] add transitive closure example from Kelly's 1996 paper --- isl_test.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/isl_test.c b/isl_test.c index ed5a69f..9d3cc5b 100644 --- a/isl_test.c +++ b/isl_test.c @@ -785,6 +785,23 @@ void test_closure(struct isl_ctx *ctx) map = isl_map_transitive_closure(map, &exact); assert(exact); isl_map_free(map); + + /* Kelly et al 1996, fig 12 */ + map = isl_map_read_from_str(ctx, + "[n] -> { [i,j] -> [i2,j2] : i2 = i and j2 = j + 1 and " + "1 <= i,j,j+1 <= n or " + "j = n and j2 = 1 and i2 = i + 1 and " + "1 <= i,i+1 <= n }", -1); + map = isl_map_transitive_closure(map, &exact); + assert(exact); + map2 = isl_map_read_from_str(ctx, + "[n] -> { [i,j] -> [i2,j2] : 1 <= j < j2 <= n and " + "1 <= i <= n and i = i2 or " + "1 <= i < i2 <= n and 1 <= j <= n and " + "1 <= j2 <= n }", -1); + assert(isl_map_is_equal(map, map2)); + isl_map_free(map2); + isl_map_free(map); } int main() -- 2.7.4