isl_printer.c: add missing includes
[isl.git] / doc / user.pod
blob23487d7c1b368e64028e2c5c53175f293c0039ec
1 =head1 Introduction
3 C<isl> is a thread-safe C library for manipulating
4 sets and relations of integer points bounded by affine constraints.
5 The descriptions of the sets and relations may involve
6 both parameters and existentially quantified variables.
7 All computations are performed in exact integer arithmetic
8 using C<GMP> or C<imath>.
9 The C<isl> library offers functionality that is similar
10 to that offered by the C<Omega> and C<Omega+> libraries,
11 but the underlying algorithms are in most cases completely different.
13 The library is by no means complete and some fairly basic
14 functionality is still missing.
15 Still, even in its current form, the library has been successfully
16 used as a backend polyhedral library for the polyhedral
17 scanner C<CLooG> and as part of an equivalence checker of
18 static affine programs.
19 For bug reports, feature requests and questions,
20 visit the discussion group at
21 L<http://groups.google.com/group/isl-development>.
23 =head2 Backward Incompatible Changes
25 =head3 Changes since isl-0.02
27 =over
29 =item * The old printing functions have been deprecated
30 and replaced by C<isl_printer> functions, see L<Input and Output>.
32 =item * Most functions related to dependence analysis have acquired
33 an extra C<must> argument.  To obtain the old behavior, this argument
34 should be given the value 1.  See L<Dependence Analysis>.
36 =back
38 =head3 Changes since isl-0.03
40 =over
42 =item * The function C<isl_pw_qpolynomial_fold_add> has been
43 renamed to C<isl_pw_qpolynomial_fold_fold>.
44 Similarly, C<isl_union_pw_qpolynomial_fold_add> has been
45 renamed to C<isl_union_pw_qpolynomial_fold_fold>.
47 =back
49 =head3 Changes since isl-0.04
51 =over
53 =item * All header files have been renamed from C<isl_header.h>
54 to C<isl/header.h>.
56 =back
58 =head3 Changes since isl-0.05
60 =over
62 =item * The functions C<isl_printer_print_basic_set> and
63 C<isl_printer_print_basic_map> no longer print a newline.
65 =item * The functions C<isl_flow_get_no_source>
66 and C<isl_union_map_compute_flow> now return
67 the accesses for which no source could be found instead of
68 the iterations where those accesses occur.
70 =item * The functions C<isl_basic_map_identity> and
71 C<isl_map_identity> now take a B<map> space as input.  An old call
72 C<isl_map_identity(space)> can be rewritten to
73 C<isl_map_identity(isl_space_map_from_set(space))>.
75 =item * The function C<isl_map_power> no longer takes
76 a parameter position as input.  Instead, the exponent
77 is now expressed as the domain of the resulting relation.
79 =back
81 =head3 Changes since isl-0.06
83 =over
85 =item * The format of C<isl_printer_print_qpolynomial>'s
86 C<ISL_FORMAT_ISL> output has changed.
87 Use C<ISL_FORMAT_C> to obtain the old output.
89 =item * The C<*_fast_*> functions have been renamed to C<*_plain_*>.
90 Some of the old names have been kept for backward compatibility,
91 but they will be removed in the future.
93 =back
95 =head3 Changes since isl-0.07
97 =over
99 =item * The function C<isl_pw_aff_max> has been renamed to
100 C<isl_pw_aff_union_max>.
101 Similarly, the function C<isl_pw_aff_add> has been renamed to
102 C<isl_pw_aff_union_add>.
104 =item * The C<isl_dim> type has been renamed to C<isl_space>
105 along with the associated functions.
106 Some of the old names have been kept for backward compatibility,
107 but they will be removed in the future.
109 =item * Spaces of maps, sets and parameter domains are now
110 treated differently.  The distinction between map spaces and set spaces
111 has always been made on a conceptual level, but proper use of such spaces
112 was never checked.  Furthermore, up until isl-0.07 there was no way
113 of explicitly creating a parameter space.  These can now be created
114 directly using C<isl_space_params_alloc> or from other spaces using
115 C<isl_space_params>.
117 =item * The space in which C<isl_aff>, C<isl_pw_aff>, C<isl_qpolynomial>,
118 C<isl_pw_qpolynomial>, C<isl_qpolynomial_fold> and C<isl_pw_qpolynomial_fold>
119 objects live is now a map space
120 instead of a set space.  This means, for example, that the dimensions
121 of the domain of an C<isl_aff> are now considered to be of type
122 C<isl_dim_in> instead of C<isl_dim_set>.  Extra functions have been
123 added to obtain the domain space.  Some of the constructors still
124 take a domain space and have therefore been renamed.
126 =item * The functions C<isl_equality_alloc> and C<isl_inequality_alloc>
127 now take an C<isl_local_space> instead of an C<isl_space>.
128 An C<isl_local_space> can be created from an C<isl_space>
129 using C<isl_local_space_from_space>.
131 =item * The C<isl_div> type has been removed.  Functions that used
132 to return an C<isl_div> now return an C<isl_aff>.
133 Note that the space of an C<isl_aff> is that of relation.
134 When replacing a call to C<isl_div_get_coefficient> by a call to
135 C<isl_aff_get_coefficient> any C<isl_dim_set> argument needs
136 to be replaced by C<isl_dim_in>.
137 A call to C<isl_aff_from_div> can be replaced by a call
138 to C<isl_aff_floor>.
139 A call to C<isl_qpolynomial_div(div)> call be replaced by
140 the nested call
142         isl_qpolynomial_from_aff(isl_aff_floor(div))
144 The function C<isl_constraint_div> has also been renamed
145 to C<isl_constraint_get_div>.
147 =item * The C<nparam> argument has been removed from
148 C<isl_map_read_from_str> and similar functions.
149 When reading input in the original PolyLib format,
150 the result will have no parameters.
151 If parameters are expected, the caller may want to perform
152 dimension manipulation on the result.
154 =back
156 =head3 Changes since isl-0.09
158 =over
160 =item * The C<schedule_split_parallel> option has been replaced
161 by the C<schedule_split_scaled> option.
163 =item * The first argument of C<isl_pw_aff_cond> is now
164 an C<isl_pw_aff> instead of an C<isl_set>.
165 A call C<isl_pw_aff_cond(a, b, c)> can be replaced by
167         isl_pw_aff_cond(isl_set_indicator_function(a), b, c)
169 =back
171 =head3 Changes since isl-0.10
173 =over
175 =item * The functions C<isl_set_dim_has_lower_bound> and
176 C<isl_set_dim_has_upper_bound> have been renamed to
177 C<isl_set_dim_has_any_lower_bound> and
178 C<isl_set_dim_has_any_upper_bound>.
179 The new C<isl_set_dim_has_lower_bound> and
180 C<isl_set_dim_has_upper_bound> have slightly different meanings.
182 =back
184 =head3 Changes since isl-0.12
186 =over
188 =item * C<isl_int> has been replaced by C<isl_val>.
189 Some of the old functions are still available in C<isl/deprecated/*.h>
190 but they will be removed in the future.
192 =item * The functions C<isl_pw_qpolynomial_eval>,
193 C<isl_union_pw_qpolynomial_eval>, C<isl_pw_qpolynomial_fold_eval>
194 and C<isl_union_pw_qpolynomial_fold_eval> have been changed to return
195 an C<isl_val> instead of an C<isl_qpolynomial>.
197 =item * The function C<isl_band_member_is_zero_distance>
198 has been removed.  Essentially the same functionality is available
199 through C<isl_band_member_is_coincident>, except that it requires
200 setting up coincidence constraints.
201 The option C<schedule_outer_zero_distance> has accordingly been
202 replaced by the option C<schedule_outer_coincidence>.
204 =item * The function C<isl_vertex_get_expr> has been changed
205 to return an C<isl_multi_aff> instead of a rational C<isl_basic_set>.
206 The function C<isl_vertex_get_domain> has been changed to return
207 a regular basic set, rather than a rational basic set.
209 =back
211 =head3 Changes since isl-0.14
213 =over
215 =item * The function C<isl_union_pw_multi_aff_add> now consistently
216 computes the sum on the shared definition domain.
217 The function C<isl_union_pw_multi_aff_union_add> has been added
218 to compute the sum on the union of definition domains.
219 The original behavior of C<isl_union_pw_multi_aff_add> was
220 confused and is no longer available.
222 =item * Band forests have been replaced by schedule trees.
224 =item * The function C<isl_union_map_compute_flow> has been
225 replaced by the function C<isl_union_access_info_compute_flow>.
226 Note that the may dependence relation returned by
227 C<isl_union_flow_get_may_dependence> is the union of
228 the two dependence relations returned by
229 C<isl_union_map_compute_flow>.  Similarly for the no source relations.
230 The function C<isl_union_map_compute_flow> is still available
231 for backward compatibility, but it will be removed in the future.
233 =item * The function C<isl_basic_set_drop_constraint> has been
234 deprecated.
236 =item * The function C<isl_ast_build_ast_from_schedule> has been
237 renamed to C<isl_ast_build_node_from_schedule_map>.
238 The original name is still available
239 for backward compatibility, but it will be removed in the future.
241 =item * The C<separation_class> AST generation option has been
242 deprecated.
244 =item * The functions C<isl_equality_alloc> and C<isl_inequality_alloc>
245 have been renamed to C<isl_constraint_alloc_equality> and
246 C<isl_constraint_alloc_inequality>.  The original names have been
247 kept for backward compatibility, but they will be removed in the future.
249 =item * The C<schedule_fuse> option has been replaced
250 by the C<schedule_serialize_sccs> option.  The effect
251 of setting the C<schedule_fuse> option to C<ISL_SCHEDULE_FUSE_MIN>
252 is now obtained by turning on the C<schedule_serialize_sccs> option.
254 =back
256 =head3 Changes since isl-0.17
258 =over
260 =item * The function C<isl_printer_print_ast_expr> no longer prints
261 in C format by default.  To print in C format, the output format
262 of the printer needs to have been explicitly set to C<ISL_FORMAT_C>.
263 As a result, the function C<isl_ast_expr_to_str> no longer prints
264 the expression in C format.  Use C<isl_ast_expr_to_C_str> instead.
266 =item * The functions C<isl_set_align_divs> and C<isl_map_align_divs>
267 have been deprecated.  The function C<isl_set_lift> has an effect
268 that is similar to C<isl_set_align_divs> and could in some cases
269 be used as an alternative.
271 =back
273 =head3 Changes since isl-0.19
275 =over
277 =item * Zero-dimensional objects of type C<isl_multi_pw_aff> or
278 C<isl_multi_union_pw_aff> can now keep track of an explicit domain.
279 This explicit domain, if present, is taken into account
280 by various operations that take such objects as input.
282 =back
284 =head1 License
286 C<isl> is released under the MIT license.
288 =over
290 Permission is hereby granted, free of charge, to any person obtaining a copy of
291 this software and associated documentation files (the "Software"), to deal in
292 the Software without restriction, including without limitation the rights to
293 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
294 of the Software, and to permit persons to whom the Software is furnished to do
295 so, subject to the following conditions:
297 The above copyright notice and this permission notice shall be included in all
298 copies or substantial portions of the Software.
300 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
301 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
302 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
303 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
304 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
305 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
306 SOFTWARE.
308 =back
310 Note that by default C<isl> requires C<GMP>, which is released
311 under the GNU Lesser General Public License (LGPL).  This means
312 that code linked against C<isl> is also linked against LGPL code.
314 When configuring with C<--with-int=imath> or C<--with-int=imath-32>, C<isl>
315 will link against C<imath>, a library for exact integer arithmetic released
316 under the MIT license.
318 =head1 Installation
320 The source of C<isl> can be obtained either as a tarball
321 or from the git repository.  Both are available from
322 L<http://isl.gforge.inria.fr/>.
323 The installation process depends on how you obtained
324 the source.
326 =head2 Installation from the git repository
328 =over
330 =item 1 Clone or update the repository
332 The first time the source is obtained, you need to clone
333 the repository.
335         git clone git://repo.or.cz/isl.git
337 To obtain updates, you need to pull in the latest changes
339         git pull
341 =item 2 Optionally get C<imath> submodule
343 To build C<isl> with C<imath>, you need to obtain the C<imath>
344 submodule by running in the git source tree of C<isl>
346        git submodule init
347        git submodule update
349 This will fetch the required version of C<imath> in a subdirectory of C<isl>.
351 =item 2 Generate C<configure>
353         ./autogen.sh
355 =back
357 After performing the above steps, continue
358 with the L<Common installation instructions>.
360 =head2 Common installation instructions
362 =over
364 =item 1 Obtain C<GMP>
366 By default, building C<isl> requires C<GMP>, including its headers files.
367 Your distribution may not provide these header files by default
368 and you may need to install a package called C<gmp-devel> or something
369 similar.  Alternatively, C<GMP> can be built from
370 source, available from L<http://gmplib.org/>.
371 C<GMP> is not needed if you build C<isl> with C<imath>.
373 =item 2 Configure
375 C<isl> uses the standard C<autoconf> C<configure> script.
376 To run it, just type
378         ./configure
380 optionally followed by some configure options.
381 A complete list of options can be obtained by running
383         ./configure --help
385 Below we discuss some of the more common options.
387 =over
389 =item C<--prefix>
391 Installation prefix for C<isl>
393 =item C<--with-int=[gmp|imath|imath-32]>
395 Select the integer library to be used by C<isl>, the default is C<gmp>.
396 With C<imath-32>, C<isl> will use 32 bit integers, but fall back to C<imath>
397 for values out of the 32 bit range. In most applications, C<isl> will run
398 fastest with the C<imath-32> option, followed by C<gmp> and C<imath>, the
399 slowest.
401 =item C<--with-gmp-prefix>
403 Installation prefix for C<GMP> (architecture-independent files).
405 =item C<--with-gmp-exec-prefix>
407 Installation prefix for C<GMP> (architecture-dependent files).
409 =back
411 =item 3 Compile
413         make
415 =item 4 Install (optional)
417         make install
419 =back
421 =head1 Integer Set Library
423 =head2 Memory Management
425 Since a high-level operation on isl objects usually involves
426 several substeps and since the user is usually not interested in
427 the intermediate results, most functions that return a new object
428 will also release all the objects passed as arguments.
429 If the user still wants to use one or more of these arguments
430 after the function call, she should pass along a copy of the
431 object rather than the object itself.
432 The user is then responsible for making sure that the original
433 object gets used somewhere else or is explicitly freed.
435 The arguments and return values of all documented functions are
436 annotated to make clear which arguments are released and which
437 arguments are preserved.  In particular, the following annotations
438 are used
440 =over
442 =item C<__isl_give>
444 C<__isl_give> means that a new object is returned.
445 The user should make sure that the returned pointer is
446 used exactly once as a value for an C<__isl_take> argument.
447 In between, it can be used as a value for as many
448 C<__isl_keep> arguments as the user likes.
449 There is one exception, and that is the case where the
450 pointer returned is C<NULL>.  Is this case, the user
451 is free to use it as an C<__isl_take> argument or not.
452 When applied to a C<char *>, the returned pointer needs to be
453 freed using C<free>.
455 =item C<__isl_null>
457 C<__isl_null> means that a C<NULL> value is returned.
459 =item C<__isl_take>
461 C<__isl_take> means that the object the argument points to
462 is taken over by the function and may no longer be used
463 by the user as an argument to any other function.
464 The pointer value must be one returned by a function
465 returning an C<__isl_give> pointer.
466 If the user passes in a C<NULL> value, then this will
467 be treated as an error in the sense that the function will
468 not perform its usual operation.  However, it will still
469 make sure that all the other C<__isl_take> arguments
470 are released.
472 =item C<__isl_keep>
474 C<__isl_keep> means that the function will only use the object
475 temporarily.  After the function has finished, the user
476 can still use it as an argument to other functions.
477 A C<NULL> value will be treated in the same way as
478 a C<NULL> value for an C<__isl_take> argument.
479 This annotation may also be used on return values of
480 type C<const char *>, in which case the returned pointer should
481 not be freed by the user and is only valid until the object
482 from which it was derived is updated or freed.
484 =back
486 =head2 Initialization
488 All manipulations of integer sets and relations occur within
489 the context of an C<isl_ctx>.
490 A given C<isl_ctx> can only be used within a single thread.
491 All arguments of a function are required to have been allocated
492 within the same context.
493 There are currently no functions available for moving an object
494 from one C<isl_ctx> to another C<isl_ctx>.  This means that
495 there is currently no way of safely moving an object from one
496 thread to another, unless the whole C<isl_ctx> is moved.
498 An C<isl_ctx> can be allocated using C<isl_ctx_alloc> and
499 freed using C<isl_ctx_free>.
500 All objects allocated within an C<isl_ctx> should be freed
501 before the C<isl_ctx> itself is freed.
503         isl_ctx *isl_ctx_alloc();
504         void isl_ctx_free(isl_ctx *ctx);
506 The user can impose a bound on the number of low-level I<operations>
507 that can be performed by an C<isl_ctx>.  This bound can be set and
508 retrieved using the following functions.  A bound of zero means that
509 no bound is imposed.  The number of operations performed can be
510 reset using C<isl_ctx_reset_operations>.  Note that the number
511 of low-level operations needed to perform a high-level computation
512 may differ significantly across different versions
513 of C<isl>, but it should be the same across different platforms
514 for the same version of C<isl>.
516 Warning: This feature is experimental.  C<isl> has good support to abort and
517 bail out during the computation, but this feature may exercise error code paths
518 that are normally not used that much. Consequently, it is not unlikely that
519 hidden bugs will be exposed.
521         void isl_ctx_set_max_operations(isl_ctx *ctx,
522                 unsigned long max_operations);
523         unsigned long isl_ctx_get_max_operations(isl_ctx *ctx);
524         void isl_ctx_reset_operations(isl_ctx *ctx);
526 In order to be able to create an object in the same context
527 as another object, most object types (described later in
528 this document) provide a function to obtain the context
529 in which the object was created.
531         #include <isl/val.h>
532         isl_ctx *isl_val_get_ctx(__isl_keep isl_val *val);
533         isl_ctx *isl_multi_val_get_ctx(
534                 __isl_keep isl_multi_val *mv);
536         #include <isl/id.h>
537         isl_ctx *isl_id_get_ctx(__isl_keep isl_id *id);
539         #include <isl/local_space.h>
540         isl_ctx *isl_local_space_get_ctx(
541                 __isl_keep isl_local_space *ls);
543         #include <isl/set.h>
544         isl_ctx *isl_set_list_get_ctx(
545                 __isl_keep isl_set_list *list);
547         #include <isl/aff.h>
548         isl_ctx *isl_aff_get_ctx(__isl_keep isl_aff *aff);
549         isl_ctx *isl_multi_aff_get_ctx(
550                 __isl_keep isl_multi_aff *maff);
551         isl_ctx *isl_pw_aff_get_ctx(__isl_keep isl_pw_aff *pa);
552         isl_ctx *isl_pw_multi_aff_get_ctx(
553                 __isl_keep isl_pw_multi_aff *pma);
554         isl_ctx *isl_multi_pw_aff_get_ctx(
555                 __isl_keep isl_multi_pw_aff *mpa);
556         isl_ctx *isl_union_pw_aff_get_ctx(
557                 __isl_keep isl_union_pw_aff *upa);
558         isl_ctx *isl_union_pw_multi_aff_get_ctx(
559                 __isl_keep isl_union_pw_multi_aff *upma);
560         isl_ctx *isl_multi_union_pw_aff_get_ctx(
561                 __isl_keep isl_multi_union_pw_aff *mupa);
563         #include <isl/id_to_ast_expr.h>
564         isl_ctx *isl_id_to_ast_expr_get_ctx(
565                 __isl_keep isl_id_to_ast_expr *id2expr);
567         #include <isl/point.h>
568         isl_ctx *isl_point_get_ctx(__isl_keep isl_point *pnt);
570         #include <isl/vec.h>
571         isl_ctx *isl_vec_get_ctx(__isl_keep isl_vec *vec);
573         #include <isl/mat.h>
574         isl_ctx *isl_mat_get_ctx(__isl_keep isl_mat *mat);
576         #include <isl/vertices.h>
577         isl_ctx *isl_vertices_get_ctx(
578                 __isl_keep isl_vertices *vertices);
579         isl_ctx *isl_vertex_get_ctx(__isl_keep isl_vertex *vertex);
580         isl_ctx *isl_cell_get_ctx(__isl_keep isl_cell *cell);
582         #include <isl/flow.h>
583         isl_ctx *isl_restriction_get_ctx(
584                 __isl_keep isl_restriction *restr);
585         isl_ctx *isl_union_access_info_get_ctx(
586                 __isl_keep isl_union_access_info *access);
587         isl_ctx *isl_union_flow_get_ctx(
588                 __isl_keep isl_union_flow *flow);
590         #include <isl/schedule.h>
591         isl_ctx *isl_schedule_get_ctx(
592                 __isl_keep isl_schedule *sched);
593         isl_ctx *isl_schedule_constraints_get_ctx(
594                 __isl_keep isl_schedule_constraints *sc);
596         #include <isl/schedule_node.h>
597         isl_ctx *isl_schedule_node_get_ctx(
598                 __isl_keep isl_schedule_node *node);
600         #include <isl/ast_build.h>
601         isl_ctx *isl_ast_build_get_ctx(
602                 __isl_keep isl_ast_build *build);
604         #include <isl/ast.h>
605         isl_ctx *isl_ast_expr_get_ctx(
606                 __isl_keep isl_ast_expr *expr);
607         isl_ctx *isl_ast_node_get_ctx(
608                 __isl_keep isl_ast_node *node);
610 =head2 Return Types
612 C<isl> uses two special return types for functions that either return
613 a boolean or that in principle do not return anything.
614 In particular, the C<isl_bool> type has three possible values:
615 C<isl_bool_true> (a positive integer value), indicating I<true> or I<yes>;
616 C<isl_bool_false> (the integer value zero), indicating I<false> or I<no>; and
617 C<isl_bool_error> (a negative integer value), indicating that something
618 went wrong.  The following function can be used to negate an C<isl_bool>,
619 where the negation of C<isl_bool_error> is C<isl_bool_error> again.
621         #include <isl/val.h>
622         isl_bool isl_bool_not(isl_bool b);
624 The C<isl_stat> type has two possible values:
625 C<isl_stat_ok> (the integer value zero), indicating a successful
626 operation; and
627 C<isl_stat_error> (a negative integer value), indicating that something
628 went wrong.
629 See L</"Error Handling"> for more information on
630 C<isl_bool_error> and C<isl_stat_error>.
632 =head2 Values
634 An C<isl_val> represents an integer value, a rational value
635 or one of three special values, infinity, negative infinity and NaN.
636 Some predefined values can be created using the following functions.
638         #include <isl/val.h>
639         __isl_give isl_val *isl_val_zero(isl_ctx *ctx);
640         __isl_give isl_val *isl_val_one(isl_ctx *ctx);
641         __isl_give isl_val *isl_val_negone(isl_ctx *ctx);
642         __isl_give isl_val *isl_val_nan(isl_ctx *ctx);
643         __isl_give isl_val *isl_val_infty(isl_ctx *ctx);
644         __isl_give isl_val *isl_val_neginfty(isl_ctx *ctx);
646 Specific integer values can be created using the following functions.
648         #include <isl/val.h>
649         __isl_give isl_val *isl_val_int_from_si(isl_ctx *ctx,
650                 long i);
651         __isl_give isl_val *isl_val_int_from_ui(isl_ctx *ctx,
652                 unsigned long u);
653         __isl_give isl_val *isl_val_int_from_chunks(isl_ctx *ctx,
654                 size_t n, size_t size, const void *chunks);
656 The function C<isl_val_int_from_chunks> constructs an C<isl_val>
657 from the C<n> I<digits>, each consisting of C<size> bytes, stored at C<chunks>.
658 The least significant digit is assumed to be stored first.
660 Value objects can be copied and freed using the following functions.
662         #include <isl/val.h>
663         __isl_give isl_val *isl_val_copy(__isl_keep isl_val *v);
664         __isl_null isl_val *isl_val_free(__isl_take isl_val *v);
666 They can be inspected using the following functions.
668         #include <isl/val.h>
669         long isl_val_get_num_si(__isl_keep isl_val *v);
670         long isl_val_get_den_si(__isl_keep isl_val *v);
671         __isl_give isl_val *isl_val_get_den_val(
672                 __isl_keep isl_val *v);
673         double isl_val_get_d(__isl_keep isl_val *v);
674         size_t isl_val_n_abs_num_chunks(__isl_keep isl_val *v,
675                 size_t size);
676         int isl_val_get_abs_num_chunks(__isl_keep isl_val *v,
677                 size_t size, void *chunks);
679 C<isl_val_n_abs_num_chunks> returns the number of I<digits>
680 of C<size> bytes needed to store the absolute value of the
681 numerator of C<v>.
682 C<isl_val_get_abs_num_chunks> stores these digits at C<chunks>,
683 which is assumed to have been preallocated by the caller.
684 The least significant digit is stored first.
685 Note that C<isl_val_get_num_si>, C<isl_val_get_den_si>,
686 C<isl_val_get_d>, C<isl_val_n_abs_num_chunks>
687 and C<isl_val_get_abs_num_chunks> can only be applied to rational values.
689 An C<isl_val> can be modified using the following function.
691         #include <isl/val.h>
692         __isl_give isl_val *isl_val_set_si(__isl_take isl_val *v,
693                 long i);
695 The following unary properties are defined on C<isl_val>s.
697         #include <isl/val.h>
698         int isl_val_sgn(__isl_keep isl_val *v);
699         isl_bool isl_val_is_zero(__isl_keep isl_val *v);
700         isl_bool isl_val_is_one(__isl_keep isl_val *v);
701         isl_bool isl_val_is_negone(__isl_keep isl_val *v);
702         isl_bool isl_val_is_nonneg(__isl_keep isl_val *v);
703         isl_bool isl_val_is_nonpos(__isl_keep isl_val *v);
704         isl_bool isl_val_is_pos(__isl_keep isl_val *v);
705         isl_bool isl_val_is_neg(__isl_keep isl_val *v);
706         isl_bool isl_val_is_int(__isl_keep isl_val *v);
707         isl_bool isl_val_is_rat(__isl_keep isl_val *v);
708         isl_bool isl_val_is_nan(__isl_keep isl_val *v);
709         isl_bool isl_val_is_infty(__isl_keep isl_val *v);
710         isl_bool isl_val_is_neginfty(__isl_keep isl_val *v);
712 Note that the sign of NaN is undefined.
714 The following binary properties are defined on pairs of C<isl_val>s.
716         #include <isl/val.h>
717         isl_bool isl_val_lt(__isl_keep isl_val *v1,
718                 __isl_keep isl_val *v2);
719         isl_bool isl_val_le(__isl_keep isl_val *v1,
720                 __isl_keep isl_val *v2);
721         isl_bool isl_val_gt(__isl_keep isl_val *v1,
722                 __isl_keep isl_val *v2);
723         isl_bool isl_val_ge(__isl_keep isl_val *v1,
724                 __isl_keep isl_val *v2);
725         isl_bool isl_val_eq(__isl_keep isl_val *v1,
726                 __isl_keep isl_val *v2);
727         isl_bool isl_val_ne(__isl_keep isl_val *v1,
728                 __isl_keep isl_val *v2);
729         isl_bool isl_val_abs_eq(__isl_keep isl_val *v1,
730                 __isl_keep isl_val *v2);
732 Comparisons to NaN always return false.
733 That is, a NaN is not considered to hold any relative position
734 with respect to any value.  In particular, a NaN
735 is neither considered to be equal to nor to be different from
736 any value (including another NaN).
737 The function C<isl_val_abs_eq> checks whether its two arguments
738 are equal in absolute value.
740 For integer C<isl_val>s we additionally have the following binary property.
742         #include <isl/val.h>
743         isl_bool isl_val_is_divisible_by(__isl_keep isl_val *v1,
744                 __isl_keep isl_val *v2);
746 An C<isl_val> can also be compared to an integer using the following
747 function.  The result is undefined for NaN.
749         #include <isl/val.h>
750         int isl_val_cmp_si(__isl_keep isl_val *v, long i);
752 The following unary operations are available on C<isl_val>s.
754         #include <isl/val.h>
755         __isl_give isl_val *isl_val_abs(__isl_take isl_val *v);
756         __isl_give isl_val *isl_val_neg(__isl_take isl_val *v);
757         __isl_give isl_val *isl_val_floor(__isl_take isl_val *v);
758         __isl_give isl_val *isl_val_ceil(__isl_take isl_val *v);
759         __isl_give isl_val *isl_val_trunc(__isl_take isl_val *v);
760         __isl_give isl_val *isl_val_inv(__isl_take isl_val *v);
761         __isl_give isl_val *isl_val_2exp(__isl_take isl_val *v);
763 The following binary operations are available on C<isl_val>s.
765         #include <isl/val.h>
766         __isl_give isl_val *isl_val_min(__isl_take isl_val *v1,
767                 __isl_take isl_val *v2);
768         __isl_give isl_val *isl_val_max(__isl_take isl_val *v1,
769                 __isl_take isl_val *v2);
770         __isl_give isl_val *isl_val_add(__isl_take isl_val *v1,
771                 __isl_take isl_val *v2);
772         __isl_give isl_val *isl_val_add_ui(__isl_take isl_val *v1,
773                 unsigned long v2);
774         __isl_give isl_val *isl_val_sub(__isl_take isl_val *v1,
775                 __isl_take isl_val *v2);
776         __isl_give isl_val *isl_val_sub_ui(__isl_take isl_val *v1,
777                 unsigned long v2);
778         __isl_give isl_val *isl_val_mul(__isl_take isl_val *v1,
779                 __isl_take isl_val *v2);
780         __isl_give isl_val *isl_val_mul_ui(__isl_take isl_val *v1,
781                 unsigned long v2);
782         __isl_give isl_val *isl_val_div(__isl_take isl_val *v1,
783                 __isl_take isl_val *v2);
784         __isl_give isl_val *isl_val_div_ui(__isl_take isl_val *v1,
785                 unsigned long v2);
787 On integer values, we additionally have the following operations.
789         #include <isl/val.h>
790         __isl_give isl_val *isl_val_2exp(__isl_take isl_val *v);
791         __isl_give isl_val *isl_val_mod(__isl_take isl_val *v1,
792                 __isl_take isl_val *v2);
793         __isl_give isl_val *isl_val_gcd(__isl_take isl_val *v1,
794                 __isl_take isl_val *v2);
795         __isl_give isl_val *isl_val_gcdext(__isl_take isl_val *v1,
796                 __isl_take isl_val *v2, __isl_give isl_val **x,
797                 __isl_give isl_val **y);
799 The function C<isl_val_gcdext> returns the greatest common divisor g
800 of C<v1> and C<v2> as well as two integers C<*x> and C<*y> such
801 that C<*x> * C<v1> + C<*y> * C<v2> = g.
803 =head3 GMP specific functions
805 These functions are only available if C<isl> has been compiled with C<GMP>
806 support.
808 Specific integer and rational values can be created from C<GMP> values using
809 the following functions.
811         #include <isl/val_gmp.h>
812         __isl_give isl_val *isl_val_int_from_gmp(isl_ctx *ctx,
813                 mpz_t z);
814         __isl_give isl_val *isl_val_from_gmp(isl_ctx *ctx,
815                 const mpz_t n, const mpz_t d);
817 The numerator and denominator of a rational value can be extracted as
818 C<GMP> values using the following functions.
820         #include <isl/val_gmp.h>
821         int isl_val_get_num_gmp(__isl_keep isl_val *v, mpz_t z);
822         int isl_val_get_den_gmp(__isl_keep isl_val *v, mpz_t z);
824 =head2 Sets and Relations
826 C<isl> uses six types of objects for representing sets and relations,
827 C<isl_basic_set>, C<isl_basic_map>, C<isl_set>, C<isl_map>,
828 C<isl_union_set> and C<isl_union_map>.
829 C<isl_basic_set> and C<isl_basic_map> represent sets and relations that
830 can be described as a conjunction of affine constraints, while
831 C<isl_set> and C<isl_map> represent unions of
832 C<isl_basic_set>s and C<isl_basic_map>s, respectively.
833 However, all C<isl_basic_set>s or C<isl_basic_map>s in the union need
834 to live in the same space.  C<isl_union_set>s and C<isl_union_map>s
835 represent unions of C<isl_set>s or C<isl_map>s in I<different> spaces,
836 where spaces are considered different if they have a different number
837 of dimensions and/or different names (see L<"Spaces">).
838 The difference between sets and relations (maps) is that sets have
839 one set of variables, while relations have two sets of variables,
840 input variables and output variables.
842 =head2 Error Handling
844 C<isl> supports different ways to react in case a runtime error is triggered.
845 Runtime errors arise, e.g., if a function such as C<isl_map_intersect> is called
846 with two maps that have incompatible spaces. There are three possible ways
847 to react on error: to warn, to continue or to abort.
849 The default behavior is to warn. In this mode, C<isl> prints a warning, stores
850 the last error in the corresponding C<isl_ctx> and the function in which the
851 error was triggered returns a value indicating that some error has
852 occurred.  In case of functions returning a pointer, this value is
853 C<NULL>.  In case of functions returning an C<isl_bool> or an
854 C<isl_stat>, this value is C<isl_bool_error> or C<isl_stat_error>.
855 An error does not corrupt internal state,
856 such that isl can continue to be used. C<isl> also provides functions to
857 read the last error, including the specific error message,
858 the isl source file where the error occurred and the line number,
859 and to reset all information about the last error. The
860 last error is only stored for information purposes. Its presence does not
861 change the behavior of C<isl>. Hence, resetting an error is not required to
862 continue to use isl, but only to observe new errors.
864         #include <isl/ctx.h>
865         enum isl_error isl_ctx_last_error(isl_ctx *ctx);
866         const char *isl_ctx_last_error_msg(isl_ctx *ctx);
867         const char *isl_ctx_last_error_file(isl_ctx *ctx);
868         int isl_ctx_last_error_line(isl_ctx *ctx);
869         void isl_ctx_reset_error(isl_ctx *ctx);
871 If no error has occurred since the last call to C<isl_ctx_reset_error>,
872 then the functions C<isl_ctx_last_error_msg> and
873 C<isl_ctx_last_error_file> return C<NULL>.
875 Another option is to continue on error. This is similar to warn on error mode,
876 except that C<isl> does not print any warning. This allows a program to
877 implement its own error reporting.
879 The last option is to directly abort the execution of the program from within
880 the isl library. This makes it obviously impossible to recover from an error,
881 but it allows to directly spot the error location. By aborting on error,
882 debuggers break at the location the error occurred and can provide a stack
883 trace. Other tools that automatically provide stack traces on abort or that do
884 not want to continue execution after an error was triggered may also prefer to
885 abort on error.
887 The on error behavior of isl can be specified by calling
888 C<isl_options_set_on_error> or by setting the command line option
889 C<--isl-on-error>. Valid arguments for the function call are
890 C<ISL_ON_ERROR_WARN>, C<ISL_ON_ERROR_CONTINUE> and C<ISL_ON_ERROR_ABORT>. The
891 choices for the command line option are C<warn>, C<continue> and C<abort>.
892 It is also possible to query the current error mode.
894         #include <isl/options.h>
895         isl_stat isl_options_set_on_error(isl_ctx *ctx, int val);
896         int isl_options_get_on_error(isl_ctx *ctx);
898 =head2 Identifiers
900 Identifiers are used to identify both individual dimensions
901 and tuples of dimensions.  They consist of an optional name and an optional
902 user pointer.  The name and the user pointer cannot both be C<NULL>, however.
903 Identifiers with the same name but different pointer values
904 are considered to be distinct.
905 Similarly, identifiers with different names but the same pointer value
906 are also considered to be distinct.
907 Equal identifiers are represented using the same object.
908 Pairs of identifiers can therefore be tested for equality using the
909 C<==> operator.
910 Identifiers can be constructed, copied, freed, inspected and printed
911 using the following functions.
913         #include <isl/id.h>
914         __isl_give isl_id *isl_id_alloc(isl_ctx *ctx,
915                 __isl_keep const char *name, void *user);
916         __isl_give isl_id *isl_id_set_free_user(
917                 __isl_take isl_id *id,
918                 void (*free_user)(void *user));
919         __isl_give isl_id *isl_id_copy(isl_id *id);
920         __isl_null isl_id *isl_id_free(__isl_take isl_id *id);
922         void *isl_id_get_user(__isl_keep isl_id *id);
923         __isl_keep const char *isl_id_get_name(__isl_keep isl_id *id);
925         __isl_give isl_printer *isl_printer_print_id(
926                 __isl_take isl_printer *p, __isl_keep isl_id *id);
928 The callback set by C<isl_id_set_free_user> is called on the user
929 pointer when the last reference to the C<isl_id> is freed.
930 Note that C<isl_id_get_name> returns a pointer to some internal
931 data structure, so the result can only be used while the
932 corresponding C<isl_id> is alive.
934 =head2 Spaces
936 Whenever a new set, relation or similar object is created from scratch,
937 the space in which it lives needs to be specified using an C<isl_space>.
938 Each space involves zero or more parameters and zero, one or two
939 tuples of set or input/output dimensions.  The parameters and dimensions
940 are identified by an C<isl_dim_type> and a position.
941 The type C<isl_dim_param> refers to parameters,
942 the type C<isl_dim_set> refers to set dimensions (for spaces
943 with a single tuple of dimensions) and the types C<isl_dim_in>
944 and C<isl_dim_out> refer to input and output dimensions
945 (for spaces with two tuples of dimensions).
946 Local spaces (see L</"Local Spaces">) also contain dimensions
947 of type C<isl_dim_div>.
948 Note that parameters are only identified by their position within
949 a given object.  Across different objects, parameters are (usually)
950 identified by their names or identifiers.  Only unnamed parameters
951 are identified by their positions across objects.  The use of unnamed
952 parameters is discouraged.
954         #include <isl/space.h>
955         __isl_give isl_space *isl_space_alloc(isl_ctx *ctx,
956                 unsigned nparam, unsigned n_in, unsigned n_out);
957         __isl_give isl_space *isl_space_params_alloc(isl_ctx *ctx,
958                 unsigned nparam);
959         __isl_give isl_space *isl_space_set_alloc(isl_ctx *ctx,
960                 unsigned nparam, unsigned dim);
961         __isl_give isl_space *isl_space_copy(__isl_keep isl_space *space);
962         __isl_null isl_space *isl_space_free(__isl_take isl_space *space);
964 The space used for creating a parameter domain
965 needs to be created using C<isl_space_params_alloc>.
966 For other sets, the space
967 needs to be created using C<isl_space_set_alloc>, while
968 for a relation, the space
969 needs to be created using C<isl_space_alloc>.
971 To check whether a given space is that of a set or a map
972 or whether it is a parameter space, use these functions:
974         #include <isl/space.h>
975         isl_bool isl_space_is_params(__isl_keep isl_space *space);
976         isl_bool isl_space_is_set(__isl_keep isl_space *space);
977         isl_bool isl_space_is_map(__isl_keep isl_space *space);
979 Spaces can be compared using the following functions:
981         #include <isl/space.h>
982         isl_bool isl_space_is_equal(__isl_keep isl_space *space1,
983                 __isl_keep isl_space *space2);
984         isl_bool isl_space_has_equal_params(
985                 __isl_keep isl_space *space1,
986                 __isl_keep isl_space *space2);
987         isl_bool isl_space_has_equal_tuples(
988                 __isl_keep isl_space *space1,
989                 __isl_keep isl_space *space2);
990         isl_bool isl_space_is_domain(__isl_keep isl_space *space1,
991                 __isl_keep isl_space *space2);
992         isl_bool isl_space_is_range(__isl_keep isl_space *space1,
993                 __isl_keep isl_space *space2);
994         isl_bool isl_space_tuple_is_equal(
995                 __isl_keep isl_space *space1,
996                 enum isl_dim_type type1,
997                 __isl_keep isl_space *space2,
998                 enum isl_dim_type type2);
1000 C<isl_space_is_domain> checks whether the first argument is equal
1001 to the domain of the second argument.  This requires in particular that
1002 the first argument is a set space and that the second argument
1003 is a map space.  C<isl_space_tuple_is_equal> checks whether the given
1004 tuples (C<isl_dim_in>, C<isl_dim_out> or C<isl_dim_set>) of the given
1005 spaces are the same.  That is, it checks if they have the same
1006 identifier (if any), the same dimension and the same internal structure
1007 (if any).
1008 The function
1009 C<isl_space_has_equal_params> checks whether two spaces
1010 have the same parameters in the same order.
1011 C<isl_space_has_equal_tuples> check whether two spaces have
1012 the same tuples.  In contrast to C<isl_space_is_equal> below,
1013 it does not check the
1014 parameters.  This is useful because many C<isl> functions align the
1015 parameters before they perform their operations, such that equivalence
1016 is not necessary.
1017 C<isl_space_is_equal> checks whether two spaces are identical,
1018 meaning that they have the same parameters and the same tuples.
1019 That is, it checks whether both C<isl_space_has_equal_params> and
1020 C<isl_space_has_equal_tuples> hold.
1022 It is often useful to create objects that live in the
1023 same space as some other object.  This can be accomplished
1024 by creating the new objects
1025 (see L</"Creating New Sets and Relations"> or
1026 L</"Functions">) based on the space
1027 of the original object.
1029         #include <isl/set.h>
1030         __isl_give isl_space *isl_basic_set_get_space(
1031                 __isl_keep isl_basic_set *bset);
1032         __isl_give isl_space *isl_set_get_space(__isl_keep isl_set *set);
1034         #include <isl/union_set.h>
1035         __isl_give isl_space *isl_union_set_get_space(
1036                 __isl_keep isl_union_set *uset);
1038         #include <isl/map.h>
1039         __isl_give isl_space *isl_basic_map_get_space(
1040                 __isl_keep isl_basic_map *bmap);
1041         __isl_give isl_space *isl_map_get_space(__isl_keep isl_map *map);
1043         #include <isl/union_map.h>
1044         __isl_give isl_space *isl_union_map_get_space(
1045                 __isl_keep isl_union_map *umap);
1047         #include <isl/constraint.h>
1048         __isl_give isl_space *isl_constraint_get_space(
1049                 __isl_keep isl_constraint *constraint);
1051         #include <isl/polynomial.h>
1052         __isl_give isl_space *isl_qpolynomial_get_domain_space(
1053                 __isl_keep isl_qpolynomial *qp);
1054         __isl_give isl_space *isl_qpolynomial_get_space(
1055                 __isl_keep isl_qpolynomial *qp);
1056         __isl_give isl_space *
1057         isl_qpolynomial_fold_get_domain_space(
1058                 __isl_keep isl_qpolynomial_fold *fold);
1059         __isl_give isl_space *isl_qpolynomial_fold_get_space(
1060                 __isl_keep isl_qpolynomial_fold *fold);
1061         __isl_give isl_space *isl_pw_qpolynomial_get_domain_space(
1062                 __isl_keep isl_pw_qpolynomial *pwqp);
1063         __isl_give isl_space *isl_pw_qpolynomial_get_space(
1064                 __isl_keep isl_pw_qpolynomial *pwqp);
1065         __isl_give isl_space *isl_pw_qpolynomial_fold_get_domain_space(
1066                 __isl_keep isl_pw_qpolynomial_fold *pwf);
1067         __isl_give isl_space *isl_pw_qpolynomial_fold_get_space(
1068                 __isl_keep isl_pw_qpolynomial_fold *pwf);
1069         __isl_give isl_space *isl_union_pw_qpolynomial_get_space(
1070                 __isl_keep isl_union_pw_qpolynomial *upwqp);
1071         __isl_give isl_space *isl_union_pw_qpolynomial_fold_get_space(
1072                 __isl_keep isl_union_pw_qpolynomial_fold *upwf);
1074         #include <isl/val.h>
1075         __isl_give isl_space *isl_multi_val_get_space(
1076                 __isl_keep isl_multi_val *mv);
1078         #include <isl/aff.h>
1079         __isl_give isl_space *isl_aff_get_domain_space(
1080                 __isl_keep isl_aff *aff);
1081         __isl_give isl_space *isl_aff_get_space(
1082                 __isl_keep isl_aff *aff);
1083         __isl_give isl_space *isl_pw_aff_get_domain_space(
1084                 __isl_keep isl_pw_aff *pwaff);
1085         __isl_give isl_space *isl_pw_aff_get_space(
1086                 __isl_keep isl_pw_aff *pwaff);
1087         __isl_give isl_space *isl_multi_aff_get_domain_space(
1088                 __isl_keep isl_multi_aff *maff);
1089         __isl_give isl_space *isl_multi_aff_get_space(
1090                 __isl_keep isl_multi_aff *maff);
1091         __isl_give isl_space *isl_pw_multi_aff_get_domain_space(
1092                 __isl_keep isl_pw_multi_aff *pma);
1093         __isl_give isl_space *isl_pw_multi_aff_get_space(
1094                 __isl_keep isl_pw_multi_aff *pma);
1095         __isl_give isl_space *isl_union_pw_aff_get_space(
1096                 __isl_keep isl_union_pw_aff *upa);
1097         __isl_give isl_space *isl_union_pw_multi_aff_get_space(
1098                 __isl_keep isl_union_pw_multi_aff *upma);
1099         __isl_give isl_space *isl_multi_pw_aff_get_domain_space(
1100                 __isl_keep isl_multi_pw_aff *mpa);
1101         __isl_give isl_space *isl_multi_pw_aff_get_space(
1102                 __isl_keep isl_multi_pw_aff *mpa);
1103         __isl_give isl_space *
1104         isl_multi_union_pw_aff_get_domain_space(
1105                 __isl_keep isl_multi_union_pw_aff *mupa);
1106         __isl_give isl_space *
1107         isl_multi_union_pw_aff_get_space(
1108                 __isl_keep isl_multi_union_pw_aff *mupa);
1110         #include <isl/point.h>
1111         __isl_give isl_space *isl_point_get_space(
1112                 __isl_keep isl_point *pnt);
1114 The number of dimensions of a given type of space
1115 may be read off from a space or an object that lives
1116 in a space using the following functions.
1117 In case of C<isl_space_dim>, type may be
1118 C<isl_dim_param>, C<isl_dim_in> (only for relations),
1119 C<isl_dim_out> (only for relations), C<isl_dim_set>
1120 (only for sets) or C<isl_dim_all>.
1122         #include <isl/space.h>
1123         unsigned isl_space_dim(__isl_keep isl_space *space,
1124                 enum isl_dim_type type);
1126         #include <isl/local_space.h>
1127         int isl_local_space_dim(__isl_keep isl_local_space *ls,
1128                 enum isl_dim_type type);
1130         #include <isl/set.h>
1131         unsigned isl_basic_set_dim(__isl_keep isl_basic_set *bset,
1132                 enum isl_dim_type type);
1133         unsigned isl_set_dim(__isl_keep isl_set *set,
1134                 enum isl_dim_type type);
1136         #include <isl/union_set.h>
1137         unsigned isl_union_set_dim(__isl_keep isl_union_set *uset,
1138                 enum isl_dim_type type);
1140         #include <isl/map.h>
1141         unsigned isl_basic_map_dim(__isl_keep isl_basic_map *bmap,
1142                 enum isl_dim_type type);
1143         unsigned isl_map_dim(__isl_keep isl_map *map,
1144                 enum isl_dim_type type);
1146         #include <isl/union_map.h>
1147         unsigned isl_union_map_dim(__isl_keep isl_union_map *umap,
1148                 enum isl_dim_type type);
1150         #include <isl/val.h>
1151         unsigned isl_multi_val_dim(__isl_keep isl_multi_val *mv,
1152                 enum isl_dim_type type);
1154         #include <isl/aff.h>
1155         int isl_aff_dim(__isl_keep isl_aff *aff,
1156                 enum isl_dim_type type);
1157         unsigned isl_multi_aff_dim(__isl_keep isl_multi_aff *maff,
1158                 enum isl_dim_type type);
1159         unsigned isl_pw_aff_dim(__isl_keep isl_pw_aff *pwaff,
1160                 enum isl_dim_type type);
1161         unsigned isl_pw_multi_aff_dim(
1162                 __isl_keep isl_pw_multi_aff *pma,
1163                 enum isl_dim_type type);
1164         unsigned isl_multi_pw_aff_dim(
1165                 __isl_keep isl_multi_pw_aff *mpa,
1166                 enum isl_dim_type type);
1167         unsigned isl_union_pw_aff_dim(
1168                 __isl_keep isl_union_pw_aff *upa,
1169                 enum isl_dim_type type);
1170         unsigned isl_union_pw_multi_aff_dim(
1171                 __isl_keep isl_union_pw_multi_aff *upma,
1172                 enum isl_dim_type type);
1173         unsigned isl_multi_union_pw_aff_dim(
1174                 __isl_keep isl_multi_union_pw_aff *mupa,
1175                 enum isl_dim_type type);
1177         #include <isl/polynomial.h>
1178         unsigned isl_union_pw_qpolynomial_dim(
1179                 __isl_keep isl_union_pw_qpolynomial *upwqp,
1180                 enum isl_dim_type type);
1181         unsigned isl_union_pw_qpolynomial_fold_dim(
1182                 __isl_keep isl_union_pw_qpolynomial_fold *upwf,
1183                 enum isl_dim_type type);
1185 Note that an C<isl_union_set>, an C<isl_union_map>,
1186 an C<isl_union_pw_multi_aff>,
1187 an C<isl_union_pw_qpolynomial> and
1188 an C<isl_union_pw_qpolynomial_fold>
1189 only have parameters.
1191 Additional parameters can be added to a space using the following function.
1193         #include <isl/space.h>
1194         __isl_give isl_space *isl_space_add_param_id(
1195                 __isl_take isl_space *space,
1196                 __isl_take isl_id *id);
1198 If a parameter with the given identifier already appears in the space,
1199 then it is not added again.
1201 The identifiers or names of the individual dimensions of spaces
1202 may be set or read off using the following functions on spaces
1203 or objects that live in spaces.
1204 These functions are mostly useful to obtain the identifiers, positions
1205 or names of the parameters.  Identifiers of individual dimensions are
1206 essentially only useful for printing.  They are ignored by all other
1207 operations and may not be preserved across those operations.
1209         #include <isl/space.h>
1210         __isl_give isl_space *isl_space_set_dim_id(
1211                 __isl_take isl_space *space,
1212                 enum isl_dim_type type, unsigned pos,
1213                 __isl_take isl_id *id);
1214         isl_bool isl_space_has_dim_id(__isl_keep isl_space *space,
1215                 enum isl_dim_type type, unsigned pos);
1216         __isl_give isl_id *isl_space_get_dim_id(
1217                 __isl_keep isl_space *space,
1218                 enum isl_dim_type type, unsigned pos);
1219         __isl_give isl_space *isl_space_set_dim_name(
1220                 __isl_take isl_space *space,
1221                  enum isl_dim_type type, unsigned pos,
1222                  __isl_keep const char *name);
1223         isl_bool isl_space_has_dim_name(__isl_keep isl_space *space,
1224                 enum isl_dim_type type, unsigned pos);
1225         __isl_keep const char *isl_space_get_dim_name(
1226                 __isl_keep isl_space *space,
1227                 enum isl_dim_type type, unsigned pos);
1229         #include <isl/local_space.h>
1230         __isl_give isl_local_space *isl_local_space_set_dim_id(
1231                 __isl_take isl_local_space *ls,
1232                 enum isl_dim_type type, unsigned pos,
1233                 __isl_take isl_id *id);
1234         isl_bool isl_local_space_has_dim_id(
1235                 __isl_keep isl_local_space *ls,
1236                 enum isl_dim_type type, unsigned pos);
1237         __isl_give isl_id *isl_local_space_get_dim_id(
1238                 __isl_keep isl_local_space *ls,
1239                 enum isl_dim_type type, unsigned pos);
1240         __isl_give isl_local_space *isl_local_space_set_dim_name(
1241                 __isl_take isl_local_space *ls,
1242                 enum isl_dim_type type, unsigned pos, const char *s);
1243         isl_bool isl_local_space_has_dim_name(
1244                 __isl_keep isl_local_space *ls,
1245                 enum isl_dim_type type, unsigned pos)
1246         const char *isl_local_space_get_dim_name(
1247                 __isl_keep isl_local_space *ls,
1248                 enum isl_dim_type type, unsigned pos);
1250         #include <isl/constraint.h>
1251         const char *isl_constraint_get_dim_name(
1252                 __isl_keep isl_constraint *constraint,
1253                 enum isl_dim_type type, unsigned pos);
1255         #include <isl/set.h>
1256         __isl_give isl_id *isl_basic_set_get_dim_id(
1257                 __isl_keep isl_basic_set *bset,
1258                 enum isl_dim_type type, unsigned pos);
1259         __isl_give isl_set *isl_set_set_dim_id(
1260                 __isl_take isl_set *set, enum isl_dim_type type,
1261                 unsigned pos, __isl_take isl_id *id);
1262         isl_bool isl_set_has_dim_id(__isl_keep isl_set *set,
1263                 enum isl_dim_type type, unsigned pos);
1264         __isl_give isl_id *isl_set_get_dim_id(
1265                 __isl_keep isl_set *set, enum isl_dim_type type,
1266                 unsigned pos);
1267         const char *isl_basic_set_get_dim_name(
1268                 __isl_keep isl_basic_set *bset,
1269                 enum isl_dim_type type, unsigned pos);
1270         isl_bool isl_set_has_dim_name(__isl_keep isl_set *set,
1271                 enum isl_dim_type type, unsigned pos);
1272         const char *isl_set_get_dim_name(
1273                 __isl_keep isl_set *set,
1274                 enum isl_dim_type type, unsigned pos);
1276         #include <isl/map.h>
1277         __isl_give isl_map *isl_map_set_dim_id(
1278                 __isl_take isl_map *map, enum isl_dim_type type,
1279                 unsigned pos, __isl_take isl_id *id);
1280         isl_bool isl_basic_map_has_dim_id(
1281                 __isl_keep isl_basic_map *bmap,
1282                 enum isl_dim_type type, unsigned pos);
1283         isl_bool isl_map_has_dim_id(__isl_keep isl_map *map,
1284                 enum isl_dim_type type, unsigned pos);
1285         __isl_give isl_id *isl_map_get_dim_id(
1286                 __isl_keep isl_map *map, enum isl_dim_type type,
1287                 unsigned pos);
1288         __isl_give isl_id *isl_union_map_get_dim_id(
1289                 __isl_keep isl_union_map *umap,
1290                 enum isl_dim_type type, unsigned pos);
1291         const char *isl_basic_map_get_dim_name(
1292                 __isl_keep isl_basic_map *bmap,
1293                 enum isl_dim_type type, unsigned pos);
1294         isl_bool isl_map_has_dim_name(__isl_keep isl_map *map,
1295                 enum isl_dim_type type, unsigned pos);
1296         const char *isl_map_get_dim_name(
1297                 __isl_keep isl_map *map,
1298                 enum isl_dim_type type, unsigned pos);
1300         #include <isl/val.h>
1301         __isl_give isl_multi_val *isl_multi_val_set_dim_id(
1302                 __isl_take isl_multi_val *mv,
1303                 enum isl_dim_type type, unsigned pos,
1304                 __isl_take isl_id *id);
1305         __isl_give isl_id *isl_multi_val_get_dim_id(
1306                 __isl_keep isl_multi_val *mv,
1307                 enum isl_dim_type type, unsigned pos);
1308         __isl_give isl_multi_val *isl_multi_val_set_dim_name(
1309                 __isl_take isl_multi_val *mv,
1310                 enum isl_dim_type type, unsigned pos, const char *s);
1312         #include <isl/aff.h>
1313         __isl_give isl_aff *isl_aff_set_dim_id(
1314                 __isl_take isl_aff *aff, enum isl_dim_type type,
1315                 unsigned pos, __isl_take isl_id *id);
1316         __isl_give isl_multi_aff *isl_multi_aff_set_dim_id(
1317                 __isl_take isl_multi_aff *maff,
1318                 enum isl_dim_type type, unsigned pos,
1319                 __isl_take isl_id *id);
1320         __isl_give isl_pw_aff *isl_pw_aff_set_dim_id(
1321                 __isl_take isl_pw_aff *pma,
1322                 enum isl_dim_type type, unsigned pos,
1323                 __isl_take isl_id *id);
1324         __isl_give isl_multi_pw_aff *
1325         isl_multi_pw_aff_set_dim_id(
1326                 __isl_take isl_multi_pw_aff *mpa,
1327                 enum isl_dim_type type, unsigned pos,
1328                 __isl_take isl_id *id);
1329         __isl_give isl_multi_union_pw_aff *
1330         isl_multi_union_pw_aff_set_dim_id(
1331                 __isl_take isl_multi_union_pw_aff *mupa,
1332                 enum isl_dim_type type, unsigned pos,
1333                 __isl_take isl_id *id);
1334         __isl_give isl_id *isl_multi_aff_get_dim_id(
1335                 __isl_keep isl_multi_aff *ma,
1336                 enum isl_dim_type type, unsigned pos);
1337         isl_bool isl_pw_aff_has_dim_id(__isl_keep isl_pw_aff *pa,
1338                 enum isl_dim_type type, unsigned pos);
1339         __isl_give isl_id *isl_pw_aff_get_dim_id(
1340                 __isl_keep isl_pw_aff *pa,
1341                 enum isl_dim_type type, unsigned pos);
1342         __isl_give isl_id *isl_pw_multi_aff_get_dim_id(
1343                 __isl_keep isl_pw_multi_aff *pma,
1344                 enum isl_dim_type type, unsigned pos);
1345         __isl_give isl_id *isl_multi_pw_aff_get_dim_id(
1346                 __isl_keep isl_multi_pw_aff *mpa,
1347                 enum isl_dim_type type, unsigned pos);
1348         __isl_give isl_id *isl_multi_union_pw_aff_get_dim_id(
1349                 __isl_keep isl_multi_union_pw_aff *mupa,
1350                 enum isl_dim_type type, unsigned pos);
1351         __isl_give isl_aff *isl_aff_set_dim_name(
1352                 __isl_take isl_aff *aff, enum isl_dim_type type,
1353                 unsigned pos, const char *s);
1354         __isl_give isl_multi_aff *isl_multi_aff_set_dim_name(
1355                 __isl_take isl_multi_aff *maff,
1356                 enum isl_dim_type type, unsigned pos, const char *s);
1357         __isl_give isl_multi_pw_aff *
1358         isl_multi_pw_aff_set_dim_name(
1359                 __isl_take isl_multi_pw_aff *mpa,
1360                 enum isl_dim_type type, unsigned pos, const char *s);
1361         __isl_give isl_union_pw_aff *
1362         isl_union_pw_aff_set_dim_name(
1363                 __isl_take isl_union_pw_aff *upa,
1364                 enum isl_dim_type type, unsigned pos,
1365                 const char *s);
1366         __isl_give isl_union_pw_multi_aff *
1367         isl_union_pw_multi_aff_set_dim_name(
1368                 __isl_take isl_union_pw_multi_aff *upma,
1369                 enum isl_dim_type type, unsigned pos,
1370                 const char *s);
1371         __isl_give isl_multi_union_pw_aff *
1372         isl_multi_union_pw_aff_set_dim_name(
1373                 __isl_take isl_multi_union_pw_aff *mupa,
1374                 enum isl_dim_type type, unsigned pos,
1375         const char *isl_aff_get_dim_name(__isl_keep isl_aff *aff,
1376                 enum isl_dim_type type, unsigned pos);
1377         const char *isl_pw_aff_get_dim_name(
1378                 __isl_keep isl_pw_aff *pa,
1379                 enum isl_dim_type type, unsigned pos);
1380         const char *isl_pw_multi_aff_get_dim_name(
1381                 __isl_keep isl_pw_multi_aff *pma,
1382                 enum isl_dim_type type, unsigned pos);
1384         #include <isl/polynomial.h>
1385         __isl_give isl_qpolynomial *isl_qpolynomial_set_dim_name(
1386                 __isl_take isl_qpolynomial *qp,
1387                 enum isl_dim_type type, unsigned pos,
1388                 const char *s);
1389         __isl_give isl_pw_qpolynomial *
1390         isl_pw_qpolynomial_set_dim_name(
1391                 __isl_take isl_pw_qpolynomial *pwqp,
1392                 enum isl_dim_type type, unsigned pos,
1393                 const char *s);
1394         __isl_give isl_pw_qpolynomial_fold *
1395         isl_pw_qpolynomial_fold_set_dim_name(
1396                 __isl_take isl_pw_qpolynomial_fold *pwf,
1397                 enum isl_dim_type type, unsigned pos,
1398                 const char *s);
1399         __isl_give isl_union_pw_qpolynomial *
1400         isl_union_pw_qpolynomial_set_dim_name(
1401                 __isl_take isl_union_pw_qpolynomial *upwqp,
1402                 enum isl_dim_type type, unsigned pos,
1403                 const char *s);
1404         __isl_give isl_union_pw_qpolynomial_fold *
1405         isl_union_pw_qpolynomial_fold_set_dim_name(
1406                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
1407                 enum isl_dim_type type, unsigned pos,
1408                 const char *s);
1410 Note that C<isl_space_get_name> returns a pointer to some internal
1411 data structure, so the result can only be used while the
1412 corresponding C<isl_space> is alive.
1413 Also note that every function that operates on two sets or relations
1414 requires that both arguments have the same parameters.  This also
1415 means that if one of the arguments has named parameters, then the
1416 other needs to have named parameters too and the names need to match.
1417 Pairs of C<isl_set>, C<isl_map>, C<isl_union_set> and/or C<isl_union_map>
1418 arguments may have different parameters (as long as they are named),
1419 in which case the result will have as parameters the union of the parameters of
1420 the arguments.
1422 Given the identifier or name of a dimension (typically a parameter),
1423 its position can be obtained from the following functions.
1425         #include <isl/space.h>
1426         int isl_space_find_dim_by_id(__isl_keep isl_space *space,
1427                 enum isl_dim_type type, __isl_keep isl_id *id);
1428         int isl_space_find_dim_by_name(__isl_keep isl_space *space,
1429                 enum isl_dim_type type, const char *name);
1431         #include <isl/local_space.h>
1432         int isl_local_space_find_dim_by_name(
1433                 __isl_keep isl_local_space *ls,
1434                 enum isl_dim_type type, const char *name);
1436         #include <isl/val.h>
1437         int isl_multi_val_find_dim_by_id(
1438                 __isl_keep isl_multi_val *mv,
1439                 enum isl_dim_type type, __isl_keep isl_id *id);
1440         int isl_multi_val_find_dim_by_name(
1441                 __isl_keep isl_multi_val *mv,
1442                 enum isl_dim_type type, const char *name);
1444         #include <isl/set.h>
1445         int isl_set_find_dim_by_id(__isl_keep isl_set *set,
1446                 enum isl_dim_type type, __isl_keep isl_id *id);
1447         int isl_set_find_dim_by_name(__isl_keep isl_set *set,
1448                 enum isl_dim_type type, const char *name);
1450         #include <isl/map.h>
1451         int isl_map_find_dim_by_id(__isl_keep isl_map *map,
1452                 enum isl_dim_type type, __isl_keep isl_id *id);
1453         int isl_basic_map_find_dim_by_name(
1454                 __isl_keep isl_basic_map *bmap,
1455                 enum isl_dim_type type, const char *name);
1456         int isl_map_find_dim_by_name(__isl_keep isl_map *map,
1457                 enum isl_dim_type type, const char *name);
1458         int isl_union_map_find_dim_by_name(
1459                 __isl_keep isl_union_map *umap,
1460                 enum isl_dim_type type, const char *name);
1462         #include <isl/aff.h>
1463         int isl_multi_aff_find_dim_by_id(
1464                 __isl_keep isl_multi_aff *ma,
1465                 enum isl_dim_type type, __isl_keep isl_id *id);
1466         int isl_multi_pw_aff_find_dim_by_id(
1467                 __isl_keep isl_multi_pw_aff *mpa,
1468                 enum isl_dim_type type, __isl_keep isl_id *id);
1469         int isl_multi_union_pw_aff_find_dim_by_id(
1470                 __isl_keep isl_union_multi_pw_aff *mupa,
1471                 enum isl_dim_type type, __isl_keep isl_id *id);
1472         int isl_aff_find_dim_by_name(__isl_keep isl_aff *aff,
1473                 enum isl_dim_type type, const char *name);
1474         int isl_multi_aff_find_dim_by_name(
1475                 __isl_keep isl_multi_aff *ma,
1476                 enum isl_dim_type type, const char *name);
1477         int isl_pw_aff_find_dim_by_name(__isl_keep isl_pw_aff *pa,
1478                 enum isl_dim_type type, const char *name);
1479         int isl_multi_pw_aff_find_dim_by_name(
1480                 __isl_keep isl_multi_pw_aff *mpa,
1481                 enum isl_dim_type type, const char *name);
1482         int isl_pw_multi_aff_find_dim_by_name(
1483                 __isl_keep isl_pw_multi_aff *pma,
1484                 enum isl_dim_type type, const char *name);
1485         int isl_union_pw_aff_find_dim_by_name(
1486                 __isl_keep isl_union_pw_aff *upa,
1487                 enum isl_dim_type type, const char *name);
1488         int isl_union_pw_multi_aff_find_dim_by_name(
1489                 __isl_keep isl_union_pw_multi_aff *upma,
1490                 enum isl_dim_type type, const char *name);
1491         int isl_multi_union_pw_aff_find_dim_by_name(
1492                 __isl_keep isl_multi_union_pw_aff *mupa,
1493                 enum isl_dim_type type, const char *name);
1495         #include <isl/polynomial.h>
1496         int isl_pw_qpolynomial_find_dim_by_name(
1497                 __isl_keep isl_pw_qpolynomial *pwqp,
1498                 enum isl_dim_type type, const char *name);
1499         int isl_pw_qpolynomial_fold_find_dim_by_name(
1500                 __isl_keep isl_pw_qpolynomial_fold *pwf,
1501                 enum isl_dim_type type, const char *name);
1502         int isl_union_pw_qpolynomial_find_dim_by_name(
1503                 __isl_keep isl_union_pw_qpolynomial *upwqp,
1504                 enum isl_dim_type type, const char *name);
1505         int isl_union_pw_qpolynomial_fold_find_dim_by_name(
1506                 __isl_keep isl_union_pw_qpolynomial_fold *upwf,
1507                 enum isl_dim_type type, const char *name);
1509 The identifiers or names of entire spaces may be set or read off
1510 using the following functions.
1512         #include <isl/space.h>
1513         __isl_give isl_space *isl_space_set_tuple_id(
1514                 __isl_take isl_space *space,
1515                 enum isl_dim_type type, __isl_take isl_id *id);
1516         __isl_give isl_space *isl_space_reset_tuple_id(
1517                 __isl_take isl_space *space, enum isl_dim_type type);
1518         isl_bool isl_space_has_tuple_id(
1519                 __isl_keep isl_space *space,
1520                 enum isl_dim_type type);
1521         __isl_give isl_id *isl_space_get_tuple_id(
1522                 __isl_keep isl_space *space, enum isl_dim_type type);
1523         __isl_give isl_space *isl_space_set_tuple_name(
1524                 __isl_take isl_space *space,
1525                 enum isl_dim_type type, const char *s);
1526         isl_bool isl_space_has_tuple_name(
1527                 __isl_keep isl_space *space,
1528                 enum isl_dim_type type);
1529         __isl_keep const char *isl_space_get_tuple_name(
1530                 __isl_keep isl_space *space,
1531                 enum isl_dim_type type);
1533         #include <isl/local_space.h>
1534         __isl_give isl_local_space *isl_local_space_set_tuple_id(
1535                 __isl_take isl_local_space *ls,
1536                 enum isl_dim_type type, __isl_take isl_id *id);
1538         #include <isl/set.h>
1539         __isl_give isl_basic_set *isl_basic_set_set_tuple_id(
1540                 __isl_take isl_basic_set *bset,
1541                 __isl_take isl_id *id);
1542         __isl_give isl_set *isl_set_set_tuple_id(
1543                 __isl_take isl_set *set, __isl_take isl_id *id);
1544         __isl_give isl_set *isl_set_reset_tuple_id(
1545                 __isl_take isl_set *set);
1546         isl_bool isl_set_has_tuple_id(__isl_keep isl_set *set);
1547         __isl_give isl_id *isl_set_get_tuple_id(
1548                 __isl_keep isl_set *set);
1549         __isl_give isl_basic_set *isl_basic_set_set_tuple_name(
1550                 __isl_take isl_basic_set *set, const char *s);
1551         __isl_give isl_set *isl_set_set_tuple_name(
1552                 __isl_take isl_set *set, const char *s);
1553         const char *isl_basic_set_get_tuple_name(
1554                 __isl_keep isl_basic_set *bset);
1555         isl_bool isl_set_has_tuple_name(__isl_keep isl_set *set);
1556         const char *isl_set_get_tuple_name(
1557                 __isl_keep isl_set *set);
1559         #include <isl/map.h>
1560         __isl_give isl_basic_map *isl_basic_map_set_tuple_id(
1561                 __isl_take isl_basic_map *bmap,
1562                 enum isl_dim_type type, __isl_take isl_id *id);
1563         __isl_give isl_map *isl_map_set_tuple_id(
1564                 __isl_take isl_map *map, enum isl_dim_type type,
1565                 __isl_take isl_id *id);
1566         __isl_give isl_map *isl_map_reset_tuple_id(
1567                 __isl_take isl_map *map, enum isl_dim_type type);
1568         isl_bool isl_map_has_tuple_id(__isl_keep isl_map *map,
1569                 enum isl_dim_type type);
1570         __isl_give isl_id *isl_map_get_tuple_id(
1571                 __isl_keep isl_map *map, enum isl_dim_type type);
1572         __isl_give isl_map *isl_map_set_tuple_name(
1573                 __isl_take isl_map *map,
1574                 enum isl_dim_type type, const char *s);
1575         const char *isl_basic_map_get_tuple_name(
1576                 __isl_keep isl_basic_map *bmap,
1577                 enum isl_dim_type type);
1578         __isl_give isl_basic_map *isl_basic_map_set_tuple_name(
1579                 __isl_take isl_basic_map *bmap,
1580                 enum isl_dim_type type, const char *s);
1581         isl_bool isl_map_has_tuple_name(__isl_keep isl_map *map,
1582                 enum isl_dim_type type);
1583         const char *isl_map_get_tuple_name(
1584                 __isl_keep isl_map *map,
1585                 enum isl_dim_type type);
1587         #include <isl/val.h>
1588         __isl_give isl_multi_val *isl_multi_val_set_tuple_id(
1589                 __isl_take isl_multi_val *mv,
1590                 enum isl_dim_type type, __isl_take isl_id *id);
1591         __isl_give isl_multi_val *isl_multi_val_reset_tuple_id(
1592                 __isl_take isl_multi_val *mv,
1593                 enum isl_dim_type type);
1594         isl_bool isl_multi_val_has_tuple_id(
1595                 __isl_keep isl_multi_val *mv,
1596                 enum isl_dim_type type);
1597         __isl_give isl_id *isl_multi_val_get_tuple_id(
1598                 __isl_keep isl_multi_val *mv,
1599                 enum isl_dim_type type);
1600         __isl_give isl_multi_val *isl_multi_val_set_tuple_name(
1601                 __isl_take isl_multi_val *mv,
1602                 enum isl_dim_type type, const char *s);
1603         const char *isl_multi_val_get_tuple_name(
1604                 __isl_keep isl_multi_val *mv,
1605                 enum isl_dim_type type);
1607         #include <isl/aff.h>
1608         __isl_give isl_aff *isl_aff_set_tuple_id(
1609                 __isl_take isl_aff *aff,
1610                 enum isl_dim_type type, __isl_take isl_id *id);
1611         __isl_give isl_multi_aff *isl_multi_aff_set_tuple_id(
1612                 __isl_take isl_multi_aff *maff,
1613                 enum isl_dim_type type, __isl_take isl_id *id);
1614         __isl_give isl_pw_aff *isl_pw_aff_set_tuple_id(
1615                 __isl_take isl_pw_aff *pwaff,
1616                 enum isl_dim_type type, __isl_take isl_id *id);
1617         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_tuple_id(
1618                 __isl_take isl_pw_multi_aff *pma,
1619                 enum isl_dim_type type, __isl_take isl_id *id);
1620         __isl_give isl_multi_union_pw_aff *
1621         isl_multi_union_pw_aff_set_tuple_id(
1622                 __isl_take isl_multi_union_pw_aff *mupa,
1623                 enum isl_dim_type type, __isl_take isl_id *id);
1624         __isl_give isl_multi_aff *isl_multi_aff_reset_tuple_id(
1625                 __isl_take isl_multi_aff *ma,
1626                 enum isl_dim_type type);
1627         __isl_give isl_pw_aff *isl_pw_aff_reset_tuple_id(
1628                 __isl_take isl_pw_aff *pa,
1629                 enum isl_dim_type type);
1630         __isl_give isl_multi_pw_aff *
1631         isl_multi_pw_aff_reset_tuple_id(
1632                 __isl_take isl_multi_pw_aff *mpa,
1633                 enum isl_dim_type type);
1634         __isl_give isl_pw_multi_aff *
1635         isl_pw_multi_aff_reset_tuple_id(
1636                 __isl_take isl_pw_multi_aff *pma,
1637                 enum isl_dim_type type);
1638         __isl_give isl_multi_union_pw_aff *
1639         isl_multi_union_pw_aff_reset_tuple_id(
1640                 __isl_take isl_multi_union_pw_aff *mupa,
1641                 enum isl_dim_type type);
1642         isl_bool isl_multi_aff_has_tuple_id(
1643                 __isl_keep isl_multi_aff *ma,
1644                 enum isl_dim_type type);
1645         __isl_give isl_id *isl_multi_aff_get_tuple_id(
1646                 __isl_keep isl_multi_aff *ma,
1647                 enum isl_dim_type type);
1648         isl_bool isl_pw_aff_has_tuple_id(__isl_keep isl_pw_aff *pa,
1649                 enum isl_dim_type type);
1650         __isl_give isl_id *isl_pw_aff_get_tuple_id(
1651                 __isl_keep isl_pw_aff *pa,
1652                 enum isl_dim_type type);
1653         isl_bool isl_pw_multi_aff_has_tuple_id(
1654                 __isl_keep isl_pw_multi_aff *pma,
1655                 enum isl_dim_type type);
1656         __isl_give isl_id *isl_pw_multi_aff_get_tuple_id(
1657                 __isl_keep isl_pw_multi_aff *pma,
1658                 enum isl_dim_type type);
1659         isl_bool isl_multi_pw_aff_has_tuple_id(
1660                 __isl_keep isl_multi_pw_aff *mpa,
1661                 enum isl_dim_type type);
1662         __isl_give isl_id *isl_multi_pw_aff_get_tuple_id(
1663                 __isl_keep isl_multi_pw_aff *mpa,
1664                 enum isl_dim_type type);
1665         isl_bool isl_multi_union_pw_aff_has_tuple_id(
1666                 __isl_keep isl_multi_union_pw_aff *mupa,
1667                 enum isl_dim_type type);
1668         __isl_give isl_id *isl_multi_union_pw_aff_get_tuple_id(
1669                 __isl_keep isl_multi_union_pw_aff *mupa,
1670                 enum isl_dim_type type);
1671         __isl_give isl_multi_aff *isl_multi_aff_set_tuple_name(
1672                 __isl_take isl_multi_aff *maff,
1673                 enum isl_dim_type type, const char *s);
1674         __isl_give isl_multi_pw_aff *
1675         isl_multi_pw_aff_set_tuple_name(
1676                 __isl_take isl_multi_pw_aff *mpa,
1677                 enum isl_dim_type type, const char *s);
1678         __isl_give isl_multi_union_pw_aff *
1679         isl_multi_union_pw_aff_set_tuple_name(
1680                 __isl_take isl_multi_union_pw_aff *mupa,
1681                 enum isl_dim_type type, const char *s);
1682         const char *isl_multi_aff_get_tuple_name(
1683                 __isl_keep isl_multi_aff *multi,
1684                 enum isl_dim_type type);
1685         isl_bool isl_pw_multi_aff_has_tuple_name(
1686                 __isl_keep isl_pw_multi_aff *pma,
1687                 enum isl_dim_type type);
1688         const char *isl_pw_multi_aff_get_tuple_name(
1689                 __isl_keep isl_pw_multi_aff *pma,
1690                 enum isl_dim_type type);
1691         const char *isl_multi_union_pw_aff_get_tuple_name(
1692                 __isl_keep isl_multi_union_pw_aff *mupa,
1693                 enum isl_dim_type type);
1695 The C<type> argument needs to be one of C<isl_dim_in>, C<isl_dim_out>
1696 or C<isl_dim_set>.  As with C<isl_space_get_name>,
1697 the C<isl_space_get_tuple_name> function returns a pointer to some internal
1698 data structure.
1699 Binary operations require the corresponding spaces of their arguments
1700 to have the same name.
1702 To keep the names of all parameters and tuples, but reset the user pointers
1703 of all the corresponding identifiers, use the following function.
1705         #include <isl/space.h>
1706         __isl_give isl_space *isl_space_reset_user(
1707                 __isl_take isl_space *space);
1709         #include <isl/set.h>
1710         __isl_give isl_set *isl_set_reset_user(
1711                 __isl_take isl_set *set);
1713         #include <isl/map.h>
1714         __isl_give isl_map *isl_map_reset_user(
1715                 __isl_take isl_map *map);
1717         #include <isl/union_set.h>
1718         __isl_give isl_union_set *isl_union_set_reset_user(
1719                 __isl_take isl_union_set *uset);
1721         #include <isl/union_map.h>
1722         __isl_give isl_union_map *isl_union_map_reset_user(
1723                 __isl_take isl_union_map *umap);
1725         #include <isl/val.h>
1726         __isl_give isl_multi_val *isl_multi_val_reset_user(
1727                 __isl_take isl_multi_val *mv);
1729         #include <isl/aff.h>
1730         __isl_give isl_multi_aff *isl_multi_aff_reset_user(
1731                 __isl_take isl_multi_aff *ma);
1732         __isl_give isl_pw_aff *isl_pw_aff_reset_user(
1733                 __isl_take isl_pw_aff *pa);
1734         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_reset_user(
1735                 __isl_take isl_multi_pw_aff *mpa);
1736         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_user(
1737                 __isl_take isl_pw_multi_aff *pma);
1738         __isl_give isl_union_pw_aff *isl_union_pw_aff_reset_user(
1739                 __isl_take isl_union_pw_aff *upa);
1740         __isl_give isl_multi_union_pw_aff *
1741         isl_multi_union_pw_aff_reset_user(
1742                 __isl_take isl_multi_union_pw_aff *mupa);
1743         __isl_give isl_union_pw_multi_aff *
1744         isl_union_pw_multi_aff_reset_user(
1745                 __isl_take isl_union_pw_multi_aff *upma);
1747         #include <isl/polynomial.h>
1748         __isl_give isl_pw_qpolynomial *
1749         isl_pw_qpolynomial_reset_user(
1750                 __isl_take isl_pw_qpolynomial *pwqp);
1751         __isl_give isl_union_pw_qpolynomial *
1752         isl_union_pw_qpolynomial_reset_user(
1753                 __isl_take isl_union_pw_qpolynomial *upwqp);
1754         __isl_give isl_pw_qpolynomial_fold *
1755         isl_pw_qpolynomial_fold_reset_user(
1756                 __isl_take isl_pw_qpolynomial_fold *pwf);
1757         __isl_give isl_union_pw_qpolynomial_fold *
1758         isl_union_pw_qpolynomial_fold_reset_user(
1759                 __isl_take isl_union_pw_qpolynomial_fold *upwf);
1761 Spaces can be nested.  In particular, the domain of a set or
1762 the domain or range of a relation can be a nested relation.
1763 This process is also called I<wrapping>.
1764 The functions for detecting, constructing and deconstructing
1765 such nested spaces can be found in the wrapping properties
1766 of L</"Unary Properties">, the wrapping operations
1767 of L</"Unary Operations"> and the Cartesian product operations
1768 of L</"Basic Operations">.
1770 Spaces can be created from other spaces
1771 using the functions described in L</"Unary Operations">
1772 and L</"Binary Operations">.
1774 =head2 Local Spaces
1776 A local space is essentially a space with
1777 zero or more existentially quantified variables.
1778 The local space of various objects can be obtained
1779 using the following functions.
1781         #include <isl/constraint.h>
1782         __isl_give isl_local_space *isl_constraint_get_local_space(
1783                 __isl_keep isl_constraint *constraint);
1785         #include <isl/set.h>
1786         __isl_give isl_local_space *isl_basic_set_get_local_space(
1787                 __isl_keep isl_basic_set *bset);
1789         #include <isl/map.h>
1790         __isl_give isl_local_space *isl_basic_map_get_local_space(
1791                 __isl_keep isl_basic_map *bmap);
1793         #include <isl/aff.h>
1794         __isl_give isl_local_space *isl_aff_get_domain_local_space(
1795                 __isl_keep isl_aff *aff);
1796         __isl_give isl_local_space *isl_aff_get_local_space(
1797                 __isl_keep isl_aff *aff);
1799 A new local space can be created from a space using
1801         #include <isl/local_space.h>
1802         __isl_give isl_local_space *isl_local_space_from_space(
1803                 __isl_take isl_space *space);
1805 They can be inspected, modified, copied and freed using the following functions.
1807         #include <isl/local_space.h>
1808         isl_bool isl_local_space_is_params(
1809                 __isl_keep isl_local_space *ls);
1810         isl_bool isl_local_space_is_set(
1811                 __isl_keep isl_local_space *ls);
1812         __isl_give isl_space *isl_local_space_get_space(
1813                 __isl_keep isl_local_space *ls);
1814         __isl_give isl_aff *isl_local_space_get_div(
1815                 __isl_keep isl_local_space *ls, int pos);
1816         __isl_give isl_local_space *isl_local_space_copy(
1817                 __isl_keep isl_local_space *ls);
1818         __isl_null isl_local_space *isl_local_space_free(
1819                 __isl_take isl_local_space *ls);
1821 Note that C<isl_local_space_get_div> can only be used on local spaces
1822 of sets.
1824 Two local spaces can be compared using
1826         isl_bool isl_local_space_is_equal(
1827                 __isl_keep isl_local_space *ls1,
1828                 __isl_keep isl_local_space *ls2);
1830 Local spaces can be created from other local spaces
1831 using the functions described in L</"Unary Operations">
1832 and L</"Binary Operations">.
1834 =head2 Creating New Sets and Relations
1836 C<isl> has functions for creating some standard sets and relations.
1838 =over
1840 =item * Empty sets and relations
1842         __isl_give isl_basic_set *isl_basic_set_empty(
1843                 __isl_take isl_space *space);
1844         __isl_give isl_basic_map *isl_basic_map_empty(
1845                 __isl_take isl_space *space);
1846         __isl_give isl_set *isl_set_empty(
1847                 __isl_take isl_space *space);
1848         __isl_give isl_map *isl_map_empty(
1849                 __isl_take isl_space *space);
1850         __isl_give isl_union_set *isl_union_set_empty(
1851                 __isl_take isl_space *space);
1852         __isl_give isl_union_map *isl_union_map_empty(
1853                 __isl_take isl_space *space);
1855 For C<isl_union_set>s and C<isl_union_map>s, the space
1856 is only used to specify the parameters.
1858 =item * Universe sets and relations
1860         __isl_give isl_basic_set *isl_basic_set_universe(
1861                 __isl_take isl_space *space);
1862         __isl_give isl_basic_map *isl_basic_map_universe(
1863                 __isl_take isl_space *space);
1864         __isl_give isl_set *isl_set_universe(
1865                 __isl_take isl_space *space);
1866         __isl_give isl_map *isl_map_universe(
1867                 __isl_take isl_space *space);
1868         __isl_give isl_union_set *isl_union_set_universe(
1869                 __isl_take isl_union_set *uset);
1870         __isl_give isl_union_map *isl_union_map_universe(
1871                 __isl_take isl_union_map *umap);
1873 The sets and relations constructed by the functions above
1874 contain all integer values, while those constructed by the
1875 functions below only contain non-negative values.
1877         __isl_give isl_basic_set *isl_basic_set_nat_universe(
1878                 __isl_take isl_space *space);
1879         __isl_give isl_basic_map *isl_basic_map_nat_universe(
1880                 __isl_take isl_space *space);
1881         __isl_give isl_set *isl_set_nat_universe(
1882                 __isl_take isl_space *space);
1883         __isl_give isl_map *isl_map_nat_universe(
1884                 __isl_take isl_space *space);
1886 =item * Identity relations
1888         __isl_give isl_basic_map *isl_basic_map_identity(
1889                 __isl_take isl_space *space);
1890         __isl_give isl_map *isl_map_identity(
1891                 __isl_take isl_space *space);
1893 The number of input and output dimensions in C<space> needs
1894 to be the same.
1896 =item * Lexicographic order
1898         __isl_give isl_map *isl_map_lex_lt(
1899                 __isl_take isl_space *set_space);
1900         __isl_give isl_map *isl_map_lex_le(
1901                 __isl_take isl_space *set_space);
1902         __isl_give isl_map *isl_map_lex_gt(
1903                 __isl_take isl_space *set_space);
1904         __isl_give isl_map *isl_map_lex_ge(
1905                 __isl_take isl_space *set_space);
1906         __isl_give isl_map *isl_map_lex_lt_first(
1907                 __isl_take isl_space *space, unsigned n);
1908         __isl_give isl_map *isl_map_lex_le_first(
1909                 __isl_take isl_space *space, unsigned n);
1910         __isl_give isl_map *isl_map_lex_gt_first(
1911                 __isl_take isl_space *space, unsigned n);
1912         __isl_give isl_map *isl_map_lex_ge_first(
1913                 __isl_take isl_space *space, unsigned n);
1915 The first four functions take a space for a B<set>
1916 and return relations that express that the elements in the domain
1917 are lexicographically less
1918 (C<isl_map_lex_lt>), less or equal (C<isl_map_lex_le>),
1919 greater (C<isl_map_lex_gt>) or greater or equal (C<isl_map_lex_ge>)
1920 than the elements in the range.
1921 The last four functions take a space for a map
1922 and return relations that express that the first C<n> dimensions
1923 in the domain are lexicographically less
1924 (C<isl_map_lex_lt_first>), less or equal (C<isl_map_lex_le_first>),
1925 greater (C<isl_map_lex_gt_first>) or greater or equal (C<isl_map_lex_ge_first>)
1926 than the first C<n> dimensions in the range.
1928 =back
1930 A basic set or relation can be converted to a set or relation
1931 using the following functions.
1933         __isl_give isl_set *isl_set_from_basic_set(
1934                 __isl_take isl_basic_set *bset);
1935         __isl_give isl_map *isl_map_from_basic_map(
1936                 __isl_take isl_basic_map *bmap);
1938 Sets and relations can be converted to union sets and relations
1939 using the following functions.
1941         __isl_give isl_union_set *isl_union_set_from_basic_set(
1942                 __isl_take isl_basic_set *bset);
1943         __isl_give isl_union_map *isl_union_map_from_basic_map(
1944                 __isl_take isl_basic_map *bmap);
1945         __isl_give isl_union_set *isl_union_set_from_set(
1946                 __isl_take isl_set *set);
1947         __isl_give isl_union_map *isl_union_map_from_map(
1948                 __isl_take isl_map *map);
1950 The inverse conversions below can only be used if the input
1951 union set or relation is known to contain elements in exactly one
1952 space.
1954         __isl_give isl_set *isl_set_from_union_set(
1955                 __isl_take isl_union_set *uset);
1956         __isl_give isl_map *isl_map_from_union_map(
1957                 __isl_take isl_union_map *umap);
1959 Sets and relations can be copied and freed again using the following
1960 functions.
1962         __isl_give isl_basic_set *isl_basic_set_copy(
1963                 __isl_keep isl_basic_set *bset);
1964         __isl_give isl_set *isl_set_copy(__isl_keep isl_set *set);
1965         __isl_give isl_union_set *isl_union_set_copy(
1966                 __isl_keep isl_union_set *uset);
1967         __isl_give isl_basic_map *isl_basic_map_copy(
1968                 __isl_keep isl_basic_map *bmap);
1969         __isl_give isl_map *isl_map_copy(__isl_keep isl_map *map);
1970         __isl_give isl_union_map *isl_union_map_copy(
1971                 __isl_keep isl_union_map *umap);
1972         __isl_null isl_basic_set *isl_basic_set_free(
1973                 __isl_take isl_basic_set *bset);
1974         __isl_null isl_set *isl_set_free(__isl_take isl_set *set);
1975         __isl_null isl_union_set *isl_union_set_free(
1976                 __isl_take isl_union_set *uset);
1977         __isl_null isl_basic_map *isl_basic_map_free(
1978                 __isl_take isl_basic_map *bmap);
1979         __isl_null isl_map *isl_map_free(__isl_take isl_map *map);
1980         __isl_null isl_union_map *isl_union_map_free(
1981                 __isl_take isl_union_map *umap);
1983 Other sets and relations can be constructed by starting
1984 from a universe set or relation, adding equality and/or
1985 inequality constraints and then projecting out the
1986 existentially quantified variables, if any.
1987 Constraints can be constructed, manipulated and
1988 added to (or removed from) (basic) sets and relations
1989 using the following functions.
1991         #include <isl/constraint.h>
1992         __isl_give isl_constraint *isl_constraint_alloc_equality(
1993                 __isl_take isl_local_space *ls);
1994         __isl_give isl_constraint *isl_constraint_alloc_inequality(
1995                 __isl_take isl_local_space *ls);
1996         __isl_give isl_constraint *isl_constraint_set_constant_si(
1997                 __isl_take isl_constraint *constraint, int v);
1998         __isl_give isl_constraint *isl_constraint_set_constant_val(
1999                 __isl_take isl_constraint *constraint,
2000                 __isl_take isl_val *v);
2001         __isl_give isl_constraint *isl_constraint_set_coefficient_si(
2002                 __isl_take isl_constraint *constraint,
2003                 enum isl_dim_type type, int pos, int v);
2004         __isl_give isl_constraint *
2005         isl_constraint_set_coefficient_val(
2006                 __isl_take isl_constraint *constraint,
2007                 enum isl_dim_type type, int pos,
2008                 __isl_take isl_val *v);
2009         __isl_give isl_basic_map *isl_basic_map_add_constraint(
2010                 __isl_take isl_basic_map *bmap,
2011                 __isl_take isl_constraint *constraint);
2012         __isl_give isl_basic_set *isl_basic_set_add_constraint(
2013                 __isl_take isl_basic_set *bset,
2014                 __isl_take isl_constraint *constraint);
2015         __isl_give isl_map *isl_map_add_constraint(
2016                 __isl_take isl_map *map,
2017                 __isl_take isl_constraint *constraint);
2018         __isl_give isl_set *isl_set_add_constraint(
2019                 __isl_take isl_set *set,
2020                 __isl_take isl_constraint *constraint);
2022 For example, to create a set containing the even integers
2023 between 10 and 42, you would use the following code.
2025         isl_space *space;
2026         isl_local_space *ls;
2027         isl_constraint *c;
2028         isl_basic_set *bset;
2030         space = isl_space_set_alloc(ctx, 0, 2);
2031         bset = isl_basic_set_universe(isl_space_copy(space));
2032         ls = isl_local_space_from_space(space);
2034         c = isl_constraint_alloc_equality(isl_local_space_copy(ls));
2035         c = isl_constraint_set_coefficient_si(c, isl_dim_set, 0, -1);
2036         c = isl_constraint_set_coefficient_si(c, isl_dim_set, 1, 2);
2037         bset = isl_basic_set_add_constraint(bset, c);
2039         c = isl_constraint_alloc_inequality(isl_local_space_copy(ls));
2040         c = isl_constraint_set_constant_si(c, -10);
2041         c = isl_constraint_set_coefficient_si(c, isl_dim_set, 0, 1);
2042         bset = isl_basic_set_add_constraint(bset, c);
2044         c = isl_constraint_alloc_inequality(ls);
2045         c = isl_constraint_set_constant_si(c, 42);
2046         c = isl_constraint_set_coefficient_si(c, isl_dim_set, 0, -1);
2047         bset = isl_basic_set_add_constraint(bset, c);
2049         bset = isl_basic_set_project_out(bset, isl_dim_set, 1, 1);
2051 Or, alternatively,
2053         isl_basic_set *bset;
2054         bset = isl_basic_set_read_from_str(ctx,
2055                 "{[i] : exists (a : i = 2a and i >= 10 and i <= 42)}");
2057 A basic set or relation can also be constructed from two matrices
2058 describing the equalities and the inequalities.
2060         __isl_give isl_basic_set *isl_basic_set_from_constraint_matrices(
2061                 __isl_take isl_space *space,
2062                 __isl_take isl_mat *eq, __isl_take isl_mat *ineq,
2063                 enum isl_dim_type c1,
2064                 enum isl_dim_type c2, enum isl_dim_type c3,
2065                 enum isl_dim_type c4);
2066         __isl_give isl_basic_map *isl_basic_map_from_constraint_matrices(
2067                 __isl_take isl_space *space,
2068                 __isl_take isl_mat *eq, __isl_take isl_mat *ineq,
2069                 enum isl_dim_type c1,
2070                 enum isl_dim_type c2, enum isl_dim_type c3,
2071                 enum isl_dim_type c4, enum isl_dim_type c5);
2073 The C<isl_dim_type> arguments indicate the order in which
2074 different kinds of variables appear in the input matrices
2075 and should be a permutation of C<isl_dim_cst>, C<isl_dim_param>,
2076 C<isl_dim_set> and C<isl_dim_div> for sets and
2077 of C<isl_dim_cst>, C<isl_dim_param>,
2078 C<isl_dim_in>, C<isl_dim_out> and C<isl_dim_div> for relations.
2080 A (basic or union) set or relation can also be constructed from a
2081 (union) (piecewise) (multiple) affine expression
2082 or a list of affine expressions
2083 (See L</"Functions">), provided these affine expressions do not
2084 involve any NaN.
2086         __isl_give isl_basic_map *isl_basic_map_from_aff(
2087                 __isl_take isl_aff *aff);
2088         __isl_give isl_map *isl_map_from_aff(
2089                 __isl_take isl_aff *aff);
2090         __isl_give isl_set *isl_set_from_pw_aff(
2091                 __isl_take isl_pw_aff *pwaff);
2092         __isl_give isl_map *isl_map_from_pw_aff(
2093                 __isl_take isl_pw_aff *pwaff);
2094         __isl_give isl_basic_map *isl_basic_map_from_aff_list(
2095                 __isl_take isl_space *domain_space,
2096                 __isl_take isl_aff_list *list);
2097         __isl_give isl_basic_map *isl_basic_map_from_multi_aff(
2098                 __isl_take isl_multi_aff *maff)
2099         __isl_give isl_map *isl_map_from_multi_aff(
2100                 __isl_take isl_multi_aff *maff)
2101         __isl_give isl_set *isl_set_from_pw_multi_aff(
2102                 __isl_take isl_pw_multi_aff *pma);
2103         __isl_give isl_map *isl_map_from_pw_multi_aff(
2104                 __isl_take isl_pw_multi_aff *pma);
2105         __isl_give isl_set *isl_set_from_multi_pw_aff(
2106                 __isl_take isl_multi_pw_aff *mpa);
2107         __isl_give isl_map *isl_map_from_multi_pw_aff(
2108                 __isl_take isl_multi_pw_aff *mpa);
2109         __isl_give isl_union_map *isl_union_map_from_union_pw_aff(
2110                 __isl_take isl_union_pw_aff *upa);
2111         __isl_give isl_union_map *
2112         isl_union_map_from_union_pw_multi_aff(
2113                 __isl_take isl_union_pw_multi_aff *upma);
2114         __isl_give isl_union_map *
2115         isl_union_map_from_multi_union_pw_aff(
2116                 __isl_take isl_multi_union_pw_aff *mupa);
2118 The C<domain_space> argument describes the domain of the resulting
2119 basic relation.  It is required because the C<list> may consist
2120 of zero affine expressions.
2121 The C<mupa> passed to C<isl_union_map_from_multi_union_pw_aff>
2122 is not allowed to be zero-dimensional.  The domain of the result
2123 is the shared domain of the union piecewise affine elements.
2125 =head2 Inspecting Sets and Relations
2127 Usually, the user should not have to care about the actual constraints
2128 of the sets and maps, but should instead apply the abstract operations
2129 explained in the following sections.
2130 Occasionally, however, it may be required to inspect the individual
2131 coefficients of the constraints.  This section explains how to do so.
2132 In these cases, it may also be useful to have C<isl> compute
2133 an explicit representation of the existentially quantified variables.
2135         __isl_give isl_set *isl_set_compute_divs(
2136                 __isl_take isl_set *set);
2137         __isl_give isl_map *isl_map_compute_divs(
2138                 __isl_take isl_map *map);
2139         __isl_give isl_union_set *isl_union_set_compute_divs(
2140                 __isl_take isl_union_set *uset);
2141         __isl_give isl_union_map *isl_union_map_compute_divs(
2142                 __isl_take isl_union_map *umap);
2144 This explicit representation defines the existentially quantified
2145 variables as integer divisions of the other variables, possibly
2146 including earlier existentially quantified variables.
2147 An explicitly represented existentially quantified variable therefore
2148 has a unique value when the values of the other variables are known.
2150 Alternatively, the existentially quantified variables can be removed
2151 using the following functions, which compute an overapproximation.
2153         #include <isl/set.h>
2154         __isl_give isl_basic_set *isl_basic_set_remove_divs(
2155                 __isl_take isl_basic_set *bset);
2156         __isl_give isl_set *isl_set_remove_divs(
2157                 __isl_take isl_set *set);
2159         #include <isl/map.h>
2160         __isl_give isl_basic_map *isl_basic_map_remove_divs(
2161                 __isl_take isl_basic_map *bmap);
2162         __isl_give isl_map *isl_map_remove_divs(
2163                 __isl_take isl_map *map);
2165         #include <isl/union_set.h>
2166         __isl_give isl_union_set *isl_union_set_remove_divs(
2167                 __isl_take isl_union_set *bset);
2169         #include <isl/union_map.h>
2170         __isl_give isl_union_map *isl_union_map_remove_divs(
2171                 __isl_take isl_union_map *bmap);
2173 It is also possible to only remove those divs that are defined
2174 in terms of a given range of dimensions or only those for which
2175 no explicit representation is known.
2177         __isl_give isl_basic_set *
2178         isl_basic_set_remove_divs_involving_dims(
2179                 __isl_take isl_basic_set *bset,
2180                 enum isl_dim_type type,
2181                 unsigned first, unsigned n);
2182         __isl_give isl_basic_map *
2183         isl_basic_map_remove_divs_involving_dims(
2184                 __isl_take isl_basic_map *bmap,
2185                 enum isl_dim_type type,
2186                 unsigned first, unsigned n);
2187         __isl_give isl_set *isl_set_remove_divs_involving_dims(
2188                 __isl_take isl_set *set, enum isl_dim_type type,
2189                 unsigned first, unsigned n);
2190         __isl_give isl_map *isl_map_remove_divs_involving_dims(
2191                 __isl_take isl_map *map, enum isl_dim_type type,
2192                 unsigned first, unsigned n);
2194         __isl_give isl_basic_set *
2195         isl_basic_set_remove_unknown_divs(
2196                 __isl_take isl_basic_set *bset);
2197         __isl_give isl_set *isl_set_remove_unknown_divs(
2198                 __isl_take isl_set *set);
2199         __isl_give isl_map *isl_map_remove_unknown_divs(
2200                 __isl_take isl_map *map);
2202 To iterate over all the sets or maps in a union set or map, use
2204         #include <isl/union_set.h>
2205         isl_stat isl_union_set_foreach_set(
2206                 __isl_keep isl_union_set *uset,
2207                 isl_stat (*fn)(__isl_take isl_set *set, void *user),
2208                 void *user);
2210         #include <isl/union_map.h>
2211         isl_stat isl_union_map_foreach_map(
2212                 __isl_keep isl_union_map *umap,
2213                 isl_stat (*fn)(__isl_take isl_map *map, void *user),
2214                 void *user);
2215         isl_bool isl_union_map_every_map(
2216                 __isl_keep isl_union_map *umap,
2217                 isl_bool (*test)(__isl_keep isl_map *map,
2218                         void *user),
2219                 void *user);
2221 These functions call the callback function once for each
2222 (pair of) space(s) for which there are elements in the input.
2223 The argument to the callback contains all elements in the input
2224 with that (pair of) space(s).
2225 The C<isl_union_map_every_map> variant check whether each
2226 call to the callback returns true and stops checking as soon as one
2227 of these calls returns false.
2229 The number of sets or maps in a union set or map can be obtained
2230 from
2232         int isl_union_set_n_set(__isl_keep isl_union_set *uset);
2233         int isl_union_map_n_map(__isl_keep isl_union_map *umap);
2235 To extract the set or map in a given space from a union, use
2237         __isl_give isl_set *isl_union_set_extract_set(
2238                 __isl_keep isl_union_set *uset,
2239                 __isl_take isl_space *space);
2240         __isl_give isl_map *isl_union_map_extract_map(
2241                 __isl_keep isl_union_map *umap,
2242                 __isl_take isl_space *space);
2244 To iterate over all the basic sets or maps in a set or map, use
2246         isl_stat isl_set_foreach_basic_set(__isl_keep isl_set *set,
2247                 isl_stat (*fn)(__isl_take isl_basic_set *bset,
2248                         void *user),
2249                 void *user);
2250         isl_stat isl_map_foreach_basic_map(__isl_keep isl_map *map,
2251                 isl_stat (*fn)(__isl_take isl_basic_map *bmap,
2252                         void *user),
2253                 void *user);
2255 The callback function C<fn> should return C<isl_stat_ok> if successful and
2256 C<isl_stat_error> if an error occurs.  In the latter case, or if any other error
2257 occurs, the above functions will return C<isl_stat_error>.
2259 It should be noted that C<isl> does not guarantee that
2260 the basic sets or maps passed to C<fn> are disjoint.
2261 If this is required, then the user should call one of
2262 the following functions first.
2264         __isl_give isl_set *isl_set_make_disjoint(
2265                 __isl_take isl_set *set);
2266         __isl_give isl_map *isl_map_make_disjoint(
2267                 __isl_take isl_map *map);
2269 The number of basic sets in a set can be obtained
2270 or the number of basic maps in a map can be obtained
2271 from
2273         #include <isl/set.h>
2274         int isl_set_n_basic_set(__isl_keep isl_set *set);
2276         #include <isl/map.h>
2277         int isl_map_n_basic_map(__isl_keep isl_map *map);
2279 It is also possible to obtain a list of basic sets from a set
2280 or union set
2282         #include <isl/set.h>
2283         __isl_give isl_basic_set_list *isl_set_get_basic_set_list(
2284                 __isl_keep isl_set *set);
2286         #include <isl/union_set.h>
2287         __isl_give isl_basic_set_list *
2288         isl_union_set_get_basic_set_list(
2289                 __isl_keep isl_union_set *uset);
2291 The returned list can be manipulated using the functions in L<"Lists">.
2293 To iterate over the constraints of a basic set or map, use
2295         #include <isl/constraint.h>
2297         int isl_basic_set_n_constraint(
2298                 __isl_keep isl_basic_set *bset);
2299         isl_stat isl_basic_set_foreach_constraint(
2300                 __isl_keep isl_basic_set *bset,
2301                 isl_stat (*fn)(__isl_take isl_constraint *c,
2302                         void *user),
2303                 void *user);
2304         int isl_basic_map_n_constraint(
2305                 __isl_keep isl_basic_map *bmap);
2306         isl_stat isl_basic_map_foreach_constraint(
2307                 __isl_keep isl_basic_map *bmap,
2308                 isl_stat (*fn)(__isl_take isl_constraint *c,
2309                         void *user),
2310                 void *user);
2311         __isl_null isl_constraint *isl_constraint_free(
2312                 __isl_take isl_constraint *c);
2314 Again, the callback function C<fn> should return C<isl_stat_ok>
2315 if successful and
2316 C<isl_stat_error> if an error occurs.  In the latter case, or if any other error
2317 occurs, the above functions will return C<isl_stat_error>.
2318 The constraint C<c> represents either an equality or an inequality.
2319 Use the following function to find out whether a constraint
2320 represents an equality.  If not, it represents an inequality.
2322         isl_bool isl_constraint_is_equality(
2323                 __isl_keep isl_constraint *constraint);
2325 It is also possible to obtain a list of constraints from a basic
2326 map or set
2328         #include <isl/constraint.h>
2329         __isl_give isl_constraint_list *
2330         isl_basic_map_get_constraint_list(
2331                 __isl_keep isl_basic_map *bmap);
2332         __isl_give isl_constraint_list *
2333         isl_basic_set_get_constraint_list(
2334                 __isl_keep isl_basic_set *bset);
2336 These functions require that all existentially quantified variables
2337 have an explicit representation.
2338 The returned list can be manipulated using the functions in L<"Lists">.
2340 The coefficients of the constraints can be inspected using
2341 the following functions.
2343         isl_bool isl_constraint_is_lower_bound(
2344                 __isl_keep isl_constraint *constraint,
2345                 enum isl_dim_type type, unsigned pos);
2346         isl_bool isl_constraint_is_upper_bound(
2347                 __isl_keep isl_constraint *constraint,
2348                 enum isl_dim_type type, unsigned pos);
2349         __isl_give isl_val *isl_constraint_get_constant_val(
2350                 __isl_keep isl_constraint *constraint);
2351         __isl_give isl_val *isl_constraint_get_coefficient_val(
2352                 __isl_keep isl_constraint *constraint,
2353                 enum isl_dim_type type, int pos);
2355 The explicit representations of the existentially quantified
2356 variables can be inspected using the following function.
2357 Note that the user is only allowed to use this function
2358 if the inspected set or map is the result of a call
2359 to C<isl_set_compute_divs> or C<isl_map_compute_divs>.
2360 The existentially quantified variable is equal to the floor
2361 of the returned affine expression.  The affine expression
2362 itself can be inspected using the functions in
2363 L</"Functions">.
2365         __isl_give isl_aff *isl_constraint_get_div(
2366                 __isl_keep isl_constraint *constraint, int pos);
2368 To obtain the constraints of a basic set or map in matrix
2369 form, use the following functions.
2371         __isl_give isl_mat *isl_basic_set_equalities_matrix(
2372                 __isl_keep isl_basic_set *bset,
2373                 enum isl_dim_type c1, enum isl_dim_type c2,
2374                 enum isl_dim_type c3, enum isl_dim_type c4);
2375         __isl_give isl_mat *isl_basic_set_inequalities_matrix(
2376                 __isl_keep isl_basic_set *bset,
2377                 enum isl_dim_type c1, enum isl_dim_type c2,
2378                 enum isl_dim_type c3, enum isl_dim_type c4);
2379         __isl_give isl_mat *isl_basic_map_equalities_matrix(
2380                 __isl_keep isl_basic_map *bmap,
2381                 enum isl_dim_type c1,
2382                 enum isl_dim_type c2, enum isl_dim_type c3,
2383                 enum isl_dim_type c4, enum isl_dim_type c5);
2384         __isl_give isl_mat *isl_basic_map_inequalities_matrix(
2385                 __isl_keep isl_basic_map *bmap,
2386                 enum isl_dim_type c1,
2387                 enum isl_dim_type c2, enum isl_dim_type c3,
2388                 enum isl_dim_type c4, enum isl_dim_type c5);
2390 The C<isl_dim_type> arguments dictate the order in which
2391 different kinds of variables appear in the resulting matrix.
2392 For set inputs, they should be a permutation of
2393 C<isl_dim_cst>, C<isl_dim_param>, C<isl_dim_set> and C<isl_dim_div>.
2394 For map inputs, they should be a permutation of
2395 C<isl_dim_cst>, C<isl_dim_param>,
2396 C<isl_dim_in>, C<isl_dim_out> and C<isl_dim_div>.
2398 =head2 Points
2400 Points are elements of a set.  They can be used to construct
2401 simple sets (boxes) or they can be used to represent the
2402 individual elements of a set.
2403 The zero point (the origin) can be created using
2405         __isl_give isl_point *isl_point_zero(__isl_take isl_space *space);
2407 The coordinates of a point can be inspected, set and changed
2408 using
2410         __isl_give isl_val *isl_point_get_coordinate_val(
2411                 __isl_keep isl_point *pnt,
2412                 enum isl_dim_type type, int pos);
2413         __isl_give isl_point *isl_point_set_coordinate_val(
2414                 __isl_take isl_point *pnt,
2415                 enum isl_dim_type type, int pos,
2416                 __isl_take isl_val *v);
2418         __isl_give isl_point *isl_point_add_ui(
2419                 __isl_take isl_point *pnt,
2420                 enum isl_dim_type type, int pos, unsigned val);
2421         __isl_give isl_point *isl_point_sub_ui(
2422                 __isl_take isl_point *pnt,
2423                 enum isl_dim_type type, int pos, unsigned val);
2425 Points can be copied or freed using
2427         __isl_give isl_point *isl_point_copy(
2428                 __isl_keep isl_point *pnt);
2429         __isl_null isl_point *isl_point_free(
2430                 __isl_take isl_point *pnt);
2432 A singleton set can be created from a point using
2434         __isl_give isl_basic_set *isl_basic_set_from_point(
2435                 __isl_take isl_point *pnt);
2436         __isl_give isl_set *isl_set_from_point(
2437                 __isl_take isl_point *pnt);
2438         __isl_give isl_union_set *isl_union_set_from_point(
2439                 __isl_take isl_point *pnt);
2441 and a box can be created from two opposite extremal points using
2443         __isl_give isl_basic_set *isl_basic_set_box_from_points(
2444                 __isl_take isl_point *pnt1,
2445                 __isl_take isl_point *pnt2);
2446         __isl_give isl_set *isl_set_box_from_points(
2447                 __isl_take isl_point *pnt1,
2448                 __isl_take isl_point *pnt2);
2450 All elements of a B<bounded> (union) set can be enumerated using
2451 the following functions.
2453         isl_stat isl_set_foreach_point(__isl_keep isl_set *set,
2454                 isl_stat (*fn)(__isl_take isl_point *pnt,
2455                         void *user),
2456                 void *user);
2457         isl_stat isl_union_set_foreach_point(
2458                 __isl_keep isl_union_set *uset,
2459                 isl_stat (*fn)(__isl_take isl_point *pnt,
2460                         void *user),
2461                 void *user);
2463 The function C<fn> is called for each integer point in
2464 C<set> with as second argument the last argument of
2465 the C<isl_set_foreach_point> call.  The function C<fn>
2466 should return C<isl_stat_ok> on success and C<isl_stat_error> on failure.
2467 In the latter case, C<isl_set_foreach_point> will stop
2468 enumerating and return C<isl_stat_error> as well.
2469 If the enumeration is performed successfully and to completion,
2470 then C<isl_set_foreach_point> returns C<isl_stat_ok>.
2472 To obtain a single point of a (basic or union) set, use
2474         __isl_give isl_point *isl_basic_set_sample_point(
2475                 __isl_take isl_basic_set *bset);
2476         __isl_give isl_point *isl_set_sample_point(
2477                 __isl_take isl_set *set);
2478         __isl_give isl_point *isl_union_set_sample_point(
2479                 __isl_take isl_union_set *uset);
2481 If C<set> does not contain any (integer) points, then the
2482 resulting point will be ``void'', a property that can be
2483 tested using
2485         isl_bool isl_point_is_void(__isl_keep isl_point *pnt);
2487 =head2 Functions
2489 Besides sets and relation, C<isl> also supports various types of functions.
2490 Each of these types is derived from the value type (see L</"Values">)
2491 or from one of two primitive function types
2492 through the application of zero or more type constructors.
2493 We first describe the primitive type and then we describe
2494 the types derived from these primitive types.
2496 =head3 Primitive Functions
2498 C<isl> support two primitive function types, quasi-affine
2499 expressions and quasipolynomials.
2500 A quasi-affine expression is defined either over a parameter
2501 space or over a set and is composed of integer constants,
2502 parameters and set variables, addition, subtraction and
2503 integer division by an integer constant.
2504 For example, the quasi-affine expression
2506         [n] -> { [x] -> [2*floor((4 n + x)/9)] }
2508 maps C<x> to C<2*floor((4 n + x)/9>.
2509 A quasipolynomial is a polynomial expression in quasi-affine
2510 expression.  That is, it additionally allows for multiplication.
2511 Note, though, that it is not allowed to construct an integer
2512 division of an expression involving multiplications.
2513 Here is an example of a quasipolynomial that is not
2514 quasi-affine expression
2516         [n] -> { [x] -> (n*floor((4 n + x)/9)) }
2518 Note that the external representations of quasi-affine expressions
2519 and quasipolynomials are different.  Quasi-affine expressions
2520 use a notation with square brackets just like binary relations,
2521 while quasipolynomials do not.  This might change at some point.
2523 If a primitive function is defined over a parameter space,
2524 then the space of the function itself is that of a set.
2525 If it is defined over a set, then the space of the function
2526 is that of a relation.  In both cases, the set space (or
2527 the output space) is single-dimensional, anonymous and unstructured.
2528 To create functions with multiple dimensions or with other kinds
2529 of set or output spaces, use multiple expressions
2530 (see L</"Multiple Expressions">).
2532 =over
2534 =item * Quasi-affine Expressions
2536 Besides the expressions described above, a quasi-affine
2537 expression can also be set to NaN.  Such expressions
2538 typically represent a failure to represent a result
2539 as a quasi-affine expression.
2541 The zero quasi affine expression or the quasi affine expression
2542 that is equal to a given value, parameter or
2543 a specified dimension on a given domain can be created using
2545         #include <isl/aff.h>
2546         __isl_give isl_aff *isl_aff_zero_on_domain(
2547                 __isl_take isl_local_space *ls);
2548         __isl_give isl_aff *isl_aff_val_on_domain(
2549                 __isl_take isl_local_space *ls,
2550                 __isl_take isl_val *val);
2551         __isl_give isl_aff *isl_aff_param_on_domain_space_id(
2552                 __isl_take isl_space *space,
2553                 __isl_take isl_id *id);
2554         __isl_give isl_aff *isl_aff_var_on_domain(
2555                 __isl_take isl_local_space *ls,
2556                 enum isl_dim_type type, unsigned pos);
2557         __isl_give isl_aff *isl_aff_nan_on_domain(
2558                 __isl_take isl_local_space *ls);
2560 The space passed to C<isl_aff_param_on_domain_space_id>
2561 is required to have a parameter with the given identifier.
2563 Quasi affine expressions can be copied and freed using
2565         #include <isl/aff.h>
2566         __isl_give isl_aff *isl_aff_copy(
2567                 __isl_keep isl_aff *aff);
2568         __isl_null isl_aff *isl_aff_free(
2569                 __isl_take isl_aff *aff);
2571 A (rational) bound on a dimension can be extracted from an C<isl_constraint>
2572 using the following function.  The constraint is required to have
2573 a non-zero coefficient for the specified dimension.
2575         #include <isl/constraint.h>
2576         __isl_give isl_aff *isl_constraint_get_bound(
2577                 __isl_keep isl_constraint *constraint,
2578                 enum isl_dim_type type, int pos);
2580 The entire affine expression of the constraint can also be extracted
2581 using the following function.
2583         #include <isl/constraint.h>
2584         __isl_give isl_aff *isl_constraint_get_aff(
2585                 __isl_keep isl_constraint *constraint);
2587 Conversely, an equality constraint equating
2588 the affine expression to zero or an inequality constraint enforcing
2589 the affine expression to be non-negative, can be constructed using
2591         __isl_give isl_constraint *isl_equality_from_aff(
2592                 __isl_take isl_aff *aff);
2593         __isl_give isl_constraint *isl_inequality_from_aff(
2594                 __isl_take isl_aff *aff);
2596 The coefficients and the integer divisions of an affine expression
2597 can be inspected using the following functions.
2599         #include <isl/aff.h>
2600         __isl_give isl_val *isl_aff_get_constant_val(
2601                 __isl_keep isl_aff *aff);
2602         __isl_give isl_val *isl_aff_get_coefficient_val(
2603                 __isl_keep isl_aff *aff,
2604                 enum isl_dim_type type, int pos);
2605         int isl_aff_coefficient_sgn(__isl_keep isl_aff *aff,
2606                 enum isl_dim_type type, int pos);
2607         __isl_give isl_val *isl_aff_get_denominator_val(
2608                 __isl_keep isl_aff *aff);
2609         __isl_give isl_aff *isl_aff_get_div(
2610                 __isl_keep isl_aff *aff, int pos);
2612 They can be modified using the following functions.
2614         #include <isl/aff.h>
2615         __isl_give isl_aff *isl_aff_set_constant_si(
2616                 __isl_take isl_aff *aff, int v);
2617         __isl_give isl_aff *isl_aff_set_constant_val(
2618                 __isl_take isl_aff *aff, __isl_take isl_val *v);
2619         __isl_give isl_aff *isl_aff_set_coefficient_si(
2620                 __isl_take isl_aff *aff,
2621                 enum isl_dim_type type, int pos, int v);
2622         __isl_give isl_aff *isl_aff_set_coefficient_val(
2623                 __isl_take isl_aff *aff,
2624                 enum isl_dim_type type, int pos,
2625                 __isl_take isl_val *v);
2627         __isl_give isl_aff *isl_aff_add_constant_si(
2628                 __isl_take isl_aff *aff, int v);
2629         __isl_give isl_aff *isl_aff_add_constant_val(
2630                 __isl_take isl_aff *aff, __isl_take isl_val *v);
2631         __isl_give isl_aff *isl_aff_add_constant_num_si(
2632                 __isl_take isl_aff *aff, int v);
2633         __isl_give isl_aff *isl_aff_add_coefficient_si(
2634                 __isl_take isl_aff *aff,
2635                 enum isl_dim_type type, int pos, int v);
2636         __isl_give isl_aff *isl_aff_add_coefficient_val(
2637                 __isl_take isl_aff *aff,
2638                 enum isl_dim_type type, int pos,
2639                 __isl_take isl_val *v);
2641 Note that C<isl_aff_set_constant_si> and C<isl_aff_set_coefficient_si>
2642 set the I<numerator> of the constant or coefficient, while
2643 C<isl_aff_set_constant_val> and C<isl_aff_set_coefficient_val> set
2644 the constant or coefficient as a whole.
2645 The C<add_constant> and C<add_coefficient> functions add an integer
2646 or rational value to
2647 the possibly rational constant or coefficient.
2648 The C<add_constant_num> functions add an integer value to
2649 the numerator.
2651 =item * Quasipolynomials
2653 Some simple quasipolynomials can be created using the following functions.
2655         #include <isl/polynomial.h>
2656         __isl_give isl_qpolynomial *isl_qpolynomial_zero_on_domain(
2657                 __isl_take isl_space *domain);
2658         __isl_give isl_qpolynomial *isl_qpolynomial_one_on_domain(
2659                 __isl_take isl_space *domain);
2660         __isl_give isl_qpolynomial *isl_qpolynomial_infty_on_domain(
2661                 __isl_take isl_space *domain);
2662         __isl_give isl_qpolynomial *isl_qpolynomial_neginfty_on_domain(
2663                 __isl_take isl_space *domain);
2664         __isl_give isl_qpolynomial *isl_qpolynomial_nan_on_domain(
2665                 __isl_take isl_space *domain);
2666         __isl_give isl_qpolynomial *isl_qpolynomial_val_on_domain(
2667                 __isl_take isl_space *domain,
2668                 __isl_take isl_val *val);
2669         __isl_give isl_qpolynomial *isl_qpolynomial_var_on_domain(
2670                 __isl_take isl_space *domain,
2671                 enum isl_dim_type type, unsigned pos);
2672         __isl_give isl_qpolynomial *isl_qpolynomial_from_aff(
2673                 __isl_take isl_aff *aff);
2675 Recall that the space in which a quasipolynomial lives is a map space
2676 with a one-dimensional range.  The C<domain> argument in some of
2677 the functions above corresponds to the domain of this map space.
2679 Quasipolynomials can be copied and freed again using the following
2680 functions.
2682         #include <isl/polynomial.h>
2683         __isl_give isl_qpolynomial *isl_qpolynomial_copy(
2684                 __isl_keep isl_qpolynomial *qp);
2685         __isl_null isl_qpolynomial *isl_qpolynomial_free(
2686                 __isl_take isl_qpolynomial *qp);
2688 The constant term of a quasipolynomial can be extracted using
2690         __isl_give isl_val *isl_qpolynomial_get_constant_val(
2691                 __isl_keep isl_qpolynomial *qp);
2693 To iterate over all terms in a quasipolynomial,
2696         isl_stat isl_qpolynomial_foreach_term(
2697                 __isl_keep isl_qpolynomial *qp,
2698                 isl_stat (*fn)(__isl_take isl_term *term,
2699                           void *user), void *user);
2701 The terms themselves can be inspected and freed using
2702 these functions
2704         unsigned isl_term_dim(__isl_keep isl_term *term,
2705                 enum isl_dim_type type);
2706         __isl_give isl_val *isl_term_get_coefficient_val(
2707                 __isl_keep isl_term *term);
2708         int isl_term_get_exp(__isl_keep isl_term *term,
2709                 enum isl_dim_type type, unsigned pos);
2710         __isl_give isl_aff *isl_term_get_div(
2711                 __isl_keep isl_term *term, unsigned pos);
2712         void isl_term_free(__isl_take isl_term *term);
2714 Each term is a product of parameters, set variables and
2715 integer divisions.  The function C<isl_term_get_exp>
2716 returns the exponent of a given dimensions in the given term.
2718 =back
2720 =head3 Reductions
2722 A reduction represents a maximum or a minimum of its
2723 base expressions.
2724 The only reduction type defined by C<isl> is
2725 C<isl_qpolynomial_fold>.
2727 There are currently no functions to directly create such
2728 objects, but they do appear in the piecewise quasipolynomial
2729 reductions returned by the C<isl_pw_qpolynomial_bound> function.
2731 L</"Bounds on Piecewise Quasipolynomials and Piecewise Quasipolynomial Reductions">.
2733 Reductions can be copied and freed using
2734 the following functions.
2736         #include <isl/polynomial.h>
2737         __isl_give isl_qpolynomial_fold *
2738         isl_qpolynomial_fold_copy(
2739                 __isl_keep isl_qpolynomial_fold *fold);
2740         void isl_qpolynomial_fold_free(
2741                 __isl_take isl_qpolynomial_fold *fold);
2743 To iterate over all quasipolynomials in a reduction, use
2745         isl_stat isl_qpolynomial_fold_foreach_qpolynomial(
2746                 __isl_keep isl_qpolynomial_fold *fold,
2747                 isl_stat (*fn)(__isl_take isl_qpolynomial *qp,
2748                           void *user), void *user);
2750 =head3 Multiple Expressions
2752 A multiple expression represents a sequence of zero or
2753 more base expressions, all defined on the same domain space.
2754 The domain space of the multiple expression is the same
2755 as that of the base expressions, but the range space
2756 can be any space.  In case the base expressions have
2757 a set space, the corresponding multiple expression
2758 also has a set space.
2759 Objects of the value type do not have an associated space.
2760 The space of a multiple value is therefore always a set space.
2761 Similarly, the space of a multiple union piecewise
2762 affine expression is always a set space.
2763 If the base expressions are not total, then
2764 a corresponding zero-dimensional multiple expression may
2765 have an explicit domain that keeps track of the domain
2766 outside of any base expressions.
2768 The multiple expression types defined by C<isl>
2769 are C<isl_multi_val>, C<isl_multi_aff>, C<isl_multi_pw_aff>,
2770 C<isl_multi_union_pw_aff>.
2772 A multiple expression with the value zero for
2773 each output (or set) dimension can be created
2774 using the following functions.
2776         #include <isl/val.h>
2777         __isl_give isl_multi_val *isl_multi_val_zero(
2778                 __isl_take isl_space *space);
2780         #include <isl/aff.h>
2781         __isl_give isl_multi_aff *isl_multi_aff_zero(
2782                 __isl_take isl_space *space);
2783         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_zero(
2784                 __isl_take isl_space *space);
2785         __isl_give isl_multi_union_pw_aff *
2786         isl_multi_union_pw_aff_zero(
2787                 __isl_take isl_space *space);
2789 Since there is no canonical way of representing a zero
2790 value of type C<isl_union_pw_aff>, the space passed
2791 to C<isl_multi_union_pw_aff_zero> needs to be zero-dimensional.
2793 An identity function can be created using the following
2794 functions.  The space needs to be that of a relation
2795 with the same number of input and output dimensions.
2797         #include <isl/aff.h>
2798         __isl_give isl_multi_aff *isl_multi_aff_identity(
2799                 __isl_take isl_space *space);
2800         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_identity(
2801                 __isl_take isl_space *space);
2803 A function that performs a projection on a universe
2804 relation or set can be created using the following functions.
2805 See also the corresponding
2806 projection operations in L</"Unary Operations">.
2808         #include <isl/aff.h>
2809         __isl_give isl_multi_aff *isl_multi_aff_domain_map(
2810                 __isl_take isl_space *space);
2811         __isl_give isl_multi_aff *isl_multi_aff_range_map(
2812                 __isl_take isl_space *space);
2813         __isl_give isl_multi_aff *isl_multi_aff_project_out_map(
2814                 __isl_take isl_space *space,
2815                 enum isl_dim_type type,
2816                 unsigned first, unsigned n);
2818 A multiple expression can be created from a single
2819 base expression using the following functions.
2820 The space of the created multiple expression is the same
2821 as that of the base expression, except for
2822 C<isl_multi_union_pw_aff_from_union_pw_aff> where the input
2823 lives in a parameter space and the output lives
2824 in a single-dimensional set space.
2826         #include <isl/aff.h>
2827         __isl_give isl_multi_aff *isl_multi_aff_from_aff(
2828                 __isl_take isl_aff *aff);
2829         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_pw_aff(
2830                 __isl_take isl_pw_aff *pa);
2831         __isl_give isl_multi_union_pw_aff *
2832         isl_multi_union_pw_aff_from_union_pw_aff(
2833                 __isl_take isl_union_pw_aff *upa);
2835 A multiple expression can be created from a list
2836 of base expression in a specified space.
2837 The domain of this space needs to be the same
2838 as the domains of the base expressions in the list.
2839 If the base expressions have a set space (or no associated space),
2840 then this space also needs to be a set space.
2842         #include <isl/val.h>
2843         __isl_give isl_multi_val *isl_multi_val_from_val_list(
2844                 __isl_take isl_space *space,
2845                 __isl_take isl_val_list *list);
2847         #include <isl/aff.h>
2848         __isl_give isl_multi_aff *isl_multi_aff_from_aff_list(
2849                 __isl_take isl_space *space,
2850                 __isl_take isl_aff_list *list);
2851         __isl_give isl_multi_pw_aff *
2852         isl_multi_pw_aff_from_pw_aff_list(
2853                 __isl_take isl_space *space,
2854                 __isl_take isl_pw_aff_list *list);
2855         __isl_give isl_multi_union_pw_aff *
2856         isl_multi_union_pw_aff_from_union_pw_aff_list(
2857                 __isl_take isl_space *space,
2858                 __isl_take isl_union_pw_aff_list *list);
2860 As a convenience, a multiple piecewise expression can
2861 also be created from a multiple expression.
2862 Each piecewise expression in the result has a single
2863 universe cell.
2865         #include <isl/aff.h>
2866         __isl_give isl_multi_pw_aff *
2867         isl_multi_pw_aff_from_multi_aff(
2868                 __isl_take isl_multi_aff *ma);
2870 Similarly, a multiple union expression can be
2871 created from a multiple expression.
2873         #include <isl/aff.h>
2874         __isl_give isl_multi_union_pw_aff *
2875         isl_multi_union_pw_aff_from_multi_aff(
2876                 __isl_take isl_multi_aff *ma);
2877         __isl_give isl_multi_union_pw_aff *
2878         isl_multi_union_pw_aff_from_multi_pw_aff(
2879                 __isl_take isl_multi_pw_aff *mpa);
2881 A multiple quasi-affine expression can be created from
2882 a multiple value with a given domain space using the following
2883 function.
2885         #include <isl/aff.h>
2886         __isl_give isl_multi_aff *
2887         isl_multi_aff_multi_val_on_space(
2888                 __isl_take isl_space *space,
2889                 __isl_take isl_multi_val *mv);
2891 Similarly,
2892 a multiple union piecewise affine expression can be created from
2893 a multiple value with a given domain or
2894 a (piecewise) multiple affine expression with a given domain
2895 using the following functions.
2897         #include <isl/aff.h>
2898         __isl_give isl_multi_union_pw_aff *
2899         isl_multi_union_pw_aff_multi_val_on_domain(
2900                 __isl_take isl_union_set *domain,
2901                 __isl_take isl_multi_val *mv);
2902         __isl_give isl_multi_union_pw_aff *
2903         isl_multi_union_pw_aff_multi_aff_on_domain(
2904                 __isl_take isl_union_set *domain,
2905                 __isl_take isl_multi_aff *ma);
2906         __isl_give isl_multi_union_pw_aff *
2907         isl_multi_union_pw_aff_pw_multi_aff_on_domain(
2908                 __isl_take isl_union_set *domain,
2909                 __isl_take isl_pw_multi_aff *pma);
2911 Multiple expressions can be copied and freed using
2912 the following functions.
2914         #include <isl/val.h>
2915         __isl_give isl_multi_val *isl_multi_val_copy(
2916                 __isl_keep isl_multi_val *mv);
2917         __isl_null isl_multi_val *isl_multi_val_free(
2918                 __isl_take isl_multi_val *mv);
2920         #include <isl/aff.h>
2921         __isl_give isl_multi_aff *isl_multi_aff_copy(
2922                 __isl_keep isl_multi_aff *maff);
2923         __isl_null isl_multi_aff *isl_multi_aff_free(
2924                 __isl_take isl_multi_aff *maff);
2925         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_copy(
2926                 __isl_keep isl_multi_pw_aff *mpa);
2927         __isl_null isl_multi_pw_aff *isl_multi_pw_aff_free(
2928                 __isl_take isl_multi_pw_aff *mpa);
2929         __isl_give isl_multi_union_pw_aff *
2930         isl_multi_union_pw_aff_copy(
2931                 __isl_keep isl_multi_union_pw_aff *mupa);
2932         __isl_null isl_multi_union_pw_aff *
2933         isl_multi_union_pw_aff_free(
2934                 __isl_take isl_multi_union_pw_aff *mupa);
2936 The base expression at a given position of a multiple
2937 expression can be extracted using the following functions.
2939         #include <isl/val.h>
2940         __isl_give isl_val *isl_multi_val_get_val(
2941                 __isl_keep isl_multi_val *mv, int pos);
2943         #include <isl/aff.h>
2944         __isl_give isl_aff *isl_multi_aff_get_aff(
2945                 __isl_keep isl_multi_aff *multi, int pos);
2946         __isl_give isl_pw_aff *isl_multi_pw_aff_get_pw_aff(
2947                 __isl_keep isl_multi_pw_aff *mpa, int pos);
2948         __isl_give isl_union_pw_aff *
2949         isl_multi_union_pw_aff_get_union_pw_aff(
2950                 __isl_keep isl_multi_union_pw_aff *mupa, int pos);
2952 It can be replaced using the following functions.
2954         #include <isl/val.h>
2955         __isl_give isl_multi_val *isl_multi_val_set_val(
2956                 __isl_take isl_multi_val *mv, int pos,
2957                 __isl_take isl_val *val);
2959         #include <isl/aff.h>
2960         __isl_give isl_multi_aff *isl_multi_aff_set_aff(
2961                 __isl_take isl_multi_aff *multi, int pos,
2962                 __isl_take isl_aff *aff);
2963         __isl_give isl_multi_union_pw_aff *
2964         isl_multi_union_pw_aff_set_union_pw_aff(
2965                 __isl_take isl_multi_union_pw_aff *mupa, int pos,
2966                 __isl_take isl_union_pw_aff *upa);
2968 As a convenience, a sequence of base expressions that have
2969 their domains in a given space can be extracted from a sequence
2970 of union expressions using the following function.
2972         #include <isl/aff.h>
2973         __isl_give isl_multi_pw_aff *
2974         isl_multi_union_pw_aff_extract_multi_pw_aff(
2975                 __isl_keep isl_multi_union_pw_aff *mupa,
2976                 __isl_take isl_space *space);
2978 Note that there is a difference between C<isl_multi_union_pw_aff>
2979 and C<isl_union_pw_multi_aff> objects.  The first is a sequence
2980 of unions of piecewise expressions, while the second is a union
2981 of piecewise sequences.  In particular, multiple affine expressions
2982 in an C<isl_union_pw_multi_aff> may live in different spaces,
2983 while there is only a single multiple expression in
2984 an C<isl_multi_union_pw_aff>, which can therefore only live
2985 in a single space.  This means that not every
2986 C<isl_union_pw_multi_aff> can be converted to
2987 an C<isl_multi_union_pw_aff>.  Conversely, the elements
2988 of an C<isl_multi_union_pw_aff> may be defined over different domains,
2989 while each multiple expression inside an C<isl_union_pw_multi_aff>
2990 has a single domain.  The conversion of an C<isl_union_pw_multi_aff>
2991 of dimension greater than one may therefore not be exact.
2992 The following functions can
2993 be used to perform these conversions when they are possible.
2995         #include <isl/aff.h>
2996         __isl_give isl_multi_union_pw_aff *
2997         isl_multi_union_pw_aff_from_union_pw_multi_aff(
2998                 __isl_take isl_union_pw_multi_aff *upma);
2999         __isl_give isl_union_pw_multi_aff *
3000         isl_union_pw_multi_aff_from_multi_union_pw_aff(
3001                 __isl_take isl_multi_union_pw_aff *mupa);
3003 =head3 Piecewise Expressions
3005 A piecewise expression is an expression that is described
3006 using zero or more base expression defined over the same
3007 number of cells in the domain space of the base expressions.
3008 All base expressions are defined over the same
3009 domain space and the cells are disjoint.
3010 The space of a piecewise expression is the same as
3011 that of the base expressions.
3012 If the union of the cells is a strict subset of the domain
3013 space, then the value of the piecewise expression outside
3014 this union is different for types derived from quasi-affine
3015 expressions and those derived from quasipolynomials.
3016 Piecewise expressions derived from quasi-affine expressions
3017 are considered to be undefined outside the union of their cells.
3018 Piecewise expressions derived from quasipolynomials
3019 are considered to be zero outside the union of their cells.
3021 Piecewise quasipolynomials are mainly used by the C<barvinok>
3022 library for representing the number of elements in a parametric set or map.
3023 For example, the piecewise quasipolynomial
3025         [n] -> { [x] -> ((1 + n) - x) : x <= n and x >= 0 }
3027 represents the number of points in the map
3029         [n] -> { [x] -> [y] : x,y >= 0 and 0 <= x + y <= n }
3031 The piecewise expression types defined by C<isl>
3032 are C<isl_pw_aff>, C<isl_pw_multi_aff>,
3033 C<isl_pw_qpolynomial> and C<isl_pw_qpolynomial_fold>.
3035 A piecewise expression with no cells can be created using
3036 the following functions.
3038         #include <isl/aff.h>
3039         __isl_give isl_pw_aff *isl_pw_aff_empty(
3040                 __isl_take isl_space *space);
3041         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_empty(
3042                 __isl_take isl_space *space);
3044 A piecewise expression with a single universe cell can be
3045 created using the following functions.
3047         #include <isl/aff.h>
3048         __isl_give isl_pw_aff *isl_pw_aff_from_aff(
3049                 __isl_take isl_aff *aff);
3050         __isl_give isl_pw_multi_aff *
3051         isl_pw_multi_aff_from_multi_aff(
3052                 __isl_take isl_multi_aff *ma);
3054         #include <isl/polynomial.h>
3055         __isl_give isl_pw_qpolynomial *
3056         isl_pw_qpolynomial_from_qpolynomial(
3057                 __isl_take isl_qpolynomial *qp);
3059 A piecewise expression with a single specified cell can be
3060 created using the following functions.
3062         #include <isl/aff.h>
3063         __isl_give isl_pw_aff *isl_pw_aff_alloc(
3064                 __isl_take isl_set *set, __isl_take isl_aff *aff);
3065         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_alloc(
3066                 __isl_take isl_set *set,
3067                 __isl_take isl_multi_aff *maff);
3069         #include <isl/polynomial.h>
3070         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_alloc(
3071                 __isl_take isl_set *set,
3072                 __isl_take isl_qpolynomial *qp);
3074 The following convenience functions first create a base expression and
3075 then create a piecewise expression over a universe domain.
3077         #include <isl/aff.h>
3078         __isl_give isl_pw_aff *isl_pw_aff_zero_on_domain(
3079                 __isl_take isl_local_space *ls);
3080         __isl_give isl_pw_aff *isl_pw_aff_var_on_domain(
3081                 __isl_take isl_local_space *ls,
3082                 enum isl_dim_type type, unsigned pos);
3083         __isl_give isl_pw_aff *isl_pw_aff_nan_on_domain(
3084                 __isl_take isl_local_space *ls);
3085         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_zero(
3086                 __isl_take isl_space *space);
3087         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_identity(
3088                 __isl_take isl_space *space);
3089         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_range_map(
3090                 __isl_take isl_space *space);
3091         __isl_give isl_pw_multi_aff *
3092         isl_pw_multi_aff_project_out_map(
3093                 __isl_take isl_space *space,
3094                 enum isl_dim_type type,
3095                 unsigned first, unsigned n);
3097         #include <isl/polynomial.h>
3098         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_zero(
3099                 __isl_take isl_space *space);
3101 The following convenience functions first create a base expression and
3102 then create a piecewise expression over a given domain.
3104         #include <isl/aff.h>
3105         __isl_give isl_pw_aff *isl_pw_aff_val_on_domain(
3106                 __isl_take isl_set *domain,
3107                 __isl_take isl_val *v);
3108         __isl_give isl_pw_multi_aff *
3109         isl_pw_multi_aff_multi_val_on_domain(
3110                 __isl_take isl_set *domain,
3111                 __isl_take isl_multi_val *mv);
3113 As a convenience, a piecewise multiple expression can
3114 also be created from a piecewise expression.
3115 Each multiple expression in the result is derived
3116 from the corresponding base expression.
3118         #include <isl/aff.h>
3119         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_pw_aff(
3120                 __isl_take isl_pw_aff *pa);
3122 Similarly, a piecewise quasipolynomial can be
3123 created from a piecewise quasi-affine expression using
3124 the following function.
3126         #include <isl/polynomial.h>
3127         __isl_give isl_pw_qpolynomial *
3128         isl_pw_qpolynomial_from_pw_aff(
3129                 __isl_take isl_pw_aff *pwaff);
3131 Piecewise expressions can be copied and freed using the following functions.
3133         #include <isl/aff.h>
3134         __isl_give isl_pw_aff *isl_pw_aff_copy(
3135                 __isl_keep isl_pw_aff *pwaff);
3136         __isl_null isl_pw_aff *isl_pw_aff_free(
3137                 __isl_take isl_pw_aff *pwaff);
3138         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_copy(
3139                 __isl_keep isl_pw_multi_aff *pma);
3140         __isl_null isl_pw_multi_aff *isl_pw_multi_aff_free(
3141                 __isl_take isl_pw_multi_aff *pma);
3143         #include <isl/polynomial.h>
3144         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_copy(
3145                 __isl_keep isl_pw_qpolynomial *pwqp);
3146         __isl_null isl_pw_qpolynomial *isl_pw_qpolynomial_free(
3147                 __isl_take isl_pw_qpolynomial *pwqp);
3148         __isl_give isl_pw_qpolynomial_fold *
3149         isl_pw_qpolynomial_fold_copy(
3150                 __isl_keep isl_pw_qpolynomial_fold *pwf);
3151         __isl_null isl_pw_qpolynomial_fold *
3152         isl_pw_qpolynomial_fold_free(
3153                 __isl_take isl_pw_qpolynomial_fold *pwf);
3155 To iterate over the different cells of a piecewise expression,
3156 use the following functions.
3158         #include <isl/aff.h>
3159         isl_bool isl_pw_aff_is_empty(__isl_keep isl_pw_aff *pwaff);
3160         int isl_pw_aff_n_piece(__isl_keep isl_pw_aff *pwaff);
3161         isl_stat isl_pw_aff_foreach_piece(
3162                 __isl_keep isl_pw_aff *pwaff,
3163                 isl_stat (*fn)(__isl_take isl_set *set,
3164                           __isl_take isl_aff *aff,
3165                           void *user), void *user);
3166         int isl_pw_multi_aff_n_piece(
3167                 __isl_keep isl_pw_multi_aff *pma);
3168         isl_stat isl_pw_multi_aff_foreach_piece(
3169                 __isl_keep isl_pw_multi_aff *pma,
3170                 isl_stat (*fn)(__isl_take isl_set *set,
3171                             __isl_take isl_multi_aff *maff,
3172                             void *user), void *user);
3174         #include <isl/polynomial.h>
3175         int isl_pw_qpolynomial_n_piece(
3176                 __isl_keep isl_pw_qpolynomial *pwqp);
3177         isl_stat isl_pw_qpolynomial_foreach_piece(
3178                 __isl_keep isl_pw_qpolynomial *pwqp,
3179                 isl_stat (*fn)(__isl_take isl_set *set,
3180                           __isl_take isl_qpolynomial *qp,
3181                           void *user), void *user);
3182         isl_stat isl_pw_qpolynomial_foreach_lifted_piece(
3183                 __isl_keep isl_pw_qpolynomial *pwqp,
3184                 isl_stat (*fn)(__isl_take isl_set *set,
3185                           __isl_take isl_qpolynomial *qp,
3186                           void *user), void *user);
3187         int isl_pw_qpolynomial_fold_n_piece(
3188                 __isl_keep isl_pw_qpolynomial_fold *pwf);
3189         isl_stat isl_pw_qpolynomial_fold_foreach_piece(
3190                 __isl_keep isl_pw_qpolynomial_fold *pwf,
3191                 isl_stat (*fn)(__isl_take isl_set *set,
3192                           __isl_take isl_qpolynomial_fold *fold,
3193                           void *user), void *user);
3194         isl_stat isl_pw_qpolynomial_fold_foreach_lifted_piece(
3195                 __isl_keep isl_pw_qpolynomial_fold *pwf,
3196                 isl_stat (*fn)(__isl_take isl_set *set,
3197                           __isl_take isl_qpolynomial_fold *fold,
3198                           void *user), void *user);
3200 As usual, the function C<fn> should return C<isl_stat_ok> on success
3201 and C<isl_stat_error> on failure.  The difference between
3202 C<isl_pw_qpolynomial_foreach_piece> and
3203 C<isl_pw_qpolynomial_foreach_lifted_piece> is that
3204 C<isl_pw_qpolynomial_foreach_lifted_piece> will first
3205 compute unique representations for all existentially quantified
3206 variables and then turn these existentially quantified variables
3207 into extra set variables, adapting the associated quasipolynomial
3208 accordingly.  This means that the C<set> passed to C<fn>
3209 will not have any existentially quantified variables, but that
3210 the dimensions of the sets may be different for different
3211 invocations of C<fn>.
3212 Similarly for C<isl_pw_qpolynomial_fold_foreach_piece>
3213 and C<isl_pw_qpolynomial_fold_foreach_lifted_piece>.
3215 A piecewise expression consisting of the expressions at a given
3216 position of a piecewise multiple expression can be extracted
3217 using the following function.
3219         #include <isl/aff.h>
3220         __isl_give isl_pw_aff *isl_pw_multi_aff_get_pw_aff(
3221                 __isl_keep isl_pw_multi_aff *pma, int pos);
3223 These expressions can be replaced using the following function.
3225         #include <isl/aff.h>
3226         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_pw_aff(
3227                 __isl_take isl_pw_multi_aff *pma, unsigned pos,
3228                 __isl_take isl_pw_aff *pa);
3230 Note that there is a difference between C<isl_multi_pw_aff> and
3231 C<isl_pw_multi_aff> objects.  The first is a sequence of piecewise
3232 affine expressions, while the second is a piecewise sequence
3233 of affine expressions.  In particular, each of the piecewise
3234 affine expressions in an C<isl_multi_pw_aff> may have a different
3235 domain, while all multiple expressions associated to a cell
3236 in an C<isl_pw_multi_aff> have the same domain.
3237 It is possible to convert between the two, but when converting
3238 an C<isl_multi_pw_aff> to an C<isl_pw_multi_aff>, the domain
3239 of the result is the intersection of the domains of the input.
3240 The reverse conversion is exact.
3242         #include <isl/aff.h>
3243         __isl_give isl_pw_multi_aff *
3244         isl_pw_multi_aff_from_multi_pw_aff(
3245                 __isl_take isl_multi_pw_aff *mpa);
3246         __isl_give isl_multi_pw_aff *
3247         isl_multi_pw_aff_from_pw_multi_aff(
3248                 __isl_take isl_pw_multi_aff *pma);
3250 =head3 Union Expressions
3252 A union expression collects base expressions defined
3253 over different domains.  The space of a union expression
3254 is that of the shared parameter space.
3256 The union expression types defined by C<isl>
3257 are C<isl_union_pw_aff>, C<isl_union_pw_multi_aff>,
3258 C<isl_union_pw_qpolynomial> and C<isl_union_pw_qpolynomial_fold>.
3259 In case of
3260 C<isl_union_pw_aff>,
3261 C<isl_union_pw_qpolynomial> and C<isl_union_pw_qpolynomial_fold>,
3262 there can be at most one base expression for a given domain space.
3263 In case of
3264 C<isl_union_pw_multi_aff>,
3265 there can be multiple such expressions for a given domain space,
3266 but the domains of these expressions need to be disjoint.
3268 An empty union expression can be created using the following functions.
3270         #include <isl/aff.h>
3271         __isl_give isl_union_pw_aff *isl_union_pw_aff_empty(
3272                 __isl_take isl_space *space);
3273         __isl_give isl_union_pw_multi_aff *
3274         isl_union_pw_multi_aff_empty(
3275                 __isl_take isl_space *space);
3277         #include <isl/polynomial.h>
3278         __isl_give isl_union_pw_qpolynomial *
3279         isl_union_pw_qpolynomial_zero(
3280                 __isl_take isl_space *space);
3282 A union expression containing a single base expression
3283 can be created using the following functions.
3285         #include <isl/aff.h>
3286         __isl_give isl_union_pw_aff *
3287         isl_union_pw_aff_from_pw_aff(
3288                 __isl_take isl_pw_aff *pa);
3289         __isl_give isl_union_pw_multi_aff *
3290         isl_union_pw_multi_aff_from_aff(
3291                 __isl_take isl_aff *aff);
3292         __isl_give isl_union_pw_multi_aff *
3293         isl_union_pw_multi_aff_from_pw_multi_aff(
3294                 __isl_take isl_pw_multi_aff *pma);
3296         #include <isl/polynomial.h>
3297         __isl_give isl_union_pw_qpolynomial *
3298         isl_union_pw_qpolynomial_from_pw_qpolynomial(
3299                 __isl_take isl_pw_qpolynomial *pwqp);
3301 The following functions create a base expression on each
3302 of the sets in the union set and collect the results.
3304         #include <isl/aff.h>
3305         __isl_give isl_union_pw_multi_aff *
3306         isl_union_pw_multi_aff_from_union_pw_aff(
3307                 __isl_take isl_union_pw_aff *upa);
3308         __isl_give isl_union_pw_aff *
3309         isl_union_pw_multi_aff_get_union_pw_aff(
3310                 __isl_keep isl_union_pw_multi_aff *upma, int pos);
3311         __isl_give isl_union_pw_aff *
3312         isl_union_pw_aff_val_on_domain(
3313                 __isl_take isl_union_set *domain,
3314                 __isl_take isl_val *v);
3315         __isl_give isl_union_pw_multi_aff *
3316         isl_union_pw_multi_aff_multi_val_on_domain(
3317                 __isl_take isl_union_set *domain,
3318                 __isl_take isl_multi_val *mv);
3319         __isl_give isl_union_pw_aff *
3320         isl_union_pw_aff_param_on_domain_id(
3321                 __isl_take isl_union_set *domain,
3322                 __isl_take isl_id *id);
3324 The C<id> argument of C<isl_union_pw_aff_param_on_domain_id>
3325 is the identifier of a parameter that may or may not already
3326 be present in C<domain>.
3328 An C<isl_union_pw_aff> that is equal to a (parametric) affine
3329 or piecewise affine
3330 expression on a given domain can be created using the following
3331 functions.
3333         #include <isl/aff.h>
3334         __isl_give isl_union_pw_aff *
3335         isl_union_pw_aff_aff_on_domain(
3336                 __isl_take isl_union_set *domain,
3337                 __isl_take isl_aff *aff);
3338         __isl_give isl_union_pw_aff *
3339         isl_union_pw_aff_pw_aff_on_domain(
3340                 __isl_take isl_union_set *domain,
3341                 __isl_take isl_pw_aff *pa);
3343 A base expression can be added to a union expression using
3344 the following functions.
3346         #include <isl/aff.h>
3347         __isl_give isl_union_pw_aff *
3348         isl_union_pw_aff_add_pw_aff(
3349                 __isl_take isl_union_pw_aff *upa,
3350                 __isl_take isl_pw_aff *pa);
3351         __isl_give isl_union_pw_multi_aff *
3352         isl_union_pw_multi_aff_add_pw_multi_aff(
3353                 __isl_take isl_union_pw_multi_aff *upma,
3354                 __isl_take isl_pw_multi_aff *pma);
3356         #include <isl/polynomial.h>
3357         __isl_give isl_union_pw_qpolynomial *
3358         isl_union_pw_qpolynomial_add_pw_qpolynomial(
3359                 __isl_take isl_union_pw_qpolynomial *upwqp,
3360                 __isl_take isl_pw_qpolynomial *pwqp);
3362 Union expressions can be copied and freed using
3363 the following functions.
3365         #include <isl/aff.h>
3366         __isl_give isl_union_pw_aff *isl_union_pw_aff_copy(
3367                 __isl_keep isl_union_pw_aff *upa);
3368         __isl_null isl_union_pw_aff *isl_union_pw_aff_free(
3369                 __isl_take isl_union_pw_aff *upa);
3370         __isl_give isl_union_pw_multi_aff *
3371         isl_union_pw_multi_aff_copy(
3372                 __isl_keep isl_union_pw_multi_aff *upma);
3373         __isl_null isl_union_pw_multi_aff *
3374         isl_union_pw_multi_aff_free(
3375                 __isl_take isl_union_pw_multi_aff *upma);
3377         #include <isl/polynomial.h>
3378         __isl_give isl_union_pw_qpolynomial *
3379         isl_union_pw_qpolynomial_copy(
3380                 __isl_keep isl_union_pw_qpolynomial *upwqp);
3381         __isl_null isl_union_pw_qpolynomial *
3382         isl_union_pw_qpolynomial_free(
3383                 __isl_take isl_union_pw_qpolynomial *upwqp);
3384         __isl_give isl_union_pw_qpolynomial_fold *
3385         isl_union_pw_qpolynomial_fold_copy(
3386                 __isl_keep isl_union_pw_qpolynomial_fold *upwf);
3387         __isl_null isl_union_pw_qpolynomial_fold *
3388         isl_union_pw_qpolynomial_fold_free(
3389                 __isl_take isl_union_pw_qpolynomial_fold *upwf);
3391 To iterate over the base expressions in a union expression,
3392 use the following functions.
3394         #include <isl/aff.h>
3395         int isl_union_pw_aff_n_pw_aff(
3396                 __isl_keep isl_union_pw_aff *upa);
3397         isl_stat isl_union_pw_aff_foreach_pw_aff(
3398                 __isl_keep isl_union_pw_aff *upa,
3399                 isl_stat (*fn)(__isl_take isl_pw_aff *pa,
3400                         void *user), void *user);
3401         int isl_union_pw_multi_aff_n_pw_multi_aff(
3402                 __isl_keep isl_union_pw_multi_aff *upma);
3403         isl_stat isl_union_pw_multi_aff_foreach_pw_multi_aff(
3404                 __isl_keep isl_union_pw_multi_aff *upma,
3405                 isl_stat (*fn)(__isl_take isl_pw_multi_aff *pma,
3406                             void *user), void *user);
3408         #include <isl/polynomial.h>
3409         int isl_union_pw_qpolynomial_n_pw_qpolynomial(
3410                 __isl_keep isl_union_pw_qpolynomial *upwqp);
3411         isl_stat isl_union_pw_qpolynomial_foreach_pw_qpolynomial(
3412                 __isl_keep isl_union_pw_qpolynomial *upwqp,
3413                 isl_stat (*fn)(__isl_take isl_pw_qpolynomial *pwqp,
3414                             void *user), void *user);
3415         int isl_union_pw_qpolynomial_fold_n_pw_qpolynomial_fold(
3416                 __isl_keep isl_union_pw_qpolynomial_fold *upwf);
3417         isl_stat isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold(
3418                 __isl_keep isl_union_pw_qpolynomial_fold *upwf,
3419                 isl_stat (*fn)(__isl_take isl_pw_qpolynomial_fold *pwf,
3420                             void *user), void *user);
3422 To extract the base expression in a given space from a union, use
3423 the following functions.
3425         #include <isl/aff.h>
3426         __isl_give isl_pw_aff *isl_union_pw_aff_extract_pw_aff(
3427                 __isl_keep isl_union_pw_aff *upa,
3428                 __isl_take isl_space *space);
3429         __isl_give isl_pw_multi_aff *
3430         isl_union_pw_multi_aff_extract_pw_multi_aff(
3431                 __isl_keep isl_union_pw_multi_aff *upma,
3432                 __isl_take isl_space *space);
3434         #include <isl/polynomial.h>
3435         __isl_give isl_pw_qpolynomial *
3436         isl_union_pw_qpolynomial_extract_pw_qpolynomial(
3437                 __isl_keep isl_union_pw_qpolynomial *upwqp,
3438                 __isl_take isl_space *space);
3440 =head2 Input and Output
3442 For set and relation,
3443 C<isl> supports its own input/output format, which is similar
3444 to the C<Omega> format, but also supports the C<PolyLib> format
3445 in some cases.
3446 For other object types, typically only an C<isl> format is supported.
3448 =head3 C<isl> format
3450 The C<isl> format is similar to that of C<Omega>, but has a different
3451 syntax for describing the parameters and allows for the definition
3452 of an existentially quantified variable as the integer division
3453 of an affine expression.
3454 For example, the set of integers C<i> between C<0> and C<n>
3455 such that C<i % 10 <= 6> can be described as
3457         [n] -> { [i] : exists (a = [i/10] : 0 <= i and i <= n and
3458                                 i - 10 a <= 6) }
3460 A set or relation can have several disjuncts, separated
3461 by the keyword C<or>.  Each disjunct is either a conjunction
3462 of constraints or a projection (C<exists>) of a conjunction
3463 of constraints.  The constraints are separated by the keyword
3464 C<and>.
3466 =head3 C<PolyLib> format
3468 If the represented set is a union, then the first line
3469 contains a single number representing the number of disjuncts.
3470 Otherwise, a line containing the number C<1> is optional.
3472 Each disjunct is represented by a matrix of constraints.
3473 The first line contains two numbers representing
3474 the number of rows and columns,
3475 where the number of rows is equal to the number of constraints
3476 and the number of columns is equal to two plus the number of variables.
3477 The following lines contain the actual rows of the constraint matrix.
3478 In each row, the first column indicates whether the constraint
3479 is an equality (C<0>) or inequality (C<1>).  The final column
3480 corresponds to the constant term.
3482 If the set is parametric, then the coefficients of the parameters
3483 appear in the last columns before the constant column.
3484 The coefficients of any existentially quantified variables appear
3485 between those of the set variables and those of the parameters.
3487 =head3 Extended C<PolyLib> format
3489 The extended C<PolyLib> format is nearly identical to the
3490 C<PolyLib> format.  The only difference is that the line
3491 containing the number of rows and columns of a constraint matrix
3492 also contains four additional numbers:
3493 the number of output dimensions, the number of input dimensions,
3494 the number of local dimensions (i.e., the number of existentially
3495 quantified variables) and the number of parameters.
3496 For sets, the number of ``output'' dimensions is equal
3497 to the number of set dimensions, while the number of ``input''
3498 dimensions is zero.
3500 =head3 Input
3502 Objects can be read from input using the following functions.
3504         #include <isl/val.h>
3505         __isl_give isl_val *isl_val_read_from_str(isl_ctx *ctx,
3506                 const char *str);
3507         __isl_give isl_multi_val *isl_multi_val_read_from_str(
3508                 isl_ctx *ctx, const char *str);
3510         #include <isl/set.h>
3511         __isl_give isl_basic_set *isl_basic_set_read_from_file(
3512                 isl_ctx *ctx, FILE *input);
3513         __isl_give isl_basic_set *isl_basic_set_read_from_str(
3514                 isl_ctx *ctx, const char *str);
3515         __isl_give isl_set *isl_set_read_from_file(isl_ctx *ctx,
3516                 FILE *input);
3517         __isl_give isl_set *isl_set_read_from_str(isl_ctx *ctx,
3518                 const char *str);
3520         #include <isl/map.h>
3521         __isl_give isl_basic_map *isl_basic_map_read_from_file(
3522                 isl_ctx *ctx, FILE *input);
3523         __isl_give isl_basic_map *isl_basic_map_read_from_str(
3524                 isl_ctx *ctx, const char *str);
3525         __isl_give isl_map *isl_map_read_from_file(
3526                 isl_ctx *ctx, FILE *input);
3527         __isl_give isl_map *isl_map_read_from_str(isl_ctx *ctx,
3528                 const char *str);
3530         #include <isl/union_set.h>
3531         __isl_give isl_union_set *isl_union_set_read_from_file(
3532                 isl_ctx *ctx, FILE *input);
3533         __isl_give isl_union_set *isl_union_set_read_from_str(
3534                 isl_ctx *ctx, const char *str);
3536         #include <isl/union_map.h>
3537         __isl_give isl_union_map *isl_union_map_read_from_file(
3538                 isl_ctx *ctx, FILE *input);
3539         __isl_give isl_union_map *isl_union_map_read_from_str(
3540                 isl_ctx *ctx, const char *str);
3542         #include <isl/aff.h>
3543         __isl_give isl_aff *isl_aff_read_from_str(
3544                 isl_ctx *ctx, const char *str);
3545         __isl_give isl_multi_aff *isl_multi_aff_read_from_str(
3546                 isl_ctx *ctx, const char *str);
3547         __isl_give isl_pw_aff *isl_pw_aff_read_from_str(
3548                 isl_ctx *ctx, const char *str);
3549         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_read_from_str(
3550                 isl_ctx *ctx, const char *str);
3551         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_read_from_str(
3552                 isl_ctx *ctx, const char *str);
3553         __isl_give isl_union_pw_aff *
3554         isl_union_pw_aff_read_from_str(
3555                 isl_ctx *ctx, const char *str);
3556         __isl_give isl_union_pw_multi_aff *
3557         isl_union_pw_multi_aff_read_from_str(
3558                 isl_ctx *ctx, const char *str);
3559         __isl_give isl_multi_union_pw_aff *
3560         isl_multi_union_pw_aff_read_from_str(
3561                 isl_ctx *ctx, const char *str);
3563         #include <isl/polynomial.h>
3564         __isl_give isl_union_pw_qpolynomial *
3565         isl_union_pw_qpolynomial_read_from_str(
3566                 isl_ctx *ctx, const char *str);
3568 For sets and relations,
3569 the input format is autodetected and may be either the C<PolyLib> format
3570 or the C<isl> format.
3572 =head3 Output
3574 Before anything can be printed, an C<isl_printer> needs to
3575 be created.
3577         __isl_give isl_printer *isl_printer_to_file(isl_ctx *ctx,
3578                 FILE *file);
3579         __isl_give isl_printer *isl_printer_to_str(isl_ctx *ctx);
3580         __isl_null isl_printer *isl_printer_free(
3581                 __isl_take isl_printer *printer);
3583 C<isl_printer_to_file> prints to the given file, while
3584 C<isl_printer_to_str> prints to a string that can be extracted
3585 using the following function.
3587         #include <isl/printer.h>
3588         __isl_give char *isl_printer_get_str(
3589                 __isl_keep isl_printer *printer);
3591 The printer can be inspected using the following functions.
3593         FILE *isl_printer_get_file(
3594                 __isl_keep isl_printer *printer);
3595         int isl_printer_get_output_format(
3596                 __isl_keep isl_printer *p);
3597         int isl_printer_get_yaml_style(__isl_keep isl_printer *p);
3599 The behavior of the printer can be modified in various ways
3601         __isl_give isl_printer *isl_printer_set_output_format(
3602                 __isl_take isl_printer *p, int output_format);
3603         __isl_give isl_printer *isl_printer_set_indent(
3604                 __isl_take isl_printer *p, int indent);
3605         __isl_give isl_printer *isl_printer_set_indent_prefix(
3606                 __isl_take isl_printer *p, const char *prefix);
3607         __isl_give isl_printer *isl_printer_indent(
3608                 __isl_take isl_printer *p, int indent);
3609         __isl_give isl_printer *isl_printer_set_prefix(
3610                 __isl_take isl_printer *p, const char *prefix);
3611         __isl_give isl_printer *isl_printer_set_suffix(
3612                 __isl_take isl_printer *p, const char *suffix);
3613         __isl_give isl_printer *isl_printer_set_yaml_style(
3614                 __isl_take isl_printer *p, int yaml_style);
3616 The C<output_format> may be either C<ISL_FORMAT_ISL>, C<ISL_FORMAT_OMEGA>,
3617 C<ISL_FORMAT_POLYLIB>, C<ISL_FORMAT_EXT_POLYLIB> or C<ISL_FORMAT_LATEX>
3618 and defaults to C<ISL_FORMAT_ISL>.
3619 Each line in the output is prefixed by C<indent_prefix>,
3620 indented by C<indent> (set by C<isl_printer_set_indent>) spaces
3621 (default: 0), prefixed by C<prefix> and suffixed by C<suffix>.
3622 In the C<PolyLib> format output,
3623 the coefficients of the existentially quantified variables
3624 appear between those of the set variables and those
3625 of the parameters.
3626 The function C<isl_printer_indent> increases the indentation
3627 by the specified amount (which may be negative).
3628 The YAML style may be either C<ISL_YAML_STYLE_BLOCK> or
3629 C<ISL_YAML_STYLE_FLOW> and when we are printing something
3630 in YAML format.
3632 To actually print something, use
3634         #include <isl/printer.h>
3635         __isl_give isl_printer *isl_printer_print_double(
3636                 __isl_take isl_printer *p, double d);
3638         #include <isl/val.h>
3639         __isl_give isl_printer *isl_printer_print_val(
3640                 __isl_take isl_printer *p, __isl_keep isl_val *v);
3642         #include <isl/set.h>
3643         __isl_give isl_printer *isl_printer_print_basic_set(
3644                 __isl_take isl_printer *printer,
3645                 __isl_keep isl_basic_set *bset);
3646         __isl_give isl_printer *isl_printer_print_set(
3647                 __isl_take isl_printer *printer,
3648                 __isl_keep isl_set *set);
3650         #include <isl/map.h>
3651         __isl_give isl_printer *isl_printer_print_basic_map(
3652                 __isl_take isl_printer *printer,
3653                 __isl_keep isl_basic_map *bmap);
3654         __isl_give isl_printer *isl_printer_print_map(
3655                 __isl_take isl_printer *printer,
3656                 __isl_keep isl_map *map);
3658         #include <isl/union_set.h>
3659         __isl_give isl_printer *isl_printer_print_union_set(
3660                 __isl_take isl_printer *p,
3661                 __isl_keep isl_union_set *uset);
3663         #include <isl/union_map.h>
3664         __isl_give isl_printer *isl_printer_print_union_map(
3665                 __isl_take isl_printer *p,
3666                 __isl_keep isl_union_map *umap);
3668         #include <isl/val.h>
3669         __isl_give isl_printer *isl_printer_print_multi_val(
3670                 __isl_take isl_printer *p,
3671                 __isl_keep isl_multi_val *mv);
3673         #include <isl/aff.h>
3674         __isl_give isl_printer *isl_printer_print_aff(
3675                 __isl_take isl_printer *p, __isl_keep isl_aff *aff);
3676         __isl_give isl_printer *isl_printer_print_multi_aff(
3677                 __isl_take isl_printer *p,
3678                 __isl_keep isl_multi_aff *maff);
3679         __isl_give isl_printer *isl_printer_print_pw_aff(
3680                 __isl_take isl_printer *p,
3681                 __isl_keep isl_pw_aff *pwaff);
3682         __isl_give isl_printer *isl_printer_print_pw_multi_aff(
3683                 __isl_take isl_printer *p,
3684                 __isl_keep isl_pw_multi_aff *pma);
3685         __isl_give isl_printer *isl_printer_print_multi_pw_aff(
3686                 __isl_take isl_printer *p,
3687                 __isl_keep isl_multi_pw_aff *mpa);
3688         __isl_give isl_printer *isl_printer_print_union_pw_aff(
3689                 __isl_take isl_printer *p,
3690                 __isl_keep isl_union_pw_aff *upa);
3691         __isl_give isl_printer *isl_printer_print_union_pw_multi_aff(
3692                 __isl_take isl_printer *p,
3693                 __isl_keep isl_union_pw_multi_aff *upma);
3694         __isl_give isl_printer *
3695         isl_printer_print_multi_union_pw_aff(
3696                 __isl_take isl_printer *p,
3697                 __isl_keep isl_multi_union_pw_aff *mupa);
3699         #include <isl/polynomial.h>
3700         __isl_give isl_printer *isl_printer_print_qpolynomial(
3701                 __isl_take isl_printer *p,
3702                 __isl_keep isl_qpolynomial *qp);
3703         __isl_give isl_printer *isl_printer_print_pw_qpolynomial(
3704                 __isl_take isl_printer *p,
3705                 __isl_keep isl_pw_qpolynomial *pwqp);
3706         __isl_give isl_printer *isl_printer_print_union_pw_qpolynomial(
3707                 __isl_take isl_printer *p,
3708                 __isl_keep isl_union_pw_qpolynomial *upwqp);
3710         __isl_give isl_printer *
3711         isl_printer_print_pw_qpolynomial_fold(
3712                 __isl_take isl_printer *p,
3713                 __isl_keep isl_pw_qpolynomial_fold *pwf);
3714         __isl_give isl_printer *
3715         isl_printer_print_union_pw_qpolynomial_fold(
3716                 __isl_take isl_printer *p,
3717                 __isl_keep isl_union_pw_qpolynomial_fold *upwf);
3719 For C<isl_printer_print_qpolynomial>,
3720 C<isl_printer_print_pw_qpolynomial> and
3721 C<isl_printer_print_pw_qpolynomial_fold>,
3722 the output format of the printer
3723 needs to be set to either C<ISL_FORMAT_ISL> or C<ISL_FORMAT_C>.
3724 For C<isl_printer_print_union_pw_qpolynomial> and
3725 C<isl_printer_print_union_pw_qpolynomial_fold>, only C<ISL_FORMAT_ISL>
3726 is supported.
3727 In case of printing in C<ISL_FORMAT_C>, the user may want
3728 to set the names of all dimensions first.
3730 C<isl> also provides limited support for printing YAML documents,
3731 just enough for the internal use for printing such documents.
3733         #include <isl/printer.h>
3734         __isl_give isl_printer *isl_printer_yaml_start_mapping(
3735                 __isl_take isl_printer *p);
3736         __isl_give isl_printer *isl_printer_yaml_end_mapping(
3737                 __isl_take isl_printer *p);
3738         __isl_give isl_printer *isl_printer_yaml_start_sequence(
3739                 __isl_take isl_printer *p);
3740         __isl_give isl_printer *isl_printer_yaml_end_sequence(
3741                 __isl_take isl_printer *p);
3742         __isl_give isl_printer *isl_printer_yaml_next(
3743                 __isl_take isl_printer *p);
3745 A document is started by a call to either
3746 C<isl_printer_yaml_start_mapping> or C<isl_printer_yaml_start_sequence>.
3747 Anything printed to the printer after such a call belong to the
3748 first key of the mapping or the first element in the sequence.
3749 The function C<isl_printer_yaml_next> moves to the value if
3750 we are currently printing a mapping key, the next key if we
3751 are printing a value or the next element if we are printing
3752 an element in a sequence.
3753 Nested mappings and sequences are initiated by the same
3754 C<isl_printer_yaml_start_mapping> or C<isl_printer_yaml_start_sequence>.
3755 Each call to these functions needs to have a corresponding call to
3756 C<isl_printer_yaml_end_mapping> or C<isl_printer_yaml_end_sequence>.
3758 When called on a file printer, the following function flushes
3759 the file.  When called on a string printer, the buffer is cleared.
3761         __isl_give isl_printer *isl_printer_flush(
3762                 __isl_take isl_printer *p);
3764 The following functions allow the user to attach
3765 notes to a printer in order to keep track of additional state.
3767         #include <isl/printer.h>
3768         isl_bool isl_printer_has_note(__isl_keep isl_printer *p,
3769                 __isl_keep isl_id *id);
3770         __isl_give isl_id *isl_printer_get_note(
3771                 __isl_keep isl_printer *p, __isl_take isl_id *id);
3772         __isl_give isl_printer *isl_printer_set_note(
3773                 __isl_take isl_printer *p,
3774                 __isl_take isl_id *id, __isl_take isl_id *note);
3776 C<isl_printer_set_note> associates the given note to the given
3777 identifier in the printer.
3778 C<isl_printer_get_note> retrieves a note associated to an
3779 identifier, while
3780 C<isl_printer_has_note> checks if there is such a note.
3781 C<isl_printer_get_note> fails if the requested note does not exist.
3783 Alternatively, a string representation can be obtained
3784 directly using the following functions, which always print
3785 in isl format.
3787         #include <isl/id.h>
3788         __isl_give char *isl_id_to_str(
3789                 __isl_keep isl_id *id);
3791         #include <isl/space.h>
3792         __isl_give char *isl_space_to_str(
3793                 __isl_keep isl_space *space);
3795         #include <isl/val.h>
3796         __isl_give char *isl_val_to_str(__isl_keep isl_val *v);
3797         __isl_give char *isl_multi_val_to_str(
3798                 __isl_keep isl_multi_val *mv);
3800         #include <isl/set.h>
3801         __isl_give char *isl_basic_set_to_str(
3802                 __isl_keep isl_basic_set *bset);
3803         __isl_give char *isl_set_to_str(
3804                 __isl_keep isl_set *set);
3806         #include <isl/union_set.h>
3807         __isl_give char *isl_union_set_to_str(
3808                 __isl_keep isl_union_set *uset);
3810         #include <isl/map.h>
3811         __isl_give char *isl_basic_map_to_str(
3812                 __isl_keep isl_basic_map *bmap);
3813         __isl_give char *isl_map_to_str(
3814                 __isl_keep isl_map *map);
3816         #include <isl/union_map.h>
3817         __isl_give char *isl_union_map_to_str(
3818                 __isl_keep isl_union_map *umap);
3820         #include <isl/aff.h>
3821         __isl_give char *isl_aff_to_str(__isl_keep isl_aff *aff);
3822         __isl_give char *isl_pw_aff_to_str(
3823                 __isl_keep isl_pw_aff *pa);
3824         __isl_give char *isl_multi_aff_to_str(
3825                 __isl_keep isl_multi_aff *ma);
3826         __isl_give char *isl_pw_multi_aff_to_str(
3827                 __isl_keep isl_pw_multi_aff *pma);
3828         __isl_give char *isl_multi_pw_aff_to_str(
3829                 __isl_keep isl_multi_pw_aff *mpa);
3830         __isl_give char *isl_union_pw_aff_to_str(
3831                 __isl_keep isl_union_pw_aff *upa);
3832         __isl_give char *isl_union_pw_multi_aff_to_str(
3833                 __isl_keep isl_union_pw_multi_aff *upma);
3834         __isl_give char *isl_multi_union_pw_aff_to_str(
3835                 __isl_keep isl_multi_union_pw_aff *mupa);
3837         #include <isl/point.h>
3838         __isl_give char *isl_point_to_str(
3839                 __isl_keep isl_point *pnt);
3841         #include <isl/polynomial.h>
3842         __isl_give char *isl_pw_qpolynomial_to_str(
3843                 __isl_keep isl_pw_qpolynomial *pwqp);
3844         __isl_give char *isl_union_pw_qpolynomial_to_str(
3845                 __isl_keep isl_union_pw_qpolynomial *upwqp);
3847 =head2 Properties
3849 =head3 Unary Properties
3851 =over
3853 =item * Emptiness
3855 The following functions test whether the given set or relation
3856 contains any integer points.  The ``plain'' variants do not perform
3857 any computations, but simply check if the given set or relation
3858 is already known to be empty.
3860         #include <isl/set.h>
3861         isl_bool isl_basic_set_plain_is_empty(
3862                 __isl_keep isl_basic_set *bset);
3863         isl_bool isl_basic_set_is_empty(
3864                 __isl_keep isl_basic_set *bset);
3865         isl_bool isl_set_plain_is_empty(
3866                 __isl_keep isl_set *set);
3867         isl_bool isl_set_is_empty(__isl_keep isl_set *set);
3869         #include <isl/union_set.h>
3870         isl_bool isl_union_set_is_empty(
3871                 __isl_keep isl_union_set *uset);
3873         #include <isl/map.h>
3874         isl_bool isl_basic_map_plain_is_empty(
3875                 __isl_keep isl_basic_map *bmap);
3876         isl_bool isl_basic_map_is_empty(
3877                 __isl_keep isl_basic_map *bmap);
3878         isl_bool isl_map_plain_is_empty(
3879                 __isl_keep isl_map *map);
3880         isl_bool isl_map_is_empty(__isl_keep isl_map *map);
3882         #include <isl/union_map.h>
3883         isl_bool isl_union_map_plain_is_empty(
3884                 __isl_keep isl_union_map *umap);
3885         isl_bool isl_union_map_is_empty(
3886                 __isl_keep isl_union_map *umap);
3888 =item * Universality
3890         isl_bool isl_basic_set_plain_is_universe(
3891                 __isl_keep isl_basic_set *bset);
3892         isl_bool isl_basic_set_is_universe(
3893                 __isl_keep isl_basic_set *bset);
3894         isl_bool isl_basic_map_plain_is_universe(
3895                 __isl_keep isl_basic_map *bmap);
3896         isl_bool isl_basic_map_is_universe(
3897                 __isl_keep isl_basic_map *bmap);
3898         isl_bool isl_set_plain_is_universe(
3899                 __isl_keep isl_set *set);
3900         isl_bool isl_map_plain_is_universe(
3901                 __isl_keep isl_map *map);
3903 =item * Single-valuedness
3905         #include <isl/set.h>
3906         isl_bool isl_set_is_singleton(__isl_keep isl_set *set);
3908         #include <isl/map.h>
3909         isl_bool isl_basic_map_is_single_valued(
3910                 __isl_keep isl_basic_map *bmap);
3911         isl_bool isl_map_plain_is_single_valued(
3912                 __isl_keep isl_map *map);
3913         isl_bool isl_map_is_single_valued(__isl_keep isl_map *map);
3915         #include <isl/union_map.h>
3916         isl_bool isl_union_map_is_single_valued(
3917                 __isl_keep isl_union_map *umap);
3919 =item * Injectivity
3921         isl_bool isl_map_plain_is_injective(
3922                 __isl_keep isl_map *map);
3923         isl_bool isl_map_is_injective(
3924                 __isl_keep isl_map *map);
3925         isl_bool isl_union_map_plain_is_injective(
3926                 __isl_keep isl_union_map *umap);
3927         isl_bool isl_union_map_is_injective(
3928                 __isl_keep isl_union_map *umap);
3930 =item * Bijectivity
3932         isl_bool isl_map_is_bijective(
3933                 __isl_keep isl_map *map);
3934         isl_bool isl_union_map_is_bijective(
3935                 __isl_keep isl_union_map *umap);
3937 =item * Identity
3939 The following functions test whether the given relation
3940 only maps elements to themselves.
3942         #include <isl/map.h>
3943         isl_bool isl_map_is_identity(
3944                 __isl_keep isl_map *map);
3946         #include <isl/union_map.h>
3947         isl_bool isl_union_map_is_identity(
3948                 __isl_keep isl_union_map *umap);
3950 =item * Position
3952         __isl_give isl_val *
3953         isl_basic_map_plain_get_val_if_fixed(
3954                 __isl_keep isl_basic_map *bmap,
3955                 enum isl_dim_type type, unsigned pos);
3956         __isl_give isl_val *isl_set_plain_get_val_if_fixed(
3957                 __isl_keep isl_set *set,
3958                 enum isl_dim_type type, unsigned pos);
3959         __isl_give isl_val *isl_map_plain_get_val_if_fixed(
3960                 __isl_keep isl_map *map,
3961                 enum isl_dim_type type, unsigned pos);
3963 If the set or relation obviously lies on a hyperplane where the given dimension
3964 has a fixed value, then return that value.
3965 Otherwise return NaN.
3967 =item * Stride
3969         isl_stat isl_set_dim_residue_class_val(
3970                 __isl_keep isl_set *set,
3971                 int pos, __isl_give isl_val **modulo,
3972                 __isl_give isl_val **residue);
3974 Check if the values of the given set dimension are equal to a fixed
3975 value modulo some integer value.  If so, assign the modulo to C<*modulo>
3976 and the fixed value to C<*residue>.  If the given dimension attains only
3977 a single value, then assign C<0> to C<*modulo> and the fixed value to
3978 C<*residue>.
3979 If the dimension does not attain only a single value and if no modulo
3980 can be found then assign C<1> to C<*modulo> and C<1> to C<*residue>.
3982         #include <isl/set.h>
3983         __isl_give isl_stride_info *isl_set_get_stride_info(
3984                 __isl_keep isl_set *set, int pos);
3985         __isl_give isl_val *isl_set_get_stride(
3986                 __isl_keep isl_set *set, int pos);
3988 Check if the values of the given set dimension are equal to
3989 some affine expression of the other dimensions (the offset)
3990 modulo some integer stride.
3991 If no more specific information can be found, then the stride
3992 is taken to be one and the offset is taken to be the zero expression.
3993 The function C<isl_set_get_stride_info> performs the same
3994 computation but only returns the stride.
3995 Otherwise,
3996 the stride and offset can be extracted from the returned object
3997 using the following functions.
3999         #include <isl/set.h>
4000         __isl_give isl_val *isl_stride_info_get_stride(
4001                 __isl_keep isl_stride_info *si);
4002         __isl_give isl_aff *isl_stride_info_get_offset(
4003                 __isl_keep isl_stride_info *si);
4005 The stride info object can be released using the following function.
4007         #include <isl/set.h>
4008         __isl_null isl_stride_info *isl_stride_info_free(
4009                 __isl_take isl_stride_info *si);
4011 =item * Dependence
4013 To check whether the description of a set, relation or function depends
4014 on one or more given dimensions,
4015 the following functions can be used.
4017         #include <isl/constraint.h>
4018         isl_bool isl_constraint_involves_dims(
4019                 __isl_keep isl_constraint *constraint,
4020                 enum isl_dim_type type, unsigned first, unsigned n);
4022         #include <isl/set.h>
4023         isl_bool isl_basic_set_involves_dims(
4024                 __isl_keep isl_basic_set *bset,
4025                 enum isl_dim_type type, unsigned first, unsigned n);
4026         isl_bool isl_set_involves_dims(__isl_keep isl_set *set,
4027                 enum isl_dim_type type, unsigned first, unsigned n);
4029         #include <isl/map.h>
4030         isl_bool isl_basic_map_involves_dims(
4031                 __isl_keep isl_basic_map *bmap,
4032                 enum isl_dim_type type, unsigned first, unsigned n);
4033         isl_bool isl_map_involves_dims(__isl_keep isl_map *map,
4034                 enum isl_dim_type type, unsigned first, unsigned n);
4036         #include <isl/union_map.h>
4037         isl_bool isl_union_map_involves_dims(
4038                 __isl_keep isl_union_map *umap,
4039                 enum isl_dim_type type, unsigned first, unsigned n);
4041         #include <isl/aff.h>
4042         isl_bool isl_aff_involves_dims(__isl_keep isl_aff *aff,
4043                 enum isl_dim_type type, unsigned first, unsigned n);
4044         isl_bool isl_pw_aff_involves_dims(
4045                 __isl_keep isl_pw_aff *pwaff,
4046                 enum isl_dim_type type, unsigned first, unsigned n);
4047         isl_bool isl_multi_aff_involves_dims(
4048                 __isl_keep isl_multi_aff *ma,
4049                 enum isl_dim_type type, unsigned first, unsigned n);
4050         isl_bool isl_multi_pw_aff_involves_dims(
4051                 __isl_keep isl_multi_pw_aff *mpa,
4052                 enum isl_dim_type type, unsigned first, unsigned n);
4054         #include <isl/polynomial.h>
4055         isl_bool isl_qpolynomial_involves_dims(
4056                 __isl_keep isl_qpolynomial *qp,
4057                 enum isl_dim_type type, unsigned first, unsigned n);
4059 Similarly, the following functions can be used to check whether
4060 a given dimension is involved in any lower or upper bound.
4062         #include <isl/set.h>
4063         isl_bool isl_set_dim_has_any_lower_bound(
4064                 __isl_keep isl_set *set,
4065                 enum isl_dim_type type, unsigned pos);
4066         isl_bool isl_set_dim_has_any_upper_bound(
4067                 __isl_keep isl_set *set,
4068                 enum isl_dim_type type, unsigned pos);
4070 Note that these functions return true even if there is a bound on
4071 the dimension on only some of the basic sets of C<set>.
4072 To check if they have a bound for all of the basic sets in C<set>,
4073 use the following functions instead.
4075         #include <isl/set.h>
4076         isl_bool isl_set_dim_has_lower_bound(
4077                 __isl_keep isl_set *set,
4078                 enum isl_dim_type type, unsigned pos);
4079         isl_bool isl_set_dim_has_upper_bound(
4080                 __isl_keep isl_set *set,
4081                 enum isl_dim_type type, unsigned pos);
4083 =item * Space
4085 To check whether a set is a parameter domain, use this function:
4087         isl_bool isl_set_is_params(__isl_keep isl_set *set);
4088         isl_bool isl_union_set_is_params(
4089                 __isl_keep isl_union_set *uset);
4091 =item * Wrapping
4093 The following functions check whether the space of the given
4094 (basic) set or relation domain and/or range is a wrapped relation.
4096         #include <isl/space.h>
4097         isl_bool isl_space_is_wrapping(
4098                 __isl_keep isl_space *space);
4099         isl_bool isl_space_domain_is_wrapping(
4100                 __isl_keep isl_space *space);
4101         isl_bool isl_space_range_is_wrapping(
4102                 __isl_keep isl_space *space);
4103         isl_bool isl_space_is_product(
4104                 __isl_keep isl_space *space);
4106         #include <isl/set.h>
4107         isl_bool isl_basic_set_is_wrapping(
4108                 __isl_keep isl_basic_set *bset);
4109         isl_bool isl_set_is_wrapping(__isl_keep isl_set *set);
4111         #include <isl/map.h>
4112         isl_bool isl_map_domain_is_wrapping(
4113                 __isl_keep isl_map *map);
4114         isl_bool isl_map_range_is_wrapping(
4115                 __isl_keep isl_map *map);
4116         isl_bool isl_map_is_product(__isl_keep isl_map *map);
4118         #include <isl/val.h>
4119         isl_bool isl_multi_val_range_is_wrapping(
4120                 __isl_keep isl_multi_val *mv);
4122         #include <isl/aff.h>
4123         isl_bool isl_multi_aff_range_is_wrapping(
4124                 __isl_keep isl_multi_aff *ma);
4125         isl_bool isl_multi_pw_aff_range_is_wrapping(
4126                 __isl_keep isl_multi_pw_aff *mpa);
4127         isl_bool isl_multi_union_pw_aff_range_is_wrapping(
4128                 __isl_keep isl_multi_union_pw_aff *mupa);
4130 The input to C<isl_space_is_wrapping> should
4131 be the space of a set, while that of
4132 C<isl_space_domain_is_wrapping> and
4133 C<isl_space_range_is_wrapping> should be the space of a relation.
4134 The input to C<isl_space_is_product> can be either the space
4135 of a set or that of a binary relation.
4136 In case the input is the space of a binary relation, it checks
4137 whether both domain and range are wrapping.
4139 =item * Internal Product
4141         isl_bool isl_basic_map_can_zip(
4142                 __isl_keep isl_basic_map *bmap);
4143         isl_bool isl_map_can_zip(__isl_keep isl_map *map);
4145 Check whether the product of domain and range of the given relation
4146 can be computed,
4147 i.e., whether both domain and range are nested relations.
4149 =item * Currying
4151         #include <isl/space.h>
4152         isl_bool isl_space_can_curry(
4153                 __isl_keep isl_space *space);
4155         #include <isl/map.h>
4156         isl_bool isl_basic_map_can_curry(
4157                 __isl_keep isl_basic_map *bmap);
4158         isl_bool isl_map_can_curry(__isl_keep isl_map *map);
4160 Check whether the domain of the (basic) relation is a wrapped relation.
4162         #include <isl/space.h>
4163         __isl_give isl_space *isl_space_uncurry(
4164                 __isl_take isl_space *space);
4166         #include <isl/map.h>
4167         isl_bool isl_basic_map_can_uncurry(
4168                 __isl_keep isl_basic_map *bmap);
4169         isl_bool isl_map_can_uncurry(__isl_keep isl_map *map);
4171 Check whether the range of the (basic) relation is a wrapped relation.
4173         #include <isl/space.h>
4174         isl_bool isl_space_can_range_curry(
4175                 __isl_keep isl_space *space);
4177         #include <isl/map.h>
4178         isl_bool isl_map_can_range_curry(
4179                 __isl_keep isl_map *map);
4181 Check whether the domain of the relation wrapped in the range of
4182 the input is itself a wrapped relation.
4184 =item * Special Values
4186         #include <isl/aff.h>
4187         isl_bool isl_aff_is_cst(__isl_keep isl_aff *aff);
4188         isl_bool isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff);
4189         isl_bool isl_multi_pw_aff_is_cst(
4190                 __isl_keep isl_multi_pw_aff *mpa);
4192 Check whether the given expression is a constant.
4194         #include <isl/val.h>
4195         isl_bool isl_multi_val_involves_nan(
4196                 __isl_keep isl_multi_val *mv);
4198         #include <isl/aff.h>
4199         isl_bool isl_aff_is_nan(__isl_keep isl_aff *aff);
4200         isl_bool isl_multi_aff_involves_nan(
4201                 __isl_keep isl_multi_aff *ma);
4202         isl_bool isl_pw_aff_involves_nan(
4203                 __isl_keep isl_pw_aff *pa);
4204         isl_bool isl_pw_multi_aff_involves_nan(
4205                 __isl_keep isl_pw_multi_aff *pma);
4206         isl_bool isl_multi_pw_aff_involves_nan(
4207                 __isl_keep isl_multi_pw_aff *mpa);
4208         isl_bool isl_union_pw_aff_involves_nan(
4209                 __isl_keep isl_union_pw_aff *upa);
4210         isl_bool isl_union_pw_multi_aff_involves_nan(
4211                 __isl_keep isl_union_pw_multi_aff *upma);
4212         isl_bool isl_multi_union_pw_aff_involves_nan(
4213                 __isl_keep isl_multi_union_pw_aff *mupa);
4215         #include <isl/polynomial.h>
4216         isl_bool isl_qpolynomial_is_nan(
4217                 __isl_keep isl_qpolynomial *qp);
4218         isl_bool isl_qpolynomial_fold_is_nan(
4219                 __isl_keep isl_qpolynomial_fold *fold);
4220         isl_bool isl_pw_qpolynomial_involves_nan(
4221                 __isl_keep isl_pw_qpolynomial *pwqp);
4222         isl_bool isl_pw_qpolynomial_fold_involves_nan(
4223                 __isl_keep isl_pw_qpolynomial_fold *pwf);
4224         isl_bool isl_union_pw_qpolynomial_involves_nan(
4225                 __isl_keep isl_union_pw_qpolynomial *upwqp);
4226         isl_bool isl_union_pw_qpolynomial_fold_involves_nan(
4227                 __isl_keep isl_union_pw_qpolynomial_fold *upwf);
4229 Check whether the given expression is equal to or involves NaN.
4231         #include <isl/aff.h>
4232         isl_bool isl_aff_plain_is_zero(
4233                 __isl_keep isl_aff *aff);
4235 Check whether the affine expression is obviously zero.
4237 =back
4239 =head3 Binary Properties
4241 =over
4243 =item * Equality
4245 The following functions check whether two objects
4246 represent the same set, relation or function.
4247 The C<plain> variants only return true if the objects
4248 are obviously the same.  That is, they may return false
4249 even if the objects are the same, but they will never
4250 return true if the objects are not the same.
4252         #include <isl/set.h>
4253         isl_bool isl_basic_set_plain_is_equal(
4254                 __isl_keep isl_basic_set *bset1,
4255                 __isl_keep isl_basic_set *bset2);
4256         isl_bool isl_basic_set_is_equal(
4257                 __isl_keep isl_basic_set *bset1,
4258                 __isl_keep isl_basic_set *bset2);
4259         isl_bool isl_set_plain_is_equal(
4260                 __isl_keep isl_set *set1,
4261                 __isl_keep isl_set *set2);
4262         isl_bool isl_set_is_equal(__isl_keep isl_set *set1,
4263                 __isl_keep isl_set *set2);
4265         #include <isl/map.h>
4266         isl_bool isl_basic_map_is_equal(
4267                 __isl_keep isl_basic_map *bmap1,
4268                 __isl_keep isl_basic_map *bmap2);
4269         isl_bool isl_map_is_equal(__isl_keep isl_map *map1,
4270                 __isl_keep isl_map *map2);
4271         isl_bool isl_map_plain_is_equal(
4272                 __isl_keep isl_map *map1,
4273                 __isl_keep isl_map *map2);
4275         #include <isl/union_set.h>
4276         isl_bool isl_union_set_is_equal(
4277                 __isl_keep isl_union_set *uset1,
4278                 __isl_keep isl_union_set *uset2);
4280         #include <isl/union_map.h>
4281         isl_bool isl_union_map_is_equal(
4282                 __isl_keep isl_union_map *umap1,
4283                 __isl_keep isl_union_map *umap2);
4285         #include <isl/aff.h>
4286         isl_bool isl_aff_plain_is_equal(
4287                 __isl_keep isl_aff *aff1,
4288                 __isl_keep isl_aff *aff2);
4289         isl_bool isl_multi_aff_plain_is_equal(
4290                 __isl_keep isl_multi_aff *maff1,
4291                 __isl_keep isl_multi_aff *maff2);
4292         isl_bool isl_pw_aff_plain_is_equal(
4293                 __isl_keep isl_pw_aff *pwaff1,
4294                 __isl_keep isl_pw_aff *pwaff2);
4295         isl_bool isl_pw_aff_is_equal(
4296                 __isl_keep isl_pw_aff *pa1,
4297                 __isl_keep isl_pw_aff *pa2);
4298         isl_bool isl_pw_multi_aff_plain_is_equal(
4299                 __isl_keep isl_pw_multi_aff *pma1,
4300                 __isl_keep isl_pw_multi_aff *pma2);
4301         isl_bool isl_pw_multi_aff_is_equal(
4302                 __isl_keep isl_pw_multi_aff *pma1,
4303                 __isl_keep isl_pw_multi_aff *pma2);
4304         isl_bool isl_multi_pw_aff_plain_is_equal(
4305                 __isl_keep isl_multi_pw_aff *mpa1,
4306                 __isl_keep isl_multi_pw_aff *mpa2);
4307         isl_bool isl_multi_pw_aff_is_equal(
4308                 __isl_keep isl_multi_pw_aff *mpa1,
4309                 __isl_keep isl_multi_pw_aff *mpa2);
4310         isl_bool isl_union_pw_aff_plain_is_equal(
4311                 __isl_keep isl_union_pw_aff *upa1,
4312                 __isl_keep isl_union_pw_aff *upa2);
4313         isl_bool isl_union_pw_multi_aff_plain_is_equal(
4314                 __isl_keep isl_union_pw_multi_aff *upma1,
4315                 __isl_keep isl_union_pw_multi_aff *upma2);
4316         isl_bool isl_multi_union_pw_aff_plain_is_equal(
4317                 __isl_keep isl_multi_union_pw_aff *mupa1,
4318                 __isl_keep isl_multi_union_pw_aff *mupa2);
4320         #include <isl/polynomial.h>
4321         isl_bool isl_union_pw_qpolynomial_plain_is_equal(
4322                 __isl_keep isl_union_pw_qpolynomial *upwqp1,
4323                 __isl_keep isl_union_pw_qpolynomial *upwqp2);
4324         isl_bool isl_union_pw_qpolynomial_fold_plain_is_equal(
4325                 __isl_keep isl_union_pw_qpolynomial_fold *upwf1,
4326                 __isl_keep isl_union_pw_qpolynomial_fold *upwf2);
4328 =item * Disjointness
4330         #include <isl/set.h>
4331         isl_bool isl_basic_set_is_disjoint(
4332                 __isl_keep isl_basic_set *bset1,
4333                 __isl_keep isl_basic_set *bset2);
4334         isl_bool isl_set_plain_is_disjoint(
4335                 __isl_keep isl_set *set1,
4336                 __isl_keep isl_set *set2);
4337         isl_bool isl_set_is_disjoint(__isl_keep isl_set *set1,
4338                 __isl_keep isl_set *set2);
4340         #include <isl/map.h>
4341         isl_bool isl_basic_map_is_disjoint(
4342                 __isl_keep isl_basic_map *bmap1,
4343                 __isl_keep isl_basic_map *bmap2);
4344         isl_bool isl_map_is_disjoint(__isl_keep isl_map *map1,
4345                 __isl_keep isl_map *map2);
4347         #include <isl/union_set.h>
4348         isl_bool isl_union_set_is_disjoint(
4349                 __isl_keep isl_union_set *uset1,
4350                 __isl_keep isl_union_set *uset2);
4352         #include <isl/union_map.h>
4353         isl_bool isl_union_map_is_disjoint(
4354                 __isl_keep isl_union_map *umap1,
4355                 __isl_keep isl_union_map *umap2);
4357 =item * Subset
4359         isl_bool isl_basic_set_is_subset(
4360                 __isl_keep isl_basic_set *bset1,
4361                 __isl_keep isl_basic_set *bset2);
4362         isl_bool isl_set_is_subset(__isl_keep isl_set *set1,
4363                 __isl_keep isl_set *set2);
4364         isl_bool isl_set_is_strict_subset(
4365                 __isl_keep isl_set *set1,
4366                 __isl_keep isl_set *set2);
4367         isl_bool isl_union_set_is_subset(
4368                 __isl_keep isl_union_set *uset1,
4369                 __isl_keep isl_union_set *uset2);
4370         isl_bool isl_union_set_is_strict_subset(
4371                 __isl_keep isl_union_set *uset1,
4372                 __isl_keep isl_union_set *uset2);
4373         isl_bool isl_basic_map_is_subset(
4374                 __isl_keep isl_basic_map *bmap1,
4375                 __isl_keep isl_basic_map *bmap2);
4376         isl_bool isl_basic_map_is_strict_subset(
4377                 __isl_keep isl_basic_map *bmap1,
4378                 __isl_keep isl_basic_map *bmap2);
4379         isl_bool isl_map_is_subset(
4380                 __isl_keep isl_map *map1,
4381                 __isl_keep isl_map *map2);
4382         isl_bool isl_map_is_strict_subset(
4383                 __isl_keep isl_map *map1,
4384                 __isl_keep isl_map *map2);
4385         isl_bool isl_union_map_is_subset(
4386                 __isl_keep isl_union_map *umap1,
4387                 __isl_keep isl_union_map *umap2);
4388         isl_bool isl_union_map_is_strict_subset(
4389                 __isl_keep isl_union_map *umap1,
4390                 __isl_keep isl_union_map *umap2);
4392 Check whether the first argument is a (strict) subset of the
4393 second argument.
4395 =item * Order
4397 Every comparison function returns a negative value if the first
4398 argument is considered smaller than the second, a positive value
4399 if the first argument is considered greater and zero if the two
4400 constraints are considered the same by the comparison criterion.
4402         #include <isl/constraint.h>
4403         int isl_constraint_plain_cmp(
4404                 __isl_keep isl_constraint *c1,
4405                 __isl_keep isl_constraint *c2);
4407 This function is useful for sorting C<isl_constraint>s.
4408 The order depends on the internal representation of the inputs.
4409 The order is fixed over different calls to the function (assuming
4410 the internal representation of the inputs has not changed), but may
4411 change over different versions of C<isl>.
4413         #include <isl/constraint.h>
4414         int isl_constraint_cmp_last_non_zero(
4415                 __isl_keep isl_constraint *c1,
4416                 __isl_keep isl_constraint *c2);
4418 This function can be used to sort constraints that live in the same
4419 local space.  Constraints that involve ``earlier'' dimensions or
4420 that have a smaller coefficient for the shared latest dimension
4421 are considered smaller than other constraints.
4422 This function only defines a B<partial> order.
4424         #include <isl/set.h>
4425         int isl_set_plain_cmp(__isl_keep isl_set *set1,
4426                 __isl_keep isl_set *set2);
4428 This function is useful for sorting C<isl_set>s.
4429 The order depends on the internal representation of the inputs.
4430 The order is fixed over different calls to the function (assuming
4431 the internal representation of the inputs has not changed), but may
4432 change over different versions of C<isl>.
4434         #include <isl/aff.h>
4435         int isl_multi_aff_plain_cmp(
4436                 __isl_keep isl_multi_aff *ma1,
4437                 __isl_keep isl_multi_aff *ma2);
4438         int isl_pw_aff_plain_cmp(__isl_keep isl_pw_aff *pa1,
4439                 __isl_keep isl_pw_aff *pa2);
4441 The functions C<isl_multi_aff_plain_cmp> and
4442 C<isl_pw_aff_plain_cmp> can be used to sort C<isl_multi_aff>s and
4443 C<isl_pw_aff>s.  The order is not strictly defined.
4444 The current order sorts expressions that only involve
4445 earlier dimensions before those that involve later dimensions.
4447 =back
4449 =head2 Unary Operations
4451 =over
4453 =item * Complement
4455         __isl_give isl_set *isl_set_complement(
4456                 __isl_take isl_set *set);
4457         __isl_give isl_map *isl_map_complement(
4458                 __isl_take isl_map *map);
4460 =item * Inverse map
4462         #include <isl/space.h>
4463         __isl_give isl_space *isl_space_reverse(
4464                 __isl_take isl_space *space);
4466         #include <isl/map.h>
4467         __isl_give isl_basic_map *isl_basic_map_reverse(
4468                 __isl_take isl_basic_map *bmap);
4469         __isl_give isl_map *isl_map_reverse(
4470                 __isl_take isl_map *map);
4472         #include <isl/union_map.h>
4473         __isl_give isl_union_map *isl_union_map_reverse(
4474                 __isl_take isl_union_map *umap);
4476 =item * Projection
4478         #include <isl/space.h>
4479         __isl_give isl_space *isl_space_domain(
4480                 __isl_take isl_space *space);
4481         __isl_give isl_space *isl_space_range(
4482                 __isl_take isl_space *space);
4483         __isl_give isl_space *isl_space_params(
4484                 __isl_take isl_space *space);
4486         #include <isl/local_space.h>
4487         __isl_give isl_local_space *isl_local_space_domain(
4488                 __isl_take isl_local_space *ls);
4489         __isl_give isl_local_space *isl_local_space_range(
4490                 __isl_take isl_local_space *ls);
4492         #include <isl/set.h>
4493         __isl_give isl_basic_set *isl_basic_set_project_out(
4494                 __isl_take isl_basic_set *bset,
4495                 enum isl_dim_type type, unsigned first, unsigned n);
4496         __isl_give isl_set *isl_set_project_out(__isl_take isl_set *set,
4497                 enum isl_dim_type type, unsigned first, unsigned n);
4498         __isl_give isl_map *isl_set_project_onto_map(
4499                 __isl_take isl_set *set,
4500                 enum isl_dim_type type, unsigned first,
4501                 unsigned n);
4502         __isl_give isl_basic_set *isl_basic_set_params(
4503                 __isl_take isl_basic_set *bset);
4504         __isl_give isl_set *isl_set_params(__isl_take isl_set *set);
4506 The function C<isl_set_project_onto_map> returns a relation
4507 that projects the input set onto the given set dimensions.
4509         #include <isl/map.h>
4510         __isl_give isl_basic_map *isl_basic_map_project_out(
4511                 __isl_take isl_basic_map *bmap,
4512                 enum isl_dim_type type, unsigned first, unsigned n);
4513         __isl_give isl_map *isl_map_project_out(__isl_take isl_map *map,
4514                 enum isl_dim_type type, unsigned first, unsigned n);
4515         __isl_give isl_basic_set *isl_basic_map_domain(
4516                 __isl_take isl_basic_map *bmap);
4517         __isl_give isl_basic_set *isl_basic_map_range(
4518                 __isl_take isl_basic_map *bmap);
4519         __isl_give isl_set *isl_map_params(__isl_take isl_map *map);
4520         __isl_give isl_set *isl_map_domain(
4521                 __isl_take isl_map *bmap);
4522         __isl_give isl_set *isl_map_range(
4523                 __isl_take isl_map *map);
4525         #include <isl/union_set.h>
4526         __isl_give isl_union_set *isl_union_set_project_out(
4527                 __isl_take isl_union_set *uset,
4528                 enum isl_dim_type type,
4529                 unsigned first, unsigned n);
4530         __isl_give isl_set *isl_union_set_params(
4531                 __isl_take isl_union_set *uset);
4533 The function C<isl_union_set_project_out> can only project out
4534 parameters.
4536         #include <isl/union_map.h>
4537         __isl_give isl_union_map *isl_union_map_project_out(
4538                 __isl_take isl_union_map *umap,
4539                 enum isl_dim_type type, unsigned first, unsigned n);
4540         __isl_give isl_union_map *
4541         isl_union_map_project_out_all_params(
4542                 __isl_take isl_union_map *umap);
4543         __isl_give isl_set *isl_union_map_params(
4544                 __isl_take isl_union_map *umap);
4545         __isl_give isl_union_set *isl_union_map_domain(
4546                 __isl_take isl_union_map *umap);
4547         __isl_give isl_union_set *isl_union_map_range(
4548                 __isl_take isl_union_map *umap);
4550 The function C<isl_union_map_project_out> can only project out
4551 parameters.
4553         #include <isl/aff.h>
4554         __isl_give isl_aff *isl_aff_project_domain_on_params(
4555                 __isl_take isl_aff *aff);
4556         __isl_give isl_multi_aff *
4557         isl_multi_aff_project_domain_on_params(
4558                 __isl_take isl_multi_aff *ma);
4559         __isl_give isl_pw_aff *
4560         isl_pw_aff_project_domain_on_params(
4561                 __isl_take isl_pw_aff *pa);
4562         __isl_give isl_multi_pw_aff *
4563         isl_multi_pw_aff_project_domain_on_params(
4564                 __isl_take isl_multi_pw_aff *mpa);
4565         __isl_give isl_pw_multi_aff *
4566         isl_pw_multi_aff_project_domain_on_params(
4567                 __isl_take isl_pw_multi_aff *pma);
4568         __isl_give isl_set *isl_pw_aff_domain(
4569                 __isl_take isl_pw_aff *pwaff);
4570         __isl_give isl_set *isl_pw_multi_aff_domain(
4571                 __isl_take isl_pw_multi_aff *pma);
4572         __isl_give isl_set *isl_multi_pw_aff_domain(
4573                 __isl_take isl_multi_pw_aff *mpa);
4574         __isl_give isl_union_set *isl_union_pw_aff_domain(
4575                 __isl_take isl_union_pw_aff *upa);
4576         __isl_give isl_union_set *isl_union_pw_multi_aff_domain(
4577                 __isl_take isl_union_pw_multi_aff *upma);
4578         __isl_give isl_union_set *
4579         isl_multi_union_pw_aff_domain(
4580                 __isl_take isl_multi_union_pw_aff *mupa);
4581         __isl_give isl_set *isl_pw_aff_params(
4582                 __isl_take isl_pw_aff *pwa);
4584 If no explicit domain was set on a zero-dimensional input to
4585 C<isl_multi_union_pw_aff_domain>, then this function will
4586 return a parameter set.
4588         #include <isl/polynomial.h>
4589         __isl_give isl_qpolynomial *
4590         isl_qpolynomial_project_domain_on_params(
4591                 __isl_take isl_qpolynomial *qp);
4592         __isl_give isl_pw_qpolynomial *
4593         isl_pw_qpolynomial_project_domain_on_params(
4594                 __isl_take isl_pw_qpolynomial *pwqp);
4595         __isl_give isl_pw_qpolynomial_fold *
4596         isl_pw_qpolynomial_fold_project_domain_on_params(
4597                 __isl_take isl_pw_qpolynomial_fold *pwf);
4598         __isl_give isl_set *isl_pw_qpolynomial_domain(
4599                 __isl_take isl_pw_qpolynomial *pwqp);
4600         __isl_give isl_union_set *isl_union_pw_qpolynomial_fold_domain(
4601                 __isl_take isl_union_pw_qpolynomial_fold *upwf);
4602         __isl_give isl_union_set *isl_union_pw_qpolynomial_domain(
4603                 __isl_take isl_union_pw_qpolynomial *upwqp);
4605         #include <isl/space.h>
4606         __isl_give isl_space *isl_space_domain_map(
4607                 __isl_take isl_space *space);
4608         __isl_give isl_space *isl_space_range_map(
4609                 __isl_take isl_space *space);
4611         #include <isl/map.h>
4612         __isl_give isl_map *isl_set_wrapped_domain_map(
4613                 __isl_take isl_set *set);
4614         __isl_give isl_basic_map *isl_basic_map_domain_map(
4615                 __isl_take isl_basic_map *bmap);
4616         __isl_give isl_basic_map *isl_basic_map_range_map(
4617                 __isl_take isl_basic_map *bmap);
4618         __isl_give isl_map *isl_map_domain_map(__isl_take isl_map *map);
4619         __isl_give isl_map *isl_map_range_map(__isl_take isl_map *map);
4621         #include <isl/union_map.h>
4622         __isl_give isl_union_map *isl_union_map_domain_map(
4623                 __isl_take isl_union_map *umap);
4624         __isl_give isl_union_pw_multi_aff *
4625         isl_union_map_domain_map_union_pw_multi_aff(
4626                 __isl_take isl_union_map *umap);
4627         __isl_give isl_union_map *isl_union_map_range_map(
4628                 __isl_take isl_union_map *umap);
4629         __isl_give isl_union_map *
4630         isl_union_set_wrapped_domain_map(
4631                 __isl_take isl_union_set *uset);
4633 The functions above construct a (basic, regular or union) relation
4634 that maps (a wrapped version of) the input relation to its domain or range.
4635 C<isl_set_wrapped_domain_map> maps the input set to the domain
4636 of its wrapped relation.
4638 =item * Elimination
4640         __isl_give isl_basic_set *isl_basic_set_eliminate(
4641                 __isl_take isl_basic_set *bset,
4642                 enum isl_dim_type type,
4643                 unsigned first, unsigned n);
4644         __isl_give isl_set *isl_set_eliminate(
4645                 __isl_take isl_set *set, enum isl_dim_type type,
4646                 unsigned first, unsigned n);
4647         __isl_give isl_basic_map *isl_basic_map_eliminate(
4648                 __isl_take isl_basic_map *bmap,
4649                 enum isl_dim_type type,
4650                 unsigned first, unsigned n);
4651         __isl_give isl_map *isl_map_eliminate(
4652                 __isl_take isl_map *map, enum isl_dim_type type,
4653                 unsigned first, unsigned n);
4655 Eliminate the coefficients for the given dimensions from the constraints,
4656 without removing the dimensions.
4658 =item * Constructing a set from a parameter domain
4660 A zero-dimensional (local) space or (basic) set can be constructed
4661 on a given parameter domain using the following functions.
4663         #include <isl/space.h>
4664         __isl_give isl_space *isl_space_set_from_params(
4665                 __isl_take isl_space *space);
4667         #include <isl/local_space.h>
4668         __isl_give isl_local_space *
4669         isl_local_space_set_from_params(
4670                 __isl_take isl_local_space *ls);
4672         #include <isl/set.h>
4673         __isl_give isl_basic_set *isl_basic_set_from_params(
4674                 __isl_take isl_basic_set *bset);
4675         __isl_give isl_set *isl_set_from_params(
4676                 __isl_take isl_set *set);
4678 =item * Constructing a relation from one or two sets
4680 Create a relation with the given set(s) as domain and/or range.
4681 If only the domain or the range is specified, then
4682 the range or domain of the created relation is a zero-dimensional
4683 flat anonymous space.
4685         #include <isl/space.h>
4686         __isl_give isl_space *isl_space_from_domain(
4687                 __isl_take isl_space *space);
4688         __isl_give isl_space *isl_space_from_range(
4689                 __isl_take isl_space *space);
4690         __isl_give isl_space *isl_space_map_from_set(
4691                 __isl_take isl_space *space);
4692         __isl_give isl_space *isl_space_map_from_domain_and_range(
4693                 __isl_take isl_space *domain,
4694                 __isl_take isl_space *range);
4696         #include <isl/local_space.h>
4697         __isl_give isl_local_space *isl_local_space_from_domain(
4698                 __isl_take isl_local_space *ls);
4700         #include <isl/map.h>
4701         __isl_give isl_map *isl_map_from_domain(
4702                 __isl_take isl_set *set);
4703         __isl_give isl_map *isl_map_from_range(
4704                 __isl_take isl_set *set);
4706         #include <isl/union_map.h>
4707         __isl_give isl_union_map *isl_union_map_from_domain(
4708                 __isl_take isl_union_set *uset);
4709         __isl_give isl_union_map *isl_union_map_from_range(
4710                 __isl_take isl_union_set *uset);
4711         __isl_give isl_union_map *
4712         isl_union_map_from_domain_and_range(
4713                 __isl_take isl_union_set *domain,
4714                 __isl_take isl_union_set *range);
4716         #include <isl/val.h>
4717         __isl_give isl_multi_val *isl_multi_val_from_range(
4718                 __isl_take isl_multi_val *mv);
4720         #include <isl/aff.h>
4721         __isl_give isl_aff *isl_aff_from_range(
4722                 __isl_take isl_aff *aff);
4723         __isl_give isl_multi_aff *isl_multi_aff_from_range(
4724                 __isl_take isl_multi_aff *ma);
4725         __isl_give isl_pw_aff *isl_pw_aff_from_range(
4726                 __isl_take isl_pw_aff *pwa);
4727         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_range(
4728                 __isl_take isl_multi_pw_aff *mpa);
4729         __isl_give isl_multi_union_pw_aff *
4730         isl_multi_union_pw_aff_from_range(
4731                 __isl_take isl_multi_union_pw_aff *mupa);
4732         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_domain(
4733                 __isl_take isl_set *set);
4734         __isl_give isl_union_pw_multi_aff *
4735         isl_union_pw_multi_aff_from_domain(
4736                 __isl_take isl_union_set *uset);
4738         #include <isl/polynomial.h>
4739         __isl_give isl_pw_qpolynomial *
4740         isl_pw_qpolynomial_from_range(
4741                 __isl_take isl_pw_qpolynomial *pwqp);
4742         __isl_give isl_pw_qpolynomial_fold *
4743         isl_pw_qpolynomial_fold_from_range(
4744                 __isl_take isl_pw_qpolynomial_fold *pwf);
4746 =item * Slicing
4748         #include <isl/set.h>
4749         __isl_give isl_basic_set *isl_basic_set_fix_si(
4750                 __isl_take isl_basic_set *bset,
4751                 enum isl_dim_type type, unsigned pos, int value);
4752         __isl_give isl_basic_set *isl_basic_set_fix_val(
4753                 __isl_take isl_basic_set *bset,
4754                 enum isl_dim_type type, unsigned pos,
4755                 __isl_take isl_val *v);
4756         __isl_give isl_set *isl_set_fix_si(__isl_take isl_set *set,
4757                 enum isl_dim_type type, unsigned pos, int value);
4758         __isl_give isl_set *isl_set_fix_val(
4759                 __isl_take isl_set *set,
4760                 enum isl_dim_type type, unsigned pos,
4761                 __isl_take isl_val *v);
4763         #include <isl/map.h>
4764         __isl_give isl_basic_map *isl_basic_map_fix_si(
4765                 __isl_take isl_basic_map *bmap,
4766                 enum isl_dim_type type, unsigned pos, int value);
4767         __isl_give isl_basic_map *isl_basic_map_fix_val(
4768                 __isl_take isl_basic_map *bmap,
4769                 enum isl_dim_type type, unsigned pos,
4770                 __isl_take isl_val *v);
4771         __isl_give isl_map *isl_map_fix_si(__isl_take isl_map *map,
4772                 enum isl_dim_type type, unsigned pos, int value);
4773         __isl_give isl_map *isl_map_fix_val(
4774                 __isl_take isl_map *map,
4775                 enum isl_dim_type type, unsigned pos,
4776                 __isl_take isl_val *v);
4778         #include <isl/aff.h>
4779         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_fix_si(
4780                 __isl_take isl_pw_multi_aff *pma,
4781                 enum isl_dim_type type, unsigned pos, int value);
4783         #include <isl/polynomial.h>
4784         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_fix_val(
4785                 __isl_take isl_pw_qpolynomial *pwqp,
4786                 enum isl_dim_type type, unsigned n,
4787                 __isl_take isl_val *v);
4788         __isl_give isl_pw_qpolynomial_fold *
4789         isl_pw_qpolynomial_fold_fix_val(
4790                 __isl_take isl_pw_qpolynomial_fold *pwf,
4791                 enum isl_dim_type type, unsigned n,
4792                 __isl_take isl_val *v);
4794 Intersect the set, relation or function domain
4795 with the hyperplane where the given
4796 dimension has the fixed given value.
4798         #include <isl/set.h>
4799         __isl_give isl_basic_set *
4800         isl_basic_set_lower_bound_val(
4801                 __isl_take isl_basic_set *bset,
4802                 enum isl_dim_type type, unsigned pos,
4803                 __isl_take isl_val *value);
4804         __isl_give isl_basic_set *
4805         isl_basic_set_upper_bound_val(
4806                 __isl_take isl_basic_set *bset,
4807                 enum isl_dim_type type, unsigned pos,
4808                 __isl_take isl_val *value);
4809         __isl_give isl_set *isl_set_lower_bound_si(
4810                 __isl_take isl_set *set,
4811                 enum isl_dim_type type, unsigned pos, int value);
4812         __isl_give isl_set *isl_set_lower_bound_val(
4813                 __isl_take isl_set *set,
4814                 enum isl_dim_type type, unsigned pos,
4815                 __isl_take isl_val *value);
4816         __isl_give isl_set *isl_set_upper_bound_si(
4817                 __isl_take isl_set *set,
4818                 enum isl_dim_type type, unsigned pos, int value);
4819         __isl_give isl_set *isl_set_upper_bound_val(
4820                 __isl_take isl_set *set,
4821                 enum isl_dim_type type, unsigned pos,
4822                 __isl_take isl_val *value);
4824         #include <isl/map.h>
4825         __isl_give isl_basic_map *isl_basic_map_lower_bound_si(
4826                 __isl_take isl_basic_map *bmap,
4827                 enum isl_dim_type type, unsigned pos, int value);
4828         __isl_give isl_basic_map *isl_basic_map_upper_bound_si(
4829                 __isl_take isl_basic_map *bmap,
4830                 enum isl_dim_type type, unsigned pos, int value);
4831         __isl_give isl_map *isl_map_lower_bound_si(
4832                 __isl_take isl_map *map,
4833                 enum isl_dim_type type, unsigned pos, int value);
4834         __isl_give isl_map *isl_map_upper_bound_si(
4835                 __isl_take isl_map *map,
4836                 enum isl_dim_type type, unsigned pos, int value);
4838 Intersect the set or relation with the half-space where the given
4839 dimension has a value bounded by the fixed given integer value.
4841         __isl_give isl_set *isl_set_equate(__isl_take isl_set *set,
4842                 enum isl_dim_type type1, int pos1,
4843                 enum isl_dim_type type2, int pos2);
4844         __isl_give isl_basic_map *isl_basic_map_equate(
4845                 __isl_take isl_basic_map *bmap,
4846                 enum isl_dim_type type1, int pos1,
4847                 enum isl_dim_type type2, int pos2);
4848         __isl_give isl_map *isl_map_equate(__isl_take isl_map *map,
4849                 enum isl_dim_type type1, int pos1,
4850                 enum isl_dim_type type2, int pos2);
4852 Intersect the set or relation with the hyperplane where the given
4853 dimensions are equal to each other.
4855         __isl_give isl_map *isl_map_oppose(__isl_take isl_map *map,
4856                 enum isl_dim_type type1, int pos1,
4857                 enum isl_dim_type type2, int pos2);
4859 Intersect the relation with the hyperplane where the given
4860 dimensions have opposite values.
4862         __isl_give isl_map *isl_map_order_le(
4863                 __isl_take isl_map *map,
4864                 enum isl_dim_type type1, int pos1,
4865                 enum isl_dim_type type2, int pos2);
4866         __isl_give isl_basic_map *isl_basic_map_order_ge(
4867                 __isl_take isl_basic_map *bmap,
4868                 enum isl_dim_type type1, int pos1,
4869                 enum isl_dim_type type2, int pos2);
4870         __isl_give isl_map *isl_map_order_ge(
4871                 __isl_take isl_map *map,
4872                 enum isl_dim_type type1, int pos1,
4873                 enum isl_dim_type type2, int pos2);
4874         __isl_give isl_map *isl_map_order_lt(__isl_take isl_map *map,
4875                 enum isl_dim_type type1, int pos1,
4876                 enum isl_dim_type type2, int pos2);
4877         __isl_give isl_basic_map *isl_basic_map_order_gt(
4878                 __isl_take isl_basic_map *bmap,
4879                 enum isl_dim_type type1, int pos1,
4880                 enum isl_dim_type type2, int pos2);
4881         __isl_give isl_map *isl_map_order_gt(__isl_take isl_map *map,
4882                 enum isl_dim_type type1, int pos1,
4883                 enum isl_dim_type type2, int pos2);
4885 Intersect the relation with the half-space where the given
4886 dimensions satisfy the given ordering.
4888         #include <isl/union_set.h>
4889         __isl_give isl_union_map *isl_union_map_remove_map_if(
4890                 __isl_take isl_union_map *umap,
4891                 isl_bool (*fn)(__isl_keep isl_map *map,
4892                         void *user), void *user);
4894 This function calls the callback function once for each
4895 pair of spaces for which there are elements in the input.
4896 If the callback returns C<isl_bool_true>, then all those elements
4897 are removed from the result.  The only remaining elements in the output
4898 are then those for which the callback returns C<isl_bool_false>.
4900 =item * Locus
4902         #include <isl/aff.h>
4903         __isl_give isl_basic_set *isl_aff_zero_basic_set(
4904                 __isl_take isl_aff *aff);
4905         __isl_give isl_basic_set *isl_aff_neg_basic_set(
4906                 __isl_take isl_aff *aff);
4907         __isl_give isl_set *isl_pw_aff_pos_set(
4908                 __isl_take isl_pw_aff *pa);
4909         __isl_give isl_set *isl_pw_aff_nonneg_set(
4910                 __isl_take isl_pw_aff *pwaff);
4911         __isl_give isl_set *isl_pw_aff_zero_set(
4912                 __isl_take isl_pw_aff *pwaff);
4913         __isl_give isl_set *isl_pw_aff_non_zero_set(
4914                 __isl_take isl_pw_aff *pwaff);
4915         __isl_give isl_union_set *
4916         isl_union_pw_aff_zero_union_set(
4917                 __isl_take isl_union_pw_aff *upa);
4918         __isl_give isl_union_set *
4919         isl_multi_union_pw_aff_zero_union_set(
4920                 __isl_take isl_multi_union_pw_aff *mupa);
4922 The function C<isl_aff_neg_basic_set> returns a basic set
4923 containing those elements in the domain space
4924 of C<aff> where C<aff> is negative.
4925 The function C<isl_pw_aff_nonneg_set> returns a set
4926 containing those elements in the domain
4927 of C<pwaff> where C<pwaff> is non-negative.
4928 The function C<isl_multi_union_pw_aff_zero_union_set>
4929 returns a union set containing those elements
4930 in the domains of its elements where they are all zero.
4932 =item * Identity
4934         __isl_give isl_map *isl_set_identity(
4935                 __isl_take isl_set *set);
4936         __isl_give isl_union_map *isl_union_set_identity(
4937                 __isl_take isl_union_set *uset);
4938         __isl_give isl_union_pw_multi_aff *
4939         isl_union_set_identity_union_pw_multi_aff(
4940                 __isl_take isl_union_set *uset);
4942 Construct an identity relation on the given (union) set.
4944 =item * Function Extraction
4946 A piecewise quasi affine expression that is equal to 1 on a set
4947 and 0 outside the set can be created using the following function.
4949         #include <isl/aff.h>
4950         __isl_give isl_pw_aff *isl_set_indicator_function(
4951                 __isl_take isl_set *set);
4953 A piecewise multiple quasi affine expression can be extracted
4954 from an C<isl_set> or C<isl_map>, provided the C<isl_set> is a singleton
4955 and the C<isl_map> is single-valued.
4956 In case of a conversion from an C<isl_union_map>
4957 to an C<isl_union_pw_multi_aff>, these properties need to hold
4958 in each domain space.
4959 A conversion to a C<isl_multi_union_pw_aff> additionally
4960 requires that the input is non-empty and involves only a single
4961 range space.
4963         #include <isl/aff.h>
4964         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_set(
4965                 __isl_take isl_set *set);
4966         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_map(
4967                 __isl_take isl_map *map);
4969         __isl_give isl_union_pw_multi_aff *
4970         isl_union_pw_multi_aff_from_union_set(
4971                 __isl_take isl_union_set *uset);
4972         __isl_give isl_union_pw_multi_aff *
4973         isl_union_pw_multi_aff_from_union_map(
4974                 __isl_take isl_union_map *umap);
4976         __isl_give isl_multi_union_pw_aff *
4977         isl_multi_union_pw_aff_from_union_map(
4978                 __isl_take isl_union_map *umap);
4980 =item * Deltas
4982         __isl_give isl_basic_set *isl_basic_map_deltas(
4983                 __isl_take isl_basic_map *bmap);
4984         __isl_give isl_set *isl_map_deltas(__isl_take isl_map *map);
4985         __isl_give isl_union_set *isl_union_map_deltas(
4986                 __isl_take isl_union_map *umap);
4988 These functions return a (basic) set containing the differences
4989 between image elements and corresponding domain elements in the input.
4991         __isl_give isl_basic_map *isl_basic_map_deltas_map(
4992                 __isl_take isl_basic_map *bmap);
4993         __isl_give isl_map *isl_map_deltas_map(
4994                 __isl_take isl_map *map);
4995         __isl_give isl_union_map *isl_union_map_deltas_map(
4996                 __isl_take isl_union_map *umap);
4998 The functions above construct a (basic, regular or union) relation
4999 that maps (a wrapped version of) the input relation to its delta set.
5001 =item * Coalescing
5003 Simplify the representation of a set, relation or functions by trying
5004 to combine pairs of basic sets or relations into a single
5005 basic set or relation.
5007         #include <isl/set.h>
5008         __isl_give isl_set *isl_set_coalesce(__isl_take isl_set *set);
5010         #include <isl/map.h>
5011         __isl_give isl_map *isl_map_coalesce(__isl_take isl_map *map);
5013         #include <isl/union_set.h>
5014         __isl_give isl_union_set *isl_union_set_coalesce(
5015                 __isl_take isl_union_set *uset);
5017         #include <isl/union_map.h>
5018         __isl_give isl_union_map *isl_union_map_coalesce(
5019                 __isl_take isl_union_map *umap);
5021         #include <isl/aff.h>
5022         __isl_give isl_pw_aff *isl_pw_aff_coalesce(
5023                 __isl_take isl_pw_aff *pwqp);
5024         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_coalesce(
5025                 __isl_take isl_pw_multi_aff *pma);
5026         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_coalesce(
5027                 __isl_take isl_multi_pw_aff *mpa);
5028         __isl_give isl_union_pw_aff *isl_union_pw_aff_coalesce(
5029                 __isl_take isl_union_pw_aff *upa);
5030         __isl_give isl_union_pw_multi_aff *
5031         isl_union_pw_multi_aff_coalesce(
5032                 __isl_take isl_union_pw_multi_aff *upma);
5033         __isl_give isl_multi_union_pw_aff *
5034         isl_multi_union_pw_aff_coalesce(
5035                 __isl_take isl_multi_union_pw_aff *aff);
5037         #include <isl/polynomial.h>
5038         __isl_give isl_pw_qpolynomial_fold *
5039         isl_pw_qpolynomial_fold_coalesce(
5040                 __isl_take isl_pw_qpolynomial_fold *pwf);
5041         __isl_give isl_union_pw_qpolynomial *
5042         isl_union_pw_qpolynomial_coalesce(
5043                 __isl_take isl_union_pw_qpolynomial *upwqp);
5044         __isl_give isl_union_pw_qpolynomial_fold *
5045         isl_union_pw_qpolynomial_fold_coalesce(
5046                 __isl_take isl_union_pw_qpolynomial_fold *upwf);
5048 One of the methods for combining pairs of basic sets or relations
5049 can result in coefficients that are much larger than those that appear
5050 in the constraints of the input.  By default, the coefficients are
5051 not allowed to grow larger, but this can be changed by unsetting
5052 the following option.
5054         isl_stat isl_options_set_coalesce_bounded_wrapping(
5055                 isl_ctx *ctx, int val);
5056         int isl_options_get_coalesce_bounded_wrapping(
5057                 isl_ctx *ctx);
5059 =item * Detecting equalities
5061         __isl_give isl_basic_set *isl_basic_set_detect_equalities(
5062                 __isl_take isl_basic_set *bset);
5063         __isl_give isl_basic_map *isl_basic_map_detect_equalities(
5064                 __isl_take isl_basic_map *bmap);
5065         __isl_give isl_set *isl_set_detect_equalities(
5066                 __isl_take isl_set *set);
5067         __isl_give isl_map *isl_map_detect_equalities(
5068                 __isl_take isl_map *map);
5069         __isl_give isl_union_set *isl_union_set_detect_equalities(
5070                 __isl_take isl_union_set *uset);
5071         __isl_give isl_union_map *isl_union_map_detect_equalities(
5072                 __isl_take isl_union_map *umap);
5074 Simplify the representation of a set or relation by detecting implicit
5075 equalities.
5077 =item * Removing redundant constraints
5079         #include <isl/set.h>
5080         __isl_give isl_basic_set *isl_basic_set_remove_redundancies(
5081                 __isl_take isl_basic_set *bset);
5082         __isl_give isl_set *isl_set_remove_redundancies(
5083                 __isl_take isl_set *set);
5085         #include <isl/union_set.h>
5086         __isl_give isl_union_set *
5087         isl_union_set_remove_redundancies(
5088                 __isl_take isl_union_set *uset);
5090         #include <isl/map.h>
5091         __isl_give isl_basic_map *isl_basic_map_remove_redundancies(
5092                 __isl_take isl_basic_map *bmap);
5093         __isl_give isl_map *isl_map_remove_redundancies(
5094                 __isl_take isl_map *map);
5096         #include <isl/union_map.h>
5097         __isl_give isl_union_map *
5098         isl_union_map_remove_redundancies(
5099                 __isl_take isl_union_map *umap);
5101 =item * Convex hull
5103         __isl_give isl_basic_set *isl_set_convex_hull(
5104                 __isl_take isl_set *set);
5105         __isl_give isl_basic_map *isl_map_convex_hull(
5106                 __isl_take isl_map *map);
5108 If the input set or relation has any existentially quantified
5109 variables, then the result of these operations is currently undefined.
5111 =item * Simple hull
5113         #include <isl/set.h>
5114         __isl_give isl_basic_set *
5115         isl_set_unshifted_simple_hull(
5116                 __isl_take isl_set *set);
5117         __isl_give isl_basic_set *isl_set_simple_hull(
5118                 __isl_take isl_set *set);
5119         __isl_give isl_basic_set *
5120         isl_set_plain_unshifted_simple_hull(
5121                 __isl_take isl_set *set);
5122         __isl_give isl_basic_set *
5123         isl_set_unshifted_simple_hull_from_set_list(
5124                 __isl_take isl_set *set,
5125                 __isl_take isl_set_list *list);
5127         #include <isl/map.h>
5128         __isl_give isl_basic_map *
5129         isl_map_unshifted_simple_hull(
5130                 __isl_take isl_map *map);
5131         __isl_give isl_basic_map *isl_map_simple_hull(
5132                 __isl_take isl_map *map);
5133         __isl_give isl_basic_map *
5134         isl_map_plain_unshifted_simple_hull(
5135                 __isl_take isl_map *map);
5136                 __isl_give isl_basic_map *
5137         isl_map_unshifted_simple_hull_from_map_list(
5138                 __isl_take isl_map *map,
5139                 __isl_take isl_map_list *list);
5141         #include <isl/union_map.h>
5142         __isl_give isl_union_map *isl_union_map_simple_hull(
5143                 __isl_take isl_union_map *umap);
5145 These functions compute a single basic set or relation
5146 that contains the whole input set or relation.
5147 In particular, the output is described by translates
5148 of the constraints describing the basic sets or relations in the input.
5149 In case of C<isl_set_unshifted_simple_hull>, only the original
5150 constraints are used, without any translation.
5151 In case of C<isl_set_plain_unshifted_simple_hull> and
5152 C<isl_map_plain_unshifted_simple_hull>, the result is described
5153 by original constraints that are obviously satisfied
5154 by the entire input set or relation.
5155 In case of C<isl_set_unshifted_simple_hull_from_set_list> and
5156 C<isl_map_unshifted_simple_hull_from_map_list>, the
5157 constraints are taken from the elements of the second argument.
5159 =begin latex
5161 (See \autoref{s:simple hull}.)
5163 =end latex
5165 =item * Affine hull
5167         __isl_give isl_basic_set *isl_basic_set_affine_hull(
5168                 __isl_take isl_basic_set *bset);
5169         __isl_give isl_basic_set *isl_set_affine_hull(
5170                 __isl_take isl_set *set);
5171         __isl_give isl_union_set *isl_union_set_affine_hull(
5172                 __isl_take isl_union_set *uset);
5173         __isl_give isl_basic_map *isl_basic_map_affine_hull(
5174                 __isl_take isl_basic_map *bmap);
5175         __isl_give isl_basic_map *isl_map_affine_hull(
5176                 __isl_take isl_map *map);
5177         __isl_give isl_union_map *isl_union_map_affine_hull(
5178                 __isl_take isl_union_map *umap);
5180 In case of union sets and relations, the affine hull is computed
5181 per space.
5183 =item * Polyhedral hull
5185         __isl_give isl_basic_set *isl_set_polyhedral_hull(
5186                 __isl_take isl_set *set);
5187         __isl_give isl_basic_map *isl_map_polyhedral_hull(
5188                 __isl_take isl_map *map);
5189         __isl_give isl_union_set *isl_union_set_polyhedral_hull(
5190                 __isl_take isl_union_set *uset);
5191         __isl_give isl_union_map *isl_union_map_polyhedral_hull(
5192                 __isl_take isl_union_map *umap);
5194 These functions compute a single basic set or relation
5195 not involving any existentially quantified variables
5196 that contains the whole input set or relation.
5197 In case of union sets and relations, the polyhedral hull is computed
5198 per space.
5200 =item * Other approximations
5202         #include <isl/set.h>
5203         __isl_give isl_basic_set *
5204         isl_basic_set_drop_constraints_involving_dims(
5205                 __isl_take isl_basic_set *bset,
5206                 enum isl_dim_type type,
5207                 unsigned first, unsigned n);
5208         __isl_give isl_basic_set *
5209         isl_basic_set_drop_constraints_not_involving_dims(
5210                 __isl_take isl_basic_set *bset,
5211                 enum isl_dim_type type,
5212                 unsigned first, unsigned n);
5213         __isl_give isl_set *
5214         isl_set_drop_constraints_involving_dims(
5215                 __isl_take isl_set *set,
5216                 enum isl_dim_type type,
5217                 unsigned first, unsigned n);
5218         __isl_give isl_set *
5219         isl_set_drop_constraints_not_involving_dims(
5220                 __isl_take isl_set *set,
5221                 enum isl_dim_type type,
5222                 unsigned first, unsigned n);
5224         #include <isl/map.h>
5225         __isl_give isl_basic_map *
5226         isl_basic_map_drop_constraints_involving_dims(
5227                 __isl_take isl_basic_map *bmap,
5228                 enum isl_dim_type type,
5229                 unsigned first, unsigned n);
5230         __isl_give isl_basic_map *
5231         isl_basic_map_drop_constraints_not_involving_dims(
5232                 __isl_take isl_basic_map *bmap,
5233                 enum isl_dim_type type,
5234                 unsigned first, unsigned n);
5235         __isl_give isl_map *
5236         isl_map_drop_constraints_involving_dims(
5237                 __isl_take isl_map *map,
5238                 enum isl_dim_type type,
5239                 unsigned first, unsigned n);
5240         __isl_give isl_map *
5241         isl_map_drop_constraints_not_involving_dims(
5242                 __isl_take isl_map *map,
5243                 enum isl_dim_type type,
5244                 unsigned first, unsigned n);
5246 These functions drop any constraints (not) involving the specified dimensions.
5247 Note that the result depends on the representation of the input.
5249         #include <isl/polynomial.h>
5250         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_to_polynomial(
5251                 __isl_take isl_pw_qpolynomial *pwqp, int sign);
5252         __isl_give isl_union_pw_qpolynomial *
5253         isl_union_pw_qpolynomial_to_polynomial(
5254                 __isl_take isl_union_pw_qpolynomial *upwqp, int sign);
5256 Approximate each quasipolynomial by a polynomial.  If C<sign> is positive,
5257 the polynomial will be an overapproximation.  If C<sign> is negative,
5258 it will be an underapproximation.  If C<sign> is zero, the approximation
5259 will lie somewhere in between.
5261 =item * Feasibility
5263         __isl_give isl_basic_set *isl_basic_set_sample(
5264                 __isl_take isl_basic_set *bset);
5265         __isl_give isl_basic_set *isl_set_sample(
5266                 __isl_take isl_set *set);
5267         __isl_give isl_basic_map *isl_basic_map_sample(
5268                 __isl_take isl_basic_map *bmap);
5269         __isl_give isl_basic_map *isl_map_sample(
5270                 __isl_take isl_map *map);
5272 If the input (basic) set or relation is non-empty, then return
5273 a singleton subset of the input.  Otherwise, return an empty set.
5275 =item * Optimization
5277         #include <isl/ilp.h>
5278         __isl_give isl_val *isl_basic_set_max_val(
5279                 __isl_keep isl_basic_set *bset,
5280                 __isl_keep isl_aff *obj);
5281         __isl_give isl_val *isl_set_min_val(
5282                 __isl_keep isl_set *set,
5283                 __isl_keep isl_aff *obj);
5284         __isl_give isl_val *isl_set_max_val(
5285                 __isl_keep isl_set *set,
5286                 __isl_keep isl_aff *obj);
5287         __isl_give isl_multi_val *
5288         isl_union_set_min_multi_union_pw_aff(
5289                 __isl_keep isl_union_set *set,
5290                 __isl_keep isl_multi_union_pw_aff *obj);
5292 Compute the minimum or maximum of the integer affine expression C<obj>
5293 over the points in C<set>, returning the result in C<opt>.
5294 The result is C<NULL> in case of an error, the optimal value in case
5295 there is one, negative infinity or infinity if the problem is unbounded and
5296 NaN if the problem is empty.
5298         #include <isl/ilp.h>
5299         __isl_give isl_val *isl_basic_set_dim_max_val(
5300                 __isl_take isl_basic_set *bset, int pos);
5302 Return the maximal value attained by the given set dimension,
5303 independently of the parameter values and of any other dimensions.
5304 The result is C<NULL> in case of an error, the optimal value in case
5305 there is one, infinity if the problem is unbounded and
5306 NaN if the input is empty.
5308 =item * Parametric optimization
5310         __isl_give isl_pw_aff *isl_set_dim_min(
5311                 __isl_take isl_set *set, int pos);
5312         __isl_give isl_pw_aff *isl_set_dim_max(
5313                 __isl_take isl_set *set, int pos);
5314         __isl_give isl_pw_aff *isl_map_dim_min(
5315                 __isl_take isl_map *map, int pos);
5316         __isl_give isl_pw_aff *isl_map_dim_max(
5317                 __isl_take isl_map *map, int pos);
5319 Compute the minimum or maximum of the given set or output dimension
5320 as a function of the parameters (and input dimensions), but independently
5321 of the other set or output dimensions.
5322 For lexicographic optimization, see L<"Lexicographic Optimization">.
5324 =item * Dual
5326 The following functions compute either the set of (rational) coefficient
5327 values of valid constraints for the given set or the set of (rational)
5328 values satisfying the constraints with coefficients from the given set.
5329 Internally, these two sets of functions perform essentially the
5330 same operations, except that the set of coefficients is assumed to
5331 be a cone, while the set of values may be any polyhedron.
5332 The current implementation is based on the Farkas lemma and
5333 Fourier-Motzkin elimination, but this may change or be made optional
5334 in future.  In particular, future implementations may use different
5335 dualization algorithms or skip the elimination step.
5337         #include <isl/set.h>
5338         __isl_give isl_basic_set *isl_basic_set_coefficients(
5339                 __isl_take isl_basic_set *bset);
5340         __isl_give isl_basic_set_list *
5341         isl_basic_set_list_coefficients(
5342                 __isl_take isl_basic_set_list *list);
5343         __isl_give isl_basic_set *isl_set_coefficients(
5344                 __isl_take isl_set *set);
5345         __isl_give isl_union_set *isl_union_set_coefficients(
5346                 __isl_take isl_union_set *bset);
5347         __isl_give isl_basic_set *isl_basic_set_solutions(
5348                 __isl_take isl_basic_set *bset);
5349         __isl_give isl_basic_set *isl_set_solutions(
5350                 __isl_take isl_set *set);
5351         __isl_give isl_union_set *isl_union_set_solutions(
5352                 __isl_take isl_union_set *bset);
5354 =item * Power
5356         __isl_give isl_map *isl_map_fixed_power_val(
5357                 __isl_take isl_map *map,
5358                 __isl_take isl_val *exp);
5359         __isl_give isl_union_map *
5360         isl_union_map_fixed_power_val(
5361                 __isl_take isl_union_map *umap,
5362                 __isl_take isl_val *exp);
5364 Compute the given power of C<map>, where C<exp> is assumed to be non-zero.
5365 If the exponent C<exp> is negative, then the -C<exp> th power of the inverse
5366 of C<map> is computed.
5368         __isl_give isl_map *isl_map_power(__isl_take isl_map *map,
5369                 int *exact);
5370         __isl_give isl_union_map *isl_union_map_power(
5371                 __isl_take isl_union_map *umap, int *exact);
5373 Compute a parametric representation for all positive powers I<k> of C<map>.
5374 The result maps I<k> to a nested relation corresponding to the
5375 I<k>th power of C<map>.
5376 The result may be an overapproximation.  If the result is known to be exact,
5377 then C<*exact> is set to C<1>.
5379 =item * Transitive closure
5381         __isl_give isl_map *isl_map_transitive_closure(
5382                 __isl_take isl_map *map, int *exact);
5383         __isl_give isl_union_map *isl_union_map_transitive_closure(
5384                 __isl_take isl_union_map *umap, int *exact);
5386 Compute the transitive closure of C<map>.
5387 The result may be an overapproximation.  If the result is known to be exact,
5388 then C<*exact> is set to C<1>.
5390 =item * Reaching path lengths
5392         __isl_give isl_map *isl_map_reaching_path_lengths(
5393                 __isl_take isl_map *map, int *exact);
5395 Compute a relation that maps each element in the range of C<map>
5396 to the lengths of all paths composed of edges in C<map> that
5397 end up in the given element.
5398 The result may be an overapproximation.  If the result is known to be exact,
5399 then C<*exact> is set to C<1>.
5400 To compute the I<maximal> path length, the resulting relation
5401 should be postprocessed by C<isl_map_lexmax>.
5402 In particular, if the input relation is a dependence relation
5403 (mapping sources to sinks), then the maximal path length corresponds
5404 to the free schedule.
5405 Note, however, that C<isl_map_lexmax> expects the maximum to be
5406 finite, so if the path lengths are unbounded (possibly due to
5407 the overapproximation), then you will get an error message.
5409 =item * Wrapping
5411         #include <isl/space.h>
5412         __isl_give isl_space *isl_space_wrap(
5413                 __isl_take isl_space *space);
5414         __isl_give isl_space *isl_space_unwrap(
5415                 __isl_take isl_space *space);
5417         #include <isl/local_space.h>
5418         __isl_give isl_local_space *isl_local_space_wrap(
5419                 __isl_take isl_local_space *ls);
5421         #include <isl/set.h>
5422         __isl_give isl_basic_map *isl_basic_set_unwrap(
5423                 __isl_take isl_basic_set *bset);
5424         __isl_give isl_map *isl_set_unwrap(
5425                 __isl_take isl_set *set);
5427         #include <isl/map.h>
5428         __isl_give isl_basic_set *isl_basic_map_wrap(
5429                 __isl_take isl_basic_map *bmap);
5430         __isl_give isl_set *isl_map_wrap(
5431                 __isl_take isl_map *map);
5433         #include <isl/union_set.h>
5434         __isl_give isl_union_map *isl_union_set_unwrap(
5435                 __isl_take isl_union_set *uset);
5437         #include <isl/union_map.h>
5438         __isl_give isl_union_set *isl_union_map_wrap(
5439                 __isl_take isl_union_map *umap);
5441 The input to C<isl_space_unwrap> should
5442 be the space of a set, while that of
5443 C<isl_space_wrap> should be the space of a relation.
5444 Conversely, the output of C<isl_space_unwrap> is the space
5445 of a relation, while that of C<isl_space_wrap> is the space of a set.
5447 =item * Flattening
5449 Remove any internal structure of domain (and range) of the given
5450 set or relation.  If there is any such internal structure in the input,
5451 then the name of the space is also removed.
5453         #include <isl/space.h>
5454         __isl_give isl_space *isl_space_flatten_domain(
5455                 __isl_take isl_space *space);
5456         __isl_give isl_space *isl_space_flatten_range(
5457                 __isl_take isl_space *space);
5459         #include <isl/local_space.h>
5460         __isl_give isl_local_space *
5461         isl_local_space_flatten_domain(
5462                 __isl_take isl_local_space *ls);
5463         __isl_give isl_local_space *
5464         isl_local_space_flatten_range(
5465                 __isl_take isl_local_space *ls);
5467         #include <isl/set.h>
5468         __isl_give isl_basic_set *isl_basic_set_flatten(
5469                 __isl_take isl_basic_set *bset);
5470         __isl_give isl_set *isl_set_flatten(
5471                 __isl_take isl_set *set);
5473         #include <isl/map.h>
5474         __isl_give isl_basic_map *isl_basic_map_flatten_domain(
5475                 __isl_take isl_basic_map *bmap);
5476         __isl_give isl_basic_map *isl_basic_map_flatten_range(
5477                 __isl_take isl_basic_map *bmap);
5478         __isl_give isl_map *isl_map_flatten_range(
5479                 __isl_take isl_map *map);
5480         __isl_give isl_map *isl_map_flatten_domain(
5481                 __isl_take isl_map *map);
5482         __isl_give isl_basic_map *isl_basic_map_flatten(
5483                 __isl_take isl_basic_map *bmap);
5484         __isl_give isl_map *isl_map_flatten(
5485                 __isl_take isl_map *map);
5487         #include <isl/val.h>
5488         __isl_give isl_multi_val *isl_multi_val_flatten_range(
5489                 __isl_take isl_multi_val *mv);
5491         #include <isl/aff.h>
5492         __isl_give isl_multi_aff *isl_multi_aff_flatten_domain(
5493                 __isl_take isl_multi_aff *ma);
5494         __isl_give isl_multi_aff *isl_multi_aff_flatten_range(
5495                 __isl_take isl_multi_aff *ma);
5496         __isl_give isl_multi_pw_aff *
5497         isl_multi_pw_aff_flatten_range(
5498                 __isl_take isl_multi_pw_aff *mpa);
5499         __isl_give isl_multi_union_pw_aff *
5500         isl_multi_union_pw_aff_flatten_range(
5501                 __isl_take isl_multi_union_pw_aff *mupa);
5503         #include <isl/map.h>
5504         __isl_give isl_map *isl_set_flatten_map(
5505                 __isl_take isl_set *set);
5507 The function above constructs a relation
5508 that maps the input set to a flattened version of the set.
5510 =item * Lifting
5512 Lift the input set to a space with extra dimensions corresponding
5513 to the existentially quantified variables in the input.
5514 In particular, the result lives in a wrapped map where the domain
5515 is the original space and the range corresponds to the original
5516 existentially quantified variables.
5518         #include <isl/set.h>
5519         __isl_give isl_basic_set *isl_basic_set_lift(
5520                 __isl_take isl_basic_set *bset);
5521         __isl_give isl_set *isl_set_lift(
5522                 __isl_take isl_set *set);
5523         __isl_give isl_union_set *isl_union_set_lift(
5524                 __isl_take isl_union_set *uset);
5526 Given a local space that contains the existentially quantified
5527 variables of a set, a basic relation that, when applied to
5528 a basic set, has essentially the same effect as C<isl_basic_set_lift>,
5529 can be constructed using the following function.
5531         #include <isl/local_space.h>
5532         __isl_give isl_basic_map *isl_local_space_lifting(
5533                 __isl_take isl_local_space *ls);
5535         #include <isl/aff.h>
5536         __isl_give isl_multi_aff *isl_multi_aff_lift(
5537                 __isl_take isl_multi_aff *maff,
5538                 __isl_give isl_local_space **ls);
5540 If the C<ls> argument of C<isl_multi_aff_lift> is not C<NULL>,
5541 then it is assigned the local space that lies at the basis of
5542 the lifting applied.
5544 =item * Internal Product
5546         #include <isl/space.h>
5547         __isl_give isl_space *isl_space_zip(
5548                 __isl_take isl_space *space);
5550         #include <isl/map.h>
5551         __isl_give isl_basic_map *isl_basic_map_zip(
5552                 __isl_take isl_basic_map *bmap);
5553         __isl_give isl_map *isl_map_zip(
5554                 __isl_take isl_map *map);
5556         #include <isl/union_map.h>
5557         __isl_give isl_union_map *isl_union_map_zip(
5558                 __isl_take isl_union_map *umap);
5560 Given a relation with nested relations for domain and range,
5561 interchange the range of the domain with the domain of the range.
5563 =item * Currying
5565         #include <isl/space.h>
5566         __isl_give isl_space *isl_space_curry(
5567                 __isl_take isl_space *space);
5568         __isl_give isl_space *isl_space_uncurry(
5569                 __isl_take isl_space *space);
5571         #include <isl/map.h>
5572         __isl_give isl_basic_map *isl_basic_map_curry(
5573                 __isl_take isl_basic_map *bmap);
5574         __isl_give isl_basic_map *isl_basic_map_uncurry(
5575                 __isl_take isl_basic_map *bmap);
5576         __isl_give isl_map *isl_map_curry(
5577                 __isl_take isl_map *map);
5578         __isl_give isl_map *isl_map_uncurry(
5579                 __isl_take isl_map *map);
5581         #include <isl/union_map.h>
5582         __isl_give isl_union_map *isl_union_map_curry(
5583                 __isl_take isl_union_map *umap);
5584         __isl_give isl_union_map *isl_union_map_uncurry(
5585                 __isl_take isl_union_map *umap);
5587 Given a relation with a nested relation for domain,
5588 the C<curry> functions
5589 move the range of the nested relation out of the domain
5590 and use it as the domain of a nested relation in the range,
5591 with the original range as range of this nested relation.
5592 The C<uncurry> functions perform the inverse operation.
5594         #include <isl/space.h>
5595         __isl_give isl_space *isl_space_range_curry(
5596                 __isl_take isl_space *space);
5598         #include <isl/map.h>
5599         __isl_give isl_map *isl_map_range_curry(
5600                 __isl_take isl_map *map);
5602         #include <isl/union_map.h>
5603         __isl_give isl_union_map *isl_union_map_range_curry(
5604                 __isl_take isl_union_map *umap);
5606 These functions apply the currying to the relation that
5607 is nested inside the range of the input.
5609 =item * Aligning parameters
5611 Change the order of the parameters of the given set, relation
5612 or function
5613 such that the first parameters match those of C<model>.
5614 This may involve the introduction of extra parameters.
5615 All parameters need to be named.
5617         #include <isl/space.h>
5618         __isl_give isl_space *isl_space_align_params(
5619                 __isl_take isl_space *space1,
5620                 __isl_take isl_space *space2)
5622         #include <isl/set.h>
5623         __isl_give isl_basic_set *isl_basic_set_align_params(
5624                 __isl_take isl_basic_set *bset,
5625                 __isl_take isl_space *model);
5626         __isl_give isl_set *isl_set_align_params(
5627                 __isl_take isl_set *set,
5628                 __isl_take isl_space *model);
5630         #include <isl/map.h>
5631         __isl_give isl_basic_map *isl_basic_map_align_params(
5632                 __isl_take isl_basic_map *bmap,
5633                 __isl_take isl_space *model);
5634         __isl_give isl_map *isl_map_align_params(
5635                 __isl_take isl_map *map,
5636                 __isl_take isl_space *model);
5638         #include <isl/val.h>
5639         __isl_give isl_multi_val *isl_multi_val_align_params(
5640                 __isl_take isl_multi_val *mv,
5641                 __isl_take isl_space *model);
5643         #include <isl/aff.h>
5644         __isl_give isl_aff *isl_aff_align_params(
5645                 __isl_take isl_aff *aff,
5646                 __isl_take isl_space *model);
5647         __isl_give isl_multi_aff *isl_multi_aff_align_params(
5648                 __isl_take isl_multi_aff *multi,
5649                 __isl_take isl_space *model);
5650         __isl_give isl_pw_aff *isl_pw_aff_align_params(
5651                 __isl_take isl_pw_aff *pwaff,
5652                 __isl_take isl_space *model);
5653         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_align_params(
5654                 __isl_take isl_pw_multi_aff *pma,
5655                 __isl_take isl_space *model);
5656         __isl_give isl_union_pw_aff *
5657         isl_union_pw_aff_align_params(
5658                 __isl_take isl_union_pw_aff *upa,
5659                 __isl_take isl_space *model);
5660         __isl_give isl_union_pw_multi_aff *
5661         isl_union_pw_multi_aff_align_params(
5662                 __isl_take isl_union_pw_multi_aff *upma,
5663                 __isl_take isl_space *model);
5664         __isl_give isl_multi_union_pw_aff *
5665         isl_multi_union_pw_aff_align_params(
5666                 __isl_take isl_multi_union_pw_aff *mupa,
5667                 __isl_take isl_space *model);
5669         #include <isl/polynomial.h>
5670         __isl_give isl_qpolynomial *isl_qpolynomial_align_params(
5671                 __isl_take isl_qpolynomial *qp,
5672                 __isl_take isl_space *model);
5674 =item * Unary Arithmetic Operations
5676         #include <isl/set.h>
5677         __isl_give isl_set *isl_set_neg(
5678                 __isl_take isl_set *set);
5679         #include <isl/map.h>
5680         __isl_give isl_map *isl_map_neg(
5681                 __isl_take isl_map *map);
5683 C<isl_set_neg> constructs a set containing the opposites of
5684 the elements in its argument.
5685 The domain of the result of C<isl_map_neg> is the same
5686 as the domain of its argument.  The corresponding range
5687 elements are the opposites of the corresponding range
5688 elements in the argument.
5690         #include <isl/val.h>
5691         __isl_give isl_multi_val *isl_multi_val_neg(
5692                 __isl_take isl_multi_val *mv);
5694         #include <isl/aff.h>
5695         __isl_give isl_aff *isl_aff_neg(
5696                 __isl_take isl_aff *aff);
5697         __isl_give isl_multi_aff *isl_multi_aff_neg(
5698                 __isl_take isl_multi_aff *ma);
5699         __isl_give isl_pw_aff *isl_pw_aff_neg(
5700                 __isl_take isl_pw_aff *pwaff);
5701         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_neg(
5702                 __isl_take isl_pw_multi_aff *pma);
5703         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_neg(
5704                 __isl_take isl_multi_pw_aff *mpa);
5705         __isl_give isl_union_pw_aff *isl_union_pw_aff_neg(
5706                 __isl_take isl_union_pw_aff *upa);
5707         __isl_give isl_union_pw_multi_aff *
5708         isl_union_pw_multi_aff_neg(
5709                 __isl_take isl_union_pw_multi_aff *upma);
5710         __isl_give isl_multi_union_pw_aff *
5711         isl_multi_union_pw_aff_neg(
5712                 __isl_take isl_multi_union_pw_aff *mupa);
5713         __isl_give isl_aff *isl_aff_ceil(
5714                 __isl_take isl_aff *aff);
5715         __isl_give isl_pw_aff *isl_pw_aff_ceil(
5716                 __isl_take isl_pw_aff *pwaff);
5717         __isl_give isl_aff *isl_aff_floor(
5718                 __isl_take isl_aff *aff);
5719         __isl_give isl_multi_aff *isl_multi_aff_floor(
5720                 __isl_take isl_multi_aff *ma);
5721         __isl_give isl_pw_aff *isl_pw_aff_floor(
5722                 __isl_take isl_pw_aff *pwaff);
5723         __isl_give isl_union_pw_aff *isl_union_pw_aff_floor(
5724                 __isl_take isl_union_pw_aff *upa);
5725         __isl_give isl_multi_union_pw_aff *
5726         isl_multi_union_pw_aff_floor(
5727                 __isl_take isl_multi_union_pw_aff *mupa);
5729         #include <isl/aff.h>
5730         __isl_give isl_pw_aff *isl_pw_aff_list_min(
5731                 __isl_take isl_pw_aff_list *list);
5732         __isl_give isl_pw_aff *isl_pw_aff_list_max(
5733                 __isl_take isl_pw_aff_list *list);
5735         #include <isl/polynomial.h>
5736         __isl_give isl_qpolynomial *isl_qpolynomial_neg(
5737                 __isl_take isl_qpolynomial *qp);
5738         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_neg(
5739                 __isl_take isl_pw_qpolynomial *pwqp);
5740         __isl_give isl_union_pw_qpolynomial *
5741         isl_union_pw_qpolynomial_neg(
5742                 __isl_take isl_union_pw_qpolynomial *upwqp);
5743         __isl_give isl_qpolynomial *isl_qpolynomial_pow(
5744                 __isl_take isl_qpolynomial *qp,
5745                 unsigned exponent);
5746         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_pow(
5747                 __isl_take isl_pw_qpolynomial *pwqp,
5748                 unsigned exponent);
5750 =item * Evaluation
5752 The following functions evaluate a function in a point.
5754         #include <isl/aff.h>
5755         __isl_give isl_val *isl_aff_eval(
5756                 __isl_take isl_aff *aff,
5757                 __isl_take isl_point *pnt);
5758         __isl_give isl_val *isl_pw_aff_eval(
5759                 __isl_take isl_pw_aff *pa,
5760                 __isl_take isl_point *pnt);
5762         #include <isl/polynomial.h>
5763         __isl_give isl_val *isl_pw_qpolynomial_eval(
5764                 __isl_take isl_pw_qpolynomial *pwqp,
5765                 __isl_take isl_point *pnt);
5766         __isl_give isl_val *isl_pw_qpolynomial_fold_eval(
5767                 __isl_take isl_pw_qpolynomial_fold *pwf,
5768                 __isl_take isl_point *pnt);
5769         __isl_give isl_val *isl_union_pw_qpolynomial_eval(
5770                 __isl_take isl_union_pw_qpolynomial *upwqp,
5771                 __isl_take isl_point *pnt);
5772         __isl_give isl_val *isl_union_pw_qpolynomial_fold_eval(
5773                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
5774                 __isl_take isl_point *pnt);
5776 These functions return NaN when evaluated at a void point.
5777 Note that C<isl_pw_aff_eval> returns NaN when the function is evaluated outside
5778 its definition domain, while C<isl_pw_qpolynomial_eval> returns zero
5779 when the function is evaluated outside its explicit domain.
5781 =item * Dimension manipulation
5783 It is usually not advisable to directly change the (input or output)
5784 space of a set or a relation as this removes the name and the internal
5785 structure of the space.  However, the functions below can be useful
5786 to add new parameters, assuming
5787 C<isl_set_align_params> and C<isl_map_align_params>
5788 are not sufficient.
5790         #include <isl/space.h>
5791         __isl_give isl_space *isl_space_add_dims(
5792                 __isl_take isl_space *space,
5793                 enum isl_dim_type type, unsigned n);
5794         __isl_give isl_space *isl_space_insert_dims(
5795                 __isl_take isl_space *space,
5796                 enum isl_dim_type type, unsigned pos, unsigned n);
5797         __isl_give isl_space *isl_space_drop_dims(
5798                 __isl_take isl_space *space,
5799                 enum isl_dim_type type, unsigned first, unsigned n);
5800         __isl_give isl_space *isl_space_move_dims(
5801                 __isl_take isl_space *space,
5802                 enum isl_dim_type dst_type, unsigned dst_pos,
5803                 enum isl_dim_type src_type, unsigned src_pos,
5804                 unsigned n);
5806         #include <isl/local_space.h>
5807         __isl_give isl_local_space *isl_local_space_add_dims(
5808                 __isl_take isl_local_space *ls,
5809                 enum isl_dim_type type, unsigned n);
5810         __isl_give isl_local_space *isl_local_space_insert_dims(
5811                 __isl_take isl_local_space *ls,
5812                 enum isl_dim_type type, unsigned first, unsigned n);
5813         __isl_give isl_local_space *isl_local_space_drop_dims(
5814                 __isl_take isl_local_space *ls,
5815                 enum isl_dim_type type, unsigned first, unsigned n);
5817         #include <isl/set.h>
5818         __isl_give isl_basic_set *isl_basic_set_add_dims(
5819                 __isl_take isl_basic_set *bset,
5820                 enum isl_dim_type type, unsigned n);
5821         __isl_give isl_set *isl_set_add_dims(
5822                 __isl_take isl_set *set,
5823                 enum isl_dim_type type, unsigned n);
5824         __isl_give isl_basic_set *isl_basic_set_insert_dims(
5825                 __isl_take isl_basic_set *bset,
5826                 enum isl_dim_type type, unsigned pos,
5827                 unsigned n);
5828         __isl_give isl_set *isl_set_insert_dims(
5829                 __isl_take isl_set *set,
5830                 enum isl_dim_type type, unsigned pos, unsigned n);
5831         __isl_give isl_basic_set *isl_basic_set_move_dims(
5832                 __isl_take isl_basic_set *bset,
5833                 enum isl_dim_type dst_type, unsigned dst_pos,
5834                 enum isl_dim_type src_type, unsigned src_pos,
5835                 unsigned n);
5836         __isl_give isl_set *isl_set_move_dims(
5837                 __isl_take isl_set *set,
5838                 enum isl_dim_type dst_type, unsigned dst_pos,
5839                 enum isl_dim_type src_type, unsigned src_pos,
5840                 unsigned n);
5842         #include <isl/map.h>
5843         __isl_give isl_basic_map *isl_basic_map_add_dims(
5844                 __isl_take isl_basic_map *bmap,
5845                 enum isl_dim_type type, unsigned n);
5846         __isl_give isl_map *isl_map_add_dims(
5847                 __isl_take isl_map *map,
5848                 enum isl_dim_type type, unsigned n);
5849         __isl_give isl_basic_map *isl_basic_map_insert_dims(
5850                 __isl_take isl_basic_map *bmap,
5851                 enum isl_dim_type type, unsigned pos,
5852                 unsigned n);
5853         __isl_give isl_map *isl_map_insert_dims(
5854                 __isl_take isl_map *map,
5855                 enum isl_dim_type type, unsigned pos, unsigned n);
5856         __isl_give isl_basic_map *isl_basic_map_move_dims(
5857                 __isl_take isl_basic_map *bmap,
5858                 enum isl_dim_type dst_type, unsigned dst_pos,
5859                 enum isl_dim_type src_type, unsigned src_pos,
5860                 unsigned n);
5861         __isl_give isl_map *isl_map_move_dims(
5862                 __isl_take isl_map *map,
5863                 enum isl_dim_type dst_type, unsigned dst_pos,
5864                 enum isl_dim_type src_type, unsigned src_pos,
5865                 unsigned n);
5867         #include <isl/val.h>
5868         __isl_give isl_multi_val *isl_multi_val_insert_dims(
5869                 __isl_take isl_multi_val *mv,
5870                 enum isl_dim_type type, unsigned first, unsigned n);
5871         __isl_give isl_multi_val *isl_multi_val_add_dims(
5872                 __isl_take isl_multi_val *mv,
5873                 enum isl_dim_type type, unsigned n);
5874         __isl_give isl_multi_val *isl_multi_val_drop_dims(
5875                 __isl_take isl_multi_val *mv,
5876                 enum isl_dim_type type, unsigned first, unsigned n);
5878         #include <isl/aff.h>
5879         __isl_give isl_aff *isl_aff_insert_dims(
5880                 __isl_take isl_aff *aff,
5881                 enum isl_dim_type type, unsigned first, unsigned n);
5882         __isl_give isl_multi_aff *isl_multi_aff_insert_dims(
5883                 __isl_take isl_multi_aff *ma,
5884                 enum isl_dim_type type, unsigned first, unsigned n);
5885         __isl_give isl_pw_aff *isl_pw_aff_insert_dims(
5886                 __isl_take isl_pw_aff *pwaff,
5887                 enum isl_dim_type type, unsigned first, unsigned n);
5888         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_insert_dims(
5889                 __isl_take isl_multi_pw_aff *mpa,
5890                 enum isl_dim_type type, unsigned first, unsigned n);
5891         __isl_give isl_aff *isl_aff_add_dims(
5892                 __isl_take isl_aff *aff,
5893                 enum isl_dim_type type, unsigned n);
5894         __isl_give isl_multi_aff *isl_multi_aff_add_dims(
5895                 __isl_take isl_multi_aff *ma,
5896                 enum isl_dim_type type, unsigned n);
5897         __isl_give isl_pw_aff *isl_pw_aff_add_dims(
5898                 __isl_take isl_pw_aff *pwaff,
5899                 enum isl_dim_type type, unsigned n);
5900         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_add_dims(
5901                 __isl_take isl_multi_pw_aff *mpa,
5902                 enum isl_dim_type type, unsigned n);
5903         __isl_give isl_aff *isl_aff_drop_dims(
5904                 __isl_take isl_aff *aff,
5905                 enum isl_dim_type type, unsigned first, unsigned n);
5906         __isl_give isl_multi_aff *isl_multi_aff_drop_dims(
5907                 __isl_take isl_multi_aff *maff,
5908                 enum isl_dim_type type, unsigned first, unsigned n);
5909         __isl_give isl_pw_aff *isl_pw_aff_drop_dims(
5910                 __isl_take isl_pw_aff *pwaff,
5911                 enum isl_dim_type type, unsigned first, unsigned n);
5912         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_drop_dims(
5913                 __isl_take isl_pw_multi_aff *pma,
5914                 enum isl_dim_type type, unsigned first, unsigned n);
5915         __isl_give isl_union_pw_aff *isl_union_pw_aff_drop_dims(
5916                 __isl_take isl_union_pw_aff *upa,
5917                 enum isl_dim_type type, unsigned first, unsigned n);
5918         __isl_give isl_union_pw_multi_aff *
5919                 isl_union_pw_multi_aff_drop_dims(
5920                 __isl_take isl_union_pw_multi_aff *upma,
5921                 enum isl_dim_type type,
5922                 unsigned first, unsigned n);
5923         __isl_give isl_multi_union_pw_aff *
5924         isl_multi_union_pw_aff_drop_dims(
5925                 __isl_take isl_multi_union_pw_aff *mupa,
5926                 enum isl_dim_type type, unsigned first,
5927                 unsigned n);
5928         __isl_give isl_aff *isl_aff_move_dims(
5929                 __isl_take isl_aff *aff,
5930                 enum isl_dim_type dst_type, unsigned dst_pos,
5931                 enum isl_dim_type src_type, unsigned src_pos,
5932                 unsigned n);
5933         __isl_give isl_multi_aff *isl_multi_aff_move_dims(
5934                 __isl_take isl_multi_aff *ma,
5935                 enum isl_dim_type dst_type, unsigned dst_pos,
5936                 enum isl_dim_type src_type, unsigned src_pos,
5937                 unsigned n);
5938         __isl_give isl_pw_aff *isl_pw_aff_move_dims(
5939                 __isl_take isl_pw_aff *pa,
5940                 enum isl_dim_type dst_type, unsigned dst_pos,
5941                 enum isl_dim_type src_type, unsigned src_pos,
5942                 unsigned n);
5943         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_move_dims(
5944                 __isl_take isl_multi_pw_aff *pma,
5945                 enum isl_dim_type dst_type, unsigned dst_pos,
5946                 enum isl_dim_type src_type, unsigned src_pos,
5947                 unsigned n);
5949         #include <isl/polynomial.h>
5950         __isl_give isl_union_pw_qpolynomial *
5951         isl_union_pw_qpolynomial_drop_dims(
5952                 __isl_take isl_union_pw_qpolynomial *upwqp,
5953                 enum isl_dim_type type,
5954                 unsigned first, unsigned n);
5955         __isl_give isl_union_pw_qpolynomial_fold *
5956                 isl_union_pw_qpolynomial_fold_drop_dims(
5957                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
5958                 enum isl_dim_type type,
5959                 unsigned first, unsigned n);
5961 The operations on union expressions can only manipulate parameters.
5963 =back
5965 =head2 Binary Operations
5967 The two arguments of a binary operation not only need to live
5968 in the same C<isl_ctx>, they currently also need to have
5969 the same (number of) parameters.
5971 =head3 Basic Operations
5973 =over
5975 =item * Intersection
5977         #include <isl/local_space.h>
5978         __isl_give isl_local_space *isl_local_space_intersect(
5979                 __isl_take isl_local_space *ls1,
5980                 __isl_take isl_local_space *ls2);
5982         #include <isl/set.h>
5983         __isl_give isl_basic_set *isl_basic_set_intersect_params(
5984                 __isl_take isl_basic_set *bset1,
5985                 __isl_take isl_basic_set *bset2);
5986         __isl_give isl_basic_set *isl_basic_set_intersect(
5987                 __isl_take isl_basic_set *bset1,
5988                 __isl_take isl_basic_set *bset2);
5989         __isl_give isl_basic_set *isl_basic_set_list_intersect(
5990                 __isl_take struct isl_basic_set_list *list);
5991         __isl_give isl_set *isl_set_intersect_params(
5992                 __isl_take isl_set *set,
5993                 __isl_take isl_set *params);
5994         __isl_give isl_set *isl_set_intersect(
5995                 __isl_take isl_set *set1,
5996                 __isl_take isl_set *set2);
5998         #include <isl/map.h>
5999         __isl_give isl_basic_map *isl_basic_map_intersect_domain(
6000                 __isl_take isl_basic_map *bmap,
6001                 __isl_take isl_basic_set *bset);
6002         __isl_give isl_basic_map *isl_basic_map_intersect_range(
6003                 __isl_take isl_basic_map *bmap,
6004                 __isl_take isl_basic_set *bset);
6005         __isl_give isl_basic_map *isl_basic_map_intersect(
6006                 __isl_take isl_basic_map *bmap1,
6007                 __isl_take isl_basic_map *bmap2);
6008         __isl_give isl_basic_map *isl_basic_map_list_intersect(
6009                 __isl_take isl_basic_map_list *list);
6010         __isl_give isl_map *isl_map_intersect_params(
6011                 __isl_take isl_map *map,
6012                 __isl_take isl_set *params);
6013         __isl_give isl_map *isl_map_intersect_domain(
6014                 __isl_take isl_map *map,
6015                 __isl_take isl_set *set);
6016         __isl_give isl_map *isl_map_intersect_range(
6017                 __isl_take isl_map *map,
6018                 __isl_take isl_set *set);
6019         __isl_give isl_map *isl_map_intersect(
6020                 __isl_take isl_map *map1,
6021                 __isl_take isl_map *map2);
6022         __isl_give isl_map *
6023         isl_map_intersect_domain_factor_range(
6024                 __isl_take isl_map *map,
6025                 __isl_take isl_map *factor);
6026         __isl_give isl_map *
6027         isl_map_intersect_range_factor_range(
6028                 __isl_take isl_map *map,
6029                 __isl_take isl_map *factor);
6031         #include <isl/union_set.h>
6032         __isl_give isl_union_set *isl_union_set_intersect_params(
6033                 __isl_take isl_union_set *uset,
6034                 __isl_take isl_set *set);
6035         __isl_give isl_union_set *isl_union_set_intersect(
6036                 __isl_take isl_union_set *uset1,
6037                 __isl_take isl_union_set *uset2);
6039         #include <isl/union_map.h>
6040         __isl_give isl_union_map *isl_union_map_intersect_params(
6041                 __isl_take isl_union_map *umap,
6042                 __isl_take isl_set *set);
6043         __isl_give isl_union_map *isl_union_map_intersect_domain(
6044                 __isl_take isl_union_map *umap,
6045                 __isl_take isl_union_set *uset);
6046         __isl_give isl_union_map *isl_union_map_intersect_range(
6047                 __isl_take isl_union_map *umap,
6048                 __isl_take isl_union_set *uset);
6049         __isl_give isl_union_map *isl_union_map_intersect(
6050                 __isl_take isl_union_map *umap1,
6051                 __isl_take isl_union_map *umap2);
6052         __isl_give isl_union_map *
6053         isl_union_map_intersect_range_factor_range(
6054                 __isl_take isl_union_map *umap,
6055                 __isl_take isl_union_map *factor);
6057         #include <isl/aff.h>
6058         __isl_give isl_pw_aff *isl_pw_aff_intersect_domain(
6059                 __isl_take isl_pw_aff *pa,
6060                 __isl_take isl_set *set);
6061         __isl_give isl_multi_pw_aff *
6062         isl_multi_pw_aff_intersect_domain(
6063                 __isl_take isl_multi_pw_aff *mpa,
6064                 __isl_take isl_set *domain);
6065         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_domain(
6066                 __isl_take isl_pw_multi_aff *pma,
6067                 __isl_take isl_set *set);
6068         __isl_give isl_union_pw_aff *isl_union_pw_aff_intersect_domain(
6069                 __isl_take isl_union_pw_aff *upa,
6070                 __isl_take isl_union_set *uset);
6071         __isl_give isl_union_pw_multi_aff *
6072         isl_union_pw_multi_aff_intersect_domain(
6073                 __isl_take isl_union_pw_multi_aff *upma,
6074                 __isl_take isl_union_set *uset);
6075         __isl_give isl_multi_union_pw_aff *
6076         isl_multi_union_pw_aff_intersect_domain(
6077                 __isl_take isl_multi_union_pw_aff *mupa,
6078                 __isl_take isl_union_set *uset);
6079         __isl_give isl_pw_aff *isl_pw_aff_intersect_params(
6080                 __isl_take isl_pw_aff *pa,
6081                 __isl_take isl_set *set);
6082         __isl_give isl_multi_pw_aff *
6083         isl_multi_pw_aff_intersect_params(
6084                 __isl_take isl_multi_pw_aff *mpa,
6085                 __isl_take isl_set *set);
6086         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_params(
6087                 __isl_take isl_pw_multi_aff *pma,
6088                 __isl_take isl_set *set);
6089         __isl_give isl_union_pw_aff *
6090         isl_union_pw_aff_intersect_params(
6091                 __isl_take isl_union_pw_aff *upa,
6092         __isl_give isl_union_pw_multi_aff *
6093         isl_union_pw_multi_aff_intersect_params(
6094                 __isl_take isl_union_pw_multi_aff *upma,
6095                 __isl_take isl_set *set);
6096         __isl_give isl_multi_union_pw_aff *
6097         isl_multi_union_pw_aff_intersect_params(
6098                 __isl_take isl_multi_union_pw_aff *mupa,
6099                 __isl_take isl_set *params);
6100         isl_multi_union_pw_aff_intersect_range(
6101                 __isl_take isl_multi_union_pw_aff *mupa,
6102                 __isl_take isl_set *set);
6104         #include <isl/polynomial.h>
6105         __isl_give isl_pw_qpolynomial *
6106         isl_pw_qpolynomial_intersect_domain(
6107                 __isl_take isl_pw_qpolynomial *pwpq,
6108                 __isl_take isl_set *set);
6109         __isl_give isl_union_pw_qpolynomial *
6110         isl_union_pw_qpolynomial_intersect_domain(
6111                 __isl_take isl_union_pw_qpolynomial *upwpq,
6112                 __isl_take isl_union_set *uset);
6113         __isl_give isl_union_pw_qpolynomial_fold *
6114         isl_union_pw_qpolynomial_fold_intersect_domain(
6115                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
6116                 __isl_take isl_union_set *uset);
6117         __isl_give isl_pw_qpolynomial *
6118         isl_pw_qpolynomial_intersect_params(
6119                 __isl_take isl_pw_qpolynomial *pwpq,
6120                 __isl_take isl_set *set);
6121         __isl_give isl_pw_qpolynomial_fold *
6122         isl_pw_qpolynomial_fold_intersect_params(
6123                 __isl_take isl_pw_qpolynomial_fold *pwf,
6124                 __isl_take isl_set *set);
6125         __isl_give isl_union_pw_qpolynomial *
6126         isl_union_pw_qpolynomial_intersect_params(
6127                 __isl_take isl_union_pw_qpolynomial *upwpq,
6128                 __isl_take isl_set *set);
6129         __isl_give isl_union_pw_qpolynomial_fold *
6130         isl_union_pw_qpolynomial_fold_intersect_params(
6131                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
6132                 __isl_take isl_set *set);
6134 The second argument to the C<_params> functions needs to be
6135 a parametric (basic) set.  For the other functions, a parametric set
6136 for either argument is only allowed if the other argument is
6137 a parametric set as well.
6138 The list passed to C<isl_basic_set_list_intersect> needs to have
6139 at least one element and all elements need to live in the same space.
6140 The function C<isl_multi_union_pw_aff_intersect_range>
6141 restricts the input function to those shared domain elements
6142 that map to the specified range.
6144 =item * Union
6146         #include <isl/set.h>
6147         __isl_give isl_set *isl_basic_set_union(
6148                 __isl_take isl_basic_set *bset1,
6149                 __isl_take isl_basic_set *bset2);
6150         __isl_give isl_set *isl_set_union(
6151                 __isl_take isl_set *set1,
6152                 __isl_take isl_set *set2);
6153         __isl_give isl_set *isl_set_list_union(
6154                 __isl_take isl_set_list *list);
6156         #include <isl/map.h>
6157         __isl_give isl_map *isl_basic_map_union(
6158                 __isl_take isl_basic_map *bmap1,
6159                 __isl_take isl_basic_map *bmap2);
6160         __isl_give isl_map *isl_map_union(
6161                 __isl_take isl_map *map1,
6162                 __isl_take isl_map *map2);
6164         #include <isl/union_set.h>
6165         __isl_give isl_union_set *isl_union_set_union(
6166                 __isl_take isl_union_set *uset1,
6167                 __isl_take isl_union_set *uset2);
6168         __isl_give isl_union_set *isl_union_set_list_union(
6169                 __isl_take isl_union_set_list *list);
6171         #include <isl/union_map.h>
6172         __isl_give isl_union_map *isl_union_map_union(
6173                 __isl_take isl_union_map *umap1,
6174                 __isl_take isl_union_map *umap2);
6176 The list passed to C<isl_set_list_union> needs to have
6177 at least one element and all elements need to live in the same space.
6179 =item * Set difference
6181         #include <isl/set.h>
6182         __isl_give isl_set *isl_set_subtract(
6183                 __isl_take isl_set *set1,
6184                 __isl_take isl_set *set2);
6186         #include <isl/map.h>
6187         __isl_give isl_map *isl_map_subtract(
6188                 __isl_take isl_map *map1,
6189                 __isl_take isl_map *map2);
6190         __isl_give isl_map *isl_map_subtract_domain(
6191                 __isl_take isl_map *map,
6192                 __isl_take isl_set *dom);
6193         __isl_give isl_map *isl_map_subtract_range(
6194                 __isl_take isl_map *map,
6195                 __isl_take isl_set *dom);
6197         #include <isl/union_set.h>
6198         __isl_give isl_union_set *isl_union_set_subtract(
6199                 __isl_take isl_union_set *uset1,
6200                 __isl_take isl_union_set *uset2);
6202         #include <isl/union_map.h>
6203         __isl_give isl_union_map *isl_union_map_subtract(
6204                 __isl_take isl_union_map *umap1,
6205                 __isl_take isl_union_map *umap2);
6206         __isl_give isl_union_map *isl_union_map_subtract_domain(
6207                 __isl_take isl_union_map *umap,
6208                 __isl_take isl_union_set *dom);
6209         __isl_give isl_union_map *isl_union_map_subtract_range(
6210                 __isl_take isl_union_map *umap,
6211                 __isl_take isl_union_set *dom);
6213         #include <isl/aff.h>
6214         __isl_give isl_pw_aff *isl_pw_aff_subtract_domain(
6215                 __isl_take isl_pw_aff *pa,
6216                 __isl_take isl_set *set);
6217         __isl_give isl_pw_multi_aff *
6218         isl_pw_multi_aff_subtract_domain(
6219                 __isl_take isl_pw_multi_aff *pma,
6220                 __isl_take isl_set *set);
6221         __isl_give isl_union_pw_aff *
6222         isl_union_pw_aff_subtract_domain(
6223                 __isl_take isl_union_pw_aff *upa,
6224                 __isl_take isl_union_set *uset);
6225         __isl_give isl_union_pw_multi_aff *
6226         isl_union_pw_multi_aff_subtract_domain(
6227                 __isl_take isl_union_pw_multi_aff *upma,
6228                 __isl_take isl_set *set);
6230         #include <isl/polynomial.h>
6231         __isl_give isl_pw_qpolynomial *
6232         isl_pw_qpolynomial_subtract_domain(
6233                 __isl_take isl_pw_qpolynomial *pwpq,
6234                 __isl_take isl_set *set);
6235         __isl_give isl_pw_qpolynomial_fold *
6236         isl_pw_qpolynomial_fold_subtract_domain(
6237                 __isl_take isl_pw_qpolynomial_fold *pwf,
6238                 __isl_take isl_set *set);
6239         __isl_give isl_union_pw_qpolynomial *
6240         isl_union_pw_qpolynomial_subtract_domain(
6241                 __isl_take isl_union_pw_qpolynomial *upwpq,
6242                 __isl_take isl_union_set *uset);
6243         __isl_give isl_union_pw_qpolynomial_fold *
6244         isl_union_pw_qpolynomial_fold_subtract_domain(
6245                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
6246                 __isl_take isl_union_set *uset);
6248 =item * Application
6250         #include <isl/space.h>
6251         __isl_give isl_space *isl_space_join(
6252                 __isl_take isl_space *left,
6253                 __isl_take isl_space *right);
6255         #include <isl/map.h>
6256         __isl_give isl_basic_set *isl_basic_set_apply(
6257                 __isl_take isl_basic_set *bset,
6258                 __isl_take isl_basic_map *bmap);
6259         __isl_give isl_set *isl_set_apply(
6260                 __isl_take isl_set *set,
6261                 __isl_take isl_map *map);
6262         __isl_give isl_union_set *isl_union_set_apply(
6263                 __isl_take isl_union_set *uset,
6264                 __isl_take isl_union_map *umap);
6265         __isl_give isl_basic_map *isl_basic_map_apply_domain(
6266                 __isl_take isl_basic_map *bmap1,
6267                 __isl_take isl_basic_map *bmap2);
6268         __isl_give isl_basic_map *isl_basic_map_apply_range(
6269                 __isl_take isl_basic_map *bmap1,
6270                 __isl_take isl_basic_map *bmap2);
6271         __isl_give isl_map *isl_map_apply_domain(
6272                 __isl_take isl_map *map1,
6273                 __isl_take isl_map *map2);
6274         __isl_give isl_map *isl_map_apply_range(
6275                 __isl_take isl_map *map1,
6276                 __isl_take isl_map *map2);
6278         #include <isl/union_map.h>
6279         __isl_give isl_union_map *isl_union_map_apply_domain(
6280                 __isl_take isl_union_map *umap1,
6281                 __isl_take isl_union_map *umap2);
6282         __isl_give isl_union_map *isl_union_map_apply_range(
6283                 __isl_take isl_union_map *umap1,
6284                 __isl_take isl_union_map *umap2);
6286         #include <isl/aff.h>
6287         __isl_give isl_union_pw_aff *
6288         isl_multi_union_pw_aff_apply_aff(
6289                 __isl_take isl_multi_union_pw_aff *mupa,
6290                 __isl_take isl_aff *aff);
6291         __isl_give isl_union_pw_aff *
6292         isl_multi_union_pw_aff_apply_pw_aff(
6293                 __isl_take isl_multi_union_pw_aff *mupa,
6294                 __isl_take isl_pw_aff *pa);
6295         __isl_give isl_multi_union_pw_aff *
6296         isl_multi_union_pw_aff_apply_multi_aff(
6297                 __isl_take isl_multi_union_pw_aff *mupa,
6298                 __isl_take isl_multi_aff *ma);
6299         __isl_give isl_multi_union_pw_aff *
6300         isl_multi_union_pw_aff_apply_pw_multi_aff(
6301                 __isl_take isl_multi_union_pw_aff *mupa,
6302                 __isl_take isl_pw_multi_aff *pma);
6304 The result of C<isl_multi_union_pw_aff_apply_aff> is defined
6305 over the shared domain of the elements of the input.  The dimension is
6306 required to be greater than zero.
6307 The C<isl_multi_union_pw_aff> argument of
6308 C<isl_multi_union_pw_aff_apply_multi_aff> is allowed to be zero-dimensional,
6309 but only if the range of the C<isl_multi_aff> argument
6310 is also zero-dimensional.
6311 Similarly for C<isl_multi_union_pw_aff_apply_pw_multi_aff>.
6313         #include <isl/polynomial.h>
6314         __isl_give isl_pw_qpolynomial_fold *
6315         isl_set_apply_pw_qpolynomial_fold(
6316                 __isl_take isl_set *set,
6317                 __isl_take isl_pw_qpolynomial_fold *pwf,
6318                 int *tight);
6319         __isl_give isl_pw_qpolynomial_fold *
6320         isl_map_apply_pw_qpolynomial_fold(
6321                 __isl_take isl_map *map,
6322                 __isl_take isl_pw_qpolynomial_fold *pwf,
6323                 int *tight);
6324         __isl_give isl_union_pw_qpolynomial_fold *
6325         isl_union_set_apply_union_pw_qpolynomial_fold(
6326                 __isl_take isl_union_set *uset,
6327                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
6328                 int *tight);
6329         __isl_give isl_union_pw_qpolynomial_fold *
6330         isl_union_map_apply_union_pw_qpolynomial_fold(
6331                 __isl_take isl_union_map *umap,
6332                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
6333                 int *tight);
6335 The functions taking a map
6336 compose the given map with the given piecewise quasipolynomial reduction.
6337 That is, compute a bound (of the same type as C<pwf> or C<upwf> itself)
6338 over all elements in the intersection of the range of the map
6339 and the domain of the piecewise quasipolynomial reduction
6340 as a function of an element in the domain of the map.
6341 The functions taking a set compute a bound over all elements in the
6342 intersection of the set and the domain of the
6343 piecewise quasipolynomial reduction.
6345 =item * Preimage
6347         #include <isl/set.h>
6348         __isl_give isl_basic_set *
6349         isl_basic_set_preimage_multi_aff(
6350                 __isl_take isl_basic_set *bset,
6351                 __isl_take isl_multi_aff *ma);
6352         __isl_give isl_set *isl_set_preimage_multi_aff(
6353                 __isl_take isl_set *set,
6354                 __isl_take isl_multi_aff *ma);
6355         __isl_give isl_set *isl_set_preimage_pw_multi_aff(
6356                 __isl_take isl_set *set,
6357                 __isl_take isl_pw_multi_aff *pma);
6358         __isl_give isl_set *isl_set_preimage_multi_pw_aff(
6359                 __isl_take isl_set *set,
6360                 __isl_take isl_multi_pw_aff *mpa);
6362         #include <isl/union_set.h>
6363         __isl_give isl_union_set *
6364         isl_union_set_preimage_multi_aff(
6365                 __isl_take isl_union_set *uset,
6366                 __isl_take isl_multi_aff *ma);
6367         __isl_give isl_union_set *
6368         isl_union_set_preimage_pw_multi_aff(
6369                 __isl_take isl_union_set *uset,
6370                 __isl_take isl_pw_multi_aff *pma);
6371         __isl_give isl_union_set *
6372         isl_union_set_preimage_union_pw_multi_aff(
6373                 __isl_take isl_union_set *uset,
6374                 __isl_take isl_union_pw_multi_aff *upma);
6376         #include <isl/map.h>
6377         __isl_give isl_basic_map *
6378         isl_basic_map_preimage_domain_multi_aff(
6379                 __isl_take isl_basic_map *bmap,
6380                 __isl_take isl_multi_aff *ma);
6381         __isl_give isl_map *isl_map_preimage_domain_multi_aff(
6382                 __isl_take isl_map *map,
6383                 __isl_take isl_multi_aff *ma);
6384         __isl_give isl_map *isl_map_preimage_range_multi_aff(
6385                 __isl_take isl_map *map,
6386                 __isl_take isl_multi_aff *ma);
6387         __isl_give isl_map *
6388         isl_map_preimage_domain_pw_multi_aff(
6389                 __isl_take isl_map *map,
6390                 __isl_take isl_pw_multi_aff *pma);
6391         __isl_give isl_map *
6392         isl_map_preimage_range_pw_multi_aff(
6393                 __isl_take isl_map *map,
6394                 __isl_take isl_pw_multi_aff *pma);
6395         __isl_give isl_map *
6396         isl_map_preimage_domain_multi_pw_aff(
6397                 __isl_take isl_map *map,
6398                 __isl_take isl_multi_pw_aff *mpa);
6399         __isl_give isl_basic_map *
6400         isl_basic_map_preimage_range_multi_aff(
6401                 __isl_take isl_basic_map *bmap,
6402                 __isl_take isl_multi_aff *ma);
6404         #include <isl/union_map.h>
6405         __isl_give isl_union_map *
6406         isl_union_map_preimage_domain_multi_aff(
6407                 __isl_take isl_union_map *umap,
6408                 __isl_take isl_multi_aff *ma);
6409         __isl_give isl_union_map *
6410         isl_union_map_preimage_range_multi_aff(
6411                 __isl_take isl_union_map *umap,
6412                 __isl_take isl_multi_aff *ma);
6413         __isl_give isl_union_map *
6414         isl_union_map_preimage_domain_pw_multi_aff(
6415                 __isl_take isl_union_map *umap,
6416                 __isl_take isl_pw_multi_aff *pma);
6417         __isl_give isl_union_map *
6418         isl_union_map_preimage_range_pw_multi_aff(
6419                 __isl_take isl_union_map *umap,
6420                 __isl_take isl_pw_multi_aff *pma);
6421         __isl_give isl_union_map *
6422         isl_union_map_preimage_domain_union_pw_multi_aff(
6423                 __isl_take isl_union_map *umap,
6424                 __isl_take isl_union_pw_multi_aff *upma);
6425         __isl_give isl_union_map *
6426         isl_union_map_preimage_range_union_pw_multi_aff(
6427                 __isl_take isl_union_map *umap,
6428                 __isl_take isl_union_pw_multi_aff *upma);
6430 These functions compute the preimage of the given set or map domain/range under
6431 the given function.  In other words, the expression is plugged
6432 into the set description or into the domain/range of the map.
6434 =item * Pullback
6436         #include <isl/aff.h>
6437         __isl_give isl_aff *isl_aff_pullback_aff(
6438                 __isl_take isl_aff *aff1,
6439                 __isl_take isl_aff *aff2);
6440         __isl_give isl_aff *isl_aff_pullback_multi_aff(
6441                 __isl_take isl_aff *aff,
6442                 __isl_take isl_multi_aff *ma);
6443         __isl_give isl_pw_aff *isl_pw_aff_pullback_multi_aff(
6444                 __isl_take isl_pw_aff *pa,
6445                 __isl_take isl_multi_aff *ma);
6446         __isl_give isl_pw_aff *isl_pw_aff_pullback_pw_multi_aff(
6447                 __isl_take isl_pw_aff *pa,
6448                 __isl_take isl_pw_multi_aff *pma);
6449         __isl_give isl_pw_aff *isl_pw_aff_pullback_multi_pw_aff(
6450                 __isl_take isl_pw_aff *pa,
6451                 __isl_take isl_multi_pw_aff *mpa);
6452         __isl_give isl_multi_aff *isl_multi_aff_pullback_multi_aff(
6453                 __isl_take isl_multi_aff *ma1,
6454                 __isl_take isl_multi_aff *ma2);
6455         __isl_give isl_pw_multi_aff *
6456         isl_pw_multi_aff_pullback_multi_aff(
6457                 __isl_take isl_pw_multi_aff *pma,
6458                 __isl_take isl_multi_aff *ma);
6459         __isl_give isl_multi_pw_aff *
6460         isl_multi_pw_aff_pullback_multi_aff(
6461                 __isl_take isl_multi_pw_aff *mpa,
6462                 __isl_take isl_multi_aff *ma);
6463         __isl_give isl_pw_multi_aff *
6464         isl_pw_multi_aff_pullback_pw_multi_aff(
6465                 __isl_take isl_pw_multi_aff *pma1,
6466                 __isl_take isl_pw_multi_aff *pma2);
6467         __isl_give isl_multi_pw_aff *
6468         isl_multi_pw_aff_pullback_pw_multi_aff(
6469                 __isl_take isl_multi_pw_aff *mpa,
6470                 __isl_take isl_pw_multi_aff *pma);
6471         __isl_give isl_multi_pw_aff *
6472         isl_multi_pw_aff_pullback_multi_pw_aff(
6473                 __isl_take isl_multi_pw_aff *mpa1,
6474                 __isl_take isl_multi_pw_aff *mpa2);
6475         __isl_give isl_union_pw_aff *
6476         isl_union_pw_aff_pullback_union_pw_multi_aff(
6477                 __isl_take isl_union_pw_aff *upa,
6478                 __isl_take isl_union_pw_multi_aff *upma);
6479         __isl_give isl_union_pw_multi_aff *
6480         isl_union_pw_multi_aff_pullback_union_pw_multi_aff(
6481                 __isl_take isl_union_pw_multi_aff *upma1,
6482                 __isl_take isl_union_pw_multi_aff *upma2);
6483         __isl_give isl_multi_union_pw_aff *
6484         isl_multi_union_pw_aff_pullback_union_pw_multi_aff(
6485                 __isl_take isl_multi_union_pw_aff *mupa,
6486                 __isl_take isl_union_pw_multi_aff *upma);
6488 These functions precompose the first expression by the second function.
6489 In other words, the second function is plugged
6490 into the first expression.
6492 =item * Locus
6494         #include <isl/aff.h>
6495         __isl_give isl_basic_set *isl_aff_eq_basic_set(
6496                 __isl_take isl_aff *aff1,
6497                 __isl_take isl_aff *aff2);
6498         __isl_give isl_set *isl_aff_eq_set(
6499                 __isl_take isl_aff *aff1,
6500                 __isl_take isl_aff *aff2);
6501         __isl_give isl_set *isl_aff_ne_set(
6502                 __isl_take isl_aff *aff1,
6503                 __isl_take isl_aff *aff2);
6504         __isl_give isl_basic_set *isl_aff_le_basic_set(
6505                 __isl_take isl_aff *aff1,
6506                 __isl_take isl_aff *aff2);
6507         __isl_give isl_set *isl_aff_le_set(
6508                 __isl_take isl_aff *aff1,
6509                 __isl_take isl_aff *aff2);
6510         __isl_give isl_basic_set *isl_aff_lt_basic_set(
6511                 __isl_take isl_aff *aff1,
6512                 __isl_take isl_aff *aff2);
6513         __isl_give isl_set *isl_aff_lt_set(
6514                 __isl_take isl_aff *aff1,
6515                 __isl_take isl_aff *aff2);
6516         __isl_give isl_basic_set *isl_aff_ge_basic_set(
6517                 __isl_take isl_aff *aff1,
6518                 __isl_take isl_aff *aff2);
6519         __isl_give isl_set *isl_aff_ge_set(
6520                 __isl_take isl_aff *aff1,
6521                 __isl_take isl_aff *aff2);
6522         __isl_give isl_basic_set *isl_aff_gt_basic_set(
6523                 __isl_take isl_aff *aff1,
6524                 __isl_take isl_aff *aff2);
6525         __isl_give isl_set *isl_aff_gt_set(
6526                 __isl_take isl_aff *aff1,
6527                 __isl_take isl_aff *aff2);
6528         __isl_give isl_set *isl_pw_aff_eq_set(
6529                 __isl_take isl_pw_aff *pwaff1,
6530                 __isl_take isl_pw_aff *pwaff2);
6531         __isl_give isl_set *isl_pw_aff_ne_set(
6532                 __isl_take isl_pw_aff *pwaff1,
6533                 __isl_take isl_pw_aff *pwaff2);
6534         __isl_give isl_set *isl_pw_aff_le_set(
6535                 __isl_take isl_pw_aff *pwaff1,
6536                 __isl_take isl_pw_aff *pwaff2);
6537         __isl_give isl_set *isl_pw_aff_lt_set(
6538                 __isl_take isl_pw_aff *pwaff1,
6539                 __isl_take isl_pw_aff *pwaff2);
6540         __isl_give isl_set *isl_pw_aff_ge_set(
6541                 __isl_take isl_pw_aff *pwaff1,
6542                 __isl_take isl_pw_aff *pwaff2);
6543         __isl_give isl_set *isl_pw_aff_gt_set(
6544                 __isl_take isl_pw_aff *pwaff1,
6545                 __isl_take isl_pw_aff *pwaff2);
6547         __isl_give isl_set *isl_multi_aff_lex_le_set(
6548                 __isl_take isl_multi_aff *ma1,
6549                 __isl_take isl_multi_aff *ma2);
6550         __isl_give isl_set *isl_multi_aff_lex_lt_set(
6551                 __isl_take isl_multi_aff *ma1,
6552                 __isl_take isl_multi_aff *ma2);
6553         __isl_give isl_set *isl_multi_aff_lex_ge_set(
6554                 __isl_take isl_multi_aff *ma1,
6555                 __isl_take isl_multi_aff *ma2);
6556         __isl_give isl_set *isl_multi_aff_lex_gt_set(
6557                 __isl_take isl_multi_aff *ma1,
6558                 __isl_take isl_multi_aff *ma2);
6560         __isl_give isl_set *isl_pw_aff_list_eq_set(
6561                 __isl_take isl_pw_aff_list *list1,
6562                 __isl_take isl_pw_aff_list *list2);
6563         __isl_give isl_set *isl_pw_aff_list_ne_set(
6564                 __isl_take isl_pw_aff_list *list1,
6565                 __isl_take isl_pw_aff_list *list2);
6566         __isl_give isl_set *isl_pw_aff_list_le_set(
6567                 __isl_take isl_pw_aff_list *list1,
6568                 __isl_take isl_pw_aff_list *list2);
6569         __isl_give isl_set *isl_pw_aff_list_lt_set(
6570                 __isl_take isl_pw_aff_list *list1,
6571                 __isl_take isl_pw_aff_list *list2);
6572         __isl_give isl_set *isl_pw_aff_list_ge_set(
6573                 __isl_take isl_pw_aff_list *list1,
6574                 __isl_take isl_pw_aff_list *list2);
6575         __isl_give isl_set *isl_pw_aff_list_gt_set(
6576                 __isl_take isl_pw_aff_list *list1,
6577                 __isl_take isl_pw_aff_list *list2);
6579 The function C<isl_aff_ge_basic_set> returns a basic set
6580 containing those elements in the shared space
6581 of C<aff1> and C<aff2> where C<aff1> is greater than or equal to C<aff2>.
6582 The function C<isl_pw_aff_ge_set> returns a set
6583 containing those elements in the shared domain
6584 of C<pwaff1> and C<pwaff2> where C<pwaff1> is
6585 greater than or equal to C<pwaff2>.
6586 The function C<isl_multi_aff_lex_le_set> returns a set
6587 containing those elements in the shared domain space
6588 where C<ma1> is lexicographically smaller than or
6589 equal to C<ma2>.
6590 The functions operating on C<isl_pw_aff_list> apply the corresponding
6591 C<isl_pw_aff> function to each pair of elements in the two lists.
6593         #include <isl/aff.h>
6594         __isl_give isl_map *isl_pw_aff_eq_map(
6595                 __isl_take isl_pw_aff *pa1,
6596                 __isl_take isl_pw_aff *pa2);
6597         __isl_give isl_map *isl_pw_aff_lt_map(
6598                 __isl_take isl_pw_aff *pa1,
6599                 __isl_take isl_pw_aff *pa2);
6600         __isl_give isl_map *isl_pw_aff_gt_map(
6601                 __isl_take isl_pw_aff *pa1,
6602                 __isl_take isl_pw_aff *pa2);
6604         __isl_give isl_map *isl_multi_pw_aff_eq_map(
6605                 __isl_take isl_multi_pw_aff *mpa1,
6606                 __isl_take isl_multi_pw_aff *mpa2);
6607         __isl_give isl_map *isl_multi_pw_aff_lex_lt_map(
6608                 __isl_take isl_multi_pw_aff *mpa1,
6609                 __isl_take isl_multi_pw_aff *mpa2);
6610         __isl_give isl_map *isl_multi_pw_aff_lex_gt_map(
6611                 __isl_take isl_multi_pw_aff *mpa1,
6612                 __isl_take isl_multi_pw_aff *mpa2);
6614 These functions return a map between domain elements of the arguments
6615 where the function values satisfy the given relation.
6617         #include <isl/union_map.h>
6618         __isl_give isl_union_map *
6619         isl_union_map_eq_at_multi_union_pw_aff(
6620                 __isl_take isl_union_map *umap,
6621                 __isl_take isl_multi_union_pw_aff *mupa);
6622         __isl_give isl_union_map *
6623         isl_union_map_lex_lt_at_multi_union_pw_aff(
6624                 __isl_take isl_union_map *umap,
6625                 __isl_take isl_multi_union_pw_aff *mupa);
6626         __isl_give isl_union_map *
6627         isl_union_map_lex_gt_at_multi_union_pw_aff(
6628                 __isl_take isl_union_map *umap,
6629                 __isl_take isl_multi_union_pw_aff *mupa);
6631 These functions select the subset of elements in the union map
6632 that have an equal or lexicographically smaller function value.
6634 =item * Cartesian Product
6636         #include <isl/space.h>
6637         __isl_give isl_space *isl_space_product(
6638                 __isl_take isl_space *space1,
6639                 __isl_take isl_space *space2);
6640         __isl_give isl_space *isl_space_domain_product(
6641                 __isl_take isl_space *space1,
6642                 __isl_take isl_space *space2);
6643         __isl_give isl_space *isl_space_range_product(
6644                 __isl_take isl_space *space1,
6645                 __isl_take isl_space *space2);
6647 The functions
6648 C<isl_space_product>, C<isl_space_domain_product>
6649 and C<isl_space_range_product> take pairs or relation spaces and
6650 produce a single relations space, where either the domain, the range
6651 or both domain and range are wrapped spaces of relations between
6652 the domains and/or ranges of the input spaces.
6653 If the product is only constructed over the domain or the range
6654 then the ranges or the domains of the inputs should be the same.
6655 The function C<isl_space_product> also accepts a pair of set spaces,
6656 in which case it returns a wrapped space of a relation between the
6657 two input spaces.
6659         #include <isl/set.h>
6660         __isl_give isl_set *isl_set_product(
6661                 __isl_take isl_set *set1,
6662                 __isl_take isl_set *set2);
6664         #include <isl/map.h>
6665         __isl_give isl_basic_map *isl_basic_map_domain_product(
6666                 __isl_take isl_basic_map *bmap1,
6667                 __isl_take isl_basic_map *bmap2);
6668         __isl_give isl_basic_map *isl_basic_map_range_product(
6669                 __isl_take isl_basic_map *bmap1,
6670                 __isl_take isl_basic_map *bmap2);
6671         __isl_give isl_basic_map *isl_basic_map_product(
6672                 __isl_take isl_basic_map *bmap1,
6673                 __isl_take isl_basic_map *bmap2);
6674         __isl_give isl_map *isl_map_domain_product(
6675                 __isl_take isl_map *map1,
6676                 __isl_take isl_map *map2);
6677         __isl_give isl_map *isl_map_range_product(
6678                 __isl_take isl_map *map1,
6679                 __isl_take isl_map *map2);
6680         __isl_give isl_map *isl_map_product(
6681                 __isl_take isl_map *map1,
6682                 __isl_take isl_map *map2);
6684         #include <isl/union_set.h>
6685         __isl_give isl_union_set *isl_union_set_product(
6686                 __isl_take isl_union_set *uset1,
6687                 __isl_take isl_union_set *uset2);
6689         #include <isl/union_map.h>
6690         __isl_give isl_union_map *isl_union_map_domain_product(
6691                 __isl_take isl_union_map *umap1,
6692                 __isl_take isl_union_map *umap2);
6693         __isl_give isl_union_map *isl_union_map_range_product(
6694                 __isl_take isl_union_map *umap1,
6695                 __isl_take isl_union_map *umap2);
6696         __isl_give isl_union_map *isl_union_map_product(
6697                 __isl_take isl_union_map *umap1,
6698                 __isl_take isl_union_map *umap2);
6700         #include <isl/val.h>
6701         __isl_give isl_multi_val *isl_multi_val_range_product(
6702                 __isl_take isl_multi_val *mv1,
6703                 __isl_take isl_multi_val *mv2);
6704         __isl_give isl_multi_val *isl_multi_val_product(
6705                 __isl_take isl_multi_val *mv1,
6706                 __isl_take isl_multi_val *mv2);
6708         #include <isl/aff.h>
6709         __isl_give isl_multi_aff *isl_multi_aff_range_product(
6710                 __isl_take isl_multi_aff *ma1,
6711                 __isl_take isl_multi_aff *ma2);
6712         __isl_give isl_multi_aff *isl_multi_aff_product(
6713                 __isl_take isl_multi_aff *ma1,
6714                 __isl_take isl_multi_aff *ma2);
6715         __isl_give isl_multi_pw_aff *
6716         isl_multi_pw_aff_range_product(
6717                 __isl_take isl_multi_pw_aff *mpa1,
6718                 __isl_take isl_multi_pw_aff *mpa2);
6719         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_product(
6720                 __isl_take isl_multi_pw_aff *mpa1,
6721                 __isl_take isl_multi_pw_aff *mpa2);
6722         __isl_give isl_pw_multi_aff *
6723         isl_pw_multi_aff_range_product(
6724                 __isl_take isl_pw_multi_aff *pma1,
6725                 __isl_take isl_pw_multi_aff *pma2);
6726         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_product(
6727                 __isl_take isl_pw_multi_aff *pma1,
6728                 __isl_take isl_pw_multi_aff *pma2);
6729         __isl_give isl_multi_union_pw_aff *
6730         isl_multi_union_pw_aff_range_product(
6731                 __isl_take isl_multi_union_pw_aff *mupa1,
6732                 __isl_take isl_multi_union_pw_aff *mupa2);
6734 The above functions compute the cross product of the given
6735 sets, relations or functions.  The domains and ranges of the results
6736 are wrapped maps between domains and ranges of the inputs.
6737 To obtain a ``flat'' product, use the following functions
6738 instead.
6740         #include <isl/set.h>
6741         __isl_give isl_basic_set *isl_basic_set_flat_product(
6742                 __isl_take isl_basic_set *bset1,
6743                 __isl_take isl_basic_set *bset2);
6744         __isl_give isl_set *isl_set_flat_product(
6745                 __isl_take isl_set *set1,
6746                 __isl_take isl_set *set2);
6748         #include <isl/map.h>
6749         __isl_give isl_basic_map *isl_basic_map_flat_range_product(
6750                 __isl_take isl_basic_map *bmap1,
6751                 __isl_take isl_basic_map *bmap2);
6752         __isl_give isl_map *isl_map_flat_domain_product(
6753                 __isl_take isl_map *map1,
6754                 __isl_take isl_map *map2);
6755         __isl_give isl_map *isl_map_flat_range_product(
6756                 __isl_take isl_map *map1,
6757                 __isl_take isl_map *map2);
6758         __isl_give isl_basic_map *isl_basic_map_flat_product(
6759                 __isl_take isl_basic_map *bmap1,
6760                 __isl_take isl_basic_map *bmap2);
6761         __isl_give isl_map *isl_map_flat_product(
6762                 __isl_take isl_map *map1,
6763                 __isl_take isl_map *map2);
6765         #include <isl/union_map.h>
6766         __isl_give isl_union_map *
6767         isl_union_map_flat_domain_product(
6768                 __isl_take isl_union_map *umap1,
6769                 __isl_take isl_union_map *umap2);
6770         __isl_give isl_union_map *
6771         isl_union_map_flat_range_product(
6772                 __isl_take isl_union_map *umap1,
6773                 __isl_take isl_union_map *umap2);
6775         #include <isl/val.h>
6776         __isl_give isl_multi_val *isl_multi_val_flat_range_product(
6777                 __isl_take isl_multi_val *mv1,
6778                 __isl_take isl_multi_aff *mv2);
6780         #include <isl/aff.h>
6781         __isl_give isl_multi_aff *isl_multi_aff_flat_range_product(
6782                 __isl_take isl_multi_aff *ma1,
6783                 __isl_take isl_multi_aff *ma2);
6784         __isl_give isl_pw_multi_aff *
6785         isl_pw_multi_aff_flat_range_product(
6786                 __isl_take isl_pw_multi_aff *pma1,
6787                 __isl_take isl_pw_multi_aff *pma2);
6788         __isl_give isl_multi_pw_aff *
6789         isl_multi_pw_aff_flat_range_product(
6790                 __isl_take isl_multi_pw_aff *mpa1,
6791                 __isl_take isl_multi_pw_aff *mpa2);
6792         __isl_give isl_union_pw_multi_aff *
6793         isl_union_pw_multi_aff_flat_range_product(
6794                 __isl_take isl_union_pw_multi_aff *upma1,
6795                 __isl_take isl_union_pw_multi_aff *upma2);
6796         __isl_give isl_multi_union_pw_aff *
6797         isl_multi_union_pw_aff_flat_range_product(
6798                 __isl_take isl_multi_union_pw_aff *mupa1,
6799                 __isl_take isl_multi_union_pw_aff *mupa2);
6801         #include <isl/space.h>
6802         __isl_give isl_space *isl_space_factor_domain(
6803                 __isl_take isl_space *space);
6804         __isl_give isl_space *isl_space_factor_range(
6805                 __isl_take isl_space *space);
6806         __isl_give isl_space *isl_space_domain_factor_domain(
6807                 __isl_take isl_space *space);
6808         __isl_give isl_space *isl_space_domain_factor_range(
6809                 __isl_take isl_space *space);
6810         __isl_give isl_space *isl_space_range_factor_domain(
6811                 __isl_take isl_space *space);
6812         __isl_give isl_space *isl_space_range_factor_range(
6813                 __isl_take isl_space *space);
6815 The functions C<isl_space_range_factor_domain> and
6816 C<isl_space_range_factor_range> extract the two arguments from
6817 the result of a call to C<isl_space_range_product>.
6819 The arguments of a call to a product can be extracted
6820 from the result using the following functions.
6822         #include <isl/map.h>
6823         __isl_give isl_map *isl_map_factor_domain(
6824                 __isl_take isl_map *map);
6825         __isl_give isl_map *isl_map_factor_range(
6826                 __isl_take isl_map *map);
6827         __isl_give isl_map *isl_map_domain_factor_domain(
6828                 __isl_take isl_map *map);
6829         __isl_give isl_map *isl_map_domain_factor_range(
6830                 __isl_take isl_map *map);
6831         __isl_give isl_map *isl_map_range_factor_domain(
6832                 __isl_take isl_map *map);
6833         __isl_give isl_map *isl_map_range_factor_range(
6834                 __isl_take isl_map *map);
6836         #include <isl/union_map.h>
6837         __isl_give isl_union_map *isl_union_map_factor_domain(
6838                 __isl_take isl_union_map *umap);
6839         __isl_give isl_union_map *isl_union_map_factor_range(
6840                 __isl_take isl_union_map *umap);
6841         __isl_give isl_union_map *
6842         isl_union_map_domain_factor_domain(
6843                 __isl_take isl_union_map *umap);
6844         __isl_give isl_union_map *
6845         isl_union_map_domain_factor_range(
6846                 __isl_take isl_union_map *umap);
6847         __isl_give isl_union_map *
6848         isl_union_map_range_factor_domain(
6849                 __isl_take isl_union_map *umap);
6850         __isl_give isl_union_map *
6851         isl_union_map_range_factor_range(
6852                 __isl_take isl_union_map *umap);
6854         #include <isl/val.h>
6855         __isl_give isl_multi_val *isl_multi_val_factor_range(
6856                 __isl_take isl_multi_val *mv);
6857         __isl_give isl_multi_val *
6858         isl_multi_val_range_factor_domain(
6859                 __isl_take isl_multi_val *mv);
6860         __isl_give isl_multi_val *
6861         isl_multi_val_range_factor_range(
6862                 __isl_take isl_multi_val *mv);
6864         #include <isl/aff.h>
6865         __isl_give isl_multi_aff *isl_multi_aff_factor_range(
6866                 __isl_take isl_multi_aff *ma);
6867         __isl_give isl_multi_aff *
6868         isl_multi_aff_range_factor_domain(
6869                 __isl_take isl_multi_aff *ma);
6870         __isl_give isl_multi_aff *
6871         isl_multi_aff_range_factor_range(
6872                 __isl_take isl_multi_aff *ma);
6873         __isl_give isl_multi_pw_aff *
6874         isl_multi_pw_aff_factor_range(
6875                 __isl_take isl_multi_pw_aff *mpa);
6876         __isl_give isl_multi_pw_aff *
6877         isl_multi_pw_aff_range_factor_domain(
6878                 __isl_take isl_multi_pw_aff *mpa);
6879         __isl_give isl_multi_pw_aff *
6880         isl_multi_pw_aff_range_factor_range(
6881                 __isl_take isl_multi_pw_aff *mpa);
6882         __isl_give isl_multi_union_pw_aff *
6883         isl_multi_union_pw_aff_factor_range(
6884                 __isl_take isl_multi_union_pw_aff *mupa);
6885         __isl_give isl_multi_union_pw_aff *
6886         isl_multi_union_pw_aff_range_factor_domain(
6887                 __isl_take isl_multi_union_pw_aff *mupa);
6888         __isl_give isl_multi_union_pw_aff *
6889         isl_multi_union_pw_aff_range_factor_range(
6890                 __isl_take isl_multi_union_pw_aff *mupa);
6892 The splice functions are a generalization of the flat product functions,
6893 where the second argument may be inserted at any position inside
6894 the first argument rather than being placed at the end.
6895 The functions C<isl_multi_val_factor_range>,
6896 C<isl_multi_aff_factor_range>,
6897 C<isl_multi_pw_aff_factor_range> and
6898 C<isl_multi_union_pw_aff_factor_range>
6899 take functions that live in a set space.
6901         #include <isl/val.h>
6902         __isl_give isl_multi_val *isl_multi_val_range_splice(
6903                 __isl_take isl_multi_val *mv1, unsigned pos,
6904                 __isl_take isl_multi_val *mv2);
6906         #include <isl/aff.h>
6907         __isl_give isl_multi_aff *isl_multi_aff_range_splice(
6908                 __isl_take isl_multi_aff *ma1, unsigned pos,
6909                 __isl_take isl_multi_aff *ma2);
6910         __isl_give isl_multi_aff *isl_multi_aff_splice(
6911                 __isl_take isl_multi_aff *ma1,
6912                 unsigned in_pos, unsigned out_pos,
6913                 __isl_take isl_multi_aff *ma2);
6914         __isl_give isl_multi_pw_aff *
6915         isl_multi_pw_aff_range_splice(
6916                 __isl_take isl_multi_pw_aff *mpa1, unsigned pos,
6917                 __isl_take isl_multi_pw_aff *mpa2);
6918         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_splice(
6919                 __isl_take isl_multi_pw_aff *mpa1,
6920                 unsigned in_pos, unsigned out_pos,
6921                 __isl_take isl_multi_pw_aff *mpa2);
6922         __isl_give isl_multi_union_pw_aff *
6923         isl_multi_union_pw_aff_range_splice(
6924                 __isl_take isl_multi_union_pw_aff *mupa1,
6925                 unsigned pos,
6926                 __isl_take isl_multi_union_pw_aff *mupa2);
6928 =item * Simplification
6930 When applied to a set or relation,
6931 the gist operation returns a set or relation that has the
6932 same intersection with the context as the input set or relation.
6933 Any implicit equality in the intersection is made explicit in the result,
6934 while all inequalities that are redundant with respect to the intersection
6935 are removed.
6936 In case of union sets and relations, the gist operation is performed
6937 per space.
6939 When applied to a function,
6940 the gist operation applies the set gist operation to each of
6941 the cells in the domain of the input piecewise expression.
6942 The context is also exploited
6943 to simplify the expression associated to each cell.
6945         #include <isl/set.h>
6946         __isl_give isl_basic_set *isl_basic_set_gist(
6947                 __isl_take isl_basic_set *bset,
6948                 __isl_take isl_basic_set *context);
6949         __isl_give isl_set *isl_set_gist(__isl_take isl_set *set,
6950                 __isl_take isl_set *context);
6951         __isl_give isl_set *isl_set_gist_params(
6952                 __isl_take isl_set *set,
6953                 __isl_take isl_set *context);
6955         #include <isl/map.h>
6956         __isl_give isl_basic_map *isl_basic_map_gist(
6957                 __isl_take isl_basic_map *bmap,
6958                 __isl_take isl_basic_map *context);
6959         __isl_give isl_basic_map *isl_basic_map_gist_domain(
6960                 __isl_take isl_basic_map *bmap,
6961                 __isl_take isl_basic_set *context);
6962         __isl_give isl_map *isl_map_gist(__isl_take isl_map *map,
6963                 __isl_take isl_map *context);
6964         __isl_give isl_map *isl_map_gist_params(
6965                 __isl_take isl_map *map,
6966                 __isl_take isl_set *context);
6967         __isl_give isl_map *isl_map_gist_domain(
6968                 __isl_take isl_map *map,
6969                 __isl_take isl_set *context);
6970         __isl_give isl_map *isl_map_gist_range(
6971                 __isl_take isl_map *map,
6972                 __isl_take isl_set *context);
6974         #include <isl/union_set.h>
6975         __isl_give isl_union_set *isl_union_set_gist(
6976                 __isl_take isl_union_set *uset,
6977                 __isl_take isl_union_set *context);
6978         __isl_give isl_union_set *isl_union_set_gist_params(
6979                 __isl_take isl_union_set *uset,
6980                 __isl_take isl_set *set);
6982         #include <isl/union_map.h>
6983         __isl_give isl_union_map *isl_union_map_gist(
6984                 __isl_take isl_union_map *umap,
6985                 __isl_take isl_union_map *context);
6986         __isl_give isl_union_map *isl_union_map_gist_params(
6987                 __isl_take isl_union_map *umap,
6988                 __isl_take isl_set *set);
6989         __isl_give isl_union_map *isl_union_map_gist_domain(
6990                 __isl_take isl_union_map *umap,
6991                 __isl_take isl_union_set *uset);
6992         __isl_give isl_union_map *isl_union_map_gist_range(
6993                 __isl_take isl_union_map *umap,
6994                 __isl_take isl_union_set *uset);
6996         #include <isl/aff.h>
6997         __isl_give isl_aff *isl_aff_gist_params(
6998                 __isl_take isl_aff *aff,
6999                 __isl_take isl_set *context);
7000         __isl_give isl_aff *isl_aff_gist(__isl_take isl_aff *aff,
7001                 __isl_take isl_set *context);
7002         __isl_give isl_multi_aff *isl_multi_aff_gist_params(
7003                 __isl_take isl_multi_aff *maff,
7004                 __isl_take isl_set *context);
7005         __isl_give isl_multi_aff *isl_multi_aff_gist(
7006                 __isl_take isl_multi_aff *maff,
7007                 __isl_take isl_set *context);
7008         __isl_give isl_pw_aff *isl_pw_aff_gist_params(
7009                 __isl_take isl_pw_aff *pwaff,
7010                 __isl_take isl_set *context);
7011         __isl_give isl_pw_aff *isl_pw_aff_gist(
7012                 __isl_take isl_pw_aff *pwaff,
7013                 __isl_take isl_set *context);
7014         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_gist_params(
7015                 __isl_take isl_pw_multi_aff *pma,
7016                 __isl_take isl_set *set);
7017         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_gist(
7018                 __isl_take isl_pw_multi_aff *pma,
7019                 __isl_take isl_set *set);
7020         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_gist_params(
7021                 __isl_take isl_multi_pw_aff *mpa,
7022                 __isl_take isl_set *set);
7023         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_gist(
7024                 __isl_take isl_multi_pw_aff *mpa,
7025                 __isl_take isl_set *set);
7026         __isl_give isl_union_pw_aff *isl_union_pw_aff_gist(
7027                 __isl_take isl_union_pw_aff *upa,
7028                 __isl_take isl_union_set *context);
7029         __isl_give isl_union_pw_aff *isl_union_pw_aff_gist_params(
7030                 __isl_take isl_union_pw_aff *upa,
7031                 __isl_take isl_set *context);
7032         __isl_give isl_union_pw_multi_aff *
7033         isl_union_pw_multi_aff_gist_params(
7034                 __isl_take isl_union_pw_multi_aff *upma,
7035                 __isl_take isl_set *context);
7036         __isl_give isl_union_pw_multi_aff *
7037         isl_union_pw_multi_aff_gist(
7038                 __isl_take isl_union_pw_multi_aff *upma,
7039                 __isl_take isl_union_set *context);
7040         __isl_give isl_multi_union_pw_aff *
7041         isl_multi_union_pw_aff_gist_params(
7042                 __isl_take isl_multi_union_pw_aff *aff,
7043                 __isl_take isl_set *context);
7044         __isl_give isl_multi_union_pw_aff *
7045         isl_multi_union_pw_aff_gist(
7046                 __isl_take isl_multi_union_pw_aff *aff,
7047                 __isl_take isl_union_set *context);
7049         #include <isl/polynomial.h>
7050         __isl_give isl_qpolynomial *isl_qpolynomial_gist_params(
7051                 __isl_take isl_qpolynomial *qp,
7052                 __isl_take isl_set *context);
7053         __isl_give isl_qpolynomial *isl_qpolynomial_gist(
7054                 __isl_take isl_qpolynomial *qp,
7055                 __isl_take isl_set *context);
7056         __isl_give isl_qpolynomial_fold *
7057         isl_qpolynomial_fold_gist_params(
7058                 __isl_take isl_qpolynomial_fold *fold,
7059                 __isl_take isl_set *context);
7060         __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_gist(
7061                 __isl_take isl_qpolynomial_fold *fold,
7062                 __isl_take isl_set *context);
7063         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_gist_params(
7064                 __isl_take isl_pw_qpolynomial *pwqp,
7065                 __isl_take isl_set *context);
7066         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_gist(
7067                 __isl_take isl_pw_qpolynomial *pwqp,
7068                 __isl_take isl_set *context);
7069         __isl_give isl_pw_qpolynomial_fold *
7070         isl_pw_qpolynomial_fold_gist(
7071                 __isl_take isl_pw_qpolynomial_fold *pwf,
7072                 __isl_take isl_set *context);
7073         __isl_give isl_pw_qpolynomial_fold *
7074         isl_pw_qpolynomial_fold_gist_params(
7075                 __isl_take isl_pw_qpolynomial_fold *pwf,
7076                 __isl_take isl_set *context);
7077         __isl_give isl_union_pw_qpolynomial *
7078         isl_union_pw_qpolynomial_gist_params(
7079                 __isl_take isl_union_pw_qpolynomial *upwqp,
7080                 __isl_take isl_set *context);
7081         __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_gist(
7082                 __isl_take isl_union_pw_qpolynomial *upwqp,
7083                 __isl_take isl_union_set *context);
7084         __isl_give isl_union_pw_qpolynomial_fold *
7085         isl_union_pw_qpolynomial_fold_gist(
7086                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
7087                 __isl_take isl_union_set *context);
7088         __isl_give isl_union_pw_qpolynomial_fold *
7089         isl_union_pw_qpolynomial_fold_gist_params(
7090                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
7091                 __isl_take isl_set *context);
7093 =item * Binary Arithmetic Operations
7095         #include <isl/set.h>
7096         __isl_give isl_set *isl_set_sum(
7097                 __isl_take isl_set *set1,
7098                 __isl_take isl_set *set2);
7099         #include <isl/map.h>
7100         __isl_give isl_map *isl_map_sum(
7101                 __isl_take isl_map *map1,
7102                 __isl_take isl_map *map2);
7104 C<isl_set_sum> computes the Minkowski sum of its two arguments,
7105 i.e., the set containing the sums of pairs of elements from
7106 C<set1> and C<set2>.
7107 The domain of the result of C<isl_map_sum> is the intersection
7108 of the domains of its two arguments.  The corresponding range
7109 elements are the sums of the corresponding range elements
7110 in the two arguments.
7112         #include <isl/val.h>
7113         __isl_give isl_multi_val *isl_multi_val_add(
7114                 __isl_take isl_multi_val *mv1,
7115                 __isl_take isl_multi_val *mv2);
7116         __isl_give isl_multi_val *isl_multi_val_sub(
7117                 __isl_take isl_multi_val *mv1,
7118                 __isl_take isl_multi_val *mv2);
7120         #include <isl/aff.h>
7121         __isl_give isl_aff *isl_aff_add(
7122                 __isl_take isl_aff *aff1,
7123                 __isl_take isl_aff *aff2);
7124         __isl_give isl_multi_aff *isl_multi_aff_add(
7125                 __isl_take isl_multi_aff *maff1,
7126                 __isl_take isl_multi_aff *maff2);
7127         __isl_give isl_pw_aff *isl_pw_aff_add(
7128                 __isl_take isl_pw_aff *pwaff1,
7129                 __isl_take isl_pw_aff *pwaff2);
7130         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_add(
7131                 __isl_take isl_multi_pw_aff *mpa1,
7132                 __isl_take isl_multi_pw_aff *mpa2);
7133         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_add(
7134                 __isl_take isl_pw_multi_aff *pma1,
7135                 __isl_take isl_pw_multi_aff *pma2);
7136         __isl_give isl_union_pw_aff *isl_union_pw_aff_add(
7137                 __isl_take isl_union_pw_aff *upa1,
7138                 __isl_take isl_union_pw_aff *upa2);
7139         __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_add(
7140                 __isl_take isl_union_pw_multi_aff *upma1,
7141                 __isl_take isl_union_pw_multi_aff *upma2);
7142         __isl_give isl_multi_union_pw_aff *
7143         isl_multi_union_pw_aff_add(
7144                 __isl_take isl_multi_union_pw_aff *mupa1,
7145                 __isl_take isl_multi_union_pw_aff *mupa2);
7146         __isl_give isl_pw_aff *isl_pw_aff_min(
7147                 __isl_take isl_pw_aff *pwaff1,
7148                 __isl_take isl_pw_aff *pwaff2);
7149         __isl_give isl_pw_aff *isl_pw_aff_max(
7150                 __isl_take isl_pw_aff *pwaff1,
7151                 __isl_take isl_pw_aff *pwaff2);
7152         __isl_give isl_aff *isl_aff_sub(
7153                 __isl_take isl_aff *aff1,
7154                 __isl_take isl_aff *aff2);
7155         __isl_give isl_multi_aff *isl_multi_aff_sub(
7156                 __isl_take isl_multi_aff *ma1,
7157                 __isl_take isl_multi_aff *ma2);
7158         __isl_give isl_pw_aff *isl_pw_aff_sub(
7159                 __isl_take isl_pw_aff *pwaff1,
7160                 __isl_take isl_pw_aff *pwaff2);
7161         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_sub(
7162                 __isl_take isl_multi_pw_aff *mpa1,
7163                 __isl_take isl_multi_pw_aff *mpa2);
7164         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_sub(
7165                 __isl_take isl_pw_multi_aff *pma1,
7166                 __isl_take isl_pw_multi_aff *pma2);
7167         __isl_give isl_union_pw_aff *isl_union_pw_aff_sub(
7168                 __isl_take isl_union_pw_aff *upa1,
7169                 __isl_take isl_union_pw_aff *upa2);
7170         __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_sub(
7171                 __isl_take isl_union_pw_multi_aff *upma1,
7172                 __isl_take isl_union_pw_multi_aff *upma2);
7173         __isl_give isl_multi_union_pw_aff *
7174         isl_multi_union_pw_aff_sub(
7175                 __isl_take isl_multi_union_pw_aff *mupa1,
7176                 __isl_take isl_multi_union_pw_aff *mupa2);
7178 C<isl_aff_sub> subtracts the second argument from the first.
7180         #include <isl/polynomial.h>
7181         __isl_give isl_qpolynomial *isl_qpolynomial_add(
7182                 __isl_take isl_qpolynomial *qp1,
7183                 __isl_take isl_qpolynomial *qp2);
7184         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add(
7185                 __isl_take isl_pw_qpolynomial *pwqp1,
7186                 __isl_take isl_pw_qpolynomial *pwqp2);
7187         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_disjoint(
7188                 __isl_take isl_pw_qpolynomial *pwqp1,
7189                 __isl_take isl_pw_qpolynomial *pwqp2);
7190         __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add(
7191                 __isl_take isl_pw_qpolynomial_fold *pwf1,
7192                 __isl_take isl_pw_qpolynomial_fold *pwf2);
7193         __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_add(
7194                 __isl_take isl_union_pw_qpolynomial *upwqp1,
7195                 __isl_take isl_union_pw_qpolynomial *upwqp2);
7196         __isl_give isl_qpolynomial *isl_qpolynomial_sub(
7197                 __isl_take isl_qpolynomial *qp1,
7198                 __isl_take isl_qpolynomial *qp2);
7199         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_sub(
7200                 __isl_take isl_pw_qpolynomial *pwqp1,
7201                 __isl_take isl_pw_qpolynomial *pwqp2);
7202         __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_sub(
7203                 __isl_take isl_union_pw_qpolynomial *upwqp1,
7204                 __isl_take isl_union_pw_qpolynomial *upwqp2);
7205         __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_fold(
7206                 __isl_take isl_pw_qpolynomial_fold *pwf1,
7207                 __isl_take isl_pw_qpolynomial_fold *pwf2);
7208         __isl_give isl_union_pw_qpolynomial_fold *
7209         isl_union_pw_qpolynomial_fold_fold(
7210                 __isl_take isl_union_pw_qpolynomial_fold *upwf1,
7211                 __isl_take isl_union_pw_qpolynomial_fold *upwf2);
7213         #include <isl/aff.h>
7214         __isl_give isl_pw_aff *isl_pw_aff_union_add(
7215                 __isl_take isl_pw_aff *pwaff1,
7216                 __isl_take isl_pw_aff *pwaff2);
7217         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_add(
7218                 __isl_take isl_pw_multi_aff *pma1,
7219                 __isl_take isl_pw_multi_aff *pma2);
7220         __isl_give isl_union_pw_aff *isl_union_pw_aff_union_add(
7221                 __isl_take isl_union_pw_aff *upa1,
7222                 __isl_take isl_union_pw_aff *upa2);
7223         __isl_give isl_union_pw_multi_aff *
7224         isl_union_pw_multi_aff_union_add(
7225                 __isl_take isl_union_pw_multi_aff *upma1,
7226                 __isl_take isl_union_pw_multi_aff *upma2);
7227         __isl_give isl_multi_union_pw_aff *
7228         isl_multi_union_pw_aff_union_add(
7229                 __isl_take isl_multi_union_pw_aff *mupa1,
7230                 __isl_take isl_multi_union_pw_aff *mupa2);
7231         __isl_give isl_pw_aff *isl_pw_aff_union_min(
7232                 __isl_take isl_pw_aff *pwaff1,
7233                 __isl_take isl_pw_aff *pwaff2);
7234         __isl_give isl_pw_aff *isl_pw_aff_union_max(
7235                 __isl_take isl_pw_aff *pwaff1,
7236                 __isl_take isl_pw_aff *pwaff2);
7238 The function C<isl_pw_aff_union_max> computes a piecewise quasi-affine
7239 expression with a domain that is the union of those of C<pwaff1> and
7240 C<pwaff2> and such that on each cell, the quasi-affine expression is
7241 the maximum of those of C<pwaff1> and C<pwaff2>.  If only one of
7242 C<pwaff1> or C<pwaff2> is defined on a given cell, then the
7243 associated expression is the defined one.
7244 This in contrast to the C<isl_pw_aff_max> function, which is
7245 only defined on the shared definition domain of the arguments.
7247         #include <isl/val.h>
7248         __isl_give isl_multi_val *isl_multi_val_add_val(
7249                 __isl_take isl_multi_val *mv,
7250                 __isl_take isl_val *v);
7251         __isl_give isl_multi_val *isl_multi_val_mod_val(
7252                 __isl_take isl_multi_val *mv,
7253                 __isl_take isl_val *v);
7254         __isl_give isl_multi_val *isl_multi_val_scale_val(
7255                 __isl_take isl_multi_val *mv,
7256                 __isl_take isl_val *v);
7257         __isl_give isl_multi_val *isl_multi_val_scale_down_val(
7258                 __isl_take isl_multi_val *mv,
7259                 __isl_take isl_val *v);
7261         #include <isl/aff.h>
7262         __isl_give isl_aff *isl_aff_mod_val(__isl_take isl_aff *aff,
7263                 __isl_take isl_val *mod);
7264         __isl_give isl_pw_aff *isl_pw_aff_mod_val(
7265                 __isl_take isl_pw_aff *pa,
7266                 __isl_take isl_val *mod);
7267         __isl_give isl_union_pw_aff *isl_union_pw_aff_mod_val(
7268                 __isl_take isl_union_pw_aff *upa,
7269                 __isl_take isl_val *f);
7270         __isl_give isl_aff *isl_aff_scale_val(__isl_take isl_aff *aff,
7271                 __isl_take isl_val *v);
7272         __isl_give isl_multi_aff *isl_multi_aff_scale_val(
7273                 __isl_take isl_multi_aff *ma,
7274                 __isl_take isl_val *v);
7275         __isl_give isl_pw_aff *isl_pw_aff_scale_val(
7276                 __isl_take isl_pw_aff *pa, __isl_take isl_val *v);
7277         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_scale_val(
7278                 __isl_take isl_multi_pw_aff *mpa,
7279                 __isl_take isl_val *v);
7280         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_val(
7281                 __isl_take isl_pw_multi_aff *pma,
7282                 __isl_take isl_val *v);
7283         __isl_give isl_union_pw_multi_aff *
7284         __isl_give isl_union_pw_aff *isl_union_pw_aff_scale_val(
7285                 __isl_take isl_union_pw_aff *upa,
7286                 __isl_take isl_val *f);
7287         isl_union_pw_multi_aff_scale_val(
7288                 __isl_take isl_union_pw_multi_aff *upma,
7289                 __isl_take isl_val *val);
7290         __isl_give isl_multi_union_pw_aff *
7291         isl_multi_union_pw_aff_scale_val(
7292                 __isl_take isl_multi_union_pw_aff *mupa,
7293                 __isl_take isl_val *v);
7294         __isl_give isl_aff *isl_aff_scale_down_ui(
7295                 __isl_take isl_aff *aff, unsigned f);
7296         __isl_give isl_aff *isl_aff_scale_down_val(
7297                 __isl_take isl_aff *aff, __isl_take isl_val *v);
7298         __isl_give isl_multi_aff *isl_multi_aff_scale_down_val(
7299                 __isl_take isl_multi_aff *ma,
7300                 __isl_take isl_val *v);
7301         __isl_give isl_pw_aff *isl_pw_aff_scale_down_val(
7302                 __isl_take isl_pw_aff *pa,
7303                 __isl_take isl_val *f);
7304         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_scale_down_val(
7305                 __isl_take isl_multi_pw_aff *mpa,
7306                 __isl_take isl_val *v);
7307         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_down_val(
7308                 __isl_take isl_pw_multi_aff *pma,
7309                 __isl_take isl_val *v);
7310         __isl_give isl_union_pw_aff *isl_union_pw_aff_scale_down_val(
7311                 __isl_take isl_union_pw_aff *upa,
7312                 __isl_take isl_val *v);
7313         __isl_give isl_union_pw_multi_aff *
7314         isl_union_pw_multi_aff_scale_down_val(
7315                 __isl_take isl_union_pw_multi_aff *upma,
7316                 __isl_take isl_val *val);
7317         __isl_give isl_multi_union_pw_aff *
7318         isl_multi_union_pw_aff_scale_down_val(
7319                 __isl_take isl_multi_union_pw_aff *mupa,
7320                 __isl_take isl_val *v);
7322         #include <isl/polynomial.h>
7323         __isl_give isl_qpolynomial *isl_qpolynomial_scale_val(
7324                 __isl_take isl_qpolynomial *qp,
7325                 __isl_take isl_val *v);
7326         __isl_give isl_qpolynomial_fold *
7327         isl_qpolynomial_fold_scale_val(
7328                 __isl_take isl_qpolynomial_fold *fold,
7329                 __isl_take isl_val *v);
7330         __isl_give isl_pw_qpolynomial *
7331         isl_pw_qpolynomial_scale_val(
7332                 __isl_take isl_pw_qpolynomial *pwqp,
7333                 __isl_take isl_val *v);
7334         __isl_give isl_pw_qpolynomial_fold *
7335         isl_pw_qpolynomial_fold_scale_val(
7336                 __isl_take isl_pw_qpolynomial_fold *pwf,
7337                 __isl_take isl_val *v);
7338         __isl_give isl_union_pw_qpolynomial *
7339         isl_union_pw_qpolynomial_scale_val(
7340                 __isl_take isl_union_pw_qpolynomial *upwqp,
7341                 __isl_take isl_val *v);
7342         __isl_give isl_union_pw_qpolynomial_fold *
7343         isl_union_pw_qpolynomial_fold_scale_val(
7344                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
7345                 __isl_take isl_val *v);
7346         __isl_give isl_qpolynomial *
7347         isl_qpolynomial_scale_down_val(
7348                 __isl_take isl_qpolynomial *qp,
7349                 __isl_take isl_val *v);
7350         __isl_give isl_qpolynomial_fold *
7351         isl_qpolynomial_fold_scale_down_val(
7352                 __isl_take isl_qpolynomial_fold *fold,
7353                 __isl_take isl_val *v);
7354         __isl_give isl_pw_qpolynomial *
7355         isl_pw_qpolynomial_scale_down_val(
7356                 __isl_take isl_pw_qpolynomial *pwqp,
7357                 __isl_take isl_val *v);
7358         __isl_give isl_pw_qpolynomial_fold *
7359         isl_pw_qpolynomial_fold_scale_down_val(
7360                 __isl_take isl_pw_qpolynomial_fold *pwf,
7361                 __isl_take isl_val *v);
7362         __isl_give isl_union_pw_qpolynomial *
7363         isl_union_pw_qpolynomial_scale_down_val(
7364                 __isl_take isl_union_pw_qpolynomial *upwqp,
7365                 __isl_take isl_val *v);
7366         __isl_give isl_union_pw_qpolynomial_fold *
7367         isl_union_pw_qpolynomial_fold_scale_down_val(
7368                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
7369                 __isl_take isl_val *v);
7371         #include <isl/val.h>
7372         __isl_give isl_multi_val *isl_multi_val_mod_multi_val(
7373                 __isl_take isl_multi_val *mv1,
7374                 __isl_take isl_multi_val *mv2);
7375         __isl_give isl_multi_val *isl_multi_val_scale_multi_val(
7376                 __isl_take isl_multi_val *mv1,
7377                 __isl_take isl_multi_val *mv2);
7378         __isl_give isl_multi_val *
7379         isl_multi_val_scale_down_multi_val(
7380                 __isl_take isl_multi_val *mv1,
7381                 __isl_take isl_multi_val *mv2);
7383         #include <isl/aff.h>
7384         __isl_give isl_multi_aff *isl_multi_aff_mod_multi_val(
7385                 __isl_take isl_multi_aff *ma,
7386                 __isl_take isl_multi_val *mv);
7387         __isl_give isl_multi_union_pw_aff *
7388         isl_multi_union_pw_aff_mod_multi_val(
7389                 __isl_take isl_multi_union_pw_aff *upma,
7390                 __isl_take isl_multi_val *mv);
7391         __isl_give isl_multi_pw_aff *
7392         isl_multi_pw_aff_mod_multi_val(
7393                 __isl_take isl_multi_pw_aff *mpa,
7394                 __isl_take isl_multi_val *mv);
7395         __isl_give isl_multi_aff *isl_multi_aff_scale_multi_val(
7396                 __isl_take isl_multi_aff *ma,
7397                 __isl_take isl_multi_val *mv);
7398         __isl_give isl_pw_multi_aff *
7399         isl_pw_multi_aff_scale_multi_val(
7400                 __isl_take isl_pw_multi_aff *pma,
7401                 __isl_take isl_multi_val *mv);
7402         __isl_give isl_multi_pw_aff *
7403         isl_multi_pw_aff_scale_multi_val(
7404                 __isl_take isl_multi_pw_aff *mpa,
7405                 __isl_take isl_multi_val *mv);
7406         __isl_give isl_multi_union_pw_aff *
7407         isl_multi_union_pw_aff_scale_multi_val(
7408                 __isl_take isl_multi_union_pw_aff *mupa,
7409                 __isl_take isl_multi_val *mv);
7410         __isl_give isl_union_pw_multi_aff *
7411         isl_union_pw_multi_aff_scale_multi_val(
7412                 __isl_take isl_union_pw_multi_aff *upma,
7413                 __isl_take isl_multi_val *mv);
7414         __isl_give isl_multi_aff *
7415         isl_multi_aff_scale_down_multi_val(
7416                 __isl_take isl_multi_aff *ma,
7417                 __isl_take isl_multi_val *mv);
7418         __isl_give isl_multi_pw_aff *
7419         isl_multi_pw_aff_scale_down_multi_val(
7420                 __isl_take isl_multi_pw_aff *mpa,
7421                 __isl_take isl_multi_val *mv);
7422         __isl_give isl_multi_union_pw_aff *
7423         isl_multi_union_pw_aff_scale_down_multi_val(
7424                 __isl_take isl_multi_union_pw_aff *mupa,
7425                 __isl_take isl_multi_val *mv);
7427 C<isl_multi_aff_scale_multi_val> scales the elements of C<ma>
7428 by the corresponding elements of C<mv>.
7430         #include <isl/aff.h>
7431         __isl_give isl_aff *isl_aff_mul(
7432                 __isl_take isl_aff *aff1,
7433                 __isl_take isl_aff *aff2);
7434         __isl_give isl_aff *isl_aff_div(
7435                 __isl_take isl_aff *aff1,
7436                 __isl_take isl_aff *aff2);
7437         __isl_give isl_pw_aff *isl_pw_aff_mul(
7438                 __isl_take isl_pw_aff *pwaff1,
7439                 __isl_take isl_pw_aff *pwaff2);
7440         __isl_give isl_pw_aff *isl_pw_aff_div(
7441                 __isl_take isl_pw_aff *pa1,
7442                 __isl_take isl_pw_aff *pa2);
7443         __isl_give isl_pw_aff *isl_pw_aff_tdiv_q(
7444                 __isl_take isl_pw_aff *pa1,
7445                 __isl_take isl_pw_aff *pa2);
7446         __isl_give isl_pw_aff *isl_pw_aff_tdiv_r(
7447                 __isl_take isl_pw_aff *pa1,
7448                 __isl_take isl_pw_aff *pa2);
7450 When multiplying two affine expressions, at least one of the two needs
7451 to be a constant.  Similarly, when dividing an affine expression by another,
7452 the second expression needs to be a constant.
7453 C<isl_pw_aff_tdiv_q> computes the quotient of an integer division with
7454 rounding towards zero.  C<isl_pw_aff_tdiv_r> computes the corresponding
7455 remainder.
7457         #include <isl/polynomial.h>
7458         __isl_give isl_qpolynomial *isl_qpolynomial_mul(
7459                 __isl_take isl_qpolynomial *qp1,
7460                 __isl_take isl_qpolynomial *qp2);
7461         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul(
7462                 __isl_take isl_pw_qpolynomial *pwqp1,
7463                 __isl_take isl_pw_qpolynomial *pwqp2);
7464         __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_mul(
7465                 __isl_take isl_union_pw_qpolynomial *upwqp1,
7466                 __isl_take isl_union_pw_qpolynomial *upwqp2);
7468 =back
7470 =head3 Lexicographic Optimization
7472 Given a (basic) set C<set> (or C<bset>) and a zero-dimensional domain C<dom>,
7473 the following functions
7474 compute a set that contains the lexicographic minimum or maximum
7475 of the elements in C<set> (or C<bset>) for those values of the parameters
7476 that satisfy C<dom>.
7477 If C<empty> is not C<NULL>, then C<*empty> is assigned a set
7478 that contains the parameter values in C<dom> for which C<set> (or C<bset>)
7479 has no elements.
7480 In other words, the union of the parameter values
7481 for which the result is non-empty and of C<*empty>
7482 is equal to C<dom>.
7484         #include <isl/set.h>
7485         __isl_give isl_set *isl_basic_set_partial_lexmin(
7486                 __isl_take isl_basic_set *bset,
7487                 __isl_take isl_basic_set *dom,
7488                 __isl_give isl_set **empty);
7489         __isl_give isl_set *isl_basic_set_partial_lexmax(
7490                 __isl_take isl_basic_set *bset,
7491                 __isl_take isl_basic_set *dom,
7492                 __isl_give isl_set **empty);
7493         __isl_give isl_set *isl_set_partial_lexmin(
7494                 __isl_take isl_set *set, __isl_take isl_set *dom,
7495                 __isl_give isl_set **empty);
7496         __isl_give isl_set *isl_set_partial_lexmax(
7497                 __isl_take isl_set *set, __isl_take isl_set *dom,
7498                 __isl_give isl_set **empty);
7500 Given a (basic) set C<set> (or C<bset>), the following functions simply
7501 return a set containing the lexicographic minimum or maximum
7502 of the elements in C<set> (or C<bset>).
7503 In case of union sets, the optimum is computed per space.
7505         #include <isl/set.h>
7506         __isl_give isl_set *isl_basic_set_lexmin(
7507                 __isl_take isl_basic_set *bset);
7508         __isl_give isl_set *isl_basic_set_lexmax(
7509                 __isl_take isl_basic_set *bset);
7510         __isl_give isl_set *isl_set_lexmin(
7511                 __isl_take isl_set *set);
7512         __isl_give isl_set *isl_set_lexmax(
7513                 __isl_take isl_set *set);
7514         __isl_give isl_union_set *isl_union_set_lexmin(
7515                 __isl_take isl_union_set *uset);
7516         __isl_give isl_union_set *isl_union_set_lexmax(
7517                 __isl_take isl_union_set *uset);
7519 Given a (basic) relation C<map> (or C<bmap>) and a domain C<dom>,
7520 the following functions
7521 compute a relation that maps each element of C<dom>
7522 to the single lexicographic minimum or maximum
7523 of the elements that are associated to that same
7524 element in C<map> (or C<bmap>).
7525 If C<empty> is not C<NULL>, then C<*empty> is assigned a set
7526 that contains the elements in C<dom> that do not map
7527 to any elements in C<map> (or C<bmap>).
7528 In other words, the union of the domain of the result and of C<*empty>
7529 is equal to C<dom>.
7531         #include <isl/map.h>
7532         __isl_give isl_map *isl_basic_map_partial_lexmax(
7533                 __isl_take isl_basic_map *bmap,
7534                 __isl_take isl_basic_set *dom,
7535                 __isl_give isl_set **empty);
7536         __isl_give isl_map *isl_basic_map_partial_lexmin(
7537                 __isl_take isl_basic_map *bmap,
7538                 __isl_take isl_basic_set *dom,
7539                 __isl_give isl_set **empty);
7540         __isl_give isl_map *isl_map_partial_lexmax(
7541                 __isl_take isl_map *map, __isl_take isl_set *dom,
7542                 __isl_give isl_set **empty);
7543         __isl_give isl_map *isl_map_partial_lexmin(
7544                 __isl_take isl_map *map, __isl_take isl_set *dom,
7545                 __isl_give isl_set **empty);
7547 Given a (basic) map C<map> (or C<bmap>), the following functions simply
7548 return a map mapping each element in the domain of
7549 C<map> (or C<bmap>) to the lexicographic minimum or maximum
7550 of all elements associated to that element.
7551 In case of union relations, the optimum is computed per space.
7553         #include <isl/map.h>
7554         __isl_give isl_map *isl_basic_map_lexmin(
7555                 __isl_take isl_basic_map *bmap);
7556         __isl_give isl_map *isl_basic_map_lexmax(
7557                 __isl_take isl_basic_map *bmap);
7558         __isl_give isl_map *isl_map_lexmin(
7559                 __isl_take isl_map *map);
7560         __isl_give isl_map *isl_map_lexmax(
7561                 __isl_take isl_map *map);
7562         __isl_give isl_union_map *isl_union_map_lexmin(
7563                 __isl_take isl_union_map *umap);
7564         __isl_give isl_union_map *isl_union_map_lexmax(
7565                 __isl_take isl_union_map *umap);
7567 The following functions return their result in the form of
7568 a piecewise multi-affine expression,
7569 but are otherwise equivalent to the corresponding functions
7570 returning a basic set or relation.
7572         #include <isl/set.h>
7573         __isl_give isl_pw_multi_aff *
7574         isl_basic_set_partial_lexmin_pw_multi_aff(
7575                 __isl_take isl_basic_set *bset,
7576                 __isl_take isl_basic_set *dom,
7577                 __isl_give isl_set **empty);
7578         __isl_give isl_pw_multi_aff *
7579         isl_basic_set_partial_lexmax_pw_multi_aff(
7580                 __isl_take isl_basic_set *bset,
7581                 __isl_take isl_basic_set *dom,
7582                 __isl_give isl_set **empty);
7583         __isl_give isl_pw_multi_aff *isl_set_lexmin_pw_multi_aff(
7584                 __isl_take isl_set *set);
7585         __isl_give isl_pw_multi_aff *isl_set_lexmax_pw_multi_aff(
7586                 __isl_take isl_set *set);
7588         #include <isl/map.h>
7589         __isl_give isl_pw_multi_aff *
7590         isl_basic_map_lexmin_pw_multi_aff(
7591                 __isl_take isl_basic_map *bmap);
7592         __isl_give isl_pw_multi_aff *
7593         isl_basic_map_partial_lexmin_pw_multi_aff(
7594                 __isl_take isl_basic_map *bmap,
7595                 __isl_take isl_basic_set *dom,
7596                 __isl_give isl_set **empty);
7597         __isl_give isl_pw_multi_aff *
7598         isl_basic_map_partial_lexmax_pw_multi_aff(
7599                 __isl_take isl_basic_map *bmap,
7600                 __isl_take isl_basic_set *dom,
7601                 __isl_give isl_set **empty);
7602         __isl_give isl_pw_multi_aff *isl_map_lexmin_pw_multi_aff(
7603                 __isl_take isl_map *map);
7604         __isl_give isl_pw_multi_aff *isl_map_lexmax_pw_multi_aff(
7605                 __isl_take isl_map *map);
7607 The following functions return the lexicographic minimum or maximum
7608 on the shared domain of the inputs and the single defined function
7609 on those parts of the domain where only a single function is defined.
7611         #include <isl/aff.h>
7612         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_lexmin(
7613                 __isl_take isl_pw_multi_aff *pma1,
7614                 __isl_take isl_pw_multi_aff *pma2);
7615         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_lexmax(
7616                 __isl_take isl_pw_multi_aff *pma1,
7617                 __isl_take isl_pw_multi_aff *pma2);
7619 If the input to a lexicographic optimization problem has
7620 multiple constraints with the same coefficients for the optimized
7621 variables, then, by default, this symmetry is exploited by
7622 replacing those constraints by a single constraint with
7623 an abstract bound, which is in turn bounded by the corresponding terms
7624 in the original constraints.
7625 Without this optimization, the solver would typically consider
7626 all possible orderings of those original bounds, resulting in a needless
7627 decomposition of the domain.
7628 However, the optimization can also result in slowdowns since
7629 an extra parameter is introduced that may get used in additional
7630 integer divisions.
7631 The following option determines whether symmetry detection is applied
7632 during lexicographic optimization.
7634         #include <isl/options.h>
7635         isl_stat isl_options_set_pip_symmetry(isl_ctx *ctx,
7636                 int val);
7637         int isl_options_get_pip_symmetry(isl_ctx *ctx);
7639 =begin latex
7641 See also \autoref{s:offline}.
7643 =end latex
7645 =head2 Ternary Operations
7647         #include <isl/aff.h>
7648         __isl_give isl_pw_aff *isl_pw_aff_cond(
7649                 __isl_take isl_pw_aff *cond,
7650                 __isl_take isl_pw_aff *pwaff_true,
7651                 __isl_take isl_pw_aff *pwaff_false);
7653 The function C<isl_pw_aff_cond> performs a conditional operator
7654 and returns an expression that is equal to C<pwaff_true>
7655 for elements where C<cond> is non-zero and equal to C<pwaff_false> for elements
7656 where C<cond> is zero.
7658 =head2 Lists
7660 Lists are defined over several element types, including
7661 C<isl_val>, C<isl_id>, C<isl_aff>, C<isl_pw_aff>, C<isl_union_pw_aff>,
7662 C<isl_union_pw_multi_aff>, C<isl_constraint>,
7663 C<isl_basic_set>, C<isl_set>, C<isl_basic_map>, C<isl_map>, C<isl_union_set>,
7664 C<isl_union_map>, C<isl_ast_expr> and C<isl_ast_node>.
7665 Here we take lists of C<isl_set>s as an example.
7666 Lists can be created, copied, modified and freed using the following functions.
7668         #include <isl/set.h>
7669         __isl_give isl_set_list *isl_set_list_from_set(
7670                 __isl_take isl_set *el);
7671         __isl_give isl_set_list *isl_set_list_alloc(
7672                 isl_ctx *ctx, int n);
7673         __isl_give isl_set_list *isl_set_list_copy(
7674                 __isl_keep isl_set_list *list);
7675         __isl_give isl_set_list *isl_set_list_insert(
7676                 __isl_take isl_set_list *list, unsigned pos,
7677                 __isl_take isl_set *el);
7678         __isl_give isl_set_list *isl_set_list_add(
7679                 __isl_take isl_set_list *list,
7680                 __isl_take isl_set *el);
7681         __isl_give isl_set_list *isl_set_list_drop(
7682                 __isl_take isl_set_list *list,
7683                 unsigned first, unsigned n);
7684         __isl_give isl_set_list *isl_set_list_set_set(
7685                 __isl_take isl_set_list *list, int index,
7686                 __isl_take isl_set *set);
7687         __isl_give isl_set_list *isl_set_list_concat(
7688                 __isl_take isl_set_list *list1,
7689                 __isl_take isl_set_list *list2);
7690         __isl_give isl_set_list *isl_set_list_map(
7691                 __isl_take isl_set_list *list,
7692                 __isl_give isl_set *(*fn)(__isl_take isl_set *el,
7693                         void *user),
7694                 void *user);
7695         __isl_give isl_set_list *isl_set_list_sort(
7696                 __isl_take isl_set_list *list,
7697                 int (*cmp)(__isl_keep isl_set *a,
7698                         __isl_keep isl_set *b, void *user),
7699                 void *user);
7700         __isl_null isl_set_list *isl_set_list_free(
7701                 __isl_take isl_set_list *list);
7703 C<isl_set_list_alloc> creates an empty list with an initial capacity
7704 for C<n> elements.  C<isl_set_list_insert> and C<isl_set_list_add>
7705 add elements to a list, increasing its capacity as needed.
7706 C<isl_set_list_from_set> creates a list with a single element.
7708 Lists can be inspected using the following functions.
7710         #include <isl/set.h>
7711         int isl_set_list_n_set(__isl_keep isl_set_list *list);
7712         __isl_give isl_set *isl_set_list_get_set(
7713                 __isl_keep isl_set_list *list, int index);
7714         isl_stat isl_set_list_foreach(__isl_keep isl_set_list *list,
7715                 isl_stat (*fn)(__isl_take isl_set *el, void *user),
7716                 void *user);
7717         isl_stat isl_set_list_foreach_scc(
7718                 __isl_keep isl_set_list *list,
7719                 isl_bool (*follows)(__isl_keep isl_set *a,
7720                         __isl_keep isl_set *b, void *user),
7721                 void *follows_user,
7722                 isl_stat (*fn)(__isl_take isl_set *el, void *user),
7723                 void *fn_user);
7725 The function C<isl_set_list_foreach_scc> calls C<fn> on each of the
7726 strongly connected components of the graph with as vertices the elements
7727 of C<list> and a directed edge from vertex C<b> to vertex C<a>
7728 iff C<follows(a, b)> returns C<isl_bool_true>.  The callbacks C<follows> and
7729 C<fn> should return C<isl_bool_error> or C<isl_stat_error> on error.
7731 Lists can be printed using
7733         #include <isl/set.h>
7734         __isl_give isl_printer *isl_printer_print_set_list(
7735                 __isl_take isl_printer *p,
7736                 __isl_keep isl_set_list *list);
7738 =head2 Associative arrays
7740 Associative arrays map isl objects of a specific type to isl objects
7741 of some (other) specific type.  They are defined for several pairs
7742 of types, including (C<isl_map>, C<isl_basic_set>),
7743 (C<isl_id>, C<isl_ast_expr>),
7744 (C<isl_id>, C<isl_id>) and
7745 (C<isl_id>, C<isl_pw_aff>).
7746 Here, we take associative arrays that map C<isl_id>s to C<isl_ast_expr>s
7747 as an example.
7749 Associative arrays can be created, copied and freed using
7750 the following functions.
7752         #include <isl/id_to_ast_expr.h>
7753         __isl_give isl_id_to_ast_expr *isl_id_to_ast_expr_alloc(
7754                 isl_ctx *ctx, int min_size);
7755         __isl_give isl_id_to_ast_expr *isl_id_to_ast_expr_copy(
7756                 __isl_keep isl_id_to_ast_expr *id2expr);
7757         __isl_null isl_id_to_ast_expr *isl_id_to_ast_expr_free(
7758                 __isl_take isl_id_to_ast_expr *id2expr);
7760 The C<min_size> argument to C<isl_id_to_ast_expr_alloc> can be used
7761 to specify the expected size of the associative array.
7762 The associative array will be grown automatically as needed.
7764 Associative arrays can be inspected using the following functions.
7766         #include <isl/id_to_ast_expr.h>
7767         __isl_give isl_maybe_isl_ast_expr
7768         isl_id_to_ast_expr_try_get(
7769                 __isl_keep isl_id_to_ast_expr *id2expr,
7770                 __isl_keep isl_id *key);
7771         isl_bool isl_id_to_ast_expr_has(
7772                 __isl_keep isl_id_to_ast_expr *id2expr,
7773                 __isl_keep isl_id *key);
7774         __isl_give isl_ast_expr *isl_id_to_ast_expr_get(
7775                 __isl_keep isl_id_to_ast_expr *id2expr,
7776                 __isl_take isl_id *key);
7777         isl_stat isl_id_to_ast_expr_foreach(
7778                 __isl_keep isl_id_to_ast_expr *id2expr,
7779                 isl_stat (*fn)(__isl_take isl_id *key,
7780                         __isl_take isl_ast_expr *val, void *user),
7781                 void *user);
7783 The function C<isl_id_to_ast_expr_try_get> returns a structure
7784 containing two elements, C<valid> and C<value>.
7785 If there is a value associated to the key, then C<valid>
7786 is set to C<isl_bool_true> and C<value> contains a copy of
7787 the associated value.  Otherwise C<value> is C<NULL> and
7788 C<valid> may be C<isl_bool_error> or C<isl_bool_false> depending
7789 on whether some error has occurred or there simply is no associated value.
7790 The function C<isl_id_to_ast_expr_has> returns the C<valid> field
7791 in the structure and
7792 the function C<isl_id_to_ast_expr_get> returns the C<value> field.
7794 Associative arrays can be modified using the following functions.
7796         #include <isl/id_to_ast_expr.h>
7797         __isl_give isl_id_to_ast_expr *isl_id_to_ast_expr_set(
7798                 __isl_take isl_id_to_ast_expr *id2expr,
7799                 __isl_take isl_id *key,
7800                 __isl_take isl_ast_expr *val);
7801         __isl_give isl_id_to_ast_expr *isl_id_to_ast_expr_drop(
7802                 __isl_take isl_id_to_ast_expr *id2expr,
7803                 __isl_take isl_id *key);
7805 Associative arrays can be printed using the following function.
7807         #include <isl/id_to_ast_expr.h>
7808         __isl_give isl_printer *isl_printer_print_id_to_ast_expr(
7809                 __isl_take isl_printer *p,
7810                 __isl_keep isl_id_to_ast_expr *id2expr);
7812 =head2 Vectors
7814 Vectors can be created, copied and freed using the following functions.
7816         #include <isl/vec.h>
7817         __isl_give isl_vec *isl_vec_alloc(isl_ctx *ctx,
7818                 unsigned size);
7819         __isl_give isl_vec *isl_vec_zero(isl_ctx *ctx,
7820                 unsigned size);
7821         __isl_give isl_vec *isl_vec_copy(__isl_keep isl_vec *vec);
7822         __isl_null isl_vec *isl_vec_free(__isl_take isl_vec *vec);
7824 Note that the elements of a vector created by C<isl_vec_alloc>
7825 may have arbitrary values.
7826 A vector created by C<isl_vec_zero> has elements with value zero.
7827 The elements can be changed and inspected using the following functions.
7829         int isl_vec_size(__isl_keep isl_vec *vec);
7830         __isl_give isl_val *isl_vec_get_element_val(
7831                 __isl_keep isl_vec *vec, int pos);
7832         __isl_give isl_vec *isl_vec_set_element_si(
7833                 __isl_take isl_vec *vec, int pos, int v);
7834         __isl_give isl_vec *isl_vec_set_element_val(
7835                 __isl_take isl_vec *vec, int pos,
7836                 __isl_take isl_val *v);
7837         __isl_give isl_vec *isl_vec_set_si(__isl_take isl_vec *vec,
7838                 int v);
7839         __isl_give isl_vec *isl_vec_set_val(
7840                 __isl_take isl_vec *vec, __isl_take isl_val *v);
7841         int isl_vec_cmp_element(__isl_keep isl_vec *vec1,
7842                 __isl_keep isl_vec *vec2, int pos);
7844 C<isl_vec_get_element> will return a negative value if anything went wrong.
7845 In that case, the value of C<*v> is undefined.
7847 The following function can be used to concatenate two vectors.
7849         __isl_give isl_vec *isl_vec_concat(__isl_take isl_vec *vec1,
7850                 __isl_take isl_vec *vec2);
7852 =head2 Matrices
7854 Matrices can be created, copied and freed using the following functions.
7856         #include <isl/mat.h>
7857         __isl_give isl_mat *isl_mat_alloc(isl_ctx *ctx,
7858                 unsigned n_row, unsigned n_col);
7859         __isl_give isl_mat *isl_mat_copy(__isl_keep isl_mat *mat);
7860         __isl_null isl_mat *isl_mat_free(__isl_take isl_mat *mat);
7862 Note that the elements of a newly created matrix may have arbitrary values.
7863 The elements can be changed and inspected using the following functions.
7865         int isl_mat_rows(__isl_keep isl_mat *mat);
7866         int isl_mat_cols(__isl_keep isl_mat *mat);
7867         __isl_give isl_val *isl_mat_get_element_val(
7868                 __isl_keep isl_mat *mat, int row, int col);
7869         __isl_give isl_mat *isl_mat_set_element_si(__isl_take isl_mat *mat,
7870                 int row, int col, int v);
7871         __isl_give isl_mat *isl_mat_set_element_val(
7872                 __isl_take isl_mat *mat, int row, int col,
7873                 __isl_take isl_val *v);
7875 The following function computes the rank of a matrix.
7876 The return value may be -1 if some error occurred.
7878         #include <isl/mat.h>
7879         int isl_mat_rank(__isl_keep isl_mat *mat);
7881 The following function can be used to compute the (right) inverse
7882 of a matrix, i.e., a matrix such that the product of the original
7883 and the inverse (in that order) is a multiple of the identity matrix.
7884 The input matrix is assumed to be of full row-rank.
7886         __isl_give isl_mat *isl_mat_right_inverse(__isl_take isl_mat *mat);
7888 The following function can be used to compute the (right) kernel
7889 (or null space) of a matrix, i.e., a matrix such that the product of
7890 the original and the kernel (in that order) is the zero matrix.
7892         __isl_give isl_mat *isl_mat_right_kernel(__isl_take isl_mat *mat);
7894 The following function computes a basis for the space spanned
7895 by the rows of a matrix.
7897         __isl_give isl_mat *isl_mat_row_basis(
7898                 __isl_take isl_mat *mat);
7900 The following function computes rows that extend a basis of C<mat1>
7901 to a basis that also covers C<mat2>.
7903         __isl_give isl_mat *isl_mat_row_basis_extension(
7904                 __isl_take isl_mat *mat1,
7905                 __isl_take isl_mat *mat2);
7907 The following function checks whether there is no linear dependence
7908 among the combined rows of "mat1" and "mat2" that is not already present
7909 in "mat1" or "mat2" individually.
7910 If "mat1" and "mat2" have linearly independent rows by themselves,
7911 then this means that there is no linear dependence among all rows together.
7913         isl_bool isl_mat_has_linearly_independent_rows(
7914                 __isl_keep isl_mat *mat1,
7915                 __isl_keep isl_mat *mat2);
7917 =head2 Bounds on Piecewise Quasipolynomials and Piecewise Quasipolynomial Reductions
7919 The following functions determine
7920 an upper or lower bound on a quasipolynomial over its domain.
7922         __isl_give isl_pw_qpolynomial_fold *
7923         isl_pw_qpolynomial_bound(
7924                 __isl_take isl_pw_qpolynomial *pwqp,
7925                 enum isl_fold type, int *tight);
7927         __isl_give isl_union_pw_qpolynomial_fold *
7928         isl_union_pw_qpolynomial_bound(
7929                 __isl_take isl_union_pw_qpolynomial *upwqp,
7930                 enum isl_fold type, int *tight);
7932 The C<type> argument may be either C<isl_fold_min> or C<isl_fold_max>.
7933 If C<tight> is not C<NULL>, then C<*tight> is set to C<1>
7934 is the returned bound is known be tight, i.e., for each value
7935 of the parameters there is at least
7936 one element in the domain that reaches the bound.
7937 If the domain of C<pwqp> is not wrapping, then the bound is computed
7938 over all elements in that domain and the result has a purely parametric
7939 domain.  If the domain of C<pwqp> is wrapping, then the bound is
7940 computed over the range of the wrapped relation.  The domain of the
7941 wrapped relation becomes the domain of the result.
7943 =head2 Parametric Vertex Enumeration
7945 The parametric vertex enumeration described in this section
7946 is mainly intended to be used internally and by the C<barvinok>
7947 library.
7949         #include <isl/vertices.h>
7950         __isl_give isl_vertices *isl_basic_set_compute_vertices(
7951                 __isl_keep isl_basic_set *bset);
7953 The function C<isl_basic_set_compute_vertices> performs the
7954 actual computation of the parametric vertices and the chamber
7955 decomposition and stores the result in an C<isl_vertices> object.
7956 This information can be queried by either iterating over all
7957 the vertices or iterating over all the chambers or cells
7958 and then iterating over all vertices that are active on the chamber.
7960         isl_stat isl_vertices_foreach_vertex(
7961                 __isl_keep isl_vertices *vertices,
7962                 isl_stat (*fn)(__isl_take isl_vertex *vertex,
7963                         void *user), void *user);
7965         isl_stat isl_vertices_foreach_cell(
7966                 __isl_keep isl_vertices *vertices,
7967                 isl_stat (*fn)(__isl_take isl_cell *cell,
7968                         void *user), void *user);
7969         isl_stat isl_cell_foreach_vertex(__isl_keep isl_cell *cell,
7970                 isl_stat (*fn)(__isl_take isl_vertex *vertex,
7971                         void *user), void *user);
7973 Other operations that can be performed on an C<isl_vertices> object are
7974 the following.
7976         int isl_vertices_get_n_vertices(
7977                 __isl_keep isl_vertices *vertices);
7978         __isl_null isl_vertices *isl_vertices_free(
7979                 __isl_take isl_vertices *vertices);
7981 Vertices can be inspected and destroyed using the following functions.
7983         int isl_vertex_get_id(__isl_keep isl_vertex *vertex);
7984         __isl_give isl_basic_set *isl_vertex_get_domain(
7985                 __isl_keep isl_vertex *vertex);
7986         __isl_give isl_multi_aff *isl_vertex_get_expr(
7987                 __isl_keep isl_vertex *vertex);
7988         void isl_vertex_free(__isl_take isl_vertex *vertex);
7990 C<isl_vertex_get_expr> returns a multiple quasi-affine expression
7991 describing the vertex in terms of the parameters,
7992 while C<isl_vertex_get_domain> returns the activity domain
7993 of the vertex.
7995 Chambers can be inspected and destroyed using the following functions.
7997         __isl_give isl_basic_set *isl_cell_get_domain(
7998                 __isl_keep isl_cell *cell);
7999         void isl_cell_free(__isl_take isl_cell *cell);
8001 =head1 Polyhedral Compilation Library
8003 This section collects functionality in C<isl> that has been specifically
8004 designed for use during polyhedral compilation.
8006 =head2 Schedule Trees
8008 A schedule tree is a structured representation of a schedule,
8009 assigning a relative order to a set of domain elements.
8010 The relative order expressed by the schedule tree is
8011 defined recursively.  In particular, the order between
8012 two domain elements is determined by the node that is closest
8013 to the root that refers to both elements and that orders them apart.
8014 Each node in the tree is of one of several types.
8015 The root node is always of type C<isl_schedule_node_domain>
8016 (or C<isl_schedule_node_extension>)
8017 and it describes the (extra) domain elements to which the schedule applies.
8018 The other types of nodes are as follows.
8020 =over
8022 =item C<isl_schedule_node_band>
8024 A band of schedule dimensions.  Each schedule dimension is represented
8025 by a union piecewise quasi-affine expression.  If this expression
8026 assigns a different value to two domain elements, while all previous
8027 schedule dimensions in the same band assign them the same value,
8028 then the two domain elements are ordered according to these two
8029 different values.
8030 Each expression is required to be total in the domain elements
8031 that reach the band node.
8033 =item C<isl_schedule_node_expansion>
8035 An expansion node maps each of the domain elements that reach the node
8036 to one or more domain elements.  The image of this mapping forms
8037 the set of domain elements that reach the child of the expansion node.
8038 The function that maps each of the expanded domain elements
8039 to the original domain element from which it was expanded
8040 is called the contraction.
8042 =item C<isl_schedule_node_filter>
8044 A filter node does not impose any ordering, but rather intersects
8045 the set of domain elements that the current subtree refers to
8046 with a given union set.  The subtree of the filter node only
8047 refers to domain elements in the intersection.
8048 A filter node is typically only used as a child of a sequence or
8049 set node.
8051 =item C<isl_schedule_node_leaf>
8053 A leaf of the schedule tree.  Leaf nodes do not impose any ordering.
8055 =item C<isl_schedule_node_mark>
8057 A mark node can be used to attach any kind of information to a subtree
8058 of the schedule tree.
8060 =item C<isl_schedule_node_sequence>
8062 A sequence node has one or more children, each of which is a filter node.
8063 The filters on these filter nodes form a partition of
8064 the domain elements that the current subtree refers to.
8065 If two domain elements appear in distinct filters then the sequence
8066 node orders them according to the child positions of the corresponding
8067 filter nodes.
8069 =item C<isl_schedule_node_set>
8071 A set node is similar to a sequence node, except that
8072 it expresses that domain elements appearing in distinct filters
8073 may have any order.  The order of the children of a set node
8074 is therefore also immaterial.
8076 =back
8078 The following node types are only supported by the AST generator.
8080 =over
8082 =item C<isl_schedule_node_context>
8084 The context describes constraints on the parameters and
8085 the schedule dimensions of outer
8086 bands that the AST generator may assume to hold.  It is also the only
8087 kind of node that may introduce additional parameters.
8088 The space of the context is that of the flat product of the outer
8089 band nodes.  In particular, if there are no outer band nodes, then
8090 this space is the unnamed zero-dimensional space.
8091 Since a context node references the outer band nodes, any tree
8092 containing a context node is considered to be anchored.
8094 =item C<isl_schedule_node_extension>
8096 An extension node instructs the AST generator to add additional
8097 domain elements that need to be scheduled.
8098 The additional domain elements are described by the range of
8099 the extension map in terms of the outer schedule dimensions,
8100 i.e., the flat product of the outer band nodes.
8101 Note that domain elements are added whenever the AST generator
8102 reaches the extension node, meaning that there are still some
8103 active domain elements for which an AST needs to be generated.
8104 The conditions under which some domain elements are still active
8105 may however not be completely described by the outer AST nodes
8106 generated at that point.
8107 Since an extension node references the outer band nodes, any tree
8108 containing an extension node is considered to be anchored.
8110 An extension node may also appear as the root of a schedule tree,
8111 when it is intended to be inserted into another tree
8112 using C<isl_schedule_node_graft_before> or C<isl_schedule_node_graft_after>.
8113 In this case, the domain of the extension node should
8114 correspond to the flat product of the outer band nodes
8115 in this other schedule tree at the point where the extension tree
8116 will be inserted.
8118 =item C<isl_schedule_node_guard>
8120 The guard describes constraints on the parameters and
8121 the schedule dimensions of outer
8122 bands that need to be enforced by the outer nodes
8123 in the generated AST.
8124 That is, the part of the AST that is generated from descendants
8125 of the guard node can assume that these constraints are satisfied.
8126 The space of the guard is that of the flat product of the outer
8127 band nodes.  In particular, if there are no outer band nodes, then
8128 this space is the unnamed zero-dimensional space.
8129 Since a guard node references the outer band nodes, any tree
8130 containing a guard node is considered to be anchored.
8132 =back
8134 Except for the C<isl_schedule_node_context> nodes,
8135 none of the nodes may introduce any parameters that were not
8136 already present in the root domain node.
8138 A schedule tree is encapsulated in an C<isl_schedule> object.
8139 The simplest such objects, those with a tree consisting of single domain node,
8140 can be created using the following functions with either an empty
8141 domain or a given domain.
8143         #include <isl/schedule.h>
8144         __isl_give isl_schedule *isl_schedule_empty(
8145                 __isl_take isl_space *space);
8146         __isl_give isl_schedule *isl_schedule_from_domain(
8147                 __isl_take isl_union_set *domain);
8149 The function C<isl_schedule_constraints_compute_schedule> described
8150 in L</"Scheduling"> can also be used to construct schedules.
8152 C<isl_schedule> objects may be copied and freed using the following functions.
8154         #include <isl/schedule.h>
8155         __isl_give isl_schedule *isl_schedule_copy(
8156                 __isl_keep isl_schedule *sched);
8157         __isl_null isl_schedule *isl_schedule_free(
8158                 __isl_take isl_schedule *sched);
8160 The following functions checks whether two C<isl_schedule> objects
8161 are obviously the same.
8163         #include <isl/schedule.h>
8164         isl_bool isl_schedule_plain_is_equal(
8165                 __isl_keep isl_schedule *schedule1,
8166                 __isl_keep isl_schedule *schedule2);
8168 The domain of the schedule, i.e., the domain described by the root node,
8169 can be obtained using the following function.
8171         #include <isl/schedule.h>
8172         __isl_give isl_union_set *isl_schedule_get_domain(
8173                 __isl_keep isl_schedule *schedule);
8175 An extra top-level band node (right underneath the domain node) can
8176 be introduced into the schedule using the following function.
8177 The schedule tree is assumed not to have any anchored nodes.
8179         #include <isl/schedule.h>
8180         __isl_give isl_schedule *
8181         isl_schedule_insert_partial_schedule(
8182                 __isl_take isl_schedule *schedule,
8183                 __isl_take isl_multi_union_pw_aff *partial);
8185 A top-level context node (right underneath the domain node) can
8186 be introduced into the schedule using the following function.
8188         #include <isl/schedule.h>
8189         __isl_give isl_schedule *isl_schedule_insert_context(
8190                 __isl_take isl_schedule *schedule,
8191                 __isl_take isl_set *context)
8193 A top-level guard node (right underneath the domain node) can
8194 be introduced into the schedule using the following function.
8196         #include <isl/schedule.h>
8197         __isl_give isl_schedule *isl_schedule_insert_guard(
8198                 __isl_take isl_schedule *schedule,
8199                 __isl_take isl_set *guard)
8201 A schedule that combines two schedules either in the given
8202 order or in an arbitrary order, i.e., with an C<isl_schedule_node_sequence>
8203 or an C<isl_schedule_node_set> node,
8204 can be created using the following functions.
8206         #include <isl/schedule.h>
8207         __isl_give isl_schedule *isl_schedule_sequence(
8208                 __isl_take isl_schedule *schedule1,
8209                 __isl_take isl_schedule *schedule2);
8210         __isl_give isl_schedule *isl_schedule_set(
8211                 __isl_take isl_schedule *schedule1,
8212                 __isl_take isl_schedule *schedule2);
8214 The domains of the two input schedules need to be disjoint.
8216 The following function can be used to restrict the domain
8217 of a schedule with a domain node as root to be a subset of the given union set.
8218 This operation may remove nodes in the tree that have become
8219 redundant.
8221         #include <isl/schedule.h>
8222         __isl_give isl_schedule *isl_schedule_intersect_domain(
8223                 __isl_take isl_schedule *schedule,
8224                 __isl_take isl_union_set *domain);
8226 The following function can be used to simplify the domain
8227 of a schedule with a domain node as root with respect to the given
8228 parameter domain.
8230         #include <isl/schedule.h>
8231         __isl_give isl_schedule *isl_schedule_gist_domain_params(
8232                 __isl_take isl_schedule *schedule,
8233                 __isl_take isl_set *context);
8235 The following function resets the user pointers on all parameter
8236 and tuple identifiers referenced by the nodes of the given schedule.
8238         #include <isl/schedule.h>
8239         __isl_give isl_schedule *isl_schedule_reset_user(
8240                 __isl_take isl_schedule *schedule);
8242 The following function aligns the parameters of all nodes
8243 in the given schedule to the given space.
8245         #include <isl/schedule.h>
8246         __isl_give isl_schedule *isl_schedule_align_params(
8247                 __isl_take isl_schedule *schedule,
8248                 __isl_take isl_space *space);
8250 The following function allows the user to plug in a given function
8251 in the iteration domains.  The input schedule is not allowed to contain
8252 any expansion nodes.
8254         #include <isl/schedule.h>
8255         __isl_give isl_schedule *
8256         isl_schedule_pullback_union_pw_multi_aff(
8257                 __isl_take isl_schedule *schedule,
8258                 __isl_take isl_union_pw_multi_aff *upma);
8260 The following function can be used to plug in the schedule C<expansion>
8261 in the leaves of C<schedule>, where C<contraction> describes how
8262 the domain elements of C<expansion> map to the domain elements
8263 at the original leaves of C<schedule>.
8264 The resulting schedule will contain expansion nodes, unless
8265 C<contraction> is an identity function.
8267         #include <isl/schedule.h>
8268         __isl_give isl_schedule *isl_schedule_expand(
8269                 __isl_take isl_schedule *schedule,
8270                 __isl_take isl_union_pw_multi_aff *contraction,
8271                 __isl_take isl_schedule *expansion);
8273 An C<isl_union_map> representation of the schedule can be obtained
8274 from an C<isl_schedule> using the following function.
8276         #include <isl/schedule.h>
8277         __isl_give isl_union_map *isl_schedule_get_map(
8278                 __isl_keep isl_schedule *sched);
8280 The resulting relation encodes the same relative ordering as
8281 the schedule by mapping the domain elements to a common schedule space.
8282 If the schedule_separate_components option is set, then the order
8283 of the children of a set node is explicitly encoded in the result.
8284 If the tree contains any expansion nodes, then the relation
8285 is formulated in terms of the expanded domain elements.
8287 Schedules can be read from input using the following functions.
8289         #include <isl/schedule.h>
8290         __isl_give isl_schedule *isl_schedule_read_from_file(
8291                 isl_ctx *ctx, FILE *input);
8292         __isl_give isl_schedule *isl_schedule_read_from_str(
8293                 isl_ctx *ctx, const char *str);
8295 A representation of the schedule can be printed using
8297         #include <isl/schedule.h>
8298         __isl_give isl_printer *isl_printer_print_schedule(
8299                 __isl_take isl_printer *p,
8300                 __isl_keep isl_schedule *schedule);
8301         __isl_give char *isl_schedule_to_str(
8302                 __isl_keep isl_schedule *schedule);
8304 C<isl_schedule_to_str> prints the schedule in flow format.
8306 The schedule tree can be traversed through the use of
8307 C<isl_schedule_node> objects that point to a particular
8308 position in the schedule tree.  Whenever a C<isl_schedule_node>
8309 is used to modify a node in the schedule tree, the original schedule
8310 tree is left untouched and the modifications are performed to a copy
8311 of the tree.  The returned C<isl_schedule_node> then points to
8312 this modified copy of the tree.
8314 The root of the schedule tree can be obtained using the following function.
8316         #include <isl/schedule.h>
8317         __isl_give isl_schedule_node *isl_schedule_get_root(
8318                 __isl_keep isl_schedule *schedule);
8320 A pointer to a newly created schedule tree with a single domain
8321 node can be created using the following functions.
8323         #include <isl/schedule_node.h>
8324         __isl_give isl_schedule_node *
8325         isl_schedule_node_from_domain(
8326                 __isl_take isl_union_set *domain);
8327         __isl_give isl_schedule_node *
8328         isl_schedule_node_from_extension(
8329                 __isl_take isl_union_map *extension);
8331 C<isl_schedule_node_from_extension> creates a tree with an extension
8332 node as root.
8334 Schedule nodes can be copied and freed using the following functions.
8336         #include <isl/schedule_node.h>
8337         __isl_give isl_schedule_node *isl_schedule_node_copy(
8338                 __isl_keep isl_schedule_node *node);
8339         __isl_null isl_schedule_node *isl_schedule_node_free(
8340                 __isl_take isl_schedule_node *node);
8342 The following functions can be used to check if two schedule
8343 nodes point to the same position in the same schedule.
8345         #include <isl/schedule_node.h>
8346         isl_bool isl_schedule_node_is_equal(
8347                 __isl_keep isl_schedule_node *node1,
8348                 __isl_keep isl_schedule_node *node2);
8350 The following properties can be obtained from a schedule node.
8352         #include <isl/schedule_node.h>
8353         enum isl_schedule_node_type isl_schedule_node_get_type(
8354                 __isl_keep isl_schedule_node *node);
8355         enum isl_schedule_node_type
8356         isl_schedule_node_get_parent_type(
8357                 __isl_keep isl_schedule_node *node);
8358         __isl_give isl_schedule *isl_schedule_node_get_schedule(
8359                 __isl_keep isl_schedule_node *node);
8361 The function C<isl_schedule_node_get_type> returns the type of
8362 the node, while C<isl_schedule_node_get_parent_type> returns
8363 type of the parent of the node, which is required to exist.
8364 The function C<isl_schedule_node_get_schedule> returns a copy
8365 to the schedule to which the node belongs.
8367 The following functions can be used to move the schedule node
8368 to a different position in the tree or to check if such a position
8369 exists.
8371         #include <isl/schedule_node.h>
8372         isl_bool isl_schedule_node_has_parent(
8373                 __isl_keep isl_schedule_node *node);
8374         __isl_give isl_schedule_node *isl_schedule_node_parent(
8375                 __isl_take isl_schedule_node *node);
8376         __isl_give isl_schedule_node *isl_schedule_node_root(
8377                 __isl_take isl_schedule_node *node);
8378         __isl_give isl_schedule_node *isl_schedule_node_ancestor(
8379                 __isl_take isl_schedule_node *node,
8380                 int generation);
8381         int isl_schedule_node_n_children(
8382                 __isl_keep isl_schedule_node *node);
8383         __isl_give isl_schedule_node *isl_schedule_node_child(
8384                 __isl_take isl_schedule_node *node, int pos);
8385         isl_bool isl_schedule_node_has_children(
8386                 __isl_keep isl_schedule_node *node);
8387         __isl_give isl_schedule_node *isl_schedule_node_first_child(
8388                 __isl_take isl_schedule_node *node);
8389         isl_bool isl_schedule_node_has_previous_sibling(
8390                 __isl_keep isl_schedule_node *node);
8391         __isl_give isl_schedule_node *
8392         isl_schedule_node_previous_sibling(
8393                 __isl_take isl_schedule_node *node);
8394         isl_bool isl_schedule_node_has_next_sibling(
8395                 __isl_keep isl_schedule_node *node);
8396         __isl_give isl_schedule_node *
8397         isl_schedule_node_next_sibling(
8398                 __isl_take isl_schedule_node *node);
8400 For C<isl_schedule_node_ancestor>, the ancestor of generation 0
8401 is the node itself, the ancestor of generation 1 is its parent and so on.
8403 It is also possible to query the number of ancestors of a node,
8404 the position of the current node
8405 within the children of its parent, the position of the subtree
8406 containing a node within the children of an ancestor
8407 or to obtain a copy of a given
8408 child without destroying the current node.
8409 Given two nodes that point to the same schedule, their closest
8410 shared ancestor can be obtained using
8411 C<isl_schedule_node_get_shared_ancestor>.
8413         #include <isl/schedule_node.h>
8414         int isl_schedule_node_get_tree_depth(
8415                 __isl_keep isl_schedule_node *node);
8416         int isl_schedule_node_get_child_position(
8417                 __isl_keep isl_schedule_node *node);
8418         int isl_schedule_node_get_ancestor_child_position(
8419                 __isl_keep isl_schedule_node *node,
8420                 __isl_keep isl_schedule_node *ancestor);
8421         __isl_give isl_schedule_node *isl_schedule_node_get_child(
8422                 __isl_keep isl_schedule_node *node, int pos);
8423         __isl_give isl_schedule_node *
8424         isl_schedule_node_get_shared_ancestor(
8425                 __isl_keep isl_schedule_node *node1,
8426                 __isl_keep isl_schedule_node *node2);
8428 All nodes in a schedule tree or
8429 all descendants of a specific node (including the node) can be visited
8430 in depth-first pre-order using the following functions.
8432         #include <isl/schedule.h>
8433         isl_stat isl_schedule_foreach_schedule_node_top_down(
8434                 __isl_keep isl_schedule *sched,
8435                 isl_bool (*fn)(__isl_keep isl_schedule_node *node,
8436                         void *user), void *user);
8438         #include <isl/schedule_node.h>
8439         isl_stat isl_schedule_node_foreach_descendant_top_down(
8440                 __isl_keep isl_schedule_node *node,
8441                 isl_bool (*fn)(__isl_keep isl_schedule_node *node,
8442                         void *user), void *user);
8444 The callback function is slightly different from the usual
8445 callbacks in that it not only indicates success (non-negative result)
8446 or failure (negative result), but also indicates whether the children
8447 of the given node should be visited.  In particular, if the callback
8448 returns a positive value, then the children are visited, but if
8449 the callback returns zero, then the children are not visited.
8451 The following functions checks whether
8452 all descendants of a specific node (including the node itself)
8453 satisfy a user-specified test.
8455         #include <isl/schedule_node.h>
8456         isl_bool isl_schedule_node_every_descendant(
8457                 __isl_keep isl_schedule_node *node,
8458                 isl_bool (*test)(__isl_keep isl_schedule_node *node,
8459                         void *user), void *user)
8461 The ancestors of a node in a schedule tree can be visited from
8462 the root down to and including the parent of the node using
8463 the following function.
8465         #include <isl/schedule_node.h>
8466         isl_stat isl_schedule_node_foreach_ancestor_top_down(
8467                 __isl_keep isl_schedule_node *node,
8468                 isl_stat (*fn)(__isl_keep isl_schedule_node *node,
8469                         void *user), void *user);
8471 The following functions allows for a depth-first post-order
8472 traversal of the nodes in a schedule tree or
8473 of the descendants of a specific node (including the node
8474 itself), where the user callback is allowed to modify the
8475 visited node.
8477         #include <isl/schedule.h>
8478         __isl_give isl_schedule *
8479         isl_schedule_map_schedule_node_bottom_up(
8480                 __isl_take isl_schedule *schedule,
8481                 __isl_give isl_schedule_node *(*fn)(
8482                         __isl_take isl_schedule_node *node,
8483                         void *user), void *user);
8485         #include <isl/schedule_node.h>
8486         __isl_give isl_schedule_node *
8487         isl_schedule_node_map_descendant_bottom_up(
8488                 __isl_take isl_schedule_node *node,
8489                 __isl_give isl_schedule_node *(*fn)(
8490                         __isl_take isl_schedule_node *node,
8491                         void *user), void *user);
8493 The traversal continues from the node returned by the callback function.
8494 It is the responsibility of the user to ensure that this does not
8495 lead to an infinite loop.  It is safest to always return a pointer
8496 to the same position (same ancestors and child positions) as the input node.
8498 The following function removes a node (along with its descendants)
8499 from a schedule tree and returns a pointer to the leaf at the
8500 same position in the updated tree.
8501 It is not allowed to remove the root of a schedule tree or
8502 a child of a set or sequence node.
8504         #include <isl/schedule_node.h>
8505         __isl_give isl_schedule_node *isl_schedule_node_cut(
8506                 __isl_take isl_schedule_node *node);
8508 The following function removes a single node
8509 from a schedule tree and returns a pointer to the child
8510 of the node, now located at the position of the original node
8511 or to a leaf node at that position if there was no child.
8512 It is not allowed to remove the root of a schedule tree,
8513 a set or sequence node, a child of a set or sequence node or
8514 a band node with an anchored subtree.
8516         #include <isl/schedule_node.h>
8517         __isl_give isl_schedule_node *isl_schedule_node_delete(
8518                 __isl_take isl_schedule_node *node);
8520 Most nodes in a schedule tree only contain local information.
8521 In some cases, however, a node may also refer to the schedule dimensions
8522 of its outer band nodes.
8523 This means that the position of the node within the tree should
8524 not be changed, or at least that no changes are performed to the
8525 outer band nodes.  The following function can be used to test
8526 whether the subtree rooted at a given node contains any such nodes.
8528         #include <isl/schedule_node.h>
8529         isl_bool isl_schedule_node_is_subtree_anchored(
8530                 __isl_keep isl_schedule_node *node);
8532 The following function resets the user pointers on all parameter
8533 and tuple identifiers referenced by the given schedule node.
8535         #include <isl/schedule_node.h>
8536         __isl_give isl_schedule_node *isl_schedule_node_reset_user(
8537                 __isl_take isl_schedule_node *node);
8539 The following function aligns the parameters of the given schedule
8540 node to the given space.
8542         #include <isl/schedule_node.h>
8543         __isl_give isl_schedule_node *
8544         isl_schedule_node_align_params(
8545                 __isl_take isl_schedule_node *node,
8546                 __isl_take isl_space *space);
8548 Several node types have their own functions for querying
8549 (and in some cases setting) some node type specific properties.
8551         #include <isl/schedule_node.h>
8552         __isl_give isl_space *isl_schedule_node_band_get_space(
8553                 __isl_keep isl_schedule_node *node);
8554         __isl_give isl_multi_union_pw_aff *
8555         isl_schedule_node_band_get_partial_schedule(
8556                 __isl_keep isl_schedule_node *node);
8557         __isl_give isl_union_map *
8558         isl_schedule_node_band_get_partial_schedule_union_map(
8559                 __isl_keep isl_schedule_node *node);
8560         unsigned isl_schedule_node_band_n_member(
8561                 __isl_keep isl_schedule_node *node);
8562         isl_bool isl_schedule_node_band_member_get_coincident(
8563                 __isl_keep isl_schedule_node *node, int pos);
8564         __isl_give isl_schedule_node *
8565         isl_schedule_node_band_member_set_coincident(
8566                 __isl_take isl_schedule_node *node, int pos,
8567                 int coincident);
8568         isl_bool isl_schedule_node_band_get_permutable(
8569                 __isl_keep isl_schedule_node *node);
8570         __isl_give isl_schedule_node *
8571         isl_schedule_node_band_set_permutable(
8572                 __isl_take isl_schedule_node *node, int permutable);
8573         enum isl_ast_loop_type
8574         isl_schedule_node_band_member_get_ast_loop_type(
8575                 __isl_keep isl_schedule_node *node, int pos);
8576         __isl_give isl_schedule_node *
8577         isl_schedule_node_band_member_set_ast_loop_type(
8578                 __isl_take isl_schedule_node *node, int pos,
8579                 enum isl_ast_loop_type type);
8580         __isl_give isl_union_set *
8581         enum isl_ast_loop_type
8582         isl_schedule_node_band_member_get_isolate_ast_loop_type(
8583                 __isl_keep isl_schedule_node *node, int pos);
8584         __isl_give isl_schedule_node *
8585         isl_schedule_node_band_member_set_isolate_ast_loop_type(
8586                 __isl_take isl_schedule_node *node, int pos,
8587                 enum isl_ast_loop_type type);
8588         isl_schedule_node_band_get_ast_build_options(
8589                 __isl_keep isl_schedule_node *node);
8590         __isl_give isl_schedule_node *
8591         isl_schedule_node_band_set_ast_build_options(
8592                 __isl_take isl_schedule_node *node,
8593                 __isl_take isl_union_set *options);
8594         __isl_give isl_set *
8595         isl_schedule_node_band_get_ast_isolate_option(
8596                 __isl_keep isl_schedule_node *node);
8598 The function C<isl_schedule_node_band_get_space> returns the space
8599 of the partial schedule of the band.
8600 The function C<isl_schedule_node_band_get_partial_schedule_union_map>
8601 returns a representation of the partial schedule of the band node
8602 in the form of an C<isl_union_map>.
8603 The coincident and permutable properties are set by
8604 C<isl_schedule_constraints_compute_schedule> on the schedule tree
8605 it produces.
8606 A scheduling dimension is considered to be ``coincident''
8607 if it satisfies the coincidence constraints within its band.
8608 That is, if the dependence distances of the coincidence
8609 constraints are all zero in that direction (for fixed
8610 iterations of outer bands).
8611 A band is marked permutable if it was produced using the Pluto-like scheduler.
8612 Note that the scheduler may have to resort to a Feautrier style scheduling
8613 step even if the default scheduler is used.
8614 An C<isl_ast_loop_type> is one of C<isl_ast_loop_default>,
8615 C<isl_ast_loop_atomic>, C<isl_ast_loop_unroll> or C<isl_ast_loop_separate>.
8616 For the meaning of these loop AST generation types and the difference
8617 between the regular loop AST generation type and the isolate
8618 loop AST generation type, see L</"AST Generation Options (Schedule Tree)">.
8619 The functions C<isl_schedule_node_band_member_get_ast_loop_type>
8620 and C<isl_schedule_node_band_member_get_isolate_ast_loop_type>
8621 may return C<isl_ast_loop_error> if an error occurs.
8622 The AST build options govern how an AST is generated for
8623 the individual schedule dimensions during AST generation.
8624 See L</"AST Generation Options (Schedule Tree)">.
8625 The isolate option for the given node can be extracted from these
8626 AST build options using the function
8627 C<isl_schedule_node_band_get_ast_isolate_option>.
8629         #include <isl/schedule_node.h>
8630         __isl_give isl_set *
8631         isl_schedule_node_context_get_context(
8632                 __isl_keep isl_schedule_node *node);
8634         #include <isl/schedule_node.h>
8635         __isl_give isl_union_set *
8636         isl_schedule_node_domain_get_domain(
8637                 __isl_keep isl_schedule_node *node);
8639         #include <isl/schedule_node.h>
8640         __isl_give isl_union_map *
8641         isl_schedule_node_expansion_get_expansion(
8642                 __isl_keep isl_schedule_node *node);
8643         __isl_give isl_union_pw_multi_aff *
8644         isl_schedule_node_expansion_get_contraction(
8645                 __isl_keep isl_schedule_node *node);
8647         #include <isl/schedule_node.h>
8648         __isl_give isl_union_map *
8649         isl_schedule_node_extension_get_extension(
8650                 __isl_keep isl_schedule_node *node);
8652         #include <isl/schedule_node.h>
8653         __isl_give isl_union_set *
8654         isl_schedule_node_filter_get_filter(
8655                 __isl_keep isl_schedule_node *node);
8657         #include <isl/schedule_node.h>
8658         __isl_give isl_set *isl_schedule_node_guard_get_guard(
8659                 __isl_keep isl_schedule_node *node);
8661         #include <isl/schedule_node.h>
8662         __isl_give isl_id *isl_schedule_node_mark_get_id(
8663                 __isl_keep isl_schedule_node *node);
8665 The following functions can be used to obtain an C<isl_multi_union_pw_aff>,
8666 an C<isl_union_pw_multi_aff> or C<isl_union_map> representation of
8667 partial schedules related to the node.
8669         #include <isl/schedule_node.h>
8670         __isl_give isl_multi_union_pw_aff *
8671         isl_schedule_node_get_prefix_schedule_multi_union_pw_aff(
8672                 __isl_keep isl_schedule_node *node);
8673         __isl_give isl_union_pw_multi_aff *
8674         isl_schedule_node_get_prefix_schedule_union_pw_multi_aff(
8675                 __isl_keep isl_schedule_node *node);
8676         __isl_give isl_union_map *
8677         isl_schedule_node_get_prefix_schedule_union_map(
8678                 __isl_keep isl_schedule_node *node);
8679         __isl_give isl_union_map *
8680         isl_schedule_node_get_prefix_schedule_relation(
8681                 __isl_keep isl_schedule_node *node);
8682         __isl_give isl_union_map *
8683         isl_schedule_node_get_subtree_schedule_union_map(
8684                 __isl_keep isl_schedule_node *node);
8686 In particular, the functions
8687 C<isl_schedule_node_get_prefix_schedule_multi_union_pw_aff>,
8688 C<isl_schedule_node_get_prefix_schedule_union_pw_multi_aff>
8689 and C<isl_schedule_node_get_prefix_schedule_union_map>
8690 return a relative ordering on the domain elements that reach the given
8691 node determined by its ancestors.
8692 The function C<isl_schedule_node_get_prefix_schedule_relation>
8693 additionally includes the domain constraints in the result.
8694 The function C<isl_schedule_node_get_subtree_schedule_union_map>
8695 returns a representation of the partial schedule defined by the
8696 subtree rooted at the given node.
8697 If the tree contains any expansion nodes, then the subtree schedule
8698 is formulated in terms of the expanded domain elements.
8699 The tree passed to functions returning a prefix schedule
8700 may only contain extension nodes if these would not affect
8701 the result of these functions.  That is, if one of the ancestors
8702 is an extension node, then all of the domain elements that were
8703 added by the extension node need to have been filtered out
8704 by filter nodes between the extension node and the input node.
8705 The tree passed to C<isl_schedule_node_get_subtree_schedule_union_map>
8706 may not contain in extension nodes in the selected subtree.
8708 The expansion/contraction defined by an entire subtree, combining
8709 the expansions/contractions
8710 on the expansion nodes in the subtree, can be obtained using
8711 the following functions.
8713         #include <isl/schedule_node.h>
8714         __isl_give isl_union_map *
8715         isl_schedule_node_get_subtree_expansion(
8716                 __isl_keep isl_schedule_node *node);
8717         __isl_give isl_union_pw_multi_aff *
8718         isl_schedule_node_get_subtree_contraction(
8719                 __isl_keep isl_schedule_node *node);
8721 The total number of outer band members of given node, i.e.,
8722 the shared output dimension of the maps in the result
8723 of C<isl_schedule_node_get_prefix_schedule_union_map> can be obtained
8724 using the following function.
8726         #include <isl/schedule_node.h>
8727         int isl_schedule_node_get_schedule_depth(
8728                 __isl_keep isl_schedule_node *node);
8730 The following functions return the elements that reach the given node
8731 or the union of universes in the spaces that contain these elements.
8733         #include <isl/schedule_node.h>
8734         __isl_give isl_union_set *
8735         isl_schedule_node_get_domain(
8736                 __isl_keep isl_schedule_node *node);
8737         __isl_give isl_union_set *
8738         isl_schedule_node_get_universe_domain(
8739                 __isl_keep isl_schedule_node *node);
8741 The input tree of C<isl_schedule_node_get_domain>
8742 may only contain extension nodes if these would not affect
8743 the result of this function.  That is, if one of the ancestors
8744 is an extension node, then all of the domain elements that were
8745 added by the extension node need to have been filtered out
8746 by filter nodes between the extension node and the input node.
8748 The following functions can be used to introduce additional nodes
8749 in the schedule tree.  The new node is introduced at the point
8750 in the tree where the C<isl_schedule_node> points to and
8751 the results points to the new node.
8753         #include <isl/schedule_node.h>
8754         __isl_give isl_schedule_node *
8755         isl_schedule_node_insert_partial_schedule(
8756                 __isl_take isl_schedule_node *node,
8757                 __isl_take isl_multi_union_pw_aff *schedule);
8759 This function inserts a new band node with (the greatest integer
8760 part of) the given partial schedule.
8761 The subtree rooted at the given node is assumed not to have
8762 any anchored nodes.
8764         #include <isl/schedule_node.h>
8765         __isl_give isl_schedule_node *
8766         isl_schedule_node_insert_context(
8767                 __isl_take isl_schedule_node *node,
8768                 __isl_take isl_set *context);
8770 This function inserts a new context node with the given context constraints.
8772         #include <isl/schedule_node.h>
8773         __isl_give isl_schedule_node *
8774         isl_schedule_node_insert_filter(
8775                 __isl_take isl_schedule_node *node,
8776                 __isl_take isl_union_set *filter);
8778 This function inserts a new filter node with the given filter.
8779 If the original node already pointed to a filter node, then the
8780 two filter nodes are merged into one.
8782         #include <isl/schedule_node.h>
8783         __isl_give isl_schedule_node *
8784         isl_schedule_node_insert_guard(
8785                 __isl_take isl_schedule_node *node,
8786                 __isl_take isl_set *guard);
8788 This function inserts a new guard node with the given guard constraints.
8790         #include <isl/schedule_node.h>
8791         __isl_give isl_schedule_node *
8792         isl_schedule_node_insert_mark(
8793                 __isl_take isl_schedule_node *node,
8794                 __isl_take isl_id *mark);
8796 This function inserts a new mark node with the give mark identifier.
8798         #include <isl/schedule_node.h>
8799         __isl_give isl_schedule_node *
8800         isl_schedule_node_insert_sequence(
8801                 __isl_take isl_schedule_node *node,
8802                 __isl_take isl_union_set_list *filters);
8803         __isl_give isl_schedule_node *
8804         isl_schedule_node_insert_set(
8805                 __isl_take isl_schedule_node *node,
8806                 __isl_take isl_union_set_list *filters);
8808 These functions insert a new sequence or set node with the given
8809 filters as children.
8811         #include <isl/schedule_node.h>
8812         __isl_give isl_schedule_node *isl_schedule_node_group(
8813                 __isl_take isl_schedule_node *node,
8814                 __isl_take isl_id *group_id);
8816 This function introduces an expansion node in between the current
8817 node and its parent that expands instances of a space with tuple
8818 identifier C<group_id> to the original domain elements that reach
8819 the node.  The group instances are identified by the prefix schedule
8820 of those domain elements.  The ancestors of the node are adjusted
8821 to refer to the group instances instead of the original domain
8822 elements.  The return value points to the same node in the updated
8823 schedule tree as the input node, i.e., to the child of the newly
8824 introduced expansion node.  Grouping instances of different statements
8825 ensures that they will be treated as a single statement by the
8826 AST generator up to the point of the expansion node.
8828 The following function can be used to flatten a nested
8829 sequence.
8831         #include <isl/schedule_node.h>
8832         __isl_give isl_schedule_node *
8833         isl_schedule_node_sequence_splice_child(
8834                 __isl_take isl_schedule_node *node, int pos);
8836 That is, given a sequence node C<node> that has another sequence node
8837 in its child at position C<pos> (in particular, the child of that filter
8838 node is a sequence node), attach the children of that other sequence
8839 node as children of C<node>, replacing the original child at position
8840 C<pos>.
8842 The partial schedule of a band node can be scaled (down) or reduced using
8843 the following functions.
8845         #include <isl/schedule_node.h>
8846         __isl_give isl_schedule_node *
8847         isl_schedule_node_band_scale(
8848                 __isl_take isl_schedule_node *node,
8849                 __isl_take isl_multi_val *mv);
8850         __isl_give isl_schedule_node *
8851         isl_schedule_node_band_scale_down(
8852                 __isl_take isl_schedule_node *node,
8853                 __isl_take isl_multi_val *mv);
8854         __isl_give isl_schedule_node *
8855         isl_schedule_node_band_mod(
8856                 __isl_take isl_schedule_node *node,
8857                 __isl_take isl_multi_val *mv);
8859 The spaces of the two arguments need to match.
8860 After scaling, the partial schedule is replaced by its greatest
8861 integer part to ensure that the schedule remains integral.
8863 The partial schedule of a band node can be shifted by an
8864 C<isl_multi_union_pw_aff> with a domain that is a superset
8865 of the domain of the partial schedule using
8866 the following function.
8868         #include <isl/schedule_node.h>
8869         __isl_give isl_schedule_node *
8870         isl_schedule_node_band_shift(
8871                 __isl_take isl_schedule_node *node,
8872                 __isl_take isl_multi_union_pw_aff *shift);
8874 A band node can be tiled using the following function.
8876         #include <isl/schedule_node.h>
8877         __isl_give isl_schedule_node *isl_schedule_node_band_tile(
8878                 __isl_take isl_schedule_node *node,
8879                 __isl_take isl_multi_val *sizes);
8881         isl_stat isl_options_set_tile_scale_tile_loops(isl_ctx *ctx,
8882                 int val);
8883         int isl_options_get_tile_scale_tile_loops(isl_ctx *ctx);
8884         isl_stat isl_options_set_tile_shift_point_loops(isl_ctx *ctx,
8885                 int val);
8886         int isl_options_get_tile_shift_point_loops(isl_ctx *ctx);
8888 The C<isl_schedule_node_band_tile> function tiles
8889 the band using the given tile sizes inside its schedule.
8890 A new child band node is created to represent the point loops and it is
8891 inserted between the modified band and its children.
8892 The subtree rooted at the given node is assumed not to have
8893 any anchored nodes.
8894 The C<tile_scale_tile_loops> option specifies whether the tile
8895 loops iterators should be scaled by the tile sizes.
8896 If the C<tile_shift_point_loops> option is set, then the point loops
8897 are shifted to start at zero.
8899 A band node can be split into two nested band nodes
8900 using the following function.
8902         #include <isl/schedule_node.h>
8903         __isl_give isl_schedule_node *isl_schedule_node_band_split(
8904                 __isl_take isl_schedule_node *node, int pos);
8906 The resulting outer band node contains the first C<pos> dimensions of
8907 the schedule of C<node> while the inner band contains the remaining dimensions.
8908 The schedules of the two band nodes live in anonymous spaces.
8909 The loop AST generation type options and the isolate option
8910 are split over the two band nodes.
8912 A band node can be moved down to the leaves of the subtree rooted
8913 at the band node using the following function.
8915         #include <isl/schedule_node.h>
8916         __isl_give isl_schedule_node *isl_schedule_node_band_sink(
8917                 __isl_take isl_schedule_node *node);
8919 The subtree rooted at the given node is assumed not to have
8920 any anchored nodes.
8921 The result points to the node in the resulting tree that is in the same
8922 position as the node pointed to by C<node> in the original tree.
8924         #include <isl/schedule_node.h>
8925         __isl_give isl_schedule_node *
8926         isl_schedule_node_order_before(
8927                 __isl_take isl_schedule_node *node,
8928                 __isl_take isl_union_set *filter);
8929         __isl_give isl_schedule_node *
8930         isl_schedule_node_order_after(
8931                 __isl_take isl_schedule_node *node,
8932                 __isl_take isl_union_set *filter);
8934 These functions split the domain elements that reach C<node>
8935 into those that satisfy C<filter> and those that do not and
8936 arranges for the elements that do satisfy the filter to be
8937 executed before (in case of C<isl_schedule_node_order_before>)
8938 or after (in case of C<isl_schedule_node_order_after>)
8939 those that do not.  The order is imposed by
8940 a sequence node, possibly reusing the grandparent of C<node>
8941 on two copies of the subtree attached to the original C<node>.
8942 Both copies are simplified with respect to their filter.
8944 Return a pointer to the copy of the subtree that does not
8945 satisfy C<filter>.  If there is no such copy (because all
8946 reaching domain elements satisfy the filter), then return
8947 the original pointer.
8949         #include <isl/schedule_node.h>
8950         __isl_give isl_schedule_node *
8951         isl_schedule_node_graft_before(
8952                 __isl_take isl_schedule_node *node,
8953                 __isl_take isl_schedule_node *graft);
8954         __isl_give isl_schedule_node *
8955         isl_schedule_node_graft_after(
8956                 __isl_take isl_schedule_node *node,
8957                 __isl_take isl_schedule_node *graft);
8959 This function inserts the C<graft> tree into the tree containing C<node>
8960 such that it is executed before (in case of C<isl_schedule_node_graft_before>)
8961 or after (in case of C<isl_schedule_node_graft_after>) C<node>.
8962 The root node of C<graft>
8963 should be an extension node where the domain of the extension
8964 is the flat product of all outer band nodes of C<node>.
8965 The root node may also be a domain node.
8966 The elements of the domain or the range of the extension may not
8967 intersect with the domain elements that reach "node".
8968 The schedule tree of C<graft> may not be anchored.
8970 The schedule tree of C<node> is modified to include an extension node
8971 corresponding to the root node of C<graft> as a child of the original
8972 parent of C<node>.  The original node that C<node> points to and the
8973 child of the root node of C<graft> are attached to this extension node
8974 through a sequence, with appropriate filters and with the child
8975 of C<graft> appearing before or after the original C<node>.
8977 If C<node> already appears inside a sequence that is the child of
8978 an extension node and if the spaces of the new domain elements
8979 do not overlap with those of the original domain elements,
8980 then that extension node is extended with the new extension
8981 rather than introducing a new segment of extension and sequence nodes.
8983 Return a pointer to the same node in the modified tree that
8984 C<node> pointed to in the original tree.
8986 A representation of the schedule node can be printed using
8988         #include <isl/schedule_node.h>
8989         __isl_give isl_printer *isl_printer_print_schedule_node(
8990                 __isl_take isl_printer *p,
8991                 __isl_keep isl_schedule_node *node);
8992         __isl_give char *isl_schedule_node_to_str(
8993                 __isl_keep isl_schedule_node *node);
8995 C<isl_schedule_node_to_str> prints the schedule node in block format.
8997 =head2 Dependence Analysis
8999 C<isl> contains specialized functionality for performing
9000 array dataflow analysis.  That is, given a I<sink> access relation,
9001 a collection of possible I<source> accesses and
9002 a collection of I<kill> accesses,
9003 C<isl> can compute relations that describe
9004 for each iteration of the sink access, which iterations
9005 of which of the source access relations may have
9006 accessed the same data element before the given iteration
9007 of the sink access without any intermediate kill of that data element.
9008 The resulting dependence relations map source iterations
9009 to either the corresponding sink iterations or
9010 pairs of corresponding sink iterations and accessed data elements.
9011 To compute standard flow dependences, the sink should be
9012 a read, while the sources should be writes.
9013 If no kills are specified,
9014 then memory based dependence analysis is performed.
9015 If, on the other hand, all sources are also kills,
9016 then value based dependence analysis is performed.
9017 If any of the source accesses are marked as being I<must>
9018 accesses, then they are also treated as kills.
9019 Furthermore, the specification of must-sources results
9020 in the computation of must-dependences.
9021 Only dependences originating in a must access not coscheduled
9022 with any other access to the same element and without
9023 any may accesses between the must access and the sink access
9024 are considered to be must dependences.
9026 =head3 High-level Interface
9028 A high-level interface to dependence analysis is provided
9029 by the following function.
9031         #include <isl/flow.h>
9032         __isl_give isl_union_flow *
9033         isl_union_access_info_compute_flow(
9034                 __isl_take isl_union_access_info *access);
9036 The input C<isl_union_access_info> object describes the sink
9037 access relations, the source access relations and a schedule,
9038 while the output C<isl_union_flow> object describes
9039 the resulting dependence relations and the subsets of the
9040 sink relations for which no source was found.
9042 An C<isl_union_access_info> is created, modified, copied and freed using
9043 the following functions.
9045         #include <isl/flow.h>
9046         __isl_give isl_union_access_info *
9047         isl_union_access_info_from_sink(
9048                 __isl_take isl_union_map *sink);
9049         __isl_give isl_union_access_info *
9050         isl_union_access_info_set_kill(
9051                 __isl_take isl_union_access_info *access,
9052                 __isl_take isl_union_map *kill);
9053         __isl_give isl_union_access_info *
9054         isl_union_access_info_set_may_source(
9055                 __isl_take isl_union_access_info *access,
9056                 __isl_take isl_union_map *may_source);
9057         __isl_give isl_union_access_info *
9058         isl_union_access_info_set_must_source(
9059                 __isl_take isl_union_access_info *access,
9060                 __isl_take isl_union_map *must_source);
9061         __isl_give isl_union_access_info *
9062         isl_union_access_info_set_schedule(
9063                 __isl_take isl_union_access_info *access,
9064                 __isl_take isl_schedule *schedule);
9065         __isl_give isl_union_access_info *
9066         isl_union_access_info_set_schedule_map(
9067                 __isl_take isl_union_access_info *access,
9068                 __isl_take isl_union_map *schedule_map);
9069         __isl_give isl_union_access_info *
9070         isl_union_access_info_copy(
9071                 __isl_keep isl_union_access_info *access);
9072         __isl_null isl_union_access_info *
9073         isl_union_access_info_free(
9074                 __isl_take isl_union_access_info *access);
9076 The may sources set by C<isl_union_access_info_set_may_source>
9077 do not need to include the must sources set by
9078 C<isl_union_access_info_set_must_source> as a subset.
9079 The kills set by C<isl_union_access_info_set_kill> may overlap
9080 with the may-sources and/or must-sources.
9081 The user is free not to call one (or more) of these functions,
9082 in which case the corresponding set is kept to its empty default.
9083 Similarly, the default schedule initialized by
9084 C<isl_union_access_info_from_sink> is empty.
9085 The current schedule is determined by the last call to either
9086 C<isl_union_access_info_set_schedule> or
9087 C<isl_union_access_info_set_schedule_map>.
9088 The domain of the schedule corresponds to the domains of
9089 the access relations.  In particular, the domains of the access
9090 relations are effectively intersected with the domain of the schedule
9091 and only the resulting accesses are considered by the dependence analysis.
9093 An C<isl_union_access_info> object can be read from input
9094 using the following function.
9096         #include <isl/flow.h>
9097         __isl_give isl_union_access_info *
9098         isl_union_access_info_read_from_file(isl_ctx *ctx,
9099                 FILE *input);
9101 A representation of the information contained in an object
9102 of type C<isl_union_access_info> can be obtained using
9104         #include <isl/flow.h>
9105         __isl_give isl_printer *
9106         isl_printer_print_union_access_info(
9107                 __isl_take isl_printer *p,
9108                 __isl_keep isl_union_access_info *access);
9109         __isl_give char *isl_union_access_info_to_str(
9110                 __isl_keep isl_union_access_info *access);
9112 C<isl_union_access_info_to_str> prints the information in flow format.
9114 The output of C<isl_union_access_info_compute_flow> can be examined,
9115 copied, and freed using the following functions.
9117         #include <isl/flow.h>
9118         __isl_give isl_union_map *isl_union_flow_get_must_dependence(
9119                 __isl_keep isl_union_flow *flow);
9120         __isl_give isl_union_map *isl_union_flow_get_may_dependence(
9121                 __isl_keep isl_union_flow *flow);
9122         __isl_give isl_union_map *
9123         isl_union_flow_get_full_must_dependence(
9124                 __isl_keep isl_union_flow *flow);
9125         __isl_give isl_union_map *
9126         isl_union_flow_get_full_may_dependence(
9127                 __isl_keep isl_union_flow *flow);
9128         __isl_give isl_union_map *isl_union_flow_get_must_no_source(
9129                 __isl_keep isl_union_flow *flow);
9130         __isl_give isl_union_map *isl_union_flow_get_may_no_source(
9131                 __isl_keep isl_union_flow *flow);
9132         __isl_give isl_union_flow *isl_union_flow_copy(
9133                 __isl_keep isl_union_flow *flow);
9134         __isl_null isl_union_flow *isl_union_flow_free(
9135                 __isl_take isl_union_flow *flow);
9137 The relation returned by C<isl_union_flow_get_must_dependence>
9138 relates domain elements of must sources to domain elements of the sink.
9139 The relation returned by C<isl_union_flow_get_may_dependence>
9140 relates domain elements of must or may sources to domain elements of the sink
9141 and includes the previous relation as a subset.
9142 The relation returned by C<isl_union_flow_get_full_must_dependence>
9143 relates domain elements of must sources to pairs of domain elements of the sink
9144 and accessed data elements.
9145 The relation returned by C<isl_union_flow_get_full_may_dependence>
9146 relates domain elements of must or may sources to pairs of
9147 domain elements of the sink and accessed data elements.
9148 This relation includes the previous relation as a subset.
9149 The relation returned by C<isl_union_flow_get_must_no_source> is the subset
9150 of the sink relation for which no dependences have been found.
9151 The relation returned by C<isl_union_flow_get_may_no_source> is the subset
9152 of the sink relation for which no definite dependences have been found.
9153 That is, it contains those sink access that do not contribute to any
9154 of the elements in the relation returned
9155 by C<isl_union_flow_get_must_dependence>.
9157 A representation of the information contained in an object
9158 of type C<isl_union_flow> can be obtained using
9160         #include <isl/flow.h>
9161         __isl_give isl_printer *isl_printer_print_union_flow(
9162                 __isl_take isl_printer *p,
9163                 __isl_keep isl_union_flow *flow);
9164         __isl_give char *isl_union_flow_to_str(
9165                 __isl_keep isl_union_flow *flow);
9167 C<isl_union_flow_to_str> prints the information in flow format.
9169 =head3 Low-level Interface
9171 A lower-level interface is provided by the following functions.
9173         #include <isl/flow.h>
9175         typedef int (*isl_access_level_before)(void *first, void *second);
9177         __isl_give isl_access_info *isl_access_info_alloc(
9178                 __isl_take isl_map *sink,
9179                 void *sink_user, isl_access_level_before fn,
9180                 int max_source);
9181         __isl_give isl_access_info *isl_access_info_add_source(
9182                 __isl_take isl_access_info *acc,
9183                 __isl_take isl_map *source, int must,
9184                 void *source_user);
9185         __isl_null isl_access_info *isl_access_info_free(
9186                 __isl_take isl_access_info *acc);
9188         __isl_give isl_flow *isl_access_info_compute_flow(
9189                 __isl_take isl_access_info *acc);
9191         isl_stat isl_flow_foreach(__isl_keep isl_flow *deps,
9192                 isl_stat (*fn)(__isl_take isl_map *dep, int must,
9193                           void *dep_user, void *user),
9194                 void *user);
9195         __isl_give isl_map *isl_flow_get_no_source(
9196                 __isl_keep isl_flow *deps, int must);
9197         void isl_flow_free(__isl_take isl_flow *deps);
9199 The function C<isl_access_info_compute_flow> performs the actual
9200 dependence analysis.  The other functions are used to construct
9201 the input for this function or to read off the output.
9203 The input is collected in an C<isl_access_info>, which can
9204 be created through a call to C<isl_access_info_alloc>.
9205 The arguments to this functions are the sink access relation
9206 C<sink>, a token C<sink_user> used to identify the sink
9207 access to the user, a callback function for specifying the
9208 relative order of source and sink accesses, and the number
9209 of source access relations that will be added.
9211 The callback function has type C<int (*)(void *first, void *second)>.
9212 The function is called with two user supplied tokens identifying
9213 either a source or the sink and it should return the shared nesting
9214 level and the relative order of the two accesses.
9215 In particular, let I<n> be the number of loops shared by
9216 the two accesses.  If C<first> precedes C<second> textually,
9217 then the function should return I<2 * n + 1>; otherwise,
9218 it should return I<2 * n>.
9219 The low-level interface assumes that no sources are coscheduled.
9220 If the information returned by the callback does not allow
9221 the relative order to be determined, then one of the sources
9222 is arbitrarily taken to be executed after the other(s).
9224 The sources can be added to the C<isl_access_info> object by performing
9225 (at most) C<max_source> calls to C<isl_access_info_add_source>.
9226 C<must> indicates whether the source is a I<must> access
9227 or a I<may> access.  Note that a multi-valued access relation
9228 should only be marked I<must> if every iteration in the domain
9229 of the relation accesses I<all> elements in its image.
9230 The C<source_user> token is again used to identify
9231 the source access.  The range of the source access relation
9232 C<source> should have the same dimension as the range
9233 of the sink access relation.
9234 The C<isl_access_info_free> function should usually not be
9235 called explicitly, because it is already called implicitly by
9236 C<isl_access_info_compute_flow>.
9238 The result of the dependence analysis is collected in an
9239 C<isl_flow>.  There may be elements of
9240 the sink access for which no preceding source access could be
9241 found or for which all preceding sources are I<may> accesses.
9242 The relations containing these elements can be obtained through
9243 calls to C<isl_flow_get_no_source>, the first with C<must> set
9244 and the second with C<must> unset.
9245 In the case of standard flow dependence analysis,
9246 with the sink a read and the sources I<must> writes,
9247 the first relation corresponds to the reads from uninitialized
9248 array elements and the second relation is empty.
9249 The actual flow dependences can be extracted using
9250 C<isl_flow_foreach>.  This function will call the user-specified
9251 callback function C<fn> for each B<non-empty> dependence between
9252 a source and the sink.  The callback function is called
9253 with four arguments, the actual flow dependence relation
9254 mapping source iterations to sink iterations, a boolean that
9255 indicates whether it is a I<must> or I<may> dependence, a token
9256 identifying the source and an additional C<void *> with value
9257 equal to the third argument of the C<isl_flow_foreach> call.
9258 A dependence is marked I<must> if it originates from a I<must>
9259 source and if it is not followed by any I<may> sources.
9261 After finishing with an C<isl_flow>, the user should call
9262 C<isl_flow_free> to free all associated memory.
9264 =head3 Interaction with the Low-level Interface
9266 During the dependence analysis, we frequently need to perform
9267 the following operation.  Given a relation between sink iterations
9268 and potential source iterations from a particular source domain,
9269 what is the last potential source iteration corresponding to each
9270 sink iteration.  It can sometimes be convenient to adjust
9271 the set of potential source iterations before or after each such operation.
9272 The prototypical example is fuzzy array dataflow analysis,
9273 where we need to analyze if, based on data-dependent constraints,
9274 the sink iteration can ever be executed without one or more of
9275 the corresponding potential source iterations being executed.
9276 If so, we can introduce extra parameters and select an unknown
9277 but fixed source iteration from the potential source iterations.
9278 To be able to perform such manipulations, C<isl> provides the following
9279 function.
9281         #include <isl/flow.h>
9283         typedef __isl_give isl_restriction *(*isl_access_restrict)(
9284                 __isl_keep isl_map *source_map,
9285                 __isl_keep isl_set *sink, void *source_user,
9286                 void *user);
9287         __isl_give isl_access_info *isl_access_info_set_restrict(
9288                 __isl_take isl_access_info *acc,
9289                 isl_access_restrict fn, void *user);
9291 The function C<isl_access_info_set_restrict> should be called
9292 before calling C<isl_access_info_compute_flow> and registers a callback function
9293 that will be called any time C<isl> is about to compute the last
9294 potential source.  The first argument is the (reverse) proto-dependence,
9295 mapping sink iterations to potential source iterations.
9296 The second argument represents the sink iterations for which
9297 we want to compute the last source iteration.
9298 The third argument is the token corresponding to the source
9299 and the final argument is the token passed to C<isl_access_info_set_restrict>.
9300 The callback is expected to return a restriction on either the input or
9301 the output of the operation computing the last potential source.
9302 If the input needs to be restricted then restrictions are needed
9303 for both the source and the sink iterations.  The sink iterations
9304 and the potential source iterations will be intersected with these sets.
9305 If the output needs to be restricted then only a restriction on the source
9306 iterations is required.
9307 If any error occurs, the callback should return C<NULL>.
9308 An C<isl_restriction> object can be created, freed and inspected
9309 using the following functions.
9311         #include <isl/flow.h>
9313         __isl_give isl_restriction *isl_restriction_input(
9314                 __isl_take isl_set *source_restr,
9315                 __isl_take isl_set *sink_restr);
9316         __isl_give isl_restriction *isl_restriction_output(
9317                 __isl_take isl_set *source_restr);
9318         __isl_give isl_restriction *isl_restriction_none(
9319                 __isl_take isl_map *source_map);
9320         __isl_give isl_restriction *isl_restriction_empty(
9321                 __isl_take isl_map *source_map);
9322         __isl_null isl_restriction *isl_restriction_free(
9323                 __isl_take isl_restriction *restr);
9325 C<isl_restriction_none> and C<isl_restriction_empty> are special
9326 cases of C<isl_restriction_input>.  C<isl_restriction_none>
9327 is essentially equivalent to
9329         isl_restriction_input(isl_set_universe(
9330             isl_space_range(isl_map_get_space(source_map))),
9331                             isl_set_universe(
9332             isl_space_domain(isl_map_get_space(source_map))));
9334 whereas C<isl_restriction_empty> is essentially equivalent to
9336         isl_restriction_input(isl_set_empty(
9337             isl_space_range(isl_map_get_space(source_map))),
9338                             isl_set_universe(
9339             isl_space_domain(isl_map_get_space(source_map))));
9341 =head2 Scheduling
9343         #include <isl/schedule.h>
9344         __isl_give isl_schedule *
9345         isl_schedule_constraints_compute_schedule(
9346                 __isl_take isl_schedule_constraints *sc);
9348 The function C<isl_schedule_constraints_compute_schedule> can be
9349 used to compute a schedule that satisfies the given schedule constraints.
9350 These schedule constraints include the iteration domain for which
9351 a schedule should be computed and dependences between pairs of
9352 iterations.  In particular, these dependences include
9353 I<validity> dependences and I<proximity> dependences.
9354 By default, the algorithm used to construct the schedule is similar
9355 to that of C<Pluto>.
9356 Alternatively, Feautrier's multi-dimensional scheduling algorithm can
9357 be selected.
9358 The generated schedule respects all validity dependences.
9359 That is, all dependence distances over these dependences in the
9360 scheduled space are lexicographically positive.
9362 The default algorithm tries to ensure that the dependence distances
9363 over coincidence constraints are zero and to minimize the
9364 dependence distances over proximity dependences.
9365 Moreover, it tries to obtain sequences (bands) of schedule dimensions
9366 for groups of domains where the dependence distances over validity
9367 dependences have only non-negative values.
9368 Note that when minimizing the maximal dependence distance
9369 over proximity dependences, a single affine expression in the parameters
9370 is constructed that bounds all dependence distances.  If no such expression
9371 exists, then the algorithm will fail and resort to an alternative
9372 scheduling algorithm.  In particular, this means that adding proximity
9373 dependences may eliminate valid solutions.  A typical example where this
9374 phenomenon may occur is when some subset of the proximity dependences
9375 has no restriction on some parameter, forcing the coefficient of that
9376 parameter to be zero, while some other subset forces the dependence
9377 distance to depend on that parameter, requiring the same coefficient
9378 to be non-zero.
9379 When using Feautrier's algorithm, the coincidence and proximity constraints
9380 are only taken into account during the extension to a
9381 full-dimensional schedule.
9383 An C<isl_schedule_constraints> object can be constructed
9384 and manipulated using the following functions.
9386         #include <isl/schedule.h>
9387         __isl_give isl_schedule_constraints *
9388         isl_schedule_constraints_copy(
9389                 __isl_keep isl_schedule_constraints *sc);
9390         __isl_give isl_schedule_constraints *
9391         isl_schedule_constraints_on_domain(
9392                 __isl_take isl_union_set *domain);
9393         __isl_give isl_schedule_constraints *
9394         isl_schedule_constraints_set_context(
9395                 __isl_take isl_schedule_constraints *sc,
9396                 __isl_take isl_set *context);
9397         __isl_give isl_schedule_constraints *
9398         isl_schedule_constraints_set_validity(
9399                 __isl_take isl_schedule_constraints *sc,
9400                 __isl_take isl_union_map *validity);
9401         __isl_give isl_schedule_constraints *
9402         isl_schedule_constraints_set_coincidence(
9403                 __isl_take isl_schedule_constraints *sc,
9404                 __isl_take isl_union_map *coincidence);
9405         __isl_give isl_schedule_constraints *
9406         isl_schedule_constraints_set_proximity(
9407                 __isl_take isl_schedule_constraints *sc,
9408                 __isl_take isl_union_map *proximity);
9409         __isl_give isl_schedule_constraints *
9410         isl_schedule_constraints_set_conditional_validity(
9411                 __isl_take isl_schedule_constraints *sc,
9412                 __isl_take isl_union_map *condition,
9413                 __isl_take isl_union_map *validity);
9414         __isl_give isl_schedule_constraints *
9415         isl_schedule_constraints_apply(
9416                 __isl_take isl_schedule_constraints *sc,
9417                 __isl_take isl_union_map *umap);
9418         __isl_null isl_schedule_constraints *
9419         isl_schedule_constraints_free(
9420                 __isl_take isl_schedule_constraints *sc);
9422 The initial C<isl_schedule_constraints> object created by
9423 C<isl_schedule_constraints_on_domain> does not impose any constraints.
9424 That is, it has an empty set of dependences.
9425 The function C<isl_schedule_constraints_set_context> allows the user
9426 to specify additional constraints on the parameters that may
9427 be assumed to hold during the construction of the schedule.
9428 The function C<isl_schedule_constraints_set_validity> replaces the
9429 validity dependences, mapping domain elements I<i> to domain
9430 elements that should be scheduled after I<i>.
9431 The function C<isl_schedule_constraints_set_coincidence> replaces the
9432 coincidence dependences, mapping domain elements I<i> to domain
9433 elements that should be scheduled together with I<I>, if possible.
9434 The function C<isl_schedule_constraints_set_proximity> replaces the
9435 proximity dependences, mapping domain elements I<i> to domain
9436 elements that should be scheduled either before I<I>
9437 or as early as possible after I<i>.
9439 The function C<isl_schedule_constraints_set_conditional_validity>
9440 replaces the conditional validity constraints.
9441 A conditional validity constraint is only imposed when any of the corresponding
9442 conditions is satisfied, i.e., when any of them is non-zero.
9443 That is, the scheduler ensures that within each band if the dependence
9444 distances over the condition constraints are not all zero
9445 then all corresponding conditional validity constraints are respected.
9446 A conditional validity constraint corresponds to a condition
9447 if the two are adjacent, i.e., if the domain of one relation intersect
9448 the range of the other relation.
9449 The typical use case of conditional validity constraints is
9450 to allow order constraints between live ranges to be violated
9451 as long as the live ranges themselves are local to the band.
9452 To allow more fine-grained control over which conditions correspond
9453 to which conditional validity constraints, the domains and ranges
9454 of these relations may include I<tags>.  That is, the domains and
9455 ranges of those relation may themselves be wrapped relations
9456 where the iteration domain appears in the domain of those wrapped relations
9457 and the range of the wrapped relations can be arbitrarily chosen
9458 by the user.  Conditions and conditional validity constraints are only
9459 considered adjacent to each other if the entire wrapped relation matches.
9460 In particular, a relation with a tag will never be considered adjacent
9461 to a relation without a tag.
9463 The function C<isl_schedule_constraints_apply> takes
9464 schedule constraints that are defined on some set of domain elements
9465 and transforms them to schedule constraints on the elements
9466 to which these domain elements are mapped by the given transformation.
9468 An C<isl_schedule_constraints> object can be inspected
9469 using the following functions.
9471         #include <isl/schedule.h>
9472         __isl_give isl_union_set *
9473         isl_schedule_constraints_get_domain(
9474                 __isl_keep isl_schedule_constraints *sc);
9475         __isl_give isl_set *isl_schedule_constraints_get_context(
9476                 __isl_keep isl_schedule_constraints *sc);
9477         __isl_give isl_union_map *
9478         isl_schedule_constraints_get_validity(
9479                 __isl_keep isl_schedule_constraints *sc);
9480         __isl_give isl_union_map *
9481         isl_schedule_constraints_get_coincidence(
9482                 __isl_keep isl_schedule_constraints *sc);
9483         __isl_give isl_union_map *
9484         isl_schedule_constraints_get_proximity(
9485                 __isl_keep isl_schedule_constraints *sc);
9486         __isl_give isl_union_map *
9487         isl_schedule_constraints_get_conditional_validity(
9488                 __isl_keep isl_schedule_constraints *sc);
9489         __isl_give isl_union_map *
9490         isl_schedule_constraints_get_conditional_validity_condition(
9491                 __isl_keep isl_schedule_constraints *sc);
9493 An C<isl_schedule_constraints> object can be read from input
9494 using the following functions.
9496         #include <isl/schedule.h>
9497         __isl_give isl_schedule_constraints *
9498         isl_schedule_constraints_read_from_str(isl_ctx *ctx,
9499                 const char *str);
9500         __isl_give isl_schedule_constraints *
9501         isl_schedule_constraints_read_from_file(isl_ctx *ctx,
9502                 FILE *input);
9504 The contents of an C<isl_schedule_constraints> object can be printed
9505 using the following functions.
9507         #include <isl/schedule.h>
9508         __isl_give isl_printer *
9509         isl_printer_print_schedule_constraints(
9510                 __isl_take isl_printer *p,
9511                 __isl_keep isl_schedule_constraints *sc);
9512         __isl_give char *isl_schedule_constraints_to_str(
9513                 __isl_keep isl_schedule_constraints *sc);
9515 The following function computes a schedule directly from
9516 an iteration domain and validity and proximity dependences
9517 and is implemented in terms of the functions described above.
9518 The use of C<isl_union_set_compute_schedule> is discouraged.
9520         #include <isl/schedule.h>
9521         __isl_give isl_schedule *isl_union_set_compute_schedule(
9522                 __isl_take isl_union_set *domain,
9523                 __isl_take isl_union_map *validity,
9524                 __isl_take isl_union_map *proximity);
9526 The generated schedule represents a schedule tree.
9527 For more information on schedule trees, see
9528 L</"Schedule Trees">.
9530 =head3 Options
9532         #include <isl/schedule.h>
9533         isl_stat isl_options_set_schedule_max_coefficient(
9534                 isl_ctx *ctx, int val);
9535         int isl_options_get_schedule_max_coefficient(
9536                 isl_ctx *ctx);
9537         isl_stat isl_options_set_schedule_max_constant_term(
9538                 isl_ctx *ctx, int val);
9539         int isl_options_get_schedule_max_constant_term(
9540                 isl_ctx *ctx);
9541         isl_stat isl_options_set_schedule_serialize_sccs(
9542                 isl_ctx *ctx, int val);
9543         int isl_options_get_schedule_serialize_sccs(isl_ctx *ctx);
9544         isl_stat isl_options_set_schedule_whole_component(
9545                 isl_ctx *ctx, int val);
9546         int isl_options_get_schedule_whole_component(
9547                 isl_ctx *ctx);
9548         isl_stat isl_options_set_schedule_maximize_band_depth(
9549                 isl_ctx *ctx, int val);
9550         int isl_options_get_schedule_maximize_band_depth(
9551                 isl_ctx *ctx);
9552         isl_stat isl_options_set_schedule_maximize_coincidence(
9553                 isl_ctx *ctx, int val);
9554         int isl_options_get_schedule_maximize_coincidence(
9555                 isl_ctx *ctx);
9556         isl_stat isl_options_set_schedule_outer_coincidence(
9557                 isl_ctx *ctx, int val);
9558         int isl_options_get_schedule_outer_coincidence(
9559                 isl_ctx *ctx);
9560         isl_stat isl_options_set_schedule_split_scaled(
9561                 isl_ctx *ctx, int val);
9562         int isl_options_get_schedule_split_scaled(
9563                 isl_ctx *ctx);
9564         isl_stat isl_options_set_schedule_treat_coalescing(
9565                 isl_ctx *ctx, int val);
9566         int isl_options_get_schedule_treat_coalescing(
9567                 isl_ctx *ctx);
9568         isl_stat isl_options_set_schedule_algorithm(
9569                 isl_ctx *ctx, int val);
9570         int isl_options_get_schedule_algorithm(
9571                 isl_ctx *ctx);
9572         isl_stat isl_options_set_schedule_carry_self_first(
9573                 isl_ctx *ctx, int val);
9574         int isl_options_get_schedule_carry_self_first(
9575                 isl_ctx *ctx);
9576         isl_stat isl_options_set_schedule_separate_components(
9577                 isl_ctx *ctx, int val);
9578         int isl_options_get_schedule_separate_components(
9579                 isl_ctx *ctx);
9581 =over
9583 =item * schedule_max_coefficient
9585 This option enforces that the coefficients for variable and parameter
9586 dimensions in the calculated schedule are not larger than the specified value.
9587 This option can significantly increase the speed of the scheduling calculation
9588 and may also prevent fusing of unrelated dimensions. A value of -1 means that
9589 this option does not introduce bounds on the variable or parameter
9590 coefficients.
9592 =item * schedule_max_constant_term
9594 This option enforces that the constant coefficients in the calculated schedule
9595 are not larger than the maximal constant term. This option can significantly
9596 increase the speed of the scheduling calculation and may also prevent fusing of
9597 unrelated dimensions. A value of -1 means that this option does not introduce
9598 bounds on the constant coefficients.
9600 =item * schedule_serialize_sccs
9602 If this option is set, then all strongly connected components
9603 in the dependence graph are serialized as soon as they are detected.
9604 This means in particular that instances of statements will only
9605 appear in the same band node if these statements belong
9606 to the same strongly connected component at the point where
9607 the band node is constructed.
9609 =item * schedule_whole_component
9611 If this option is set, then entire (weakly) connected
9612 components in the dependence graph are scheduled together
9613 as a whole.
9614 Otherwise, each strongly connected component within
9615 such a weakly connected component is first scheduled separately
9616 and then combined with other strongly connected components.
9617 This option has no effect if C<schedule_serialize_sccs> is set.
9619 =item * schedule_maximize_band_depth
9621 If this option is set, then the scheduler tries to maximize
9622 the width of the bands.  Wider bands give more possibilities for tiling.
9623 In particular, if the C<schedule_whole_component> option is set,
9624 then bands are split if this might result in wider bands.
9625 Otherwise, the effect of this option is to only allow
9626 strongly connected components to be combined if this does
9627 not reduce the width of the bands.
9628 Note that if the C<schedule_serialize_sccs> options is set, then
9629 the C<schedule_maximize_band_depth> option therefore has no effect.
9631 =item * schedule_maximize_coincidence
9633 This option is only effective if the C<schedule_whole_component>
9634 option is turned off.
9635 If the C<schedule_maximize_coincidence> option is set, then (clusters of)
9636 strongly connected components are only combined with each other
9637 if this does not reduce the number of coincident band members.
9639 =item * schedule_outer_coincidence
9641 If this option is set, then we try to construct schedules
9642 where the outermost scheduling dimension in each band
9643 satisfies the coincidence constraints.
9645 =item * schedule_algorithm
9647 Selects the scheduling algorithm to be used.
9648 Available scheduling algorithms are C<ISL_SCHEDULE_ALGORITHM_ISL>
9649 and C<ISL_SCHEDULE_ALGORITHM_FEAUTRIER>.
9651 =item * schedule_split_scaled
9653 If this option is set, then we try to construct schedules in which the
9654 constant term is split off from the linear part if the linear parts of
9655 the scheduling rows for all nodes in the graph have a common non-trivial
9656 divisor.
9657 The constant term is then dropped and the linear
9658 part is reduced.
9659 This option is only effective when the Feautrier style scheduler is
9660 being used, either as the main scheduler or as a fallback for the
9661 Pluto-like scheduler.
9663 =item * schedule_treat_coalescing
9665 If this option is set, then the scheduler will try and avoid
9666 producing schedules that perform loop coalescing.
9667 In particular, for the Pluto-like scheduler, this option places
9668 bounds on the schedule coefficients based on the sizes of the instance sets.
9669 For the Feautrier style scheduler, this option detects potentially
9670 coalescing schedules and then tries to adjust the schedule to avoid
9671 the coalescing.
9673 =item * schedule_carry_self_first
9675 If this option is set, then the Feautrier style scheduler
9676 (when used as a fallback for the Pluto-like scheduler) will
9677 first try to only carry self-dependences.
9679 =item * schedule_separate_components
9681 If this option is set then the function C<isl_schedule_get_map>
9682 will treat set nodes in the same way as sequence nodes.
9684 =back
9686 =head2 AST Generation
9688 This section describes the C<isl> functionality for generating
9689 ASTs that visit all the elements
9690 in a domain in an order specified by a schedule tree or
9691 a schedule map.
9692 In case the schedule given as a C<isl_union_map>, an AST is generated
9693 that visits all the elements in the domain of the C<isl_union_map>
9694 according to the lexicographic order of the corresponding image
9695 element(s).  If the range of the C<isl_union_map> consists of
9696 elements in more than one space, then each of these spaces is handled
9697 separately in an arbitrary order.
9698 It should be noted that the schedule tree or the image elements
9699 in a schedule map only specify the I<order>
9700 in which the corresponding domain elements should be visited.
9701 No direct relation between the partial schedule values
9702 or the image elements on the one hand and the loop iterators
9703 in the generated AST on the other hand should be assumed.
9705 Each AST is generated within a build.  The initial build
9706 simply specifies the constraints on the parameters (if any)
9707 and can be created, inspected, copied and freed using the following functions.
9709         #include <isl/ast_build.h>
9710         __isl_give isl_ast_build *isl_ast_build_alloc(
9711                 isl_ctx *ctx);
9712         __isl_give isl_ast_build *isl_ast_build_from_context(
9713                 __isl_take isl_set *set);
9714         __isl_give isl_ast_build *isl_ast_build_copy(
9715                 __isl_keep isl_ast_build *build);
9716         __isl_null isl_ast_build *isl_ast_build_free(
9717                 __isl_take isl_ast_build *build);
9719 The C<set> argument is usually a parameter set with zero or more parameters.
9720 In fact, when creating an AST using C<isl_ast_build_node_from_schedule>,
9721 this set is required to be a parameter set.
9722 An C<isl_ast_build> created using C<isl_ast_build_alloc> does not
9723 specify any parameter constraints.
9724 More C<isl_ast_build> functions are described in L</"Nested AST Generation">
9725 and L</"Fine-grained Control over AST Generation">.
9726 Finally, the AST itself can be constructed using one of the following
9727 functions.
9729         #include <isl/ast_build.h>
9730         __isl_give isl_ast_node *isl_ast_build_node_from_schedule(
9731                 __isl_keep isl_ast_build *build,
9732                 __isl_take isl_schedule *schedule);
9733         __isl_give isl_ast_node *
9734         isl_ast_build_node_from_schedule_map(
9735                 __isl_keep isl_ast_build *build,
9736                 __isl_take isl_union_map *schedule);
9738 =head3 Inspecting the AST
9740 The basic properties of an AST node can be obtained as follows.
9742         #include <isl/ast.h>
9743         enum isl_ast_node_type isl_ast_node_get_type(
9744                 __isl_keep isl_ast_node *node);
9746 The type of an AST node is one of
9747 C<isl_ast_node_for>,
9748 C<isl_ast_node_if>,
9749 C<isl_ast_node_block>,
9750 C<isl_ast_node_mark> or
9751 C<isl_ast_node_user>.
9752 An C<isl_ast_node_for> represents a for node.
9753 An C<isl_ast_node_if> represents an if node.
9754 An C<isl_ast_node_block> represents a compound node.
9755 An C<isl_ast_node_mark> introduces a mark in the AST.
9756 An C<isl_ast_node_user> represents an expression statement.
9757 An expression statement typically corresponds to a domain element, i.e.,
9758 one of the elements that is visited by the AST.
9760 Each type of node has its own additional properties.
9762         #include <isl/ast.h>
9763         __isl_give isl_ast_expr *isl_ast_node_for_get_iterator(
9764                 __isl_keep isl_ast_node *node);
9765         __isl_give isl_ast_expr *isl_ast_node_for_get_init(
9766                 __isl_keep isl_ast_node *node);
9767         __isl_give isl_ast_expr *isl_ast_node_for_get_cond(
9768                 __isl_keep isl_ast_node *node);
9769         __isl_give isl_ast_expr *isl_ast_node_for_get_inc(
9770                 __isl_keep isl_ast_node *node);
9771         __isl_give isl_ast_node *isl_ast_node_for_get_body(
9772                 __isl_keep isl_ast_node *node);
9773         isl_bool isl_ast_node_for_is_degenerate(
9774                 __isl_keep isl_ast_node *node);
9776 An C<isl_ast_for> is considered degenerate if it is known to execute
9777 exactly once.
9779         #include <isl/ast.h>
9780         __isl_give isl_ast_expr *isl_ast_node_if_get_cond(
9781                 __isl_keep isl_ast_node *node);
9782         __isl_give isl_ast_node *isl_ast_node_if_get_then(
9783                 __isl_keep isl_ast_node *node);
9784         isl_bool isl_ast_node_if_has_else(
9785                 __isl_keep isl_ast_node *node);
9786         __isl_give isl_ast_node *isl_ast_node_if_get_else(
9787                 __isl_keep isl_ast_node *node);
9789         __isl_give isl_ast_node_list *
9790         isl_ast_node_block_get_children(
9791                 __isl_keep isl_ast_node *node);
9793         __isl_give isl_id *isl_ast_node_mark_get_id(
9794                 __isl_keep isl_ast_node *node);
9795         __isl_give isl_ast_node *isl_ast_node_mark_get_node(
9796                 __isl_keep isl_ast_node *node);
9798 C<isl_ast_node_mark_get_id> returns the identifier of the mark.
9799 C<isl_ast_node_mark_get_node> returns the child node that is being marked.
9801         #include <isl/ast.h>
9802         __isl_give isl_ast_expr *isl_ast_node_user_get_expr(
9803                 __isl_keep isl_ast_node *node);
9805 All descendants of a specific node in the AST (including the node itself)
9806 can be visited
9807 in depth-first pre-order using the following function.
9809         #include <isl/ast.h>
9810         isl_stat isl_ast_node_foreach_descendant_top_down(
9811                 __isl_keep isl_ast_node *node,
9812                 isl_bool (*fn)(__isl_keep isl_ast_node *node,
9813                         void *user), void *user);
9815 The callback function should return C<isl_bool_true> if the children
9816 of the given node should be visited and C<isl_bool_false> if they should not.
9817 It should return C<isl_bool_error> in case of failure, in which case
9818 the entire traversal is aborted.
9820 Each of the returned C<isl_ast_expr>s can in turn be inspected using
9821 the following functions.
9823         #include <isl/ast.h>
9824         enum isl_ast_expr_type isl_ast_expr_get_type(
9825                 __isl_keep isl_ast_expr *expr);
9827 The type of an AST expression is one of
9828 C<isl_ast_expr_op>,
9829 C<isl_ast_expr_id> or
9830 C<isl_ast_expr_int>.
9831 An C<isl_ast_expr_op> represents the result of an operation.
9832 An C<isl_ast_expr_id> represents an identifier.
9833 An C<isl_ast_expr_int> represents an integer value.
9835 Each type of expression has its own additional properties.
9837         #include <isl/ast.h>
9838         enum isl_ast_op_type isl_ast_expr_get_op_type(
9839                 __isl_keep isl_ast_expr *expr);
9840         int isl_ast_expr_get_op_n_arg(__isl_keep isl_ast_expr *expr);
9841         __isl_give isl_ast_expr *isl_ast_expr_get_op_arg(
9842                 __isl_keep isl_ast_expr *expr, int pos);
9843         isl_stat isl_ast_expr_foreach_ast_op_type(
9844                 __isl_keep isl_ast_expr *expr,
9845                 isl_stat (*fn)(enum isl_ast_op_type type,
9846                         void *user), void *user);
9847         isl_stat isl_ast_node_foreach_ast_op_type(
9848                 __isl_keep isl_ast_node *node,
9849                 isl_stat (*fn)(enum isl_ast_op_type type,
9850                         void *user), void *user);
9852 C<isl_ast_expr_get_op_type> returns the type of the operation
9853 performed.  C<isl_ast_expr_get_op_n_arg> returns the number of
9854 arguments.  C<isl_ast_expr_get_op_arg> returns the specified
9855 argument.
9856 C<isl_ast_expr_foreach_ast_op_type> calls C<fn> for each distinct
9857 C<isl_ast_op_type> that appears in C<expr>.
9858 C<isl_ast_node_foreach_ast_op_type> does the same for each distinct
9859 C<isl_ast_op_type> that appears in C<node>.
9860 The operation type is one of the following.
9862 =over
9864 =item C<isl_ast_op_and>
9866 Logical I<and> of two arguments.
9867 Both arguments can be evaluated.
9869 =item C<isl_ast_op_and_then>
9871 Logical I<and> of two arguments.
9872 The second argument can only be evaluated if the first evaluates to true.
9874 =item C<isl_ast_op_or>
9876 Logical I<or> of two arguments.
9877 Both arguments can be evaluated.
9879 =item C<isl_ast_op_or_else>
9881 Logical I<or> of two arguments.
9882 The second argument can only be evaluated if the first evaluates to false.
9884 =item C<isl_ast_op_max>
9886 Maximum of two or more arguments.
9888 =item C<isl_ast_op_min>
9890 Minimum of two or more arguments.
9892 =item C<isl_ast_op_minus>
9894 Change sign.
9896 =item C<isl_ast_op_add>
9898 Sum of two arguments.
9900 =item C<isl_ast_op_sub>
9902 Difference of two arguments.
9904 =item C<isl_ast_op_mul>
9906 Product of two arguments.
9908 =item C<isl_ast_op_div>
9910 Exact division.  That is, the result is known to be an integer.
9912 =item C<isl_ast_op_fdiv_q>
9914 Result of integer division, rounded towards negative
9915 infinity.
9917 =item C<isl_ast_op_pdiv_q>
9919 Result of integer division, where dividend is known to be non-negative.
9921 =item C<isl_ast_op_pdiv_r>
9923 Remainder of integer division, where dividend is known to be non-negative.
9925 =item C<isl_ast_op_zdiv_r>
9927 Equal to zero iff the remainder on integer division is zero.
9929 =item C<isl_ast_op_cond>
9931 Conditional operator defined on three arguments.
9932 If the first argument evaluates to true, then the result
9933 is equal to the second argument.  Otherwise, the result
9934 is equal to the third argument.
9935 The second and third argument may only be evaluated if
9936 the first argument evaluates to true and false, respectively.
9937 Corresponds to C<a ? b : c> in C.
9939 =item C<isl_ast_op_select>
9941 Conditional operator defined on three arguments.
9942 If the first argument evaluates to true, then the result
9943 is equal to the second argument.  Otherwise, the result
9944 is equal to the third argument.
9945 The second and third argument may be evaluated independently
9946 of the value of the first argument.
9947 Corresponds to C<a * b + (1 - a) * c> in C.
9949 =item C<isl_ast_op_eq>
9951 Equality relation.
9953 =item C<isl_ast_op_le>
9955 Less than or equal relation.
9957 =item C<isl_ast_op_lt>
9959 Less than relation.
9961 =item C<isl_ast_op_ge>
9963 Greater than or equal relation.
9965 =item C<isl_ast_op_gt>
9967 Greater than relation.
9969 =item C<isl_ast_op_call>
9971 A function call.
9972 The number of arguments of the C<isl_ast_expr> is one more than
9973 the number of arguments in the function call, the first argument
9974 representing the function being called.
9976 =item C<isl_ast_op_access>
9978 An array access.
9979 The number of arguments of the C<isl_ast_expr> is one more than
9980 the number of index expressions in the array access, the first argument
9981 representing the array being accessed.
9983 =item C<isl_ast_op_member>
9985 A member access.
9986 This operation has two arguments, a structure and the name of
9987 the member of the structure being accessed.
9989 =back
9991         #include <isl/ast.h>
9992         __isl_give isl_id *isl_ast_expr_get_id(
9993                 __isl_keep isl_ast_expr *expr);
9995 Return the identifier represented by the AST expression.
9997         #include <isl/ast.h>
9998         __isl_give isl_val *isl_ast_expr_get_val(
9999                 __isl_keep isl_ast_expr *expr);
10001 Return the integer represented by the AST expression.
10003 =head3 Properties of ASTs
10005         #include <isl/ast.h>
10006         isl_bool isl_ast_expr_is_equal(
10007                 __isl_keep isl_ast_expr *expr1,
10008                 __isl_keep isl_ast_expr *expr2);
10010 Check if two C<isl_ast_expr>s are equal to each other.
10012 =head3 Manipulating and printing the AST
10014 AST nodes can be copied and freed using the following functions.
10016         #include <isl/ast.h>
10017         __isl_give isl_ast_node *isl_ast_node_copy(
10018                 __isl_keep isl_ast_node *node);
10019         __isl_null isl_ast_node *isl_ast_node_free(
10020                 __isl_take isl_ast_node *node);
10022 AST expressions can be copied and freed using the following functions.
10024         #include <isl/ast.h>
10025         __isl_give isl_ast_expr *isl_ast_expr_copy(
10026                 __isl_keep isl_ast_expr *expr);
10027         __isl_null isl_ast_expr *isl_ast_expr_free(
10028                 __isl_take isl_ast_expr *expr);
10030 New AST expressions can be created either directly or within
10031 the context of an C<isl_ast_build>.
10033         #include <isl/ast.h>
10034         __isl_give isl_ast_expr *isl_ast_expr_from_val(
10035                 __isl_take isl_val *v);
10036         __isl_give isl_ast_expr *isl_ast_expr_from_id(
10037                 __isl_take isl_id *id);
10038         __isl_give isl_ast_expr *isl_ast_expr_neg(
10039                 __isl_take isl_ast_expr *expr);
10040         __isl_give isl_ast_expr *isl_ast_expr_address_of(
10041                 __isl_take isl_ast_expr *expr);
10042         __isl_give isl_ast_expr *isl_ast_expr_add(
10043                 __isl_take isl_ast_expr *expr1,
10044                 __isl_take isl_ast_expr *expr2);
10045         __isl_give isl_ast_expr *isl_ast_expr_sub(
10046                 __isl_take isl_ast_expr *expr1,
10047                 __isl_take isl_ast_expr *expr2);
10048         __isl_give isl_ast_expr *isl_ast_expr_mul(
10049                 __isl_take isl_ast_expr *expr1,
10050                 __isl_take isl_ast_expr *expr2);
10051         __isl_give isl_ast_expr *isl_ast_expr_div(
10052                 __isl_take isl_ast_expr *expr1,
10053                 __isl_take isl_ast_expr *expr2);
10054         __isl_give isl_ast_expr *isl_ast_expr_pdiv_q(
10055                 __isl_take isl_ast_expr *expr1,
10056                 __isl_take isl_ast_expr *expr2);
10057         __isl_give isl_ast_expr *isl_ast_expr_pdiv_r(
10058                 __isl_take isl_ast_expr *expr1,
10059                 __isl_take isl_ast_expr *expr2);
10060         __isl_give isl_ast_expr *isl_ast_expr_and(
10061                 __isl_take isl_ast_expr *expr1,
10062                 __isl_take isl_ast_expr *expr2)
10063         __isl_give isl_ast_expr *isl_ast_expr_and_then(
10064                 __isl_take isl_ast_expr *expr1,
10065                 __isl_take isl_ast_expr *expr2)
10066         __isl_give isl_ast_expr *isl_ast_expr_or(
10067                 __isl_take isl_ast_expr *expr1,
10068                 __isl_take isl_ast_expr *expr2)
10069         __isl_give isl_ast_expr *isl_ast_expr_or_else(
10070                 __isl_take isl_ast_expr *expr1,
10071                 __isl_take isl_ast_expr *expr2)
10072         __isl_give isl_ast_expr *isl_ast_expr_eq(
10073                 __isl_take isl_ast_expr *expr1,
10074                 __isl_take isl_ast_expr *expr2);
10075         __isl_give isl_ast_expr *isl_ast_expr_le(
10076                 __isl_take isl_ast_expr *expr1,
10077                 __isl_take isl_ast_expr *expr2);
10078         __isl_give isl_ast_expr *isl_ast_expr_lt(
10079                 __isl_take isl_ast_expr *expr1,
10080                 __isl_take isl_ast_expr *expr2);
10081         __isl_give isl_ast_expr *isl_ast_expr_ge(
10082                 __isl_take isl_ast_expr *expr1,
10083                 __isl_take isl_ast_expr *expr2);
10084         __isl_give isl_ast_expr *isl_ast_expr_gt(
10085                 __isl_take isl_ast_expr *expr1,
10086                 __isl_take isl_ast_expr *expr2);
10087         __isl_give isl_ast_expr *isl_ast_expr_access(
10088                 __isl_take isl_ast_expr *array,
10089                 __isl_take isl_ast_expr_list *indices);
10090         __isl_give isl_ast_expr *isl_ast_expr_call(
10091                 __isl_take isl_ast_expr *function,
10092                 __isl_take isl_ast_expr_list *arguments);
10094 The function C<isl_ast_expr_address_of> can be applied to an
10095 C<isl_ast_expr> of type C<isl_ast_op_access> only. It is meant
10096 to represent the address of the C<isl_ast_expr_access>. The function
10097 C<isl_ast_expr_and_then> as well as C<isl_ast_expr_or_else> are short-circuit
10098 versions of C<isl_ast_expr_and> and C<isl_ast_expr_or>, respectively.
10100         #include <isl/ast_build.h>
10101         __isl_give isl_ast_expr *isl_ast_build_expr_from_set(
10102                 __isl_keep isl_ast_build *build,
10103                 __isl_take isl_set *set);
10104         __isl_give isl_ast_expr *isl_ast_build_expr_from_pw_aff(
10105                 __isl_keep isl_ast_build *build,
10106                 __isl_take isl_pw_aff *pa);
10107         __isl_give isl_ast_expr *
10108         isl_ast_build_access_from_pw_multi_aff(
10109                 __isl_keep isl_ast_build *build,
10110                 __isl_take isl_pw_multi_aff *pma);
10111         __isl_give isl_ast_expr *
10112         isl_ast_build_access_from_multi_pw_aff(
10113                 __isl_keep isl_ast_build *build,
10114                 __isl_take isl_multi_pw_aff *mpa);
10115         __isl_give isl_ast_expr *
10116         isl_ast_build_call_from_pw_multi_aff(
10117                 __isl_keep isl_ast_build *build,
10118                 __isl_take isl_pw_multi_aff *pma);
10119         __isl_give isl_ast_expr *
10120         isl_ast_build_call_from_multi_pw_aff(
10121                 __isl_keep isl_ast_build *build,
10122                 __isl_take isl_multi_pw_aff *mpa);
10124 The set <set> and
10125 the domains of C<pa>, C<mpa> and C<pma> should correspond
10126 to the schedule space of C<build>.
10127 The tuple id of C<mpa> or C<pma> is used as the array being accessed or
10128 the function being called.
10129 If the accessed space is a nested relation, then it is taken
10130 to represent an access of the member specified by the range
10131 of this nested relation of the structure specified by the domain
10132 of the nested relation.
10134 The following functions can be used to modify an C<isl_ast_expr>.
10136         #include <isl/ast.h>
10137         __isl_give isl_ast_expr *isl_ast_expr_set_op_arg(
10138                 __isl_take isl_ast_expr *expr, int pos,
10139                 __isl_take isl_ast_expr *arg);
10141 Replace the argument of C<expr> at position C<pos> by C<arg>.
10143         #include <isl/ast.h>
10144         __isl_give isl_ast_expr *isl_ast_expr_substitute_ids(
10145                 __isl_take isl_ast_expr *expr,
10146                 __isl_take isl_id_to_ast_expr *id2expr);
10148 The function C<isl_ast_expr_substitute_ids> replaces the
10149 subexpressions of C<expr> of type C<isl_ast_expr_id>
10150 by the corresponding expression in C<id2expr>, if there is any.
10153 User specified data can be attached to an C<isl_ast_node> and obtained
10154 from the same C<isl_ast_node> using the following functions.
10156         #include <isl/ast.h>
10157         __isl_give isl_ast_node *isl_ast_node_set_annotation(
10158                 __isl_take isl_ast_node *node,
10159                 __isl_take isl_id *annotation);
10160         __isl_give isl_id *isl_ast_node_get_annotation(
10161                 __isl_keep isl_ast_node *node);
10163 Basic printing can be performed using the following functions.
10165         #include <isl/ast.h>
10166         __isl_give isl_printer *isl_printer_print_ast_expr(
10167                 __isl_take isl_printer *p,
10168                 __isl_keep isl_ast_expr *expr);
10169         __isl_give isl_printer *isl_printer_print_ast_node(
10170                 __isl_take isl_printer *p,
10171                 __isl_keep isl_ast_node *node);
10172         __isl_give char *isl_ast_expr_to_str(
10173                 __isl_keep isl_ast_expr *expr);
10174         __isl_give char *isl_ast_node_to_str(
10175                 __isl_keep isl_ast_node *node);
10176         __isl_give char *isl_ast_expr_to_C_str(
10177                 __isl_keep isl_ast_expr *expr);
10178         __isl_give char *isl_ast_node_to_C_str(
10179                 __isl_keep isl_ast_node *node);
10181 The functions C<isl_ast_expr_to_C_str> and
10182 C<isl_ast_node_to_C_str> are convenience functions
10183 that return a string representation of the input in C format.
10185 More advanced printing can be performed using the following functions.
10187         #include <isl/ast.h>
10188         __isl_give isl_printer *isl_ast_op_type_set_print_name(
10189                 __isl_take isl_printer *p,
10190                 enum isl_ast_op_type type,
10191                 __isl_keep const char *name);
10192         isl_stat isl_options_set_ast_print_macro_once(
10193                 isl_ctx *ctx, int val);
10194         int isl_options_get_ast_print_macro_once(isl_ctx *ctx);
10195         __isl_give isl_printer *isl_ast_op_type_print_macro(
10196                 enum isl_ast_op_type type,
10197                 __isl_take isl_printer *p);
10198         __isl_give isl_printer *isl_ast_expr_print_macros(
10199                 __isl_keep isl_ast_expr *expr,
10200                 __isl_take isl_printer *p);
10201         __isl_give isl_printer *isl_ast_node_print_macros(
10202                 __isl_keep isl_ast_node *node,
10203                 __isl_take isl_printer *p);
10204         __isl_give isl_printer *isl_ast_node_print(
10205                 __isl_keep isl_ast_node *node,
10206                 __isl_take isl_printer *p,
10207                 __isl_take isl_ast_print_options *options);
10208         __isl_give isl_printer *isl_ast_node_for_print(
10209                 __isl_keep isl_ast_node *node,
10210                 __isl_take isl_printer *p,
10211                 __isl_take isl_ast_print_options *options);
10212         __isl_give isl_printer *isl_ast_node_if_print(
10213                 __isl_keep isl_ast_node *node,
10214                 __isl_take isl_printer *p,
10215                 __isl_take isl_ast_print_options *options);
10217 While printing an C<isl_ast_node> in C<ISL_FORMAT_C>,
10218 C<isl> may print out an AST that makes use of macros such
10219 as C<floord>, C<min> and C<max>.
10220 The names of these macros may be modified by a call
10221 to C<isl_ast_op_type_set_print_name>.  The user-specified
10222 names are associated to the printer object.
10223 C<isl_ast_op_type_print_macro> prints out the macro
10224 corresponding to a specific C<isl_ast_op_type>.
10225 If the print-macro-once option is set, then a given macro definition
10226 is only printed once to any given printer object.
10227 C<isl_ast_expr_print_macros> scans the C<isl_ast_expr>
10228 for subexpressions where these macros would be used and prints
10229 out the required macro definitions.
10230 Essentially, C<isl_ast_expr_print_macros> calls
10231 C<isl_ast_expr_foreach_ast_op_type> with C<isl_ast_op_type_print_macro>
10232 as function argument.
10233 C<isl_ast_node_print_macros> does the same
10234 for expressions in its C<isl_ast_node> argument.
10235 C<isl_ast_node_print>, C<isl_ast_node_for_print> and
10236 C<isl_ast_node_if_print> print an C<isl_ast_node>
10237 in C<ISL_FORMAT_C>, but allow for some extra control
10238 through an C<isl_ast_print_options> object.
10239 This object can be created using the following functions.
10241         #include <isl/ast.h>
10242         __isl_give isl_ast_print_options *
10243         isl_ast_print_options_alloc(isl_ctx *ctx);
10244         __isl_give isl_ast_print_options *
10245         isl_ast_print_options_copy(
10246                 __isl_keep isl_ast_print_options *options);
10247         __isl_null isl_ast_print_options *
10248         isl_ast_print_options_free(
10249                 __isl_take isl_ast_print_options *options);
10251         __isl_give isl_ast_print_options *
10252         isl_ast_print_options_set_print_user(
10253                 __isl_take isl_ast_print_options *options,
10254                 __isl_give isl_printer *(*print_user)(
10255                         __isl_take isl_printer *p,
10256                         __isl_take isl_ast_print_options *options,
10257                         __isl_keep isl_ast_node *node, void *user),
10258                 void *user);
10259         __isl_give isl_ast_print_options *
10260         isl_ast_print_options_set_print_for(
10261                 __isl_take isl_ast_print_options *options,
10262                 __isl_give isl_printer *(*print_for)(
10263                         __isl_take isl_printer *p,
10264                         __isl_take isl_ast_print_options *options,
10265                         __isl_keep isl_ast_node *node, void *user),
10266                 void *user);
10268 The callback set by C<isl_ast_print_options_set_print_user>
10269 is called whenever a node of type C<isl_ast_node_user> needs to
10270 be printed.
10271 The callback set by C<isl_ast_print_options_set_print_for>
10272 is called whenever a node of type C<isl_ast_node_for> needs to
10273 be printed.
10274 Note that C<isl_ast_node_for_print> will I<not> call the
10275 callback set by C<isl_ast_print_options_set_print_for> on the node
10276 on which C<isl_ast_node_for_print> is called, but only on nested
10277 nodes of type C<isl_ast_node_for>.  It is therefore safe to
10278 call C<isl_ast_node_for_print> from within the callback set by
10279 C<isl_ast_print_options_set_print_for>.
10281 The following option determines the type to be used for iterators
10282 while printing the AST.
10284         isl_stat isl_options_set_ast_iterator_type(
10285                 isl_ctx *ctx, const char *val);
10286         const char *isl_options_get_ast_iterator_type(
10287                 isl_ctx *ctx);
10289 The AST printer only prints body nodes as blocks if these
10290 blocks cannot be safely omitted.
10291 For example, a C<for> node with one body node will not be
10292 surrounded with braces in C<ISL_FORMAT_C>.
10293 A block will always be printed by setting the following option.
10295         isl_stat isl_options_set_ast_always_print_block(isl_ctx *ctx,
10296                 int val);
10297         int isl_options_get_ast_always_print_block(isl_ctx *ctx);
10299 =head3 Options
10301         #include <isl/ast_build.h>
10302         isl_stat isl_options_set_ast_build_atomic_upper_bound(
10303                 isl_ctx *ctx, int val);
10304         int isl_options_get_ast_build_atomic_upper_bound(
10305                 isl_ctx *ctx);
10306         isl_stat isl_options_set_ast_build_prefer_pdiv(isl_ctx *ctx,
10307                 int val);
10308         int isl_options_get_ast_build_prefer_pdiv(isl_ctx *ctx);
10309         isl_stat isl_options_set_ast_build_detect_min_max(
10310                 isl_ctx *ctx, int val);
10311         int isl_options_get_ast_build_detect_min_max(
10312                 isl_ctx *ctx);
10313         isl_stat isl_options_set_ast_build_exploit_nested_bounds(
10314                 isl_ctx *ctx, int val);
10315         int isl_options_get_ast_build_exploit_nested_bounds(
10316                 isl_ctx *ctx);
10317         isl_stat isl_options_set_ast_build_group_coscheduled(
10318                 isl_ctx *ctx, int val);
10319         int isl_options_get_ast_build_group_coscheduled(
10320                 isl_ctx *ctx);
10321         isl_stat isl_options_set_ast_build_scale_strides(
10322                 isl_ctx *ctx, int val);
10323         int isl_options_get_ast_build_scale_strides(
10324                 isl_ctx *ctx);
10325         isl_stat isl_options_set_ast_build_allow_else(isl_ctx *ctx,
10326                 int val);
10327         int isl_options_get_ast_build_allow_else(isl_ctx *ctx);
10328         isl_stat isl_options_set_ast_build_allow_or(isl_ctx *ctx,
10329                 int val);
10330         int isl_options_get_ast_build_allow_or(isl_ctx *ctx);
10332 =over
10334 =item * ast_build_atomic_upper_bound
10336 Generate loop upper bounds that consist of the current loop iterator,
10337 an operator and an expression not involving the iterator.
10338 If this option is not set, then the current loop iterator may appear
10339 several times in the upper bound.
10340 For example, when this option is turned off, AST generation
10341 for the schedule
10343         [n] -> { A[i] -> [i] : 0 <= i <= 100, n }
10345 produces
10347         for (int c0 = 0; c0 <= 100 && n >= c0; c0 += 1)
10348           A(c0);
10350 When the option is turned on, the following AST is generated
10352         for (int c0 = 0; c0 <= min(100, n); c0 += 1)
10353           A(c0);
10355 =item * ast_build_prefer_pdiv
10357 If this option is turned off, then the AST generation will
10358 produce ASTs that may only contain C<isl_ast_op_fdiv_q>
10359 operators, but no C<isl_ast_op_pdiv_q> or
10360 C<isl_ast_op_pdiv_r> operators.
10361 If this option is turned on, then C<isl> will try to convert
10362 some of the C<isl_ast_op_fdiv_q> operators to (expressions containing)
10363 C<isl_ast_op_pdiv_q> or C<isl_ast_op_pdiv_r> operators.
10365 =item * ast_build_detect_min_max
10367 If this option is turned on, then C<isl> will try and detect
10368 min or max-expressions when building AST expressions from
10369 piecewise affine expressions.
10371 =item * ast_build_exploit_nested_bounds
10373 Simplify conditions based on bounds of nested for loops.
10374 In particular, remove conditions that are implied by the fact
10375 that one or more nested loops have at least one iteration,
10376 meaning that the upper bound is at least as large as the lower bound.
10377 For example, when this option is turned off, AST generation
10378 for the schedule
10380         [N,M] -> { A[i,j] -> [i,j] : 0 <= i <= N and
10381                                         0 <= j <= M }
10383 produces
10385         if (M >= 0)
10386           for (int c0 = 0; c0 <= N; c0 += 1)
10387             for (int c1 = 0; c1 <= M; c1 += 1)
10388               A(c0, c1);
10390 When the option is turned on, the following AST is generated
10392         for (int c0 = 0; c0 <= N; c0 += 1)
10393           for (int c1 = 0; c1 <= M; c1 += 1)
10394             A(c0, c1);
10396 =item * ast_build_group_coscheduled
10398 If two domain elements are assigned the same schedule point, then
10399 they may be executed in any order and they may even appear in different
10400 loops.  If this options is set, then the AST generator will make
10401 sure that coscheduled domain elements do not appear in separate parts
10402 of the AST.  This is useful in case of nested AST generation
10403 if the outer AST generation is given only part of a schedule
10404 and the inner AST generation should handle the domains that are
10405 coscheduled by this initial part of the schedule together.
10406 For example if an AST is generated for a schedule
10408         { A[i] -> [0]; B[i] -> [0] }
10410 then the C<isl_ast_build_set_create_leaf> callback described
10411 below may get called twice, once for each domain.
10412 Setting this option ensures that the callback is only called once
10413 on both domains together.
10415 =item * ast_build_separation_bounds
10417 This option specifies which bounds to use during separation.
10418 If this option is set to C<ISL_AST_BUILD_SEPARATION_BOUNDS_IMPLICIT>
10419 then all (possibly implicit) bounds on the current dimension will
10420 be used during separation.
10421 If this option is set to C<ISL_AST_BUILD_SEPARATION_BOUNDS_EXPLICIT>
10422 then only those bounds that are explicitly available will
10423 be used during separation.
10425 =item * ast_build_scale_strides
10427 This option specifies whether the AST generator is allowed
10428 to scale down iterators of strided loops.
10430 =item * ast_build_allow_else
10432 This option specifies whether the AST generator is allowed
10433 to construct if statements with else branches.
10435 =item * ast_build_allow_or
10437 This option specifies whether the AST generator is allowed
10438 to construct if conditions with disjunctions.
10440 =back
10442 =head3 AST Generation Options (Schedule Tree)
10444 In case of AST construction from a schedule tree, the options
10445 that control how an AST is created from the individual schedule
10446 dimensions are stored in the band nodes of the tree
10447 (see L</"Schedule Trees">).
10449 In particular, a schedule dimension can be handled in four
10450 different ways, atomic, separate, unroll or the default.
10451 This loop AST generation type can be set using
10452 C<isl_schedule_node_band_member_set_ast_loop_type>.
10453 Alternatively,
10454 the first three can be selected by including a one-dimensional
10455 element with as value the position of the schedule dimension
10456 within the band and as name one of C<atomic>, C<separate>
10457 or C<unroll> in the options
10458 set by C<isl_schedule_node_band_set_ast_build_options>.
10459 Only one of these three may be specified for
10460 any given schedule dimension within a band node.
10461 If none of these is specified, then the default
10462 is used.  The meaning of the options is as follows.
10464 =over
10466 =item C<atomic>
10468 When this option is specified, the AST generator will make
10469 sure that a given domains space only appears in a single
10470 loop at the specified level.
10472 For example, for the schedule tree
10474         domain: "{ a[i] : 0 <= i < 10; b[i] : 0 <= i < 10 }"
10475         child:
10476           schedule: "[{ a[i] -> [i]; b[i] -> [i+1] }]"
10477           options: "{ atomic[x] }"
10479 the following AST will be generated
10481         for (int c0 = 0; c0 <= 10; c0 += 1) {
10482           if (c0 >= 1)
10483             b(c0 - 1);
10484           if (c0 <= 9)
10485             a(c0);
10486         }
10488 On the other hand, for the schedule tree
10490         domain: "{ a[i] : 0 <= i < 10; b[i] : 0 <= i < 10 }"
10491         child:
10492           schedule: "[{ a[i] -> [i]; b[i] -> [i+1] }]"
10493           options: "{ separate[x] }"
10495 the following AST will be generated
10497         {
10498           a(0);
10499           for (int c0 = 1; c0 <= 9; c0 += 1) {
10500             b(c0 - 1);
10501             a(c0);
10502           }
10503           b(9);
10504         }
10506 If neither C<atomic> nor C<separate> is specified, then the AST generator
10507 may produce either of these two results or some intermediate form.
10509 =item C<separate>
10511 When this option is specified, the AST generator will
10512 split the domain of the specified schedule dimension
10513 into pieces with a fixed set of statements for which
10514 instances need to be executed by the iterations in
10515 the schedule domain part.  This option tends to avoid
10516 the generation of guards inside the corresponding loops.
10517 See also the C<atomic> option.
10519 =item C<unroll>
10521 When this option is specified, the AST generator will
10522 I<completely> unroll the corresponding schedule dimension.
10523 It is the responsibility of the user to ensure that such
10524 unrolling is possible.
10525 To obtain a partial unrolling, the user should apply an additional
10526 strip-mining to the schedule and fully unroll the inner schedule
10527 dimension.
10529 =back
10531 The C<isolate> option is a bit more involved.  It allows the user
10532 to isolate a range of schedule dimension values from smaller and
10533 greater values.  Additionally, the user may specify a different
10534 atomic/separate/unroll choice for the isolated part and the remaining
10535 parts.  The typical use case of the C<isolate> option is to isolate
10536 full tiles from partial tiles.
10537 The part that needs to be isolated may depend on outer schedule dimensions.
10538 The option therefore needs to be able to reference those outer schedule
10539 dimensions.  In particular, the space of the C<isolate> option is that
10540 of a wrapped map with as domain the flat product of all outer band nodes
10541 and as range the space of the current band node.
10542 The atomic/separate/unroll choice for the isolated part is determined
10543 by an option that lives in an unnamed wrapped space with as domain
10544 a zero-dimensional C<isolate> space and as range the regular
10545 C<atomic>, C<separate> or C<unroll> space.
10546 This option may also be set directly using
10547 C<isl_schedule_node_band_member_set_isolate_ast_loop_type>.
10548 The atomic/separate/unroll choice for the remaining part is determined
10549 by the regular C<atomic>, C<separate> or C<unroll> option.
10550 Since the C<isolate> option references outer schedule dimensions,
10551 its use in a band node causes any tree containing the node
10552 to be considered anchored.
10554 As an example, consider the isolation of full tiles from partial tiles
10555 in a tiling of a triangular domain.  The original schedule is as follows.
10557         domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }"
10558         child:
10559           schedule: "[{ A[i,j] -> [floor(i/10)] }, \
10560                 { A[i,j] -> [floor(j/10)] }, \
10561                 { A[i,j] -> [i] }, { A[i,j] -> [j] }]"
10563 The output is
10565         for (int c0 = 0; c0 <= 10; c0 += 1)
10566           for (int c1 = 0; c1 <= -c0 + 10; c1 += 1)
10567             for (int c2 = 10 * c0;
10568                  c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1)
10569               for (int c3 = 10 * c1;
10570                    c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1)
10571                 A(c2, c3);
10573 Isolating the full tiles, we have the following input
10575         domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }"
10576         child:
10577           schedule: "[{ A[i,j] -> [floor(i/10)] }, \
10578                 { A[i,j] -> [floor(j/10)] }, \
10579                 { A[i,j] -> [i] }, { A[i,j] -> [j] }]"
10580           options: "{ isolate[[] -> [a,b,c,d]] : 0 <= 10a,10b and \
10581                 10a+9+10b+9 <= 100 }"
10583 and output
10585         {
10586           for (int c0 = 0; c0 <= 8; c0 += 1) {
10587             for (int c1 = 0; c1 <= -c0 + 8; c1 += 1)
10588               for (int c2 = 10 * c0;
10589                    c2 <= 10 * c0 + 9; c2 += 1)
10590                 for (int c3 = 10 * c1;
10591                      c3 <= 10 * c1 + 9; c3 += 1)
10592                   A(c2, c3);
10593             for (int c1 = -c0 + 9; c1 <= -c0 + 10; c1 += 1)
10594               for (int c2 = 10 * c0;
10595                    c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1)
10596                 for (int c3 = 10 * c1;
10597                      c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1)
10598                   A(c2, c3);
10599           }
10600           for (int c0 = 9; c0 <= 10; c0 += 1)
10601             for (int c1 = 0; c1 <= -c0 + 10; c1 += 1)
10602               for (int c2 = 10 * c0;
10603                    c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1)
10604                 for (int c3 = 10 * c1;
10605                      c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1)
10606                   A(c2, c3);
10607         }
10609 We may then additionally unroll the innermost loop of the isolated part
10611         domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }"
10612         child:
10613           schedule: "[{ A[i,j] -> [floor(i/10)] }, \
10614                 { A[i,j] -> [floor(j/10)] }, \
10615                 { A[i,j] -> [i] }, { A[i,j] -> [j] }]"
10616           options: "{ isolate[[] -> [a,b,c,d]] : 0 <= 10a,10b and \
10617                 10a+9+10b+9 <= 100; [isolate[] -> unroll[3]] }"
10619 to obtain
10621         {
10622           for (int c0 = 0; c0 <= 8; c0 += 1) {
10623             for (int c1 = 0; c1 <= -c0 + 8; c1 += 1)
10624               for (int c2 = 10 * c0; c2 <= 10 * c0 + 9; c2 += 1) {
10625                 A(c2, 10 * c1);
10626                 A(c2, 10 * c1 + 1);
10627                 A(c2, 10 * c1 + 2);
10628                 A(c2, 10 * c1 + 3);
10629                 A(c2, 10 * c1 + 4);
10630                 A(c2, 10 * c1 + 5);
10631                 A(c2, 10 * c1 + 6);
10632                 A(c2, 10 * c1 + 7);
10633                 A(c2, 10 * c1 + 8);
10634                 A(c2, 10 * c1 + 9);
10635               }
10636             for (int c1 = -c0 + 9; c1 <= -c0 + 10; c1 += 1)
10637               for (int c2 = 10 * c0;
10638                    c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1)
10639                 for (int c3 = 10 * c1;
10640                      c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1)
10641                   A(c2, c3);
10642           }
10643           for (int c0 = 9; c0 <= 10; c0 += 1)
10644             for (int c1 = 0; c1 <= -c0 + 10; c1 += 1)
10645               for (int c2 = 10 * c0;
10646                    c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1)
10647                 for (int c3 = 10 * c1;
10648                      c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1)
10649                   A(c2, c3);
10650         }
10653 =head3 AST Generation Options (Schedule Map)
10655 In case of AST construction using
10656 C<isl_ast_build_node_from_schedule_map>, the options
10657 that control how an AST is created from the individual schedule
10658 dimensions are stored in the C<isl_ast_build>.
10659 They can be set using the following function.
10661         #include <isl/ast_build.h>
10662         __isl_give isl_ast_build *
10663         isl_ast_build_set_options(
10664                 __isl_take isl_ast_build *build,
10665                 __isl_take isl_union_map *options);
10667 The options are encoded in an C<isl_union_map>.
10668 The domain of this union relation refers to the schedule domain,
10669 i.e., the range of the schedule passed
10670 to C<isl_ast_build_node_from_schedule_map>.
10671 In the case of nested AST generation (see L</"Nested AST Generation">),
10672 the domain of C<options> should refer to the extra piece of the schedule.
10673 That is, it should be equal to the range of the wrapped relation in the
10674 range of the schedule.
10675 The range of the options can consist of elements in one or more spaces,
10676 the names of which determine the effect of the option.
10677 The values of the range typically also refer to the schedule dimension
10678 to which the option applies, with value C<0> representing
10679 the outermost schedule dimension.  In case of nested AST generation
10680 (see L</"Nested AST Generation">), these values refer to the position
10681 of the schedule dimension within the innermost AST generation.
10682 The constraints on the domain elements of
10683 the option should only refer to this dimension and earlier dimensions.
10684 We consider the following spaces.
10686 =over
10688 =item C<separation_class>
10690 B<This option has been deprecated.  Use the isolate option on
10691 schedule trees instead.>
10693 This space is a wrapped relation between two one dimensional spaces.
10694 The input space represents the schedule dimension to which the option
10695 applies and the output space represents the separation class.
10696 While constructing a loop corresponding to the specified schedule
10697 dimension(s), the AST generator will try to generate separate loops
10698 for domain elements that are assigned different classes.
10699 If only some of the elements are assigned a class, then those elements
10700 that are not assigned any class will be treated as belonging to a class
10701 that is separate from the explicitly assigned classes.
10702 The typical use case for this option is to separate full tiles from
10703 partial tiles.
10704 The other options, described below, are applied after the separation
10705 into classes.
10707 As an example, consider the separation into full and partial tiles
10708 of a tiling of a triangular domain.
10709 Take, for example, the domain
10711         { A[i,j] : 0 <= i,j and i + j <= 100 }
10713 and a tiling into tiles of 10 by 10.  The input to the AST generator
10714 is then the schedule
10716         { A[i,j] -> [([i/10]),[j/10],i,j] : 0 <= i,j and
10717                                                 i + j <= 100 }
10719 Without any options, the following AST is generated
10721         for (int c0 = 0; c0 <= 10; c0 += 1)
10722           for (int c1 = 0; c1 <= -c0 + 10; c1 += 1)
10723             for (int c2 = 10 * c0;
10724                  c2 <= min(-10 * c1 + 100, 10 * c0 + 9);
10725                  c2 += 1)
10726               for (int c3 = 10 * c1;
10727                    c3 <= min(10 * c1 + 9, -c2 + 100);
10728                    c3 += 1)
10729                 A(c2, c3);
10731 Separation into full and partial tiles can be obtained by assigning
10732 a class, say C<0>, to the full tiles.  The full tiles are represented by those
10733 values of the first and second schedule dimensions for which there are
10734 values of the third and fourth dimensions to cover an entire tile.
10735 That is, we need to specify the following option
10737         { [a,b,c,d] -> separation_class[[0]->[0]] :
10738                 exists b': 0 <= 10a,10b' and
10739                            10a+9+10b'+9 <= 100;
10740           [a,b,c,d] -> separation_class[[1]->[0]] :
10741                 0 <= 10a,10b and 10a+9+10b+9 <= 100 }
10743 which simplifies to
10745         { [a, b, c, d] -> separation_class[[1] -> [0]] :
10746                 a >= 0 and b >= 0 and b <= 8 - a;
10747           [a, b, c, d] -> separation_class[[0] -> [0]] :
10748                 a >= 0 and a <= 8 }
10750 With this option, the generated AST is as follows
10752         {
10753           for (int c0 = 0; c0 <= 8; c0 += 1) {
10754             for (int c1 = 0; c1 <= -c0 + 8; c1 += 1)
10755               for (int c2 = 10 * c0;
10756                    c2 <= 10 * c0 + 9; c2 += 1)
10757                 for (int c3 = 10 * c1;
10758                      c3 <= 10 * c1 + 9; c3 += 1)
10759                   A(c2, c3);
10760             for (int c1 = -c0 + 9; c1 <= -c0 + 10; c1 += 1)
10761               for (int c2 = 10 * c0;
10762                    c2 <= min(-10 * c1 + 100, 10 * c0 + 9);
10763                    c2 += 1)
10764                 for (int c3 = 10 * c1;
10765                      c3 <= min(-c2 + 100, 10 * c1 + 9);
10766                      c3 += 1)
10767                   A(c2, c3);
10768           }
10769           for (int c0 = 9; c0 <= 10; c0 += 1)
10770             for (int c1 = 0; c1 <= -c0 + 10; c1 += 1)
10771               for (int c2 = 10 * c0;
10772                    c2 <= min(-10 * c1 + 100, 10 * c0 + 9);
10773                    c2 += 1)
10774                 for (int c3 = 10 * c1;
10775                      c3 <= min(10 * c1 + 9, -c2 + 100);
10776                      c3 += 1)
10777                   A(c2, c3);
10778         }
10780 =item C<separate>
10782 This is a single-dimensional space representing the schedule dimension(s)
10783 to which ``separation'' should be applied.  Separation tries to split
10784 a loop into several pieces if this can avoid the generation of guards
10785 inside the loop.
10786 See also the C<atomic> option.
10788 =item C<atomic>
10790 This is a single-dimensional space representing the schedule dimension(s)
10791 for which the domains should be considered ``atomic''.  That is, the
10792 AST generator will make sure that any given domain space will only appear
10793 in a single loop at the specified level.
10795 Consider the following schedule
10797         { a[i] -> [i] : 0 <= i < 10;
10798           b[i] -> [i+1] : 0 <= i < 10 }
10800 If the following option is specified
10802         { [i] -> separate[x] }
10804 then the following AST will be generated
10806         {
10807           a(0);
10808           for (int c0 = 1; c0 <= 9; c0 += 1) {
10809             a(c0);
10810             b(c0 - 1);
10811           }
10812           b(9);
10813         }
10815 If, on the other hand, the following option is specified
10817         { [i] -> atomic[x] }
10819 then the following AST will be generated
10821         for (int c0 = 0; c0 <= 10; c0 += 1) {
10822           if (c0 <= 9)
10823             a(c0);
10824           if (c0 >= 1)
10825             b(c0 - 1);
10826         }
10828 If neither C<atomic> nor C<separate> is specified, then the AST generator
10829 may produce either of these two results or some intermediate form.
10831 =item C<unroll>
10833 This is a single-dimensional space representing the schedule dimension(s)
10834 that should be I<completely> unrolled.
10835 To obtain a partial unrolling, the user should apply an additional
10836 strip-mining to the schedule and fully unroll the inner loop.
10838 =back
10840 =head3 Fine-grained Control over AST Generation
10842 Besides specifying the constraints on the parameters,
10843 an C<isl_ast_build> object can be used to control
10844 various aspects of the AST generation process.
10845 In case of AST construction using
10846 C<isl_ast_build_node_from_schedule_map>,
10847 the most prominent way of control is through ``options'',
10848 as explained above.
10850 Additional control is available through the following functions.
10852         #include <isl/ast_build.h>
10853         __isl_give isl_ast_build *
10854         isl_ast_build_set_iterators(
10855                 __isl_take isl_ast_build *build,
10856                 __isl_take isl_id_list *iterators);
10858 The function C<isl_ast_build_set_iterators> allows the user to
10859 specify a list of iterator C<isl_id>s to be used as iterators.
10860 If the input schedule is injective, then
10861 the number of elements in this list should be as large as the dimension
10862 of the schedule space, but no direct correspondence should be assumed
10863 between dimensions and elements.
10864 If the input schedule is not injective, then an additional number
10865 of C<isl_id>s equal to the largest dimension of the input domains
10866 may be required.
10867 If the number of provided C<isl_id>s is insufficient, then additional
10868 names are automatically generated.
10870         #include <isl/ast_build.h>
10871         __isl_give isl_ast_build *
10872         isl_ast_build_set_create_leaf(
10873                 __isl_take isl_ast_build *build,
10874                 __isl_give isl_ast_node *(*fn)(
10875                         __isl_take isl_ast_build *build,
10876                         void *user), void *user);
10879 C<isl_ast_build_set_create_leaf> function allows for the
10880 specification of a callback that should be called whenever the AST
10881 generator arrives at an element of the schedule domain.
10882 The callback should return an AST node that should be inserted
10883 at the corresponding position of the AST.  The default action (when
10884 the callback is not set) is to continue generating parts of the AST to scan
10885 all the domain elements associated to the schedule domain element
10886 and to insert user nodes, ``calling'' the domain element, for each of them.
10887 The C<build> argument contains the current state of the C<isl_ast_build>.
10888 To ease nested AST generation (see L</"Nested AST Generation">),
10889 all control information that is
10890 specific to the current AST generation such as the options and
10891 the callbacks has been removed from this C<isl_ast_build>.
10892 The callback would typically return the result of a nested
10893 AST generation or a
10894 user defined node created using the following function.
10896         #include <isl/ast.h>
10897         __isl_give isl_ast_node *isl_ast_node_alloc_user(
10898                 __isl_take isl_ast_expr *expr);
10900         #include <isl/ast_build.h>
10901         __isl_give isl_ast_build *
10902         isl_ast_build_set_at_each_domain(
10903                 __isl_take isl_ast_build *build,
10904                 __isl_give isl_ast_node *(*fn)(
10905                         __isl_take isl_ast_node *node,
10906                         __isl_keep isl_ast_build *build,
10907                         void *user), void *user);
10908         __isl_give isl_ast_build *
10909         isl_ast_build_set_before_each_for(
10910                 __isl_take isl_ast_build *build,
10911                 __isl_give isl_id *(*fn)(
10912                         __isl_keep isl_ast_build *build,
10913                         void *user), void *user);
10914         __isl_give isl_ast_build *
10915         isl_ast_build_set_after_each_for(
10916                 __isl_take isl_ast_build *build,
10917                 __isl_give isl_ast_node *(*fn)(
10918                         __isl_take isl_ast_node *node,
10919                         __isl_keep isl_ast_build *build,
10920                         void *user), void *user);
10921         __isl_give isl_ast_build *
10922         isl_ast_build_set_before_each_mark(
10923                 __isl_take isl_ast_build *build,
10924                 isl_stat (*fn)(__isl_keep isl_id *mark,
10925                         __isl_keep isl_ast_build *build,
10926                         void *user), void *user);
10927         __isl_give isl_ast_build *
10928         isl_ast_build_set_after_each_mark(
10929                 __isl_take isl_ast_build *build,
10930                 __isl_give isl_ast_node *(*fn)(
10931                         __isl_take isl_ast_node *node,
10932                         __isl_keep isl_ast_build *build,
10933                         void *user), void *user);
10935 The callback set by C<isl_ast_build_set_at_each_domain> will
10936 be called for each domain AST node.
10937 The callbacks set by C<isl_ast_build_set_before_each_for>
10938 and C<isl_ast_build_set_after_each_for> will be called
10939 for each for AST node.  The first will be called in depth-first
10940 pre-order, while the second will be called in depth-first post-order.
10941 Since C<isl_ast_build_set_before_each_for> is called before the for
10942 node is actually constructed, it is only passed an C<isl_ast_build>.
10943 The returned C<isl_id> will be added as an annotation (using
10944 C<isl_ast_node_set_annotation>) to the constructed for node.
10945 In particular, if the user has also specified an C<after_each_for>
10946 callback, then the annotation can be retrieved from the node passed to
10947 that callback using C<isl_ast_node_get_annotation>.
10948 The callbacks set by C<isl_ast_build_set_before_each_mark>
10949 and C<isl_ast_build_set_after_each_mark> will be called for each
10950 mark AST node that is created, i.e., for each mark schedule node
10951 in the input schedule tree.  The first will be called in depth-first
10952 pre-order, while the second will be called in depth-first post-order.
10953 Since the callback set by C<isl_ast_build_set_before_each_mark>
10954 is called before the mark AST node is actually constructed, it is passed
10955 the identifier of the mark node.
10956 All callbacks should C<NULL> (or C<isl_stat_error>) on failure.
10957 The given C<isl_ast_build> can be used to create new
10958 C<isl_ast_expr> objects using C<isl_ast_build_expr_from_pw_aff>
10959 or C<isl_ast_build_call_from_pw_multi_aff>.
10961 =head3 Nested AST Generation
10963 C<isl> allows the user to create an AST within the context
10964 of another AST.  These nested ASTs are created using the
10965 same C<isl_ast_build_node_from_schedule_map> function that is used to create
10966 the outer AST.  The C<build> argument should be an C<isl_ast_build>
10967 passed to a callback set by
10968 C<isl_ast_build_set_create_leaf>.
10969 The space of the range of the C<schedule> argument should refer
10970 to this build.  In particular, the space should be a wrapped
10971 relation and the domain of this wrapped relation should be the
10972 same as that of the range of the schedule returned by
10973 C<isl_ast_build_get_schedule> below.
10974 In practice, the new schedule is typically
10975 created by calling C<isl_union_map_range_product> on the old schedule
10976 and some extra piece of the schedule.
10977 The space of the schedule domain is also available from
10978 the C<isl_ast_build>.
10980         #include <isl/ast_build.h>
10981         __isl_give isl_union_map *isl_ast_build_get_schedule(
10982                 __isl_keep isl_ast_build *build);
10983         __isl_give isl_space *isl_ast_build_get_schedule_space(
10984                 __isl_keep isl_ast_build *build);
10985         __isl_give isl_ast_build *isl_ast_build_restrict(
10986                 __isl_take isl_ast_build *build,
10987                 __isl_take isl_set *set);
10989 The C<isl_ast_build_get_schedule> function returns a (partial)
10990 schedule for the domains elements for which part of the AST still needs to
10991 be generated in the current build.
10992 In particular, the domain elements are mapped to those iterations of the loops
10993 enclosing the current point of the AST generation inside which
10994 the domain elements are executed.
10995 No direct correspondence between
10996 the input schedule and this schedule should be assumed.
10997 The space obtained from C<isl_ast_build_get_schedule_space> can be used
10998 to create a set for C<isl_ast_build_restrict> to intersect
10999 with the current build.  In particular, the set passed to
11000 C<isl_ast_build_restrict> can have additional parameters.
11001 The ids of the set dimensions in the space returned by
11002 C<isl_ast_build_get_schedule_space> correspond to the
11003 iterators of the already generated loops.
11004 The user should not rely on the ids of the output dimensions
11005 of the relations in the union relation returned by
11006 C<isl_ast_build_get_schedule> having any particular value.
11008 =head1 Applications
11010 Although C<isl> is mainly meant to be used as a library,
11011 it also contains some basic applications that use some
11012 of the functionality of C<isl>.
11013 For applications that take one or more polytopes or polyhedra
11014 as input, this input may be specified in either the L<isl format>
11015 or the L<PolyLib format>.
11017 =head2 C<isl_polyhedron_sample>
11019 C<isl_polyhedron_sample> takes a polyhedron as input and prints
11020 an integer element of the polyhedron, if there is any.
11021 The first column in the output is the denominator and is always
11022 equal to 1.  If the polyhedron contains no integer points,
11023 then a vector of length zero is printed.
11025 =head2 C<isl_pip>
11027 C<isl_pip> takes the same input as the C<example> program
11028 from the C<piplib> distribution, i.e., a set of constraints
11029 on the parameters, a line containing only -1 and finally a set
11030 of constraints on a parametric polyhedron.
11031 The coefficients of the parameters appear in the last columns
11032 (but before the final constant column).
11033 The output is the lexicographic minimum of the parametric polyhedron.
11034 As C<isl> currently does not have its own output format, the output
11035 is just a dump of the internal state.
11037 =head2 C<isl_polyhedron_minimize>
11039 C<isl_polyhedron_minimize> computes the minimum of some linear
11040 or affine objective function over the integer points in a polyhedron.
11041 If an affine objective function
11042 is given, then the constant should appear in the last column.
11044 =head2 C<isl_polytope_scan>
11046 Given a polytope, C<isl_polytope_scan> prints
11047 all integer points in the polytope.
11049 =head2 C<isl_flow>
11051 Given an C<isl_union_access_info> object as input,
11052 C<isl_flow> prints out the corresponding dependences,
11053 as computed by C<isl_union_access_info_compute_flow>.
11055 =head2 C<isl_codegen>
11057 Given either a schedule tree or a sequence consisting of
11058 a schedule map, a context set and an options relation,
11059 C<isl_codegen> prints out an AST that scans the domain elements
11060 of the schedule in the order of their image(s) taking into account
11061 the constraints in the context set.
11063 =head2 C<isl_schedule>
11065 Given an C<isl_schedule_constraints> object as input,
11066 C<isl_schedule> prints out a schedule that satisfies the given
11067 constraints.