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