doc: reorganize table of iscc operations
[barvinok/uuh.git] / doc / isl.tex
blob9a9f639def38dae424ae644ff840ff7cbdca7b95
1 \section{\protect\isl/ interface}
3 \subsection{Library}
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.
12 \begin{verbatim}
13 __isl_give isl_pw_qpolynomial *isl_set_card(__isl_take isl_set *set);
14 \end{verbatim}
15 Compute the number of elements in an \ai[\tt]{isl\_set}.
16 The resulting \ai[\tt]{isl\_pw\_qpolynomial} has purely parametric cells.
18 \begin{verbatim}
19 __isl_give isl_pw_qpolynomial *isl_map_card(__isl_take isl_map *map);
20 \end{verbatim}
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}.
26 \begin{verbatim}
27 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_sum(
28 __isl_take isl_pw_qpolynomial *pwqp);
29 \end{verbatim}
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/
38 libraries.
39 The supported operations are shown in \autoref{t:iscc}.
40 Here are some examples:
41 \begin{verbatim}
42 P := [n, m] -> { [i,j] : 0 <= i <= n and i <= j <= m };
43 card P;
45 f := [n,m] -> { [i,j] -> i*j + n*i*i*j : i,j >= 0 and 5i + 27j <= n+m };
46 sum f;
47 s := sum f;
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 ) };
53 ub f;
54 u := ub f;
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 };
59 m^+;
60 (m^+)[0];
61 \end{verbatim}
63 \begin{table}
64 \begin{tabular}{lp{0.7\textwidth}}
65 Syntax & Meaning
67 \hline
68 $q$ := \ai[\tt]{card} $s$ &
69 number of elements in the set $s$
71 $q$ := \ai[\tt]{card} $m$ &
72 number of elements in the image of a domain element
74 $s$ := \ai[\tt]{dom} $m$ &
75 domain of map $m$
77 $s$ := \ai[\tt]{ran} $m$ &
78 range of map $m$
80 $s_2$ := \ai[\tt]{lexmin} $s_1$ &
81 lexicographically minimal element of $s_1$
83 $m_2$ := \ai[\tt]{lexmin} $m_1$ &
84 lexicographically minimal image element
86 $s_2$ := \ai[\tt]{lexmax} $s_1$ &
87 lexicographically maximal element of $s_1$
89 $m_2$ := \ai[\tt]{lexmax} $m_1$ &
90 lexicographically maximal image element
92 $s_2$ := \ai[\tt]{sample} $s_1$ &
93 a sample element of the set $s_1$
95 $m_2$ := \ai[\tt]{sample} $m_1$ &
96 a sample element of the map $m_1$
98 $q_2$ := \ai[\tt]{sum} $q_1$ &
99 sum $q_1$ over all integer points in the domain of $q_1$
101 $f$ := \ai[\tt]{ub} $q$ &
102 upper bound on the piecewise quasipolynomial $q$ over
103 all integer points in the domain of $q$.
104 This operation is only available if
105 \ai[\tt]{GiNaC} support was compiled in.
107 $s_3$ := $s_1$ \ai{$+$} $s_2$ & union
109 $m_3$ := $m_1$ \ai{$+$} $m_2$ & union
111 $q_3$ := $q_1$ \ai{$+$} $q_2$ & sum
113 $s_3$ := $s_1$ \ai{$-$} $s_2$ & set difference
115 $m_3$ := $m_1$ \ai{$-$} $m_2$ & set difference
117 $q_3$ := $q_1$ \ai{$-$} $q_2$ & difference
119 $s_3$ := $s_1$ \ai{$*$} $s_2$ & intersection
121 $m_3$ := $m_1$ \ai{$*$} $m_2$ & intersection
123 $q_3$ := $q_1$ \ai{$*$} $q_2$ & product
125 $q_2$ := $q_1$ \ai{@} $s$ &
126 evaluate the piecewise quasipolynomial $q_1$ in each element
127 of the set $s$ and return a piecewise quasipolynomial
128 mapping each of the individual elements to the resulting
129 constant
131 $q$ := $f$ \ai{@} $s$ &
132 evaluate the piecewise quasipolynomial fold $f$ in each element
133 of the set $s$ and return a piecewise quasipolynomial
134 mapping each of the individual elements to the resulting
135 constant
137 $l$ := $m$\ai[\tt]{\^{}+} &
138 compute an overapproximation of the transitive closure
139 of $m$ and return a list containing the overapproximation
140 and a boolean that is true if the overapproximation
141 is known to be exact
143 $l$[$i$] &
144 the element at position $i$ in the list $l$
146 \end{tabular}
147 \caption{\protect\ai[\tt]{iscc} operations. The variables
148 have the following types,
149 $s$: set,
150 $m$: map,
151 $q$: piecewise quasipolynomial,
152 $f$: piecewise quasipolynomial fold,
153 $l$: list,
154 $i$: integer
156 \label{t:iscc}
157 \end{table}