isl_map_transitive_closure: coalesce after each step
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 31 Mar 2010 19:19:22 +0000 (21:19 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 1 Apr 2010 12:47:25 +0000 (14:47 +0200)
Without coalescing, the number of disjuncts in the result
is exponential in the number of disjuncts in the input.

doc/implementation.tex
doc/isl.bib
isl_transitive_closure.c

index 338ec07..13d35d0 100644 (file)
@@ -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
index 240d4c3..16fdc83 100644 (file)
     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",
+}
index 879e0ad..369d0fb 100644 (file)
@@ -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;