1 \section{\protect\isl/ interface
}
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.
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);
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.
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);
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}.
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);
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.
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);
62 Compute the sum of the given piecewise quasipolynomial over
63 all integer points in the intersection of the domain and the given set.
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);
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/
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,
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
}
98 \begin{lstlisting
}[escapechar=@
]{}
99 for (i =
1; i <= n; ++i)
100 for (j =
1; j <= i; ++j)
103 \caption{A loop nest
}
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);
119 \caption{The iteration domain of the loop nest in
\autoref{f:loop nest
}}
120 \label{f:iteration domain
}
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
135 (i,j)
\in \ZZ^
2 \mid 1 \le i
\le 5 \wedge 1 \le j
\le i
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
}
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,
166 (i,j)
\mid 0 \le i,j
\le 10 \wedge \lnot (i = j)
169 can be constructed as
170 \begin{lstlisting
}[columns=flexible,escapechar=@,language=
]{}
171 { [i,j
] :
0 <= i,j <=
10 } -
{ [i,i
] }
174 \begin{lstlisting
}[columns=flexible,escapechar=@,language=
]{}
175 { [i,j
] :
0 <= i,j <=
10 and not (i = j)
}
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.
183 \begin{lstlisting
}[columns=flexible,escapechar=@,language=
]{}
186 represents the entire (unnamed) zero-dimensional space,
187 and should not be confused with
188 \begin{lstlisting
}[columns=flexible,escapechar=@,language=
]{}
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
}
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.
211 \begin{lstlisting
}[columns=flexible,escapechar=@,language=
]{}
212 [n
] ->
{ [i,j
] :
1 <= i <= n and
1 <= j <= i
}
215 \begin{lstlisting
}[columns=flexible,escapechar=@,language=
]{}
216 [n
] ->
{ [a,b
] :
1 <= a <= n and
1 <= b <= a
}
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
}
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
}
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.
235 \begin{lstlisting
}[columns=flexible,escapechar=@,language=
]{}
238 represents the universal parameter domain, which is very different
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.
245 \begin{lstlisting
}[columns=flexible,escapechar=@,language=
]{}
246 S :=
[n
] ->
{ [i,j
] :
1 <= i <= n and
1 <= j <= i
};
247 S *
[n
] ->
{ : n =
5 };
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;
263 \begin{lstlisting
}[escapechar=@
]{}
264 for (i =
1; i <= n; i +=
3)
267 \caption{A loop with non-unit stride
}
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
}
287 \begin{lstlisting
}[escapechar=@
]{}
288 for (i =
1; i <= n; ++i)
289 if ((i +
1)
% 5 <= 2)
292 \caption{A loop with a modulo condition
}
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 }
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 }
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 }
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
333 \begin{lstlisting
}[escapechar=@
]{}
334 for (i =
0; i < n; ++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)
342 \caption{A program with three loop nests
}
343 \label{f:three loops
}
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
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
}
362 The union of all iteration domains can be represented as
363 \begin{lstlisting
}[columns=flexible,escapechar=@,language=
]{}
366 F
[i,j
] :
0 <= i < n and
0 <= j < n - i;
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
375 \begin{lstlisting
}[columns=flexible,escapechar=@,language=
]{}
376 { [i
] : i =
3 or i =
5 } =
{ [3];
[5] };
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
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
397 \begin{lstlisting
}[columns=flexible,escapechar=@,language=
]{}
398 { F
[i,j
] -> t
[j +
1] }
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
}
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=
]{}
412 F
[i,j
] :
0 <= i < n and
0 <= j < n - i;
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 }
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
}
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
462 [n
] ->
{ S1
[i
] -> SA
[i
] :
0 <= i <= n
}
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.,
469 { [S1
[i
] -> SA
[i'
]] ->
[S2
[i
] -> SB
[1+i'
]] }
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
496 card
{ A
[i
] -> B
[j
] :
0 <= j <= i
}
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
504 ub
{ [[i
] ->
[j
]] -> j^
2 : -i <= j <= i
}
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
525 sum
{ [[i
] ->
[j
]] -> i*j :
0 <= j <= i
}
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
}
547 P :=
[n, m
] ->
{ [i,j
] :
0 <= i <= n and i <= j <= m
};
550 f :=
[n,m
] ->
{ [i,j
] -> i*j + n*i*i*j : i,j >=
0 and
5i +
27j <= n+m
};
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 )
};
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
};
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 };
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
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
}
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
}.
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
}.
615 \tablecaption{{\tt iscc
} operations. The variables
616 have the following types,
619 $q$: piecewise quasipolynomial,
620 $f$: piecewise quasipolynomial fold,
621 $t$: schedule (tree),
626 $o$: object of any type
636 \multicolumn{2}{r
}{\small\sl continued on next page
}
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
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
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
} $s$ &
672 generate code for the given domain.
674 \ai[\tt]{codegen
} $m$ &
675 generate code for the given schedule.
677 \ai[\tt]{codegen
} $s$
\ai[\tt]{using
} $m$ &
678 generate code for the domain $s$ using the options $m$.
680 \ai[\tt]{codegen
} $m_1$
\ai[\tt]{using
} $m_2$ &
681 generate code for the schedule $m_1$ using the options $m_2$.
683 $s_2$ :=
\ai[\tt]{coefficients
} $s_1$ &
684 The set of coefficients of valid constraints for $s_1$
686 $s_2$ :=
\ai[\tt]{solutions
} $s_1$ &
687 The set of elements satisfying the constraints with coefficients in $s_1$
689 $s_3$ := $s_1$
\ai[\tt]{cross
} $s_2$ &
690 Cartesian product of $s_1$ and $s_2$
692 $m_3$ := $m_1$
\ai[\tt]{cross
} $m_2$ &
693 Cartesian product of $m_1$ and $m_2$
695 $s$ :=
\ai[\tt]{deltas
} $m$ &
696 the set $\
{\, y - x
\mid x
\to y
\in m \,\
}$
698 $m_2$ :=
\ai[\tt]{deltas
\_map} $m_1$ &
699 the map $\
{\, (x
\to y)
\to y - x
\mid x
\to y
\in m_1 \,\
}$
701 $s$ :=
\ai[\tt]{dom
} $m$ &
704 $s$ :=
\ai[\tt]{dom
} $q$ &
705 domain of piecewise quasipolynomial $q$
707 $s$ :=
\ai[\tt]{dom
} $f$ &
708 domain of piecewise quasipolynomial fold $f$
710 $s$ :=
\ai[\tt]{domain
} $m$ &
713 $s$ :=
\ai[\tt]{domain
} $q$ &
714 domain of piecewise quasipolynomial $q$
716 $s$ :=
\ai[\tt]{domain
} $f$ &
717 domain of piecewise quasipolynomial fold $f$
719 $m_2$ :=
\ai[\tt]{domain
\_map} $m_1$ &
720 a map from a wrapped copy of $m_1$ to the domain of $m_1$
722 $s$ :=
\ai[\tt]{ran
} $m$ &
725 $s$ :=
\ai[\tt]{range
} $m$ &
728 $m_2$ :=
\ai[\tt]{range
\_map} $m_1$ &
729 a map from a wrapped copy of $m_1$ to the range of $m_1$
731 $m$ :=
\ai[\tt]{identity
} $s$ &
732 identity relation on $s$
734 $q$ :=
\ai[\tt]{lattice
\_width} $s$ &
735 lattice width of the set $s$
737 $l$ :=
\ai[\tt]{lb
} $q$ &
739 lower bound on the piecewise quasipolynomial $q$ over
740 all integer points in the domain of $q$
741 and return a list containing the lower bound
742 and a boolean that is true if the lower bound
743 is known to be tight.
744 If the domain of $q$ wraps a map, then the lower
745 bound is computed over all integer points in
746 the range of the wrapped map instead.
748 $s_2$ :=
\ai[\tt]{lexmin
} $s_1$ &
749 lexicographically minimal element of $s_1$
751 $m_2$ :=
\ai[\tt]{lexmin
} $m_1$ &
752 lexicographically minimal image element
754 $s_2$ :=
\ai[\tt]{lexmax
} $s_1$ &
755 lexicographically maximal element of $s_1$
757 $m_2$ :=
\ai[\tt]{lexmax
} $m_1$ &
758 lexicographically maximal image element
760 $s_2$ :=
\ai[\tt]{lift
} $s_1$ &
761 lift $s_1$ to a space with extra dimensions corresponding
762 to the existentially quantified variables in $s_1$ such
763 that
\lstinline!domain(unwrap(lift S))! is equal to
\lstinline!S!
765 $s_2$ :=
\ai[\tt]{params
} $s_1$ &
766 parameter domain of set $s_1$
768 $s$ :=
\ai[\tt]{params
} $m$ &
769 parameter domain of map $m$
771 $l$ :=
\ai[\tt]{parse
\_file} $S$ &
772 parse the file names $S$ and return a list consisting of
773 the iteration domain, the must write access relation,
774 the may write access relation, the read access relation and
775 the original schedule.
776 This operation is only available if
\ai[\tt]{pet
}
777 support was compiled in.
779 $s_2$ :=
\ai[\tt]{poly
} $s_1$ & polyhedral hull of $s_1$
781 $m_2$ :=
\ai[\tt]{poly
} $m_1$ & polyhedral hull of $m_1$
783 $q_2$ :=
\ai[\tt]{poly
} $q_1$ & polynomial approximation of $q_1$
785 $q_2$ :=
\ai[\tt]{lpoly
} $q_1$ & polynomial underapproximation of $q_1$
787 $q_2$ :=
\ai[\tt]{upoly
} $q_1$ & polynomial overapproximation of $q_1$
789 $l$ :=
\ai[\tt]{pow
} $m$\ &
790 compute an overapproximation of the power
791 of $m$ and return a list containing the overapproximation
792 and a boolean that is true if the overapproximation
795 \ai[\tt]{print
} $o$ &
798 $o$ :=
\ai[\tt]{read
} {\tt "
}{\it filename
}{\tt"
} &
799 read object from file
801 $s_2$ :=
\ai[\tt]{sample
} $s_1$ &
802 a sample element of the set $s_1$
804 $m_2$ :=
\ai[\tt]{sample
} $m_1$ &
805 a sample element of the map $m_1$
807 $s_2$ :=
\ai[\tt]{scan
} $s_1$ &
808 the set $s_1$ split into individual elements,
809 provided $s_1$ contains a finite number of elements
811 $m_2$ :=
\ai[\tt]{scan
} $m_1$ &
812 the map $m_1$ split into individual elements,
813 provided $m_1$ contains a finite number of elements
815 \ai[\tt]{source
} {\tt "
}{\it filename
}{\tt"
} &
816 read commands from file
818 $q_2$ :=
\ai[\tt]{sum
} $q_1$ &
819 sum $q_1$ over all integer points in the domain of $q_1$,
820 or, if the domain of $q_1$ wraps a map, over all integer
821 points in the range of the wrapped map.
823 $S$ :=
\ai[\tt]{typeof
} $o$ &
824 a string representation of the type of $o$
826 $l$ :=
\ai[\tt]{ub
} $q$ &
828 upper bound on the piecewise quasipolynomial $q$ over
829 all integer points in the domain of $q$
830 and return a list containing the upper bound
831 and a boolean that is true if the upper bound
832 is known to be tight.
833 If the domain of $q$ wraps a map, then the upper
834 bound is computed over all integer points in
835 the range of the wrapped map instead.
837 $l$ :=
\ai[\tt]{vertices
} $s$ &
838 a list of vertices of the rational polytope defined by the same constraints
841 $s$ :=
\ai[\tt]{wrap
} $m$ &
842 wrap the map in a set
844 $m$ :=
\ai[\tt]{unwrap
} $s$ &
845 unwrap the map from the set
847 \ai[\tt]{write
} {\tt "
}{\it filename
}{\tt"
} $o$ &
850 $m_2$ :=
\ai[\tt]{zip
} $m_1$ &
851 the cross product of domain and range of $m_1$, i.e.,
852 $\
{\, (
\vec w
\to \vec y)
\to (
\vec x
\to \vec z)
853 \mid (
\vec w
\to \vec x)
\to (
\vec y
\to \vec z)
\in m_1 \,\
}$
855 $m_3$ :=
\ai[\tt]{any
} $m_1$
\ai[\tt]{before
} $m_2$
\ai[\tt]{under
} $t$ &
856 compute a map from any element $x$ in the domain of $m_1$
857 to any element $y$ in the domain of $m_2$
858 such that their images $m_1(x)$ and $m_2(y)$ overlap
859 and such that $x$ is scheduled before $y$ by $t$.
861 $m_4$ :=
\ai[\tt]{any
} $m_1$
\ai[\tt]{before
} $m_2$
\ai[\tt]{under
} $m_3$ &
862 same as the previous operation, with the schedule represented by a map.
864 $l$ :=
\ai[\tt]{last
} $m_1$
\ai[\tt]{before
} $m_2$
\ai[\tt]{under
} $t$ &
865 compute a map that contains for any element $y$ in the domain of $m_2$
866 a mapping from the last element $x$ in the domain of $m_1$
867 (according to the schedule $t$) to $y$
868 such that $m_1(x)$ and $m_2(y)$ overlap
869 and such that $x$ is scheduled before $y$ by $t$.
870 Return a list containing this map and the set of elements in the domain of
871 $m_2$ for which there is no corresponding element in the domain of $m_1$.
873 $l$ :=
\ai[\tt]{last
} $m_1$
\ai[\tt]{before
} $m_2$
\ai[\tt]{under
} $m_3$ &
874 same as the previous operation, with the schedule represented by a map.
876 $m_4$ :=
\ai[\tt]{any
} $m_1$
\ai[\tt]{last
} $m_2$
\ai[\tt]{before
} $m_3$
877 \ai[\tt]{under
} $t$ &
878 compute a map that contains for any element $y$ in the domain of $m_3$
879 a mapping from the last element $x$ in the domain of $m_2$
880 (according to the schedule $t$) to $y$
881 such that $m_2(x)$ and $m_3(y)$ overlap
882 and such that $x$ is scheduled before $y$ by $t$
883 as well as from any element $z$ in the domain of $m_1$ such that
884 $m_1(z)$ and $m_3(y)$ overlap,
885 $z$ is scheduled before $y$ by $t$
886 and such that there is no $x$ in the domain of $m_2$ with
887 $m_2(x)
\cap m_3(y)
\ne \emptyset$ and
888 $x$ scheduled between $z$ and $y$ by $t$.
890 $m_5$ :=
\ai[\tt]{any
} $m_1$
\ai[\tt]{last
} $m_2$
\ai[\tt]{before
} $m_3$
891 \ai[\tt]{under
} $m_4$ &
892 same as the previous operation, with the schedule represented by a map.
894 $m_3$ :=
\ai[\tt]{schedule
} $s$
\ai[\tt]{respecting
} $m_1$
\ai[\tt]{minimizing
} $m_2$ &
895 compute a schedule for the domains in $s$ that respects all dependences
896 in $m_1$ and tries to minimize the dependences in $m_2$.
898 $l$ :=
\ai[\tt]{schedule
\_forest} $s$
\ai[\tt]{respecting
} $m_1$
\ai[\tt]{minimizing
} $m_2$ &
899 compute a schedule for the domains in $s$ that respects all dependences
900 in $m_1$ and tries to minimize the dependences in $m_2$ and return
901 the forest of bands in the schedule.
903 $i_3$ := $i_1$
\ai{$+$
} $i_2$ & sum
905 $s_3$ := $s_1$
\ai{$+$
} $s_2$ & union
907 $m_3$ := $m_1$
\ai{$+$
} $m_2$ & union
909 $q_3$ := $q_1$
\ai{$+$
} $q_2$ & sum
911 $f_2$ := $f_1$
\ai{$+$
} $q$ & sum
913 $f_2$ := $q$
\ai{$+$
} $f_1$ & sum
915 $S_3$ := $S_1$
\ai{$+$
} $S_2$ & concatenation
917 $S_2$ := $o$
\ai{$+$
} $S_1$ &
918 concatenation of stringification of $o$ and $S_1$
920 $S_2$ := $S_1$
\ai{$+$
} $o$ &
921 concatenation of $S_1$ and stringification of $o$
923 $i_3$ := $i_1$
\ai{$-$
} $i_2$ & difference
925 $s_3$ := $s_1$
\ai{$-$
} $s_2$ & set difference
927 $m_3$ := $m_1$
\ai{$-$
} $m_2$ & set difference
929 $q_3$ := $q_1$
\ai{$-$
} $q_2$ & difference
931 $i_3$ := $i_1$
\ai{$*$
} $i_2$ & product
933 $s_3$ := $s_1$
\ai{$*$
} $s_2$ & intersection
935 $m_3$ := $m_1$
\ai{$*$
} $m_2$ & intersection
937 $q_2$ := $i$
\ai{$*$
} $q_1$ & product
939 $q_2$ := $q_1$
\ai{$*$
} $i$ & product
941 $q_3$ := $q_1$
\ai{$*$
} $q_2$ & product
943 $f_2$ := $i$
\ai{$*$
} $f_1$ & product
945 $f_2$ := $f_1$
\ai{$*$
} $i$ & product
947 $m_2$ := $m_1$
\ai{$*$
} $s$ & intersect domain of $m_1$ with $s$
949 $q_2$ := $q_1$
\ai{$*$
} $s$ & intersect domain of $q_1$ with $s$
951 $f_2$ := $f_1$
\ai{$*$
} $s$ & intersect domain of $f_1$ with $s$
953 $s_2$ := $m$($s_1$) & apply map $m$ to set $s_1$
955 $q_2$ := $q_1$($s$) & apply $q_1$ to each element in $s$ and compute
956 the sum of the results
958 $l$ := $f$($s$) & apply $f$ to each element in $s$, compute
959 a bound of the results
960 and return a list containing the bound
961 and a boolean that is true if the bound
962 is known to be tight.
964 $m_3$ := $m_1$
\ai[\tt]{.
} $m_2$ & join of $m_1$ and $m_2$
966 $m_3$ := $m_1$
\ai[\tt]{before
} $m_2$ & join of $m_1$ and $m_2$
968 $m_3$ := $m_2$($m_1)$ & join of $m_1$ and $m_2$
970 $m_3$ := $m_2$
\ai[\tt]{after
} $m_1$ & join of $m_1$ and $m_2$
972 $f_3$ := $f_1$
\ai[\tt]{.
} $f_2$ & join of $f_1$ and $f_2$, combining
973 the lists of quasipolynomials over shared domains
975 $q_2$ := $m$
\ai[\tt]{.
} $q_1$ & join of $m$ and $q_1$, taking the sum
976 over all elements in the intersection of the range of $m$ and the domain
979 $q_2$ := $m$
\ai[\tt]{before
} $q_1$ & $q_2$ := $m$
\ai[\tt]{.
} $q_1$
981 $q_2$ := $q_1(m)$ & $q_2$ := $m$
\ai[\tt]{.
} $q_1$
983 $q_2$ := $q_1$
\ai[\tt]{after
} $m$ & $q_2$ := $m$
\ai[\tt]{.
} $q_1$
985 $l$ := $m$
\ai[\tt]{.
} $f$ & join of $m$ and $f$, computing a bound
986 over all elements in the intersection of the range of $m$ and the domain
987 of $f$ and returning a list containing the bound
988 and a boolean that is true if the bound is known to be tight.
990 $l$ := $m$
\ai[\tt]{before
} $f$ & $l$ := $m$
\ai[\tt]{.
} $f$
992 $l$ := $f(m)$ & $l$ := $m$
\ai[\tt]{.
} $f$
994 $l$ := $f$
\ai[\tt]{after
} $m$ & $l$ := $m$
\ai[\tt]{.
} $f$
996 $m$ := $s_1$
\ai[\tt]{->
} $s_2$ & universal map with domain $s_1$
999 $q_2$ := $q_1$
\ai{@
} $s$ &
1000 evaluate the piecewise quasipolynomial $q_1$ in each element
1001 of the set $s$ and return a piecewise quasipolynomial
1002 mapping each of the individual elements to the resulting
1005 $q$ := $f$
\ai{@
} $s$ &
1006 evaluate the piecewise quasipolynomial fold $f$ in each element
1007 of the set $s$ and return a piecewise quasipolynomial
1008 mapping each of the individual elements to the resulting
1011 $s_3$ := $s_1$
\ai[\tt]{\%
} $s_2$ &
1012 simplify $s_1$ in the context of $s_2$, i.e., compute
1013 the gist of $s_1$ given $s_2$
1015 $m_3$ := $m_1$
\ai[\tt]{\%
} $m_2$ &
1016 simplify $m_1$ in the context of $m_2$, i.e., compute
1017 the gist of $m_1$ given $m_2$
1019 $m_2$ := $m_1$
\ai[\tt]{\%
} $s$ &
1020 simplify $m_1$ in the context of the domain $s$, i.e., compute
1021 the gist of $m_1$ given domain $s$
1023 $q_2$ := $q_1$
\ai[\tt]{\%
} $s$ &
1024 simplify $q_1$ in the context of the domain $s$, i.e., compute
1025 the gist of $q_1$ given $s$
1027 $f_2$ := $f_1$
\ai[\tt]{\%
} $s$ &
1028 simplify $f_1$ in the context of the domain $s$, i.e., compute
1029 the gist of $f_1$ given $s$
1031 $m_2$ := $m_1$
\ai[\tt]{\^
{}}i & the $i$th power of $m_1$;
1032 if $i$ is negative then the result is the ($-i$)th power of the inverse
1035 $l$ := $m$
\ai[\tt]{\^
{}+
} &
1036 compute an overapproximation of the transitive closure
1037 of $m$ and return a list containing the overapproximation
1038 and a boolean that is true if the overapproximation
1039 is known to be exact
1042 the element at position $i$ in the list $l$
1044 $b$ := $q_1$
\ai[\tt]{==
} $q_2$ & is $q_1$ obviously equal to $q_2$?
1046 $b$ := $f_1$
\ai[\tt]{==
} $f_2$ & is $f_1$ obviously equal to $f_2$?
1048 $b$ := $s_1$
\ai[\tt]{=
} $s_2$ & is $s_1$ equal to $s_2$?
1050 $b$ := $m_1$
\ai[\tt]{=
} $m_2$ & is $m_1$ equal to $m_2$?
1052 $b$ := $S_1$
\ai[\tt]{=
} $S_2$ & is $S_1$ equal to $S_2$?
1054 $b$ := $s_1$
\ai[\tt]{<=
} $s_2$ & is $s_1$ a subset of $s_2$?
1056 $b$ := $m_1$
\ai[\tt]{<=
} $m_2$ & is $m_1$ a subset of $m_2$?
1058 $b$ := $s_1$
\ai[\tt]{<
} $s_2$ & is $s_1$ a proper subset of $s_2$?
1060 $b$ := $m_1$
\ai[\tt]{<
} $m_2$ & is $m_1$ a proper subset of $m_2$?
1062 $b$ := $s_1$
\ai[\tt]{>=
} $s_2$ & is $s_1$ a superset of $s_2$?
1064 $b$ := $m_1$
\ai[\tt]{>=
} $m_2$ & is $m_1$ a superset of $m_2$?
1066 $b$ := $s_1$
\ai[\tt]{>
} $s_2$ & is $s_1$ a proper superset of $s_2$?
1068 $b$ := $m_1$
\ai[\tt]{>
} $m_2$ & is $m_1$ a proper superset of $m_2$?
1070 $m$ := $s_1$
\ai[\tt]{<<
} $s_2$ & a map from
1071 $s_1$ to $s_2$ of those elements that live in the same space and
1072 such that the elements of $s_1$ are lexicographically strictly smaller
1073 than those of $s_2$.
1075 $m_3$ := $m_1$
\ai[\tt]{<<
} $m_2$ & a map from the domain of
1076 $m_1$ to the domain of $m_2$ of those elements such that their images
1077 live in the same space and such that the images of the elements of
1078 $m_1$ are lexicographically strictly smaller than those of $m_2$.
1080 $m$ := $s_1$
\ai[\tt]{<<=
} $s_2$ & a map from
1081 $s_1$ to $s_2$ of those elements that live in the same space and
1082 such that the elements of $s_1$ are lexicographically smaller
1083 than those of $s_2$.
1085 $m_3$ := $m_1$
\ai[\tt]{<<=
} $m_2$ & a map from the domain of
1086 $m_1$ to the domain of $m_2$ of those elements such that their images
1087 live in the same space and such that the images of the elements of
1088 $m_1$ are lexicographically smaller than those of $m_2$.
1090 $m$ := $s_1$
\ai[\tt]{>>
} $s_2$ & a map from
1091 $s_1$ to $s_2$ of those elements that live in the same space and
1092 such that the elements of $s_1$ are lexicographically strictly greater
1093 than those of $s_2$.
1095 $m_3$ := $m_1$
\ai[\tt]{>>
} $m_2$ & a map from the domain of
1096 $m_1$ to the domain of $m_2$ of those elements such that their images
1097 live in the same space and such that the images of the elements of
1098 $m_1$ are lexicographically strictly greater than those of $m_2$.
1100 $m$ := $s_1$
\ai[\tt]{>>=
} $s_2$ & a map from
1101 $s_1$ to $s_2$ of those elements that live in the same space and
1102 such that the elements of $s_1$ are lexicographically greater
1103 than those of $s_2$.
1105 $m_3$ := $m_1$
\ai[\tt]{>>=
} $m_2$ & a map from the domain of
1106 $m_1$ to the domain of $m_2$ of those elements such that their images
1107 live in the same space and such that the images of the elements of
1108 $m_1$ are lexicographically greater than those of $m_2$.