1 \section{\protect\isl/ interface
}
5 The
\barvinok/ library currently supports just two
6 functions that interface with the
\isl/ library.
7 In time, this interface will grow and is set to replace
8 the
\PolyLib/ interface.
9 For more information on the
\isl/ data structures, see
10 the
\isl/ user manual.
13 __isl_give isl_pw_qpolynomial *isl_set_card(__isl_take isl_set *set);
15 Compute the number of elements in an
\ai[\tt]{isl
\_set}.
16 The resulting
\ai[\tt]{isl
\_pw\_qpolynomial} has purely parametric cells.
19 __isl_give isl_pw_qpolynomial *isl_map_card(__isl_take isl_map *map);
21 Compute a closed form expression for the number of image elements
22 associated to any element in the domain of the given
\ai[\tt]{isl
\_map}.
23 The union of the cells in the resulting
\ai[\tt]{isl
\_pw\_qpolynomial}
24 is equal to the domain of the input
\ai[\tt]{isl
\_map}.
27 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_sum(
28 __isl_take isl_pw_qpolynomial *pwqp);
30 Compute the sum of the given piecewise quasipolynomial over
31 all integer points in the domain. The result is a piecewise
32 quasipolynomial that only involves the parameters.
34 \subsection{Calculator
}
36 The
\ai[\tt]{iscc
} calculator offers an interface to some
37 of the functionality provided by the
\isl/ and
\barvinok/
39 The supported operations are shown in
\autoref{t:iscc
}.
40 Here are some examples:
42 P :=
[n, m
] ->
{ [i,j
] :
0 <= i <= n and i <= j <= m
};
45 f :=
[n,m
] ->
{ [i,j
] -> i*j + n*i*i*j : i,j >=
0 and
5i +
27j <= n+m
};
48 s @
[n,m
] ->
{ [] :
0 <= n,m <=
20 };
50 f :=
[n
] ->
{ [i
] ->
2*n*i - n*n +
3*n -
1/
2*i*i -
3/
2*i-
1 :
51 (exists j :
0 <= i <
4*n-
1 and
0 <= j < n and
52 2*n-
1 <= i+j <=
4*n-
2 and i <=
2*n-
1 )
};
55 u @
[n
] ->
{ [] :
0 <= n <=
10 };
57 m :=
[n
] ->
{ [i,j
] ->
[i+
1,j+
1] :
1 <= i,j < n;
58 [i,j
] ->
[i+
1,j-
1] :
1 <= i < n and
2 <= j <= n
};
63 \bottomcaption{{\tt iscc
} operations. The variables
64 have the following types,
67 $q$: piecewise quasipolynomial,
68 $f$: piecewise quasipolynomial fold,
72 $o$: object of any type
81 \multicolumn{2}{r
}{\small\sl continued on next page
}
85 \begin{supertabular
}{lp
{0.7\textwidth}}
86 $s_2$ :=
\ai[\tt]{aff
} $s_1$ & affine hull of $s_1$
88 $m_2$ :=
\ai[\tt]{aff
} $m_1$ & affine hull of $m_1$
90 $q$ :=
\ai[\tt]{card
} $s$ &
91 number of elements in the set $s$
93 $q$ :=
\ai[\tt]{card
} $m$ &
94 number of elements in the image of a domain element
96 $s_2$ :=
\ai[\tt]{coalesce
} $s_1$ &
97 simplify the representation of set $s_1$ by trying
98 to combine pairs of basic sets into a single
101 $m_2$ :=
\ai[\tt]{coalesce
} $m_1$ &
102 simplify the representation of map $m_1$ by trying
103 to combine pairs of basic maps into a single
106 $q_2$ :=
\ai[\tt]{coalesce
} $q_1$ &
107 simplify the representation of $q_1$ by trying
108 to combine pairs of basic sets in the domain
109 of $q_1$ into a single basic set
111 $f_2$ :=
\ai[\tt]{coalesce
} $f_1$ &
112 simplify the representation of $f_1$ by trying
113 to combine pairs of basic sets in the domain
114 of $f_1$ into a single basic set
116 $s_3$ := $s_1$
\ai[\tt]{cross
} $s_2$ &
117 Cartesian product of $s_1$ and $s_2$
119 $m_3$ := $m_1$
\ai[\tt]{cross
} $m_2$ &
120 Cartesian product of $m_1$ and $m_2$
122 $s$ :=
\ai[\tt]{deltas
} $m$ &
123 the set $\
{\, y - x
\mid x
\to y
\in m \,\
}$
125 $s$ :=
\ai[\tt]{dom
} $m$ &
128 $s$ :=
\ai[\tt]{dom
} $q$ &
129 domain of piecewise quasipolynomial $q$
131 $s$ :=
\ai[\tt]{dom
} $f$ &
132 domain of piecewise quasipolynomial fold $f$
134 $s$ :=
\ai[\tt]{ran
} $m$ &
137 $s_2$ :=
\ai[\tt]{lexmin
} $s_1$ &
138 lexicographically minimal element of $s_1$
140 $m_2$ :=
\ai[\tt]{lexmin
} $m_1$ &
141 lexicographically minimal image element
143 $s_2$ :=
\ai[\tt]{lexmax
} $s_1$ &
144 lexicographically maximal element of $s_1$
146 $m_2$ :=
\ai[\tt]{lexmax
} $m_1$ &
147 lexicographically maximal image element
149 $o$ :=
\ai[\tt]{read
} {\tt "
}{\it filename
}{\tt"
} &
150 read object from file
152 $s_2$ :=
\ai[\tt]{sample
} $s_1$ &
153 a sample element of the set $s_1$
155 $m_2$ :=
\ai[\tt]{sample
} $m_1$ &
156 a sample element of the map $m_1$
158 $q_2$ :=
\ai[\tt]{sum
} $q_1$ &
159 sum $q_1$ over all integer points in the domain of $q_1$
161 $f$ :=
\ai[\tt]{ub
} $q$ &
162 upper bound on the piecewise quasipolynomial $q$ over
163 all integer points in the domain of $q$
165 $s_3$ := $s_1$
\ai{$+$
} $s_2$ & union
167 $m_3$ := $m_1$
\ai{$+$
} $m_2$ & union
169 $q_3$ := $q_1$
\ai{$+$
} $q_2$ & sum
171 $s_3$ := $s_1$
\ai{$-$
} $s_2$ & set difference
173 $m_3$ := $m_1$
\ai{$-$
} $m_2$ & set difference
175 $q_3$ := $q_1$
\ai{$-$
} $q_2$ & difference
177 $s_3$ := $s_1$
\ai{$*$
} $s_2$ & intersection
179 $m_3$ := $m_1$
\ai{$*$
} $m_2$ & intersection
181 $q_3$ := $q_1$
\ai{$*$
} $q_2$ & product
183 $m_2$ := $m_1$
\ai{$*$
} $s$ & intersect domain of $m_1$ with $s$
185 $q_2$ := $q_1$
\ai{$*$
} $s$ & intersect domain of $q_1$ with $s$
187 $f_2$ := $f_1$
\ai{$*$
} $s$ & intersect domain of $f_1$ with $s$
189 $s_2$ := $m$($s_1$) & apply map $m$ to set $s_1$
191 $m_3$ := $m_1$
\ai[\tt]{.
} $m_2$ & join of $m_1$ and $m_2$
193 $m_3$ := $m_2$($m_1)$ & join of $m_1$ and $m_2$
195 $m$ := $s_1$
\ai[\tt]{->
} $s_2$ & universal map with domain $s_1$
198 $q_2$ := $q_1$
\ai{@
} $s$ &
199 evaluate the piecewise quasipolynomial $q_1$ in each element
200 of the set $s$ and return a piecewise quasipolynomial
201 mapping each of the individual elements to the resulting
204 $q$ := $f$
\ai{@
} $s$ &
205 evaluate the piecewise quasipolynomial fold $f$ in each element
206 of the set $s$ and return a piecewise quasipolynomial
207 mapping each of the individual elements to the resulting
210 $s_3$ := $s_1$
\ai[\tt]{\%
} $s_2$ &
211 simplify $s_1$ in the context of $s_2$, i.e., compute
212 the gist of $s_1$ given $s_2$
214 $m_3$ := $m_1$
\ai[\tt]{\%
} $m_2$ &
215 simplify $m_1$ in the context of $m_2$, i.e., compute
216 the gist of $m_1$ given $m_2$
218 $q_2$ := $q_1$
\ai[\tt]{\%
} $s$ &
219 simplify $q_1$ in the context of the domain $s$, i.e., compute
220 the gist of $q_1$ given $s$
222 $f_2$ := $f_1$
\ai[\tt]{\%
} $s$ &
223 simplify $f_1$ in the context of the domain $s$, i.e., compute
224 the gist of $f_1$ given $s$
226 $m_2$ := $m_1$
\ai[\tt]{\^
{}-
1} & inverse of $m_1$
228 $l$ := $m$
\ai[\tt]{\^
{}+
} &
229 compute an overapproximation of the transitive closure
230 of $m$ and return a list containing the overapproximation
231 and a boolean that is true if the overapproximation
235 the element at position $i$ in the list $l$
237 $b$ := $s_1$
\ai[\tt]{=
} $s_2$ & is $s_1$ equal to $s_2$?
239 $b$ := $m_1$
\ai[\tt]{=
} $m_2$ & is $m_1$ equal to $m_2$?
241 $b$ := $s_1$
\ai[\tt]{<=
} $s_2$ & is $s_1$ a subset of $s_2$?
243 $b$ := $m_1$
\ai[\tt]{<=
} $m_2$ & is $m_1$ a subset of $m_2$?
245 $b$ := $s_1$
\ai[\tt]{<
} $s_2$ & is $s_1$ a proper subset of $s_2$?
247 $b$ := $m_1$
\ai[\tt]{<
} $m_2$ & is $m_1$ a proper subset of $m_2$?
249 $b$ := $s_1$
\ai[\tt]{>=
} $s_2$ & is $s_1$ a superset of $s_2$?
251 $b$ := $m_1$
\ai[\tt]{>=
} $m_2$ & is $m_1$ a superset of $m_2$?
253 $b$ := $s_1$
\ai[\tt]{>
} $s_2$ & is $s_1$ a proper superset of $s_2$?
255 $b$ := $m_1$
\ai[\tt]{>
} $m_2$ & is $m_1$ a proper superset of $m_2$?