From 72f3a540ea7ea0952911b89b2aab8942d1e1da78 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 31 Mar 2010 21:19:22 +0200 Subject: [PATCH] isl_map_transitive_closure: coalesce after each step Without coalescing, the number of disjuncts in the result is exponential in the number of disjuncts in the input. --- doc/implementation.tex | 13 +++++++++++++ doc/isl.bib | 9 +++++++++ isl_transitive_closure.c | 1 + 3 files changed, 23 insertions(+) diff --git a/doc/implementation.tex b/doc/implementation.tex index 338ec07..13d35d0 100644 --- a/doc/implementation.tex +++ b/doc/implementation.tex @@ -102,6 +102,11 @@ $$ $$ \end{definition} +\section{Coalescing}\label{s:coalescing} + +See \shortciteN{Verdoolaege2009isl}, for now. +More details will be added later. + \section{Transitive Closure} \subsection{Introduction} @@ -265,6 +270,14 @@ when composing the $P_i'$s to allow for paths that do not contain any offsets from one or more $\Delta_i'$. The path that consists of only identity relations is removed by imposing the constraint $y_{d+1} - x_{d+1} > 0$. +Taking the union with the identity relation means that +that the relations we compose in \eqref{eq:transitive:decompose} +each consist of two basic relations. If there are $m$ +disjuncts in the input relation, then a direct application +of the composition operation may therefore result in a relation +with $2^m$ disjuncts, which is prohibitively expensive. +It is therefore crucial to apply coalescing (\autoref{s:coalescing}) +after each composition. Let us now consider how to compute an overapproximation of $P_i'$. Those that correspond to singleton $\Delta_i$s are grouped together diff --git a/doc/isl.bib b/doc/isl.bib index 240d4c3..16fdc83 100644 --- a/doc/isl.bib +++ b/doc/isl.bib @@ -60,3 +60,12 @@ institution = "University of Maryland", year = 1996 } + +@unpublished{Verdoolaege2009isl, + author = "Verdoolaege, Sven", + title = "An integer set library for program analysis", + note = "Advances in the Theory of Integer Linear Optimization and its Extensions,AMS 2009 Spring Western Section Meeting, San Francisco, California, 25-26 April 2009", + month = Apr, + year = "2009", + url = "https://lirias.kuleuven.be/handle/123456789/228373", +} diff --git a/isl_transitive_closure.c b/isl_transitive_closure.c index 879e0ad..369d0fb 100644 --- a/isl_transitive_closure.c +++ b/isl_transitive_closure.c @@ -556,6 +556,7 @@ static __isl_give isl_map *construct_extended_path(__isl_take isl_dim *dim, if (j < d) { path = isl_map_apply_range(path, path_along_delta(isl_dim_copy(dim), delta)); + path = isl_map_coalesce(path); } else { isl_basic_set_free(delta); ++n; -- 2.7.4