iscc: codegen: accept schedule as input
[barvinok.git] / doc / isl.tex
blob608c37751d8c9dd0a3f94b09767277eeb7f4054e
1 \section{\protect\isl/ interface}
3 \let\llt\prec
4 \let\lle\preccurlyeq
5 \let\lgt\succ
7 \subsection{Library}
9 The \barvinok/ library currently supports only a few
10 functions that interface with the \isl/ library.
11 In time, this interface will grow and is set to replace
12 the \PolyLib/ interface.
13 For more information on the \isl/ data structures, see
14 the \isl/ user manual.
16 \begin{verbatim}
17 __isl_give isl_pw_qpolynomial *isl_basic_set_card(
18 __isl_take isl_basic_set *bset);
19 __isl_give isl_pw_qpolynomial *isl_set_card(__isl_take isl_set *set);
20 __isl_give isl_union_pw_qpolynomial *isl_union_set_card(
21 __isl_take isl_union_set *uset);
22 \end{verbatim}
23 Compute the number of elements in an \ai[\tt]{isl\_basic\_set},
24 \ai[\tt]{isl\_set} or \ai[\tt]{isl\_union\_set}.
25 The resulting \ai[\tt]{isl\_pw\_qpolynomial}
26 or \ai[\tt]{isl\_union\_pw\_qpolynomial} has purely parametric cells.
28 \begin{verbatim}
29 __isl_give isl_pw_qpolynomial *isl_basic_map_card(
30 __isl_take isl_basic_map *bmap);
31 __isl_give isl_pw_qpolynomial *isl_map_card(__isl_take isl_map *map);
32 __isl_give isl_union_pw_qpolynomial *isl_union_map_card(
33 __isl_take isl_union_map *umap);
34 \end{verbatim}
35 Compute a closed form expression for the number of image elements
36 associated to any element in the domain of the given \ai[\tt]{isl\_basic\_map},
37 \ai[\tt]{isl\_map} or \ai[\tt]{isl\_union\_map}.
38 The union of the cells in the resulting \ai[\tt]{isl\_pw\_qpolynomial}
39 is equal to the domain of the input \ai[\tt]{isl\_map}.
41 \begin{verbatim}
42 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_sum(
43 __isl_take isl_pw_qpolynomial *pwqp);
44 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_sum(
45 __isl_take isl_union_pw_qpolynomial *upwqp);
46 \end{verbatim}
47 Compute the sum of the given piecewise quasipolynomial over
48 all integer points in the domain. The result is a piecewise
49 quasipolynomial that only involves the parameters.
50 If, however, the domain of the piecewise quasipolynomial wraps
51 a relation, then the sum is computed over all integer points
52 in the range of that relation and the domain of the relation
53 becomes the domain of the result.
55 \begin{verbatim}
56 __isl_give isl_pw_qpolynomial *isl_set_apply_pw_qpolynomial(
57 __isl_take isl_set *set, __isl_take isl_pw_qpolynomial *pwqp);
58 __isl_give isl_union_pw_qpolynomial *isl_union_set_apply_union_pw_qpolynomial(
59 __isl_take isl_union_set *uset,
60 __isl_take isl_union_pw_qpolynomial *upwqp);
61 \end{verbatim}
62 Compute the sum of the given piecewise quasipolynomial over
63 all integer points in the intersection of the domain and the given set.
65 \begin{verbatim}
66 __isl_give isl_pw_qpolynomial *isl_map_apply_pw_qpolynomial(
67 __isl_take isl_map *map, __isl_take isl_pw_qpolynomial *pwqp);
68 __isl_give isl_union_pw_qpolynomial *isl_union_map_apply_union_pw_qpolynomial(
69 __isl_take isl_union_map *umap,
70 __isl_take isl_union_pw_qpolynomial *upwqp);
71 \end{verbatim}
72 Compose the given map with the given piecewise quasipolynomial.
73 That is, compute the sum over all elements in the intersection
74 of the range of the map and the domain of the piecewise quasipolynomial
75 as a function of an element in the domain of the map.
77 \subsection{Calculator}
79 The \ai[\tt]{iscc} calculator offers an interface to some
80 of the functionality provided by the \isl/ and \barvinok/
81 libraries.
82 The language used by \ai[\tt]{iscc} is extremely simple. The calculator
83 supports operations on constants and dynamically typed variables and
84 assignments (\ai[\tt]{:=}) to those variables. If the result of an expression
85 is not used inside another expression and not assigned to a variable,
86 then this result is printed on the screen. The operators are overloaded
87 based on the types of the arguments, which may be sets, relations,
88 piecewise quasipolynomials, piecewise quasipolynomial folds, lists,
89 strings or booleans.
90 The supported operations are shown in \autoref{t:iscc}.
91 Note that when an operation requires an argument of a certain
92 type, a binary list with the first element of the required type
93 may also be used instead.
95 \subsubsection{Sets and Iteration Domains}
97 \begin{figure}
98 \begin{lstlisting}[escapechar=@]{}
99 for (i = 1; i <= n; ++i)
100 for (j = 1; j <= i; ++j)
101 /* S */
102 \end{lstlisting}
103 \caption{A loop nest}
104 \label{f:loop nest}
105 \end{figure}
107 \begin{figure}
108 \begin{tikzpicture}[>=stealth,x=0.7cm,y=-0.7cm]
109 \draw[thick] (1,1)--(5,5)--(1,5)--(1,1);
110 \draw[->] (-0.6,0) to (5.6,0) node[anchor=south east] {$j$};
111 \draw[->] (0,-0.6) to (0,5.6) node[anchor=south east] {$i$};
112 \draw[help lines,step=0.7cm] (-0.6,5.6) grid (5.6,-0.6);
113 \foreach \i in {1,...,5}{
114 \foreach \j in {1,...,\i}{
115 \fill (\j,\i) circle (2pt);
118 \end{tikzpicture}
119 \caption{The iteration domain of the loop nest in \autoref{f:loop nest}}
120 \label{f:iteration domain}
121 \end{figure}
123 Within the polyhedral model for analysis and transformation of
124 static affine programs, the most basic kind of set is the
125 \defindex{iteration domain}.
126 The iteration domain represents the iterations of a statement in a loop nest.
127 Take, for example, the loop nest in \autoref{f:loop nest}
128 and assume first that \lstinline{n} has a fixed value, say 5.
129 The pairs of values of \lstinline{i} and \lstinline{j} for
130 which statement \lstinline{S} is executed are shown graphically
131 in \autoref{f:iteration domain}.
132 Mathematically, this set of pairs can be represented as
134 \{\,
135 (i,j) \in \ZZ^2 \mid 1 \le i \le 5 \wedge 1 \le j \le i
136 \,\}
138 and the \isl/ notation is very similar:
139 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
140 { [i,j] : 1 <= i <= 5 and 1 <= j <= i }
141 \end{lstlisting}
142 In this notation,
143 the coordinates are separated by commas and enclosed in square
144 brackets. This description of the space in which the set lives
145 is followed by a colon and the constraints on the coordinates.
146 Assuming the iterators are incremented by one in every iterations
147 of the loop, a lower and upper bound on each loop iterator
148 can be read off from the initialization and the test.
149 Note that in an \iscc/ set,
150 the coordinates are assumed to be integer by default.
151 For an iteration domain to be representable by such a set,
152 the iterators therefore need to be integers.
154 The constraints of a set need to be affine, i.e., linear plus constant term.
155 These affine constraint may be combined through conjunctions (\texttt{and}),
156 disjunctions (\texttt{or}), projections (\texttt{exists}) and
157 negations (\texttt{not}).
158 Note that the formula is immediately converted
159 into \indac{DNF}, so it may sometimes be more efficient
160 to construct a set from smaller sets by applying
161 basic operations such as intersection ({\tt *}),
162 union ({\tt +}) and difference ({\tt -}).
163 For example, the following square with its diagonal removed,
165 \{\,
166 (i,j) \mid 0 \le i,j \le 10 \wedge \lnot (i = j)
167 \,\}
169 can be constructed as
170 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
171 { [i,j] : 0 <= i,j <= 10 } - { [i,i] }
172 \end{lstlisting}
173 or as
174 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
175 { [i,j] : 0 <= i,j <= 10 and not (i = j) }
176 \end{lstlisting}
177 Note that an occurrence of a relational operator in a set description
178 may define several constraints, one for each pair of arguments.
179 The elements in a list of arguments are separated by a comma.
180 If there are no constraints on the coordinates, i.e., in case of
181 a universe set, the colon may be omitted as well.
182 For example
183 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
184 { [] }
185 \end{lstlisting}
186 represents the entire (unnamed) zero-dimensional space,
187 and should not be confused with
188 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
190 \end{lstlisting}
191 which represents the empty set.
193 Returning to the iteration domain of the loop nest
194 in \autoref{f:loop nest}, we usually do not want to analyze
195 such a program for a specific value of \lstinline{n},
196 but instead for all possible values of \lstinline{n} at once.
197 A generic description of the iteration domain can be obtained
198 through the introduction of a (free) parameter, as in
199 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
200 [n] -> { [i,j] : 1 <= i <= n and 1 <= j <= i }
201 \end{lstlisting}
202 The optional parameters should
203 be declared by placing them in a comma delimited list inside \lstinline![]!
204 (followed by an ``\lstinline!->!'') in front of the main set description.
205 The parameters are global and are identified by their names,
206 so the order inside the list is arbitrary.
207 This should be contrasted to the coordinates of a space, the names of
208 which are only relevant within the description of the set and which
209 are instead identified by their positions.
210 That is,
211 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
212 [n] -> { [i,j] : 1 <= i <= n and 1 <= j <= i }
213 \end{lstlisting}
214 is equal to
215 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
216 [n] -> { [a,b] : 1 <= a <= n and 1 <= b <= a }
217 \end{lstlisting}
218 but it is not equal to
219 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
220 [n] -> { [j,i] : 1 <= i <= n and 1 <= j <= i }
221 \end{lstlisting}
222 (because the order of the coordinates has changed)
224 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
225 [m] -> { [i,j] : 1 <= i <= m and 1 <= j <= i }
226 \end{lstlisting}
227 (because it involves a different parameter).
229 It is sometimes convenient to represent constraints that only
230 involve parameters and that are not tied to any particular space.
231 To construct such a parameter domain, the list of coordinates
232 should simply be omitted. Note that the colon is required
233 in this case, even if there are no constraints.
234 In particular,
235 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
236 { : }
237 \end{lstlisting}
238 represents the universal parameter domain, which is very different
239 from the empty set.
241 To plug in a particular value for a parameter, the user should
242 take the \ai{intersection} (\ai[\tt]{*}) with a parameter domain
243 assigns a particular value to the parameter.
244 For example,
245 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
246 S := [n] -> { [i,j] : 1 <= i <= n and 1 <= j <= i };
247 S * [n] -> { : n = 5 };
248 \end{lstlisting}
249 It should be noted, though, that the result is not the same
250 as simply replacing \lstinline{n} by 5 as the result of the above
251 sequence will still have the global parameter \lstinline{n} set to 5.
252 To avoid this assignment, the user should instead compute
253 the \ai{gist} (\ai[\tt]{\%}) of the original set in the context
254 of setting \lstinline{n} to 5.
255 That is, the result of the sequence below is \lstinline{True}.
256 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
257 S1 := { [i,j] : 1 <= i <= 5 and 1 <= j <= i };
258 S2 := [n] -> { [i,j] : 1 <= i <= n and 1 <= j <= i };
259 (S2 % [n] -> { : n = 5}) = S1;
260 \end{lstlisting}
262 \begin{figure}
263 \begin{lstlisting}[escapechar=@]{}
264 for (i = 1; i <= n; i += 3)
265 /* S */
266 \end{lstlisting}
267 \caption{A loop with non-unit stride}
268 \label{f:stride}
269 \end{figure}
271 If a loop has a non-unit stride as in \autoref{f:stride}
272 then affine constraints on the coordinates and the parameters
273 are not sufficient to represent the iteration domain.
274 What is needed is a way to express that the value of
275 \lstinline{i} is equal to 1 plus 3 times some integer and
276 this is where existentially quantified variables can be used.
277 Existentially quantified variables are introduced by the
278 \ai[\tt]{exists} keyword and followed by a colon.
279 They can only be used within a single disjunct.
280 As an example, the iteration domain of the loop in \autoref{f:stride}
281 can be represented as
282 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
283 [n] -> { [i] : exists a : 1 <= i <= n and i = 1 + 3 a }
284 \end{lstlisting}
286 \begin{figure}
287 \begin{lstlisting}[escapechar=@]{}
288 for (i = 1; i <= n; ++i)
289 if ((i + 1) % 5 <= 2)
290 /* S */
291 \end{lstlisting}
292 \caption{A loop with a modulo condition}
293 \label{f:modulo}
294 \end{figure}
296 Existentially quantified variables are also useful to represent
297 modulo constraints. Consider for example the loop in
298 \autoref{f:modulo}. The iterator values \lstinline!i! for which
299 the statement \lstinline!S! is executed lie between
300 1 and \lstinline!n! and are such that the remainder of
301 \lstinline!i + 1! on division by 5 is less than or equal to 2.
302 The constraint $(i + 1) \bmod 5 \le 2$ can be written
303 as $(i + 1) - 5 \floor{\frac{i+1}5} \le 2$, where
304 $f = \floor{\frac{i+1}5}$ is the greatest integer part of $\frac{i+1}5$.
305 That is, $f$ is the unique integer value satisfying the constraints
306 $5 f \le i + 1$ and $5 f \ge (i+1) - 4$.
307 The iteration domain of the statement in \autoref{f:modulo}
308 can therefore be represented as
309 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
310 [n] -> { [i] : exists f : 1 <= i <= n and (i + 1) - 5 f <= 2 and
311 (i + 1) - 4 <= 5 f <= i + 1 }
312 \end{lstlisting}
313 Since greatest integer parts occur relatively frequently, there is
314 a special notation for them in \isl/ using \lstinline![]!.
315 The above set can therefore also be represented as
316 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
317 [n] -> { [i] : 1 <= i <= n and (i + 1) - 5 * [(i + 1)/5] <= 2 }
318 \end{lstlisting}
319 Actually, since modulos are pretty common too, \isl/ also has
320 a special notation for them and the set can therefore also be respresented as
321 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
322 [n] -> { [i] : 1 <= i <= n and (i + 1) % 5 <= 2 }
323 \end{lstlisting}
324 It should be noted that \lstinline![]! always rounds down
325 (towards $-\infty$), while integer division in C truncates
326 (towards 0). When translating conditions in C containing integer
327 divisions and/or modulos to \isl/ constraints, the user should therefore
328 make sure the sign of the dividend is positive. If not, the integer
329 division needs to be translated differently for positive and negative
330 values.
332 \begin{figure}
333 \begin{lstlisting}[escapechar=@]{}
334 for (i = 0; i < n; ++i)
335 T: t[i] = a[i];
336 for (i = 0; i < n; ++i)
337 for (j = 0; j < n - i; ++j)
338 F: t[j] = f(t[j], t[j+1]);
339 for (i = 0; i < n; ++i)
340 B: b[i] = t[i];
341 \end{lstlisting}
342 \caption{A program with three loop nests}
343 \label{f:three loops}
344 \end{figure}
346 Most programs involve more than one statement.
347 Although it is possible to work with different sets, each
348 representing the iteration domain of a statement,
349 it is usually more convenient to collect all iteration domains
350 in a single set. To be able to differentiate between iterations
351 of different statements with the same values for the iterators,
352 \isl/ allows spaces to be named. The name is placed in front
353 of the \lstinline![]! enclosing the iterators.
354 Consider for example the program in \autoref{f:three loops}.
355 The program contains three statements which have been labeled
356 for convenience.
357 The iteration domain of the first statement (\lstinline!T!)
358 can be represented as
359 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
360 [n] -> { T[i] : 0 <= i < n }
361 \end{lstlisting}
362 The union of all iteration domains can be represented as
363 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
364 [n] -> {
365 T[i] : 0 <= i < n;
366 F[i,j] : 0 <= i < n and 0 <= j < n - i;
367 B[i] : 0 <= i < n
369 \end{lstlisting}
370 The semicolon \lstinline{;} is used to express a disjunction
371 between spaces. This should be contrasted with the \lstinline{or}
372 keyword which expresses a disjunction between conjunctions of constraints.
373 For example, the result of the following \iscc/ statement is
374 \lstinline{True}.
375 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
376 { [i] : i = 3 or i = 5 } = { [3]; [5] };
377 \end{lstlisting}
379 \subsubsection{Maps and Access Relations}
381 A second important concept in the polyhedral model is that
382 of an \defindex{access relation}.
383 An access relation connects iterations of a statement
384 to the array elements accessed by those iterations.
385 Such a binary relation can be represented by a map in \isl/.
386 Maps are defined in similar way to sets,
387 except that the single space is replaced by a pair of spaces separated
388 by \verb!->!.
389 As an example, consider once more the program in \autoref{f:three loops}.
390 In particular, consider the access \lstinline{t[j+1]} in
391 statement \lstinline{F}.
392 The index expression maps the pair of iterations \lstinline{i}
393 and \lstinline{j} to \lstinline{t[j+1]}, i.e., element \lstinline{j+1}
394 of a space with name \lstinline{t}.
395 Ignoring the loop bound constraints, this access relation can
396 be represented as
397 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
398 { F[i,j] -> t[j + 1] }
399 \end{lstlisting}
400 It is however customary to include the constraints on the iterators
401 in the access relation, resulting in
402 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
403 [n] -> { F[i,j] -> t[j + 1] : 0 <= i < n and 0 <= j < n - i }
404 \end{lstlisting}
405 The constraints can be added by intersecting the domains
406 of the access relations with the iteration domains.
407 For example, the following sequence constructs the access
408 relation for all reads in the program.
409 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
410 D := [n] -> {
411 T[i] : 0 <= i < n;
412 F[i,j] : 0 <= i < n and 0 <= j < n - i;
413 B[i] : 0 <= i < n
415 Read := {
416 T[i] -> a[i];
417 F[i,j] -> t[j];
418 F[i,j] -> t[j + 1];
419 B[i] -> t[i]
421 Read := Read * D;
422 \end{lstlisting}
423 In this sequence, the \lstinline{*} operator, when applied
424 to a map and a set, intersects the domain of the map with the set.
426 The notation \lstinline{R(S)} can be used to compute the image
427 of the set \lstinline{S} under the map \lstinline{R}.
428 For example, given the sequence above, \lstinline!Read({F[0,1]})!
429 computes the array elements read in iteration $(0,1)$ of statement
430 \lstinline{F} and is equal to
431 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
432 [n] -> { t[2] : n >= 2; t[1] : n >= 2 }
433 \end{lstlisting}
434 That is, elements 1 and 2 of the \lstinline{t} array are read,
435 provided \lstinline{n} is at least 2.
437 Maps need not be single-valued.
438 As an example, assume that \lstinline{A} is a two-dimensional
439 array of size \lstinline{n} in both dimensions.
440 Iterations \lstinline{i} of
441 a statement \lstinline{S} may pass a pointer to an entire row
442 of \lstinline{A} to a function as in \lstinline{f(A[i])}.
443 Without knowing anything about \lstinline{f}, we would have
444 to assume that this function may access any element of the row.
445 The access relation corresponding to \lstinline{A[i]} is therefore
446 \begin{lstlisting}[columns=flexible,escapechar=@,language=]{}
447 [n] -> { S[i] -> A[i,j] : 0 <= i,j < n }
448 \end{lstlisting}
449 This map associates \lstinline{n} elements of \lstinline{A}
450 to each iteration of \lstinline{S}.
452 \subsubsection{Nested Spaces}
454 Each space may contain a nested pair of spaces. Such nested spaces
455 are extremely useful in more advanced applications.
456 As an example, suppose that during equivalence checking
457 \shortcite{Verdoolaege2009equivalence}
458 of two programs the iterations of \verb!S1! in one program are supposed to
459 produce the same results as the same iterations of \verb!SA! in the other program,
460 which may be described using the following map
461 \begin{verbatim}
462 [n] -> { S1[i] -> SA[i] : 0 <= i <= n }
463 \end{verbatim}
464 If the iterations of \verb!S1! depend on the same iterations
465 of \verb!S2!, i.e., \verb!{S1[i]->S2[i]}!, while those of \verb!SA!
466 depend on the next iteration of \verb!B!, i.e., \verb!{SA[i]->SB[i+1]}!,
467 then we can apply the cross product of these two dependence maps, i.e.,
468 \begin{verbatim}
469 { [S1[i] -> SA[i']] -> [S2[i] -> SB[1+i']] }
470 \end{verbatim}
471 to the original map to find
472 out which iterations of \verb!S2! should correspond to which
473 iterations of \verb!SB!.
475 \subsubsection{Basic Operations}
477 Basic operations on sets and maps include intersection (\ai[\tt]{*}),
478 union (\ai[\tt]{+}), difference (\ai[\tt]{-}), cross product (\ai[\tt]{cross}),
479 sampling (\ai[\tt]{sample}), affine hull (\ai[\tt]{aff}),
480 lexicographic optimization (\ai[\tt]{lexmin} or \ai[\tt]{lexmax}),
481 subset (\ai[\tt]{<=}) and equality (\ai[\tt]{=}) tests,
482 code generation (\ai[\tt]{codegen})
483 and the cardinality (\ai[\tt]{card}).
484 Additional operations on maps include computing domain (\ai[\tt]{dom})
485 and range (\ai[\tt]{ran}), differences between image and domain (\ai[\tt]{deltas}),
486 join (\ai[\tt]{.}), inverse (\ai[\tt]{\^{}-1}) and transitive closure (\ai[\tt]{\^{}+}).
487 The latter may result in an overapproximation.
489 The \ai[\tt]{card} operation computes the number of elements in a set
490 or the number of elements in the image of a domain element of a map.
491 The operation is performed exactly and completely symbolically and
492 the result is a piecewise quasipolynomial, i.e., a subdivision of one
493 or more spaces, with a quasipolynomial associated to each cell in the subdivision.
494 As a trivial example, the result of
495 \begin{verbatim}
496 card { A[i] -> B[j] : 0 <= j <= i }
497 \end{verbatim}
498 is \verb!{ A[i] -> (1+i) : i >= 0 }!.
499 Operations on piecewise quasipolynomials include sum (\ai[\tt]{+})
500 and difference (\ai[\tt]{-}) and the computation of an upper bound over the domain.
501 If the domain contains a pair of nested spaces, then the upper bound is computed over
502 the nested range. As another trivial example, the result of
503 \begin{verbatim}
504 ub{ [[i] -> [j]] -> j^2 : -i <= j <= i }
505 \end{verbatim}
507 \verb!({ [i] -> max(i^2) : i >= 0 }, True)!.
508 The first element in this list is the actual bound in the form
509 of a piecewise quasipolynomial fold,
510 i.e., a maximum of quasipolynomials defined over cells.
511 The second indicates whether the bound is tight, i.e., whether
512 a maximum has been computed.
514 \subsubsection{Advanced Operations}
516 While the basic {\tt card} operation simply counts the number of elements
517 in an affine set, it is also possible to assign a weight to each element
518 of the set and to compute the sum of those weights over all the points in the set.
519 The syntax for this weighted counting is to compute the {\tt sum} of
520 a piecewise quasipolynomial over its domain. As in the case of the {\tt ub}
521 operator, if the domain contains a pair of nested space, the sum is computed
522 over the range. As an example, the result
524 \begin{verbatim}
525 sum{ [[i] -> [j]] -> i*j : 0 <= j <= i }
526 \end{verbatim}
528 \verb|{ [i] -> (1/2*i^2+1/2*i^3) : i >= 0 }|.
530 After the computation of some sum or bound, the result may have to
531 be reformulated in terms of other variables. For example, during
532 inter procedural analysis, a result computed in terms of the formal
533 parameters may have to be reformulated in terms of the actual parameters.
534 {\tt iscc} therefore allows maps and
535 piecewise quasipolynomials or folds to be composed.
536 If the map is multi-valued, then the composition maps each domain element
537 to the sum or upper bound of the values at its image elements.
539 Finally, because of its high-level representation, {\tt iscc} can
540 provide a dependence analysis operation taking only three maps as input,
541 the sink accesses, the potential source accesses and a schedule.
542 The result is a single dependence map.
545 \subsubsection{More Examples}
546 \begin{verbatim}
547 P := [n, m] -> { [i,j] : 0 <= i <= n and i <= j <= m };
548 card P;
550 f := [n,m] -> { [i,j] -> i*j + n*i*i*j : i,j >= 0 and 5i + 27j <= n+m };
551 sum f;
552 s := sum f;
553 s @ [n,m] -> { : 0 <= n,m <= 20 };
555 f := [n] -> { [i] -> 2*n*i - n*n + 3*n - 1/2*i*i - 3/2*i-1 :
556 (exists j : 0 <= i < 4*n-1 and 0 <= j < n and
557 2*n-1 <= i+j <= 4*n-2 and i <= 2*n-1 ) };
558 ub f;
559 u := (ub f)[0];
560 u @ [n] -> { : 0 <= n <= 10 };
562 m := [n] -> { [i,j] -> [i+1,j+1] : 1 <= i,j < n;
563 [i,j] -> [i+1,j-1] : 1 <= i < n and 2 <= j <= n };
564 m^+;
565 (m^+)[0];
567 codegen [N] -> { A[i] -> [i,0] : 0 <= i <= N; B[i] -> [i,1] : 1 <= i <= N };
569 { [k] -> [i] : 1 <= i <= k } . { [n] -> 2 * n : n >= 1 };
571 { [m] -> [c] : 1 <= c <= m } . { [k] -> max((3 * k + k^2)) : k >= 1 };
572 \end{verbatim}
574 \subsubsection{Comparison to other Interactive Polyhedral Tools}
576 Two related interactive polyhedral tools are
577 the Omega calculator \shortcite{Omega_calc}
578 and {\tt SPPoC} \shortcite{Boulet2001SPPoC}.
579 The syntax of {\tt iscc} was very much inspired
580 by that of the Omega calculator. However, the Omega
581 calculator only knows sets and maps. In particular,
582 it does not perform any form of counting. An earlier version
583 of \barvinok/ came with a modified version of
584 the Omega calculator that introduced an operation
585 for counting the number of elements in a set, but it
586 would simply print the result and not allow any further
587 manipulations.
588 {\tt SPPoC} does support counting, but only the basic
589 operation of counting the elements in a set.
590 In particular, it does not support weighted counting,
591 nor the computation of upper bounds.
592 It also only supports (single-valued) functions
593 and not generic relations like the Omega calculator and {\tt iscc}.
594 Internally, {\tt SPPoC} uses {\tt PolyLib}, {\tt PipLib} and {\tt omega}
595 to perform
596 its operations. Although the first two of these libraries may have been
597 state-of-the-art at the time {\tt SPPoC} was created, they are
598 no longer actively maintained and have been largely
599 superseded by more recent libraries.
600 In particular, {\tt PipLib} effectively only supports a single
601 operation, which is now also available in both {\tt isl} and {\tt PPL}.
602 The operations on rational polyhedra in {\tt PolyLib} are also
603 available in {\tt PPL}, usually through a cleaner interface and
604 with a more efficient implementation. As to counting the elements
605 in a parametric polytope, Barvinok's algorithm,
606 implemented in the {\tt barvinok} library, is usually much faster
607 than the algorithm implemented in {\tt PolyLib}
608 \shortcite{Verdoolaege2007parametric}.
609 Furthermore,
610 the ability to work with named and nested spaces and the ability
611 of sets and maps to contain (pairs of) elements from different spaces
612 are not available in the Omega calculator and {\tt SPPoC}.
614 \newpage
615 \tablecaption{{\tt iscc} operations. The variables
616 have the following types,
617 $s$: set,
618 $m$: map,
619 $q$: piecewise quasipolynomial,
620 $f$: piecewise quasipolynomial fold,
621 $t$: schedule (tree),
622 $l$: list,
623 $i$: integer,
624 $b$: boolean,
625 $S$: string,
626 $o$: object of any type
628 \label{t:iscc}
629 \tablehead{
630 \hline
631 Syntax & Meaning
633 \hline
635 \tabletail{
636 \multicolumn{2}{r}{\small\sl continued on next page}
639 \tablelasttail{}
640 \begin{supertabular}{p{0.35\textwidth}p{0.6\textwidth}}
641 $s_2$ := \ai[\tt]{aff} $s_1$ & affine hull of $s_1$
643 $m_2$ := \ai[\tt]{aff} $m_1$ & affine hull of $m_1$
645 $q$ := \ai[\tt]{card} $s$ &
646 number of elements in the set $s$
648 $q$ := \ai[\tt]{card} $m$ &
649 number of elements in the image of a domain element
651 $s_2$ := \ai[\tt]{coalesce} $s_1$ &
652 simplify the representation of set $s_1$ by trying
653 to combine pairs of basic sets into a single
654 basic set
656 $m_2$ := \ai[\tt]{coalesce} $m_1$ &
657 simplify the representation of map $m_1$ by trying
658 to combine pairs of basic maps into a single
659 basic map
661 $q_2$ := \ai[\tt]{coalesce} $q_1$ &
662 simplify the representation of $q_1$ by trying
663 to combine pairs of basic sets in the domain
664 of $q_1$ into a single basic set
666 $f_2$ := \ai[\tt]{coalesce} $f_1$ &
667 simplify the representation of $f_1$ by trying
668 to combine pairs of basic sets in the domain
669 of $f_1$ into a single basic set
671 \ai[\tt]{codegen} $t$ &
672 generate code for the given schedule.
674 \ai[\tt]{codegen} $s$ &
675 generate code for the given domain.
677 \ai[\tt]{codegen} $m$ &
678 generate code for the given schedule.
680 \ai[\tt]{codegen} $s$ \ai[\tt]{using} $m$ &
681 generate code for the domain $s$ using the options $m$.
683 \ai[\tt]{codegen} $m_1$ \ai[\tt]{using} $m_2$ &
684 generate code for the schedule $m_1$ using the options $m_2$.
686 $s_2$ := \ai[\tt]{coefficients} $s_1$ &
687 The set of coefficients of valid constraints for $s_1$
689 $s_2$ := \ai[\tt]{solutions} $s_1$ &
690 The set of elements satisfying the constraints with coefficients in $s_1$
692 $s_3$ := $s_1$ \ai[\tt]{cross} $s_2$ &
693 Cartesian product of $s_1$ and $s_2$
695 $m_3$ := $m_1$ \ai[\tt]{cross} $m_2$ &
696 Cartesian product of $m_1$ and $m_2$
698 $s$ := \ai[\tt]{deltas} $m$ &
699 the set $\{\, y - x \mid x \to y \in m \,\}$
701 $m_2$ := \ai[\tt]{deltas\_map} $m_1$ &
702 the map $\{\, (x \to y) \to y - x \mid x \to y \in m_1 \,\}$
704 $s$ := \ai[\tt]{dom} $m$ &
705 domain of map $m$
707 $s$ := \ai[\tt]{dom} $q$ &
708 domain of piecewise quasipolynomial $q$
710 $s$ := \ai[\tt]{dom} $f$ &
711 domain of piecewise quasipolynomial fold $f$
713 $s$ := \ai[\tt]{domain} $m$ &
714 domain of map $m$
716 $s$ := \ai[\tt]{domain} $q$ &
717 domain of piecewise quasipolynomial $q$
719 $s$ := \ai[\tt]{domain} $f$ &
720 domain of piecewise quasipolynomial fold $f$
722 $m_2$ := \ai[\tt]{domain\_map} $m_1$ &
723 a map from a wrapped copy of $m_1$ to the domain of $m_1$
725 $s$ := \ai[\tt]{ran} $m$ &
726 range of map $m$
728 $s$ := \ai[\tt]{range} $m$ &
729 range of map $m$
731 $m_2$ := \ai[\tt]{range\_map} $m_1$ &
732 a map from a wrapped copy of $m_1$ to the range of $m_1$
734 $m$ := \ai[\tt]{identity} $s$ &
735 identity relation on $s$
737 $q$ := \ai[\tt]{lattice\_width} $s$ &
738 lattice width of the set $s$
740 $l$ := \ai[\tt]{lb} $q$ &
741 compute a
742 lower bound on the piecewise quasipolynomial $q$ over
743 all integer points in the domain of $q$
744 and return a list containing the lower bound
745 and a boolean that is true if the lower bound
746 is known to be tight.
747 If the domain of $q$ wraps a map, then the lower
748 bound is computed over all integer points in
749 the range of the wrapped map instead.
751 $s_2$ := \ai[\tt]{lexmin} $s_1$ &
752 lexicographically minimal element of $s_1$
754 $m_2$ := \ai[\tt]{lexmin} $m_1$ &
755 lexicographically minimal image element
757 $s_2$ := \ai[\tt]{lexmax} $s_1$ &
758 lexicographically maximal element of $s_1$
760 $m_2$ := \ai[\tt]{lexmax} $m_1$ &
761 lexicographically maximal image element
763 $s_2$ := \ai[\tt]{lift} $s_1$ &
764 lift $s_1$ to a space with extra dimensions corresponding
765 to the existentially quantified variables in $s_1$ such
766 that \lstinline!domain(unwrap(lift S))! is equal to \lstinline!S!
768 $s_2$ := \ai[\tt]{params} $s_1$ &
769 parameter domain of set $s_1$
771 $s$ := \ai[\tt]{params} $m$ &
772 parameter domain of map $m$
774 $l$ := \ai[\tt]{parse\_file} $S$ &
775 parse the file names $S$ and return a list consisting of
776 the iteration domain, the must write access relation,
777 the may write access relation, the read access relation and
778 the original schedule.
779 This operation is only available if \ai[\tt]{pet}
780 support was compiled in.
782 $s_2$ := \ai[\tt]{poly} $s_1$ & polyhedral hull of $s_1$
784 $m_2$ := \ai[\tt]{poly} $m_1$ & polyhedral hull of $m_1$
786 $q_2$ := \ai[\tt]{poly} $q_1$ & polynomial approximation of $q_1$
788 $q_2$ := \ai[\tt]{lpoly} $q_1$ & polynomial underapproximation of $q_1$
790 $q_2$ := \ai[\tt]{upoly} $q_1$ & polynomial overapproximation of $q_1$
792 $l$ := \ai[\tt]{pow} $m$\ &
793 compute an overapproximation of the power
794 of $m$ and return a list containing the overapproximation
795 and a boolean that is true if the overapproximation
796 is known to be exact
798 \ai[\tt]{print} $o$ &
799 print object
801 $o$ := \ai[\tt]{read} {\tt "}{\it filename}{\tt"} &
802 read object from file
804 $s_2$ := \ai[\tt]{sample} $s_1$ &
805 a sample element of the set $s_1$
807 $m_2$ := \ai[\tt]{sample} $m_1$ &
808 a sample element of the map $m_1$
810 $s_2$ := \ai[\tt]{scan} $s_1$ &
811 the set $s_1$ split into individual elements,
812 provided $s_1$ contains a finite number of elements
814 $m_2$ := \ai[\tt]{scan} $m_1$ &
815 the map $m_1$ split into individual elements,
816 provided $m_1$ contains a finite number of elements
818 \ai[\tt]{source} {\tt "}{\it filename}{\tt"} &
819 read commands from file
821 $q_2$ := \ai[\tt]{sum} $q_1$ &
822 sum $q_1$ over all integer points in the domain of $q_1$,
823 or, if the domain of $q_1$ wraps a map, over all integer
824 points in the range of the wrapped map.
826 $S$ := \ai[\tt]{typeof} $o$ &
827 a string representation of the type of $o$
829 $l$ := \ai[\tt]{ub} $q$ &
830 compute an
831 upper bound on the piecewise quasipolynomial $q$ over
832 all integer points in the domain of $q$
833 and return a list containing the upper bound
834 and a boolean that is true if the upper bound
835 is known to be tight.
836 If the domain of $q$ wraps a map, then the upper
837 bound is computed over all integer points in
838 the range of the wrapped map instead.
840 $l$ := \ai[\tt]{vertices} $s$ &
841 a list of vertices of the rational polytope defined by the same constraints
842 as $s$
844 $s$ := \ai[\tt]{wrap} $m$ &
845 wrap the map in a set
847 $m$ := \ai[\tt]{unwrap} $s$ &
848 unwrap the map from the set
850 \ai[\tt]{write} {\tt "}{\it filename}{\tt"} $o$ &
851 write object to file
853 $m_2$ := \ai[\tt]{zip} $m_1$ &
854 the cross product of domain and range of $m_1$, i.e.,
855 $\{\, (\vec w \to \vec y) \to (\vec x \to \vec z)
856 \mid (\vec w \to \vec x) \to (\vec y \to \vec z) \in m_1 \,\}$
858 $m_3$ := \ai[\tt]{any} $m_1$ \ai[\tt]{before} $m_2$ \ai[\tt]{under} $t$ &
859 compute a map from any element $x$ in the domain of $m_1$
860 to any element $y$ in the domain of $m_2$
861 such that their images $m_1(x)$ and $m_2(y)$ overlap
862 and such that $x$ is scheduled before $y$ by $t$.
864 $m_4$ := \ai[\tt]{any} $m_1$ \ai[\tt]{before} $m_2$ \ai[\tt]{under} $m_3$ &
865 same as the previous operation, with the schedule represented by a map.
867 $l$ := \ai[\tt]{last} $m_1$ \ai[\tt]{before} $m_2$ \ai[\tt]{under} $t$ &
868 compute a map that contains for any element $y$ in the domain of $m_2$
869 a mapping from the last element $x$ in the domain of $m_1$
870 (according to the schedule $t$) to $y$
871 such that $m_1(x)$ and $m_2(y)$ overlap
872 and such that $x$ is scheduled before $y$ by $t$.
873 Return a list containing this map and the set of elements in the domain of
874 $m_2$ for which there is no corresponding element in the domain of $m_1$.
876 $l$ := \ai[\tt]{last} $m_1$ \ai[\tt]{before} $m_2$ \ai[\tt]{under} $m_3$ &
877 same as the previous operation, with the schedule represented by a map.
879 $m_4$ := \ai[\tt]{any} $m_1$ \ai[\tt]{last} $m_2$ \ai[\tt]{before} $m_3$
880 \ai[\tt]{under} $t$ &
881 compute a map that contains for any element $y$ in the domain of $m_3$
882 a mapping from the last element $x$ in the domain of $m_2$
883 (according to the schedule $t$) to $y$
884 such that $m_2(x)$ and $m_3(y)$ overlap
885 and such that $x$ is scheduled before $y$ by $t$
886 as well as from any element $z$ in the domain of $m_1$ such that
887 $m_1(z)$ and $m_3(y)$ overlap,
888 $z$ is scheduled before $y$ by $t$
889 and such that there is no $x$ in the domain of $m_2$ with
890 $m_2(x) \cap m_3(y) \ne \emptyset$ and
891 $x$ scheduled between $z$ and $y$ by $t$.
893 $m_5$ := \ai[\tt]{any} $m_1$ \ai[\tt]{last} $m_2$ \ai[\tt]{before} $m_3$
894 \ai[\tt]{under} $m_4$ &
895 same as the previous operation, with the schedule represented by a map.
897 $m_3$ := \ai[\tt]{schedule} $s$ \ai[\tt]{respecting} $m_1$ \ai[\tt]{minimizing} $m_2$ &
898 compute a schedule for the domains in $s$ that respects all dependences
899 in $m_1$ and tries to minimize the dependences in $m_2$.
901 $l$ := \ai[\tt]{schedule\_forest} $s$ \ai[\tt]{respecting} $m_1$ \ai[\tt]{minimizing} $m_2$ &
902 compute a schedule for the domains in $s$ that respects all dependences
903 in $m_1$ and tries to minimize the dependences in $m_2$ and return
904 the forest of bands in the schedule.
906 $i_3$ := $i_1$ \ai{$+$} $i_2$ & sum
908 $s_3$ := $s_1$ \ai{$+$} $s_2$ & union
910 $m_3$ := $m_1$ \ai{$+$} $m_2$ & union
912 $q_3$ := $q_1$ \ai{$+$} $q_2$ & sum
914 $f_2$ := $f_1$ \ai{$+$} $q$ & sum
916 $f_2$ := $q$ \ai{$+$} $f_1$ & sum
918 $S_3$ := $S_1$ \ai{$+$} $S_2$ & concatenation
920 $S_2$ := $o$ \ai{$+$} $S_1$ &
921 concatenation of stringification of $o$ and $S_1$
923 $S_2$ := $S_1$ \ai{$+$} $o$ &
924 concatenation of $S_1$ and stringification of $o$
926 $i_3$ := $i_1$ \ai{$-$} $i_2$ & difference
928 $s_3$ := $s_1$ \ai{$-$} $s_2$ & set difference
930 $m_3$ := $m_1$ \ai{$-$} $m_2$ & set difference
932 $q_3$ := $q_1$ \ai{$-$} $q_2$ & difference
934 $i_3$ := $i_1$ \ai{$*$} $i_2$ & product
936 $s_3$ := $s_1$ \ai{$*$} $s_2$ & intersection
938 $m_3$ := $m_1$ \ai{$*$} $m_2$ & intersection
940 $q_2$ := $i$ \ai{$*$} $q_1$ & product
942 $q_2$ := $q_1$ \ai{$*$} $i$ & product
944 $q_3$ := $q_1$ \ai{$*$} $q_2$ & product
946 $f_2$ := $i$ \ai{$*$} $f_1$ & product
948 $f_2$ := $f_1$ \ai{$*$} $i$ & product
950 $m_2$ := $m_1$ \ai{$*$} $s$ & intersect domain of $m_1$ with $s$
952 $q_2$ := $q_1$ \ai{$*$} $s$ & intersect domain of $q_1$ with $s$
954 $f_2$ := $f_1$ \ai{$*$} $s$ & intersect domain of $f_1$ with $s$
956 $s_2$ := $m$($s_1$) & apply map $m$ to set $s_1$
958 $q_2$ := $q_1$($s$) & apply $q_1$ to each element in $s$ and compute
959 the sum of the results
961 $l$ := $f$($s$) & apply $f$ to each element in $s$, compute
962 a bound of the results
963 and return a list containing the bound
964 and a boolean that is true if the bound
965 is known to be tight.
967 $m_3$ := $m_1$ \ai[\tt]{.} $m_2$ & join of $m_1$ and $m_2$
969 $m_3$ := $m_1$ \ai[\tt]{before} $m_2$ & join of $m_1$ and $m_2$
971 $m_3$ := $m_2$($m_1)$ & join of $m_1$ and $m_2$
973 $m_3$ := $m_2$ \ai[\tt]{after} $m_1$ & join of $m_1$ and $m_2$
975 $f_3$ := $f_1$ \ai[\tt]{.} $f_2$ & join of $f_1$ and $f_2$, combining
976 the lists of quasipolynomials over shared domains
978 $q_2$ := $m$ \ai[\tt]{.} $q_1$ & join of $m$ and $q_1$, taking the sum
979 over all elements in the intersection of the range of $m$ and the domain
980 of $q_1$
982 $q_2$ := $m$ \ai[\tt]{before} $q_1$ & $q_2$ := $m$ \ai[\tt]{.} $q_1$
984 $q_2$ := $q_1(m)$ & $q_2$ := $m$ \ai[\tt]{.} $q_1$
986 $q_2$ := $q_1$ \ai[\tt]{after} $m$ & $q_2$ := $m$ \ai[\tt]{.} $q_1$
988 $l$ := $m$ \ai[\tt]{.} $f$ & join of $m$ and $f$, computing a bound
989 over all elements in the intersection of the range of $m$ and the domain
990 of $f$ and returning a list containing the bound
991 and a boolean that is true if the bound is known to be tight.
993 $l$ := $m$ \ai[\tt]{before} $f$ & $l$ := $m$ \ai[\tt]{.} $f$
995 $l$ := $f(m)$ & $l$ := $m$ \ai[\tt]{.} $f$
997 $l$ := $f$ \ai[\tt]{after} $m$ & $l$ := $m$ \ai[\tt]{.} $f$
999 $m$ := $s_1$ \ai[\tt]{->} $s_2$ & universal map with domain $s_1$
1000 and range $s_2$
1002 $q_2$ := $q_1$ \ai{@} $s$ &
1003 evaluate the piecewise quasipolynomial $q_1$ in each element
1004 of the set $s$ and return a piecewise quasipolynomial
1005 mapping each of the individual elements to the resulting
1006 constant
1008 $q$ := $f$ \ai{@} $s$ &
1009 evaluate the piecewise quasipolynomial fold $f$ in each element
1010 of the set $s$ and return a piecewise quasipolynomial
1011 mapping each of the individual elements to the resulting
1012 constant
1014 $s_3$ := $s_1$ \ai[\tt]{\%} $s_2$ &
1015 simplify $s_1$ in the context of $s_2$, i.e., compute
1016 the gist of $s_1$ given $s_2$
1018 $m_3$ := $m_1$ \ai[\tt]{\%} $m_2$ &
1019 simplify $m_1$ in the context of $m_2$, i.e., compute
1020 the gist of $m_1$ given $m_2$
1022 $m_2$ := $m_1$ \ai[\tt]{\%} $s$ &
1023 simplify $m_1$ in the context of the domain $s$, i.e., compute
1024 the gist of $m_1$ given domain $s$
1026 $q_2$ := $q_1$ \ai[\tt]{\%} $s$ &
1027 simplify $q_1$ in the context of the domain $s$, i.e., compute
1028 the gist of $q_1$ given $s$
1030 $f_2$ := $f_1$ \ai[\tt]{\%} $s$ &
1031 simplify $f_1$ in the context of the domain $s$, i.e., compute
1032 the gist of $f_1$ given $s$
1034 $m_2$ := $m_1$\ai[\tt]{\^{}}i & the $i$th power of $m_1$;
1035 if $i$ is negative then the result is the ($-i$)th power of the inverse
1036 of $m_1$
1038 $l$ := $m$\ai[\tt]{\^{}+} &
1039 compute an overapproximation of the transitive closure
1040 of $m$ and return a list containing the overapproximation
1041 and a boolean that is true if the overapproximation
1042 is known to be exact
1044 $o$ := $l$[$i$] &
1045 the element at position $i$ in the list $l$
1047 $b$ := $q_1$ \ai[\tt]{==} $q_2$ & is $q_1$ obviously equal to $q_2$?
1049 $b$ := $f_1$ \ai[\tt]{==} $f_2$ & is $f_1$ obviously equal to $f_2$?
1051 $b$ := $s_1$ \ai[\tt]{=} $s_2$ & is $s_1$ equal to $s_2$?
1053 $b$ := $m_1$ \ai[\tt]{=} $m_2$ & is $m_1$ equal to $m_2$?
1055 $b$ := $S_1$ \ai[\tt]{=} $S_2$ & is $S_1$ equal to $S_2$?
1057 $b$ := $s_1$ \ai[\tt]{<=} $s_2$ & is $s_1$ a subset of $s_2$?
1059 $b$ := $m_1$ \ai[\tt]{<=} $m_2$ & is $m_1$ a subset of $m_2$?
1061 $b$ := $s_1$ \ai[\tt]{<} $s_2$ & is $s_1$ a proper subset of $s_2$?
1063 $b$ := $m_1$ \ai[\tt]{<} $m_2$ & is $m_1$ a proper subset of $m_2$?
1065 $b$ := $s_1$ \ai[\tt]{>=} $s_2$ & is $s_1$ a superset of $s_2$?
1067 $b$ := $m_1$ \ai[\tt]{>=} $m_2$ & is $m_1$ a superset of $m_2$?
1069 $b$ := $s_1$ \ai[\tt]{>} $s_2$ & is $s_1$ a proper superset of $s_2$?
1071 $b$ := $m_1$ \ai[\tt]{>} $m_2$ & is $m_1$ a proper superset of $m_2$?
1073 $m$ := $s_1$ \ai[\tt]{<<} $s_2$ & a map from
1074 $s_1$ to $s_2$ of those elements that live in the same space and
1075 such that the elements of $s_1$ are lexicographically strictly smaller
1076 than those of $s_2$.
1078 $m_3$ := $m_1$ \ai[\tt]{<<} $m_2$ & a map from the domain of
1079 $m_1$ to the domain of $m_2$ of those elements such that their images
1080 live in the same space and such that the images of the elements of
1081 $m_1$ are lexicographically strictly smaller than those of $m_2$.
1083 $m$ := $s_1$ \ai[\tt]{<<=} $s_2$ & a map from
1084 $s_1$ to $s_2$ of those elements that live in the same space and
1085 such that the elements of $s_1$ are lexicographically smaller
1086 than those of $s_2$.
1088 $m_3$ := $m_1$ \ai[\tt]{<<=} $m_2$ & a map from the domain of
1089 $m_1$ to the domain of $m_2$ of those elements such that their images
1090 live in the same space and such that the images of the elements of
1091 $m_1$ are lexicographically smaller than those of $m_2$.
1093 $m$ := $s_1$ \ai[\tt]{>>} $s_2$ & a map from
1094 $s_1$ to $s_2$ of those elements that live in the same space and
1095 such that the elements of $s_1$ are lexicographically strictly greater
1096 than those of $s_2$.
1098 $m_3$ := $m_1$ \ai[\tt]{>>} $m_2$ & a map from the domain of
1099 $m_1$ to the domain of $m_2$ of those elements such that their images
1100 live in the same space and such that the images of the elements of
1101 $m_1$ are lexicographically strictly greater than those of $m_2$.
1103 $m$ := $s_1$ \ai[\tt]{>>=} $s_2$ & a map from
1104 $s_1$ to $s_2$ of those elements that live in the same space and
1105 such that the elements of $s_1$ are lexicographically greater
1106 than those of $s_2$.
1108 $m_3$ := $m_1$ \ai[\tt]{>>=} $m_2$ & a map from the domain of
1109 $m_1$ to the domain of $m_2$ of those elements such that their images
1110 live in the same space and such that the images of the elements of
1111 $m_1$ are lexicographically greater than those of $m_2$.
1113 \end{supertabular}