Document: comparisons between isl_val and NaN always return false
[isl.git] / doc / user.pod
blob760fcbf80da6f25faede5a77037f0e780678d504
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 =head1 License
275 C<isl> is released under the MIT license.
277 =over
279 Permission is hereby granted, free of charge, to any person obtaining a copy of
280 this software and associated documentation files (the "Software"), to deal in
281 the Software without restriction, including without limitation the rights to
282 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
283 of the Software, and to permit persons to whom the Software is furnished to do
284 so, subject to the following conditions:
286 The above copyright notice and this permission notice shall be included in all
287 copies or substantial portions of the Software.
289 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
290 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
291 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
292 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
293 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
294 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
295 SOFTWARE.
297 =back
299 Note that by default C<isl> requires C<GMP>, which is released
300 under the GNU Lesser General Public License (LGPL).  This means
301 that code linked against C<isl> is also linked against LGPL code.
303 When configuring with C<--with-int=imath> or C<--with-int=imath-32>, C<isl>
304 will link against C<imath>, a library for exact integer arithmetic released
305 under the MIT license.
307 =head1 Installation
309 The source of C<isl> can be obtained either as a tarball
310 or from the git repository.  Both are available from
311 L<http://isl.gforge.inria.fr/>.
312 The installation process depends on how you obtained
313 the source.
315 =head2 Installation from the git repository
317 =over
319 =item 1 Clone or update the repository
321 The first time the source is obtained, you need to clone
322 the repository.
324         git clone git://repo.or.cz/isl.git
326 To obtain updates, you need to pull in the latest changes
328         git pull
330 =item 2 Optionally get C<imath> submodule
332 To build C<isl> with C<imath>, you need to obtain the C<imath>
333 submodule by running in the git source tree of C<isl>
335        git submodule init
336        git submodule update
338 This will fetch the required version of C<imath> in a subdirectory of C<isl>.
340 =item 2 Generate C<configure>
342         ./autogen.sh
344 =back
346 After performing the above steps, continue
347 with the L<Common installation instructions>.
349 =head2 Common installation instructions
351 =over
353 =item 1 Obtain C<GMP>
355 By default, building C<isl> requires C<GMP>, including its headers files.
356 Your distribution may not provide these header files by default
357 and you may need to install a package called C<gmp-devel> or something
358 similar.  Alternatively, C<GMP> can be built from
359 source, available from L<http://gmplib.org/>.
360 C<GMP> is not needed if you build C<isl> with C<imath>.
362 =item 2 Configure
364 C<isl> uses the standard C<autoconf> C<configure> script.
365 To run it, just type
367         ./configure
369 optionally followed by some configure options.
370 A complete list of options can be obtained by running
372         ./configure --help
374 Below we discuss some of the more common options.
376 =over
378 =item C<--prefix>
380 Installation prefix for C<isl>
382 =item C<--with-int=[gmp|imath|imath-32]>
384 Select the integer library to be used by C<isl>, the default is C<gmp>.
385 With C<imath-32>, C<isl> will use 32 bit integers, but fall back to C<imath>
386 for values out of the 32 bit range. In most applications, C<isl> will run
387 fastest with the C<imath-32> option, followed by C<gmp> and C<imath>, the
388 slowest.
390 =item C<--with-gmp-prefix>
392 Installation prefix for C<GMP> (architecture-independent files).
394 =item C<--with-gmp-exec-prefix>
396 Installation prefix for C<GMP> (architecture-dependent files).
398 =back
400 =item 3 Compile
402         make
404 =item 4 Install (optional)
406         make install
408 =back
410 =head1 Integer Set Library
412 =head2 Memory Management
414 Since a high-level operation on isl objects usually involves
415 several substeps and since the user is usually not interested in
416 the intermediate results, most functions that return a new object
417 will also release all the objects passed as arguments.
418 If the user still wants to use one or more of these arguments
419 after the function call, she should pass along a copy of the
420 object rather than the object itself.
421 The user is then responsible for making sure that the original
422 object gets used somewhere else or is explicitly freed.
424 The arguments and return values of all documented functions are
425 annotated to make clear which arguments are released and which
426 arguments are preserved.  In particular, the following annotations
427 are used
429 =over
431 =item C<__isl_give>
433 C<__isl_give> means that a new object is returned.
434 The user should make sure that the returned pointer is
435 used exactly once as a value for an C<__isl_take> argument.
436 In between, it can be used as a value for as many
437 C<__isl_keep> arguments as the user likes.
438 There is one exception, and that is the case where the
439 pointer returned is C<NULL>.  Is this case, the user
440 is free to use it as an C<__isl_take> argument or not.
441 When applied to a C<char *>, the returned pointer needs to be
442 freed using C<free>.
444 =item C<__isl_null>
446 C<__isl_null> means that a C<NULL> value is returned.
448 =item C<__isl_take>
450 C<__isl_take> means that the object the argument points to
451 is taken over by the function and may no longer be used
452 by the user as an argument to any other function.
453 The pointer value must be one returned by a function
454 returning an C<__isl_give> pointer.
455 If the user passes in a C<NULL> value, then this will
456 be treated as an error in the sense that the function will
457 not perform its usual operation.  However, it will still
458 make sure that all the other C<__isl_take> arguments
459 are released.
461 =item C<__isl_keep>
463 C<__isl_keep> means that the function will only use the object
464 temporarily.  After the function has finished, the user
465 can still use it as an argument to other functions.
466 A C<NULL> value will be treated in the same way as
467 a C<NULL> value for an C<__isl_take> argument.
468 This annotation may also be used on return values of
469 type C<const char *>, in which case the returned pointer should
470 not be freed by the user and is only valid until the object
471 from which it was derived is updated or freed.
473 =back
475 =head2 Initialization
477 All manipulations of integer sets and relations occur within
478 the context of an C<isl_ctx>.
479 A given C<isl_ctx> can only be used within a single thread.
480 All arguments of a function are required to have been allocated
481 within the same context.
482 There are currently no functions available for moving an object
483 from one C<isl_ctx> to another C<isl_ctx>.  This means that
484 there is currently no way of safely moving an object from one
485 thread to another, unless the whole C<isl_ctx> is moved.
487 An C<isl_ctx> can be allocated using C<isl_ctx_alloc> and
488 freed using C<isl_ctx_free>.
489 All objects allocated within an C<isl_ctx> should be freed
490 before the C<isl_ctx> itself is freed.
492         isl_ctx *isl_ctx_alloc();
493         void isl_ctx_free(isl_ctx *ctx);
495 The user can impose a bound on the number of low-level I<operations>
496 that can be performed by an C<isl_ctx>.  This bound can be set and
497 retrieved using the following functions.  A bound of zero means that
498 no bound is imposed.  The number of operations performed can be
499 reset using C<isl_ctx_reset_operations>.  Note that the number
500 of low-level operations needed to perform a high-level computation
501 may differ significantly across different versions
502 of C<isl>, but it should be the same across different platforms
503 for the same version of C<isl>.
505 Warning: This feature is experimental.  C<isl> has good support to abort and
506 bail out during the computation, but this feature may exercise error code paths
507 that are normally not used that much. Consequently, it is not unlikely that
508 hidden bugs will be exposed.
510         void isl_ctx_set_max_operations(isl_ctx *ctx,
511                 unsigned long max_operations);
512         unsigned long isl_ctx_get_max_operations(isl_ctx *ctx);
513         void isl_ctx_reset_operations(isl_ctx *ctx);
515 In order to be able to create an object in the same context
516 as another object, most object types (described later in
517 this document) provide a function to obtain the context
518 in which the object was created.
520         #include <isl/val.h>
521         isl_ctx *isl_val_get_ctx(__isl_keep isl_val *val);
522         isl_ctx *isl_multi_val_get_ctx(
523                 __isl_keep isl_multi_val *mv);
525         #include <isl/id.h>
526         isl_ctx *isl_id_get_ctx(__isl_keep isl_id *id);
528         #include <isl/local_space.h>
529         isl_ctx *isl_local_space_get_ctx(
530                 __isl_keep isl_local_space *ls);
532         #include <isl/set.h>
533         isl_ctx *isl_set_list_get_ctx(
534                 __isl_keep isl_set_list *list);
536         #include <isl/aff.h>
537         isl_ctx *isl_aff_get_ctx(__isl_keep isl_aff *aff);
538         isl_ctx *isl_multi_aff_get_ctx(
539                 __isl_keep isl_multi_aff *maff);
540         isl_ctx *isl_pw_aff_get_ctx(__isl_keep isl_pw_aff *pa);
541         isl_ctx *isl_pw_multi_aff_get_ctx(
542                 __isl_keep isl_pw_multi_aff *pma);
543         isl_ctx *isl_multi_pw_aff_get_ctx(
544                 __isl_keep isl_multi_pw_aff *mpa);
545         isl_ctx *isl_union_pw_aff_get_ctx(
546                 __isl_keep isl_union_pw_aff *upa);
547         isl_ctx *isl_union_pw_multi_aff_get_ctx(
548                 __isl_keep isl_union_pw_multi_aff *upma);
549         isl_ctx *isl_multi_union_pw_aff_get_ctx(
550                 __isl_keep isl_multi_union_pw_aff *mupa);
552         #include <isl/id_to_ast_expr.h>
553         isl_ctx *isl_id_to_ast_expr_get_ctx(
554                 __isl_keep isl_id_to_ast_expr *id2expr);
556         #include <isl/point.h>
557         isl_ctx *isl_point_get_ctx(__isl_keep isl_point *pnt);
559         #include <isl/vec.h>
560         isl_ctx *isl_vec_get_ctx(__isl_keep isl_vec *vec);
562         #include <isl/mat.h>
563         isl_ctx *isl_mat_get_ctx(__isl_keep isl_mat *mat);
565         #include <isl/vertices.h>
566         isl_ctx *isl_vertices_get_ctx(
567                 __isl_keep isl_vertices *vertices);
568         isl_ctx *isl_vertex_get_ctx(__isl_keep isl_vertex *vertex);
569         isl_ctx *isl_cell_get_ctx(__isl_keep isl_cell *cell);
571         #include <isl/flow.h>
572         isl_ctx *isl_restriction_get_ctx(
573                 __isl_keep isl_restriction *restr);
574         isl_ctx *isl_union_access_info_get_ctx(
575                 __isl_keep isl_union_access_info *access);
576         isl_ctx *isl_union_flow_get_ctx(
577                 __isl_keep isl_union_flow *flow);
579         #include <isl/schedule.h>
580         isl_ctx *isl_schedule_get_ctx(
581                 __isl_keep isl_schedule *sched);
582         isl_ctx *isl_schedule_constraints_get_ctx(
583                 __isl_keep isl_schedule_constraints *sc);
585         #include <isl/schedule_node.h>
586         isl_ctx *isl_schedule_node_get_ctx(
587                 __isl_keep isl_schedule_node *node);
589         #include <isl/band.h>
590         isl_ctx *isl_band_get_ctx(__isl_keep isl_band *band);
592         #include <isl/ast_build.h>
593         isl_ctx *isl_ast_build_get_ctx(
594                 __isl_keep isl_ast_build *build);
596         #include <isl/ast.h>
597         isl_ctx *isl_ast_expr_get_ctx(
598                 __isl_keep isl_ast_expr *expr);
599         isl_ctx *isl_ast_node_get_ctx(
600                 __isl_keep isl_ast_node *node);
602 =head2 Return Types
604 C<isl> uses two special return types for functions that either return
605 a boolean or that in principle do not return anything.
606 In particular, the C<isl_bool> type has three possible values:
607 C<isl_bool_true> (a positive integer value), indicating I<true> or I<yes>;
608 C<isl_bool_false> (the integer value zero), indicating I<false> or I<no>; and
609 C<isl_bool_error> (a negative integer value), indicating that something
610 went wrong.  The following function can be used to negate an C<isl_bool>,
611 where the negation of C<isl_bool_error> is C<isl_bool_error> again.
613         #include <isl/val.h>
614         isl_bool isl_bool_not(isl_bool b);
616 The C<isl_stat> type has two possible values:
617 C<isl_stat_ok> (the integer value zero), indicating a successful
618 operation; and
619 C<isl_stat_error> (a negative integer value), indicating that something
620 went wrong.
621 See L</"Error Handling"> for more information on
622 C<isl_bool_error> and C<isl_stat_error>.
624 =head2 Values
626 An C<isl_val> represents an integer value, a rational value
627 or one of three special values, infinity, negative infinity and NaN.
628 Some predefined values can be created using the following functions.
630         #include <isl/val.h>
631         __isl_give isl_val *isl_val_zero(isl_ctx *ctx);
632         __isl_give isl_val *isl_val_one(isl_ctx *ctx);
633         __isl_give isl_val *isl_val_negone(isl_ctx *ctx);
634         __isl_give isl_val *isl_val_nan(isl_ctx *ctx);
635         __isl_give isl_val *isl_val_infty(isl_ctx *ctx);
636         __isl_give isl_val *isl_val_neginfty(isl_ctx *ctx);
638 Specific integer values can be created using the following functions.
640         #include <isl/val.h>
641         __isl_give isl_val *isl_val_int_from_si(isl_ctx *ctx,
642                 long i);
643         __isl_give isl_val *isl_val_int_from_ui(isl_ctx *ctx,
644                 unsigned long u);
645         __isl_give isl_val *isl_val_int_from_chunks(isl_ctx *ctx,
646                 size_t n, size_t size, const void *chunks);
648 The function C<isl_val_int_from_chunks> constructs an C<isl_val>
649 from the C<n> I<digits>, each consisting of C<size> bytes, stored at C<chunks>.
650 The least significant digit is assumed to be stored first.
652 Value objects can be copied and freed using the following functions.
654         #include <isl/val.h>
655         __isl_give isl_val *isl_val_copy(__isl_keep isl_val *v);
656         __isl_null isl_val *isl_val_free(__isl_take isl_val *v);
658 They can be inspected using the following functions.
660         #include <isl/val.h>
661         long isl_val_get_num_si(__isl_keep isl_val *v);
662         long isl_val_get_den_si(__isl_keep isl_val *v);
663         __isl_give isl_val *isl_val_get_den_val(
664                 __isl_keep isl_val *v);
665         double isl_val_get_d(__isl_keep isl_val *v);
666         size_t isl_val_n_abs_num_chunks(__isl_keep isl_val *v,
667                 size_t size);
668         int isl_val_get_abs_num_chunks(__isl_keep isl_val *v,
669                 size_t size, void *chunks);
671 C<isl_val_n_abs_num_chunks> returns the number of I<digits>
672 of C<size> bytes needed to store the absolute value of the
673 numerator of C<v>.
674 C<isl_val_get_abs_num_chunks> stores these digits at C<chunks>,
675 which is assumed to have been preallocated by the caller.
676 The least significant digit is stored first.
677 Note that C<isl_val_get_num_si>, C<isl_val_get_den_si>,
678 C<isl_val_get_d>, C<isl_val_n_abs_num_chunks>
679 and C<isl_val_get_abs_num_chunks> can only be applied to rational values.
681 An C<isl_val> can be modified using the following function.
683         #include <isl/val.h>
684         __isl_give isl_val *isl_val_set_si(__isl_take isl_val *v,
685                 long i);
687 The following unary properties are defined on C<isl_val>s.
689         #include <isl/val.h>
690         int isl_val_sgn(__isl_keep isl_val *v);
691         isl_bool isl_val_is_zero(__isl_keep isl_val *v);
692         isl_bool isl_val_is_one(__isl_keep isl_val *v);
693         isl_bool isl_val_is_negone(__isl_keep isl_val *v);
694         isl_bool isl_val_is_nonneg(__isl_keep isl_val *v);
695         isl_bool isl_val_is_nonpos(__isl_keep isl_val *v);
696         isl_bool isl_val_is_pos(__isl_keep isl_val *v);
697         isl_bool isl_val_is_neg(__isl_keep isl_val *v);
698         isl_bool isl_val_is_int(__isl_keep isl_val *v);
699         isl_bool isl_val_is_rat(__isl_keep isl_val *v);
700         isl_bool isl_val_is_nan(__isl_keep isl_val *v);
701         isl_bool isl_val_is_infty(__isl_keep isl_val *v);
702         isl_bool isl_val_is_neginfty(__isl_keep isl_val *v);
704 Note that the sign of NaN is undefined.
706 The following binary properties are defined on pairs of C<isl_val>s.
708         #include <isl/val.h>
709         isl_bool isl_val_lt(__isl_keep isl_val *v1,
710                 __isl_keep isl_val *v2);
711         isl_bool isl_val_le(__isl_keep isl_val *v1,
712                 __isl_keep isl_val *v2);
713         isl_bool isl_val_gt(__isl_keep isl_val *v1,
714                 __isl_keep isl_val *v2);
715         isl_bool isl_val_ge(__isl_keep isl_val *v1,
716                 __isl_keep isl_val *v2);
717         isl_bool isl_val_eq(__isl_keep isl_val *v1,
718                 __isl_keep isl_val *v2);
719         isl_bool isl_val_ne(__isl_keep isl_val *v1,
720                 __isl_keep isl_val *v2);
721         isl_bool isl_val_abs_eq(__isl_keep isl_val *v1,
722                 __isl_keep isl_val *v2);
724 Comparisons to NaN always return false.
725 That is, a NaN is not considered to hold any relative position
726 with respect to any value.  In particular, a NaN
727 is neither considered to be equal to nor to be different from
728 any value (including another NaN).
729 The function C<isl_val_abs_eq> checks whether its two arguments
730 are equal in absolute value.
732 For integer C<isl_val>s we additionally have the following binary property.
734         #include <isl/val.h>
735         isl_bool isl_val_is_divisible_by(__isl_keep isl_val *v1,
736                 __isl_keep isl_val *v2);
738 An C<isl_val> can also be compared to an integer using the following
739 function.  The result is undefined for NaN.
741         #include <isl/val.h>
742         int isl_val_cmp_si(__isl_keep isl_val *v, long i);
744 The following unary operations are available on C<isl_val>s.
746         #include <isl/val.h>
747         __isl_give isl_val *isl_val_abs(__isl_take isl_val *v);
748         __isl_give isl_val *isl_val_neg(__isl_take isl_val *v);
749         __isl_give isl_val *isl_val_floor(__isl_take isl_val *v);
750         __isl_give isl_val *isl_val_ceil(__isl_take isl_val *v);
751         __isl_give isl_val *isl_val_trunc(__isl_take isl_val *v);
752         __isl_give isl_val *isl_val_inv(__isl_take isl_val *v);
753         __isl_give isl_val *isl_val_2exp(__isl_take isl_val *v);
755 The following binary operations are available on C<isl_val>s.
757         #include <isl/val.h>
758         __isl_give isl_val *isl_val_min(__isl_take isl_val *v1,
759                 __isl_take isl_val *v2);
760         __isl_give isl_val *isl_val_max(__isl_take isl_val *v1,
761                 __isl_take isl_val *v2);
762         __isl_give isl_val *isl_val_add(__isl_take isl_val *v1,
763                 __isl_take isl_val *v2);
764         __isl_give isl_val *isl_val_add_ui(__isl_take isl_val *v1,
765                 unsigned long v2);
766         __isl_give isl_val *isl_val_sub(__isl_take isl_val *v1,
767                 __isl_take isl_val *v2);
768         __isl_give isl_val *isl_val_sub_ui(__isl_take isl_val *v1,
769                 unsigned long v2);
770         __isl_give isl_val *isl_val_mul(__isl_take isl_val *v1,
771                 __isl_take isl_val *v2);
772         __isl_give isl_val *isl_val_mul_ui(__isl_take isl_val *v1,
773                 unsigned long v2);
774         __isl_give isl_val *isl_val_div(__isl_take isl_val *v1,
775                 __isl_take isl_val *v2);
776         __isl_give isl_val *isl_val_div_ui(__isl_take isl_val *v1,
777                 unsigned long v2);
779 On integer values, we additionally have the following operations.
781         #include <isl/val.h>
782         __isl_give isl_val *isl_val_2exp(__isl_take isl_val *v);
783         __isl_give isl_val *isl_val_mod(__isl_take isl_val *v1,
784                 __isl_take isl_val *v2);
785         __isl_give isl_val *isl_val_gcd(__isl_take isl_val *v1,
786                 __isl_take isl_val *v2);
787         __isl_give isl_val *isl_val_gcdext(__isl_take isl_val *v1,
788                 __isl_take isl_val *v2, __isl_give isl_val **x,
789                 __isl_give isl_val **y);
791 The function C<isl_val_gcdext> returns the greatest common divisor g
792 of C<v1> and C<v2> as well as two integers C<*x> and C<*y> such
793 that C<*x> * C<v1> + C<*y> * C<v2> = g.
795 =head3 GMP specific functions
797 These functions are only available if C<isl> has been compiled with C<GMP>
798 support.
800 Specific integer and rational values can be created from C<GMP> values using
801 the following functions.
803         #include <isl/val_gmp.h>
804         __isl_give isl_val *isl_val_int_from_gmp(isl_ctx *ctx,
805                 mpz_t z);
806         __isl_give isl_val *isl_val_from_gmp(isl_ctx *ctx,
807                 const mpz_t n, const mpz_t d);
809 The numerator and denominator of a rational value can be extracted as
810 C<GMP> values using the following functions.
812         #include <isl/val_gmp.h>
813         int isl_val_get_num_gmp(__isl_keep isl_val *v, mpz_t z);
814         int isl_val_get_den_gmp(__isl_keep isl_val *v, mpz_t z);
816 =head2 Sets and Relations
818 C<isl> uses six types of objects for representing sets and relations,
819 C<isl_basic_set>, C<isl_basic_map>, C<isl_set>, C<isl_map>,
820 C<isl_union_set> and C<isl_union_map>.
821 C<isl_basic_set> and C<isl_basic_map> represent sets and relations that
822 can be described as a conjunction of affine constraints, while
823 C<isl_set> and C<isl_map> represent unions of
824 C<isl_basic_set>s and C<isl_basic_map>s, respectively.
825 However, all C<isl_basic_set>s or C<isl_basic_map>s in the union need
826 to live in the same space.  C<isl_union_set>s and C<isl_union_map>s
827 represent unions of C<isl_set>s or C<isl_map>s in I<different> spaces,
828 where spaces are considered different if they have a different number
829 of dimensions and/or different names (see L<"Spaces">).
830 The difference between sets and relations (maps) is that sets have
831 one set of variables, while relations have two sets of variables,
832 input variables and output variables.
834 =head2 Error Handling
836 C<isl> supports different ways to react in case a runtime error is triggered.
837 Runtime errors arise, e.g., if a function such as C<isl_map_intersect> is called
838 with two maps that have incompatible spaces. There are three possible ways
839 to react on error: to warn, to continue or to abort.
841 The default behavior is to warn. In this mode, C<isl> prints a warning, stores
842 the last error in the corresponding C<isl_ctx> and the function in which the
843 error was triggered returns a value indicating that some error has
844 occurred.  In case of functions returning a pointer, this value is
845 C<NULL>.  In case of functions returning an C<isl_bool> or an
846 C<isl_stat>, this valus is C<isl_bool_error> or C<isl_stat_error>.
847 An error does not corrupt internal state,
848 such that isl can continue to be used. C<isl> also provides functions to
849 read the last error and to reset the memory that stores the last error. The
850 last error is only stored for information purposes. Its presence does not
851 change the behavior of C<isl>. Hence, resetting an error is not required to
852 continue to use isl, but only to observe new errors.
854         #include <isl/ctx.h>
855         enum isl_error isl_ctx_last_error(isl_ctx *ctx);
856         void isl_ctx_reset_error(isl_ctx *ctx);
858 Another option is to continue on error. This is similar to warn on error mode,
859 except that C<isl> does not print any warning. This allows a program to
860 implement its own error reporting.
862 The last option is to directly abort the execution of the program from within
863 the isl library. This makes it obviously impossible to recover from an error,
864 but it allows to directly spot the error location. By aborting on error,
865 debuggers break at the location the error occurred and can provide a stack
866 trace. Other tools that automatically provide stack traces on abort or that do
867 not want to continue execution after an error was triggered may also prefer to
868 abort on error.
870 The on error behavior of isl can be specified by calling
871 C<isl_options_set_on_error> or by setting the command line option
872 C<--isl-on-error>. Valid arguments for the function call are
873 C<ISL_ON_ERROR_WARN>, C<ISL_ON_ERROR_CONTINUE> and C<ISL_ON_ERROR_ABORT>. The
874 choices for the command line option are C<warn>, C<continue> and C<abort>.
875 It is also possible to query the current error mode.
877         #include <isl/options.h>
878         isl_stat isl_options_set_on_error(isl_ctx *ctx, int val);
879         int isl_options_get_on_error(isl_ctx *ctx);
881 =head2 Identifiers
883 Identifiers are used to identify both individual dimensions
884 and tuples of dimensions.  They consist of an optional name and an optional
885 user pointer.  The name and the user pointer cannot both be C<NULL>, however.
886 Identifiers with the same name but different pointer values
887 are considered to be distinct.
888 Similarly, identifiers with different names but the same pointer value
889 are also considered to be distinct.
890 Equal identifiers are represented using the same object.
891 Pairs of identifiers can therefore be tested for equality using the
892 C<==> operator.
893 Identifiers can be constructed, copied, freed, inspected and printed
894 using the following functions.
896         #include <isl/id.h>
897         __isl_give isl_id *isl_id_alloc(isl_ctx *ctx,
898                 __isl_keep const char *name, void *user);
899         __isl_give isl_id *isl_id_set_free_user(
900                 __isl_take isl_id *id,
901                 void (*free_user)(void *user));
902         __isl_give isl_id *isl_id_copy(isl_id *id);
903         __isl_null isl_id *isl_id_free(__isl_take isl_id *id);
905         void *isl_id_get_user(__isl_keep isl_id *id);
906         __isl_keep const char *isl_id_get_name(__isl_keep isl_id *id);
908         __isl_give isl_printer *isl_printer_print_id(
909                 __isl_take isl_printer *p, __isl_keep isl_id *id);
911 The callback set by C<isl_id_set_free_user> is called on the user
912 pointer when the last reference to the C<isl_id> is freed.
913 Note that C<isl_id_get_name> returns a pointer to some internal
914 data structure, so the result can only be used while the
915 corresponding C<isl_id> is alive.
917 =head2 Spaces
919 Whenever a new set, relation or similar object is created from scratch,
920 the space in which it lives needs to be specified using an C<isl_space>.
921 Each space involves zero or more parameters and zero, one or two
922 tuples of set or input/output dimensions.  The parameters and dimensions
923 are identified by an C<isl_dim_type> and a position.
924 The type C<isl_dim_param> refers to parameters,
925 the type C<isl_dim_set> refers to set dimensions (for spaces
926 with a single tuple of dimensions) and the types C<isl_dim_in>
927 and C<isl_dim_out> refer to input and output dimensions
928 (for spaces with two tuples of dimensions).
929 Local spaces (see L</"Local Spaces">) also contain dimensions
930 of type C<isl_dim_div>.
931 Note that parameters are only identified by their position within
932 a given object.  Across different objects, parameters are (usually)
933 identified by their names or identifiers.  Only unnamed parameters
934 are identified by their positions across objects.  The use of unnamed
935 parameters is discouraged.
937         #include <isl/space.h>
938         __isl_give isl_space *isl_space_alloc(isl_ctx *ctx,
939                 unsigned nparam, unsigned n_in, unsigned n_out);
940         __isl_give isl_space *isl_space_params_alloc(isl_ctx *ctx,
941                 unsigned nparam);
942         __isl_give isl_space *isl_space_set_alloc(isl_ctx *ctx,
943                 unsigned nparam, unsigned dim);
944         __isl_give isl_space *isl_space_copy(__isl_keep isl_space *space);
945         __isl_null isl_space *isl_space_free(__isl_take isl_space *space);
947 The space used for creating a parameter domain
948 needs to be created using C<isl_space_params_alloc>.
949 For other sets, the space
950 needs to be created using C<isl_space_set_alloc>, while
951 for a relation, the space
952 needs to be created using C<isl_space_alloc>.
954 To check whether a given space is that of a set or a map
955 or whether it is a parameter space, use these functions:
957         #include <isl/space.h>
958         isl_bool isl_space_is_params(__isl_keep isl_space *space);
959         isl_bool isl_space_is_set(__isl_keep isl_space *space);
960         isl_bool isl_space_is_map(__isl_keep isl_space *space);
962 Spaces can be compared using the following functions:
964         #include <isl/space.h>
965         isl_bool isl_space_is_equal(__isl_keep isl_space *space1,
966                 __isl_keep isl_space *space2);
967         isl_bool isl_space_has_equal_params(
968                 __isl_keep isl_space *space1,
969                 __isl_keep isl_space *space2);
970         isl_bool isl_space_has_equal_tuples(
971                 __isl_keep isl_space *space1,
972                 __isl_keep isl_space *space2);
973         isl_bool isl_space_is_domain(__isl_keep isl_space *space1,
974                 __isl_keep isl_space *space2);
975         isl_bool isl_space_is_range(__isl_keep isl_space *space1,
976                 __isl_keep isl_space *space2);
977         isl_bool isl_space_tuple_is_equal(
978                 __isl_keep isl_space *space1,
979                 enum isl_dim_type type1,
980                 __isl_keep isl_space *space2,
981                 enum isl_dim_type type2);
983 C<isl_space_is_domain> checks whether the first argument is equal
984 to the domain of the second argument.  This requires in particular that
985 the first argument is a set space and that the second argument
986 is a map space.  C<isl_space_tuple_is_equal> checks whether the given
987 tuples (C<isl_dim_in>, C<isl_dim_out> or C<isl_dim_set>) of the given
988 spaces are the same.  That is, it checks if they have the same
989 identifier (if any), the same dimension and the same internal structure
990 (if any).
991 The function
992 C<isl_space_has_equal_params> checks whether two spaces
993 have the same parameters in the same order.
994 C<isl_space_has_equal_tuples> check whether two spaces have
995 the same tuples.  In contrast to C<isl_space_is_equal> below,
996 it does not check the
997 parameters.  This is useful because many C<isl> functions align the
998 parameters before they perform their operations, such that equivalence
999 is not necessary.
1000 C<isl_space_is_equal> checks whether two spaces are identical,
1001 meaning that they have the same parameters and the same tuples.
1002 That is, it checks whether both C<isl_space_has_equal_params> and
1003 C<isl_space_has_equal_tuples> hold.
1005 It is often useful to create objects that live in the
1006 same space as some other object.  This can be accomplished
1007 by creating the new objects
1008 (see L</"Creating New Sets and Relations"> or
1009 L</"Functions">) based on the space
1010 of the original object.
1012         #include <isl/set.h>
1013         __isl_give isl_space *isl_basic_set_get_space(
1014                 __isl_keep isl_basic_set *bset);
1015         __isl_give isl_space *isl_set_get_space(__isl_keep isl_set *set);
1017         #include <isl/union_set.h>
1018         __isl_give isl_space *isl_union_set_get_space(
1019                 __isl_keep isl_union_set *uset);
1021         #include <isl/map.h>
1022         __isl_give isl_space *isl_basic_map_get_space(
1023                 __isl_keep isl_basic_map *bmap);
1024         __isl_give isl_space *isl_map_get_space(__isl_keep isl_map *map);
1026         #include <isl/union_map.h>
1027         __isl_give isl_space *isl_union_map_get_space(
1028                 __isl_keep isl_union_map *umap);
1030         #include <isl/constraint.h>
1031         __isl_give isl_space *isl_constraint_get_space(
1032                 __isl_keep isl_constraint *constraint);
1034         #include <isl/polynomial.h>
1035         __isl_give isl_space *isl_qpolynomial_get_domain_space(
1036                 __isl_keep isl_qpolynomial *qp);
1037         __isl_give isl_space *isl_qpolynomial_get_space(
1038                 __isl_keep isl_qpolynomial *qp);
1039         __isl_give isl_space *
1040         isl_qpolynomial_fold_get_domain_space(
1041                 __isl_keep isl_qpolynomial_fold *fold);
1042         __isl_give isl_space *isl_qpolynomial_fold_get_space(
1043                 __isl_keep isl_qpolynomial_fold *fold);
1044         __isl_give isl_space *isl_pw_qpolynomial_get_domain_space(
1045                 __isl_keep isl_pw_qpolynomial *pwqp);
1046         __isl_give isl_space *isl_pw_qpolynomial_get_space(
1047                 __isl_keep isl_pw_qpolynomial *pwqp);
1048         __isl_give isl_space *isl_pw_qpolynomial_fold_get_domain_space(
1049                 __isl_keep isl_pw_qpolynomial_fold *pwf);
1050         __isl_give isl_space *isl_pw_qpolynomial_fold_get_space(
1051                 __isl_keep isl_pw_qpolynomial_fold *pwf);
1052         __isl_give isl_space *isl_union_pw_qpolynomial_get_space(
1053                 __isl_keep isl_union_pw_qpolynomial *upwqp);
1054         __isl_give isl_space *isl_union_pw_qpolynomial_fold_get_space(
1055                 __isl_keep isl_union_pw_qpolynomial_fold *upwf);
1057         #include <isl/val.h>
1058         __isl_give isl_space *isl_multi_val_get_space(
1059                 __isl_keep isl_multi_val *mv);
1061         #include <isl/aff.h>
1062         __isl_give isl_space *isl_aff_get_domain_space(
1063                 __isl_keep isl_aff *aff);
1064         __isl_give isl_space *isl_aff_get_space(
1065                 __isl_keep isl_aff *aff);
1066         __isl_give isl_space *isl_pw_aff_get_domain_space(
1067                 __isl_keep isl_pw_aff *pwaff);
1068         __isl_give isl_space *isl_pw_aff_get_space(
1069                 __isl_keep isl_pw_aff *pwaff);
1070         __isl_give isl_space *isl_multi_aff_get_domain_space(
1071                 __isl_keep isl_multi_aff *maff);
1072         __isl_give isl_space *isl_multi_aff_get_space(
1073                 __isl_keep isl_multi_aff *maff);
1074         __isl_give isl_space *isl_pw_multi_aff_get_domain_space(
1075                 __isl_keep isl_pw_multi_aff *pma);
1076         __isl_give isl_space *isl_pw_multi_aff_get_space(
1077                 __isl_keep isl_pw_multi_aff *pma);
1078         __isl_give isl_space *isl_union_pw_aff_get_space(
1079                 __isl_keep isl_union_pw_aff *upa);
1080         __isl_give isl_space *isl_union_pw_multi_aff_get_space(
1081                 __isl_keep isl_union_pw_multi_aff *upma);
1082         __isl_give isl_space *isl_multi_pw_aff_get_domain_space(
1083                 __isl_keep isl_multi_pw_aff *mpa);
1084         __isl_give isl_space *isl_multi_pw_aff_get_space(
1085                 __isl_keep isl_multi_pw_aff *mpa);
1086         __isl_give isl_space *
1087         isl_multi_union_pw_aff_get_domain_space(
1088                 __isl_keep isl_multi_union_pw_aff *mupa);
1089         __isl_give isl_space *
1090         isl_multi_union_pw_aff_get_space(
1091                 __isl_keep isl_multi_union_pw_aff *mupa);
1093         #include <isl/point.h>
1094         __isl_give isl_space *isl_point_get_space(
1095                 __isl_keep isl_point *pnt);
1097 The number of dimensions of a given type of space
1098 may be read off from a space or an object that lives
1099 in a space using the following functions.
1100 In case of C<isl_space_dim>, type may be
1101 C<isl_dim_param>, C<isl_dim_in> (only for relations),
1102 C<isl_dim_out> (only for relations), C<isl_dim_set>
1103 (only for sets) or C<isl_dim_all>.
1105         #include <isl/space.h>
1106         unsigned isl_space_dim(__isl_keep isl_space *space,
1107                 enum isl_dim_type type);
1109         #include <isl/local_space.h>
1110         int isl_local_space_dim(__isl_keep isl_local_space *ls,
1111                 enum isl_dim_type type);
1113         #include <isl/set.h>
1114         unsigned isl_basic_set_dim(__isl_keep isl_basic_set *bset,
1115                 enum isl_dim_type type);
1116         unsigned isl_set_dim(__isl_keep isl_set *set,
1117                 enum isl_dim_type type);
1119         #include <isl/union_set.h>
1120         unsigned isl_union_set_dim(__isl_keep isl_union_set *uset,
1121                 enum isl_dim_type type);
1123         #include <isl/map.h>
1124         unsigned isl_basic_map_dim(__isl_keep isl_basic_map *bmap,
1125                 enum isl_dim_type type);
1126         unsigned isl_map_dim(__isl_keep isl_map *map,
1127                 enum isl_dim_type type);
1129         #include <isl/union_map.h>
1130         unsigned isl_union_map_dim(__isl_keep isl_union_map *umap,
1131                 enum isl_dim_type type);
1133         #include <isl/val.h>
1134         unsigned isl_multi_val_dim(__isl_keep isl_multi_val *mv,
1135                 enum isl_dim_type type);
1137         #include <isl/aff.h>
1138         int isl_aff_dim(__isl_keep isl_aff *aff,
1139                 enum isl_dim_type type);
1140         unsigned isl_multi_aff_dim(__isl_keep isl_multi_aff *maff,
1141                 enum isl_dim_type type);
1142         unsigned isl_pw_aff_dim(__isl_keep isl_pw_aff *pwaff,
1143                 enum isl_dim_type type);
1144         unsigned isl_pw_multi_aff_dim(
1145                 __isl_keep isl_pw_multi_aff *pma,
1146                 enum isl_dim_type type);
1147         unsigned isl_multi_pw_aff_dim(
1148                 __isl_keep isl_multi_pw_aff *mpa,
1149                 enum isl_dim_type type);
1150         unsigned isl_union_pw_aff_dim(
1151                 __isl_keep isl_union_pw_aff *upa,
1152                 enum isl_dim_type type);
1153         unsigned isl_union_pw_multi_aff_dim(
1154                 __isl_keep isl_union_pw_multi_aff *upma,
1155                 enum isl_dim_type type);
1156         unsigned isl_multi_union_pw_aff_dim(
1157                 __isl_keep isl_multi_union_pw_aff *mupa,
1158                 enum isl_dim_type type);
1160         #include <isl/polynomial.h>
1161         unsigned isl_union_pw_qpolynomial_dim(
1162                 __isl_keep isl_union_pw_qpolynomial *upwqp,
1163                 enum isl_dim_type type);
1164         unsigned isl_union_pw_qpolynomial_fold_dim(
1165                 __isl_keep isl_union_pw_qpolynomial_fold *upwf,
1166                 enum isl_dim_type type);
1168 Note that an C<isl_union_set>, an C<isl_union_map>,
1169 an C<isl_union_pw_multi_aff>,
1170 an C<isl_union_pw_qpolynomial> and
1171 an C<isl_union_pw_qpolynomial_fold>
1172 only have parameters.
1174 The identifiers or names of the individual dimensions of spaces
1175 may be set or read off using the following functions on spaces
1176 or objects that live in spaces.
1177 These functions are mostly useful to obtain the identifiers, positions
1178 or names of the parameters.  Identifiers of individual dimensions are
1179 essentially only useful for printing.  They are ignored by all other
1180 operations and may not be preserved across those operations.
1182         #include <isl/space.h>
1183         __isl_give isl_space *isl_space_set_dim_id(
1184                 __isl_take isl_space *space,
1185                 enum isl_dim_type type, unsigned pos,
1186                 __isl_take isl_id *id);
1187         isl_bool isl_space_has_dim_id(__isl_keep isl_space *space,
1188                 enum isl_dim_type type, unsigned pos);
1189         __isl_give isl_id *isl_space_get_dim_id(
1190                 __isl_keep isl_space *space,
1191                 enum isl_dim_type type, unsigned pos);
1192         __isl_give isl_space *isl_space_set_dim_name(
1193                 __isl_take isl_space *space,
1194                  enum isl_dim_type type, unsigned pos,
1195                  __isl_keep const char *name);
1196         isl_bool isl_space_has_dim_name(__isl_keep isl_space *space,
1197                 enum isl_dim_type type, unsigned pos);
1198         __isl_keep const char *isl_space_get_dim_name(
1199                 __isl_keep isl_space *space,
1200                 enum isl_dim_type type, unsigned pos);
1202         #include <isl/local_space.h>
1203         __isl_give isl_local_space *isl_local_space_set_dim_id(
1204                 __isl_take isl_local_space *ls,
1205                 enum isl_dim_type type, unsigned pos,
1206                 __isl_take isl_id *id);
1207         isl_bool isl_local_space_has_dim_id(
1208                 __isl_keep isl_local_space *ls,
1209                 enum isl_dim_type type, unsigned pos);
1210         __isl_give isl_id *isl_local_space_get_dim_id(
1211                 __isl_keep isl_local_space *ls,
1212                 enum isl_dim_type type, unsigned pos);
1213         __isl_give isl_local_space *isl_local_space_set_dim_name(
1214                 __isl_take isl_local_space *ls,
1215                 enum isl_dim_type type, unsigned pos, const char *s);
1216         isl_bool isl_local_space_has_dim_name(
1217                 __isl_keep isl_local_space *ls,
1218                 enum isl_dim_type type, unsigned pos)
1219         const char *isl_local_space_get_dim_name(
1220                 __isl_keep isl_local_space *ls,
1221                 enum isl_dim_type type, unsigned pos);
1223         #include <isl/constraint.h>
1224         const char *isl_constraint_get_dim_name(
1225                 __isl_keep isl_constraint *constraint,
1226                 enum isl_dim_type type, unsigned pos);
1228         #include <isl/set.h>
1229         __isl_give isl_id *isl_basic_set_get_dim_id(
1230                 __isl_keep isl_basic_set *bset,
1231                 enum isl_dim_type type, unsigned pos);
1232         __isl_give isl_set *isl_set_set_dim_id(
1233                 __isl_take isl_set *set, enum isl_dim_type type,
1234                 unsigned pos, __isl_take isl_id *id);
1235         isl_bool isl_set_has_dim_id(__isl_keep isl_set *set,
1236                 enum isl_dim_type type, unsigned pos);
1237         __isl_give isl_id *isl_set_get_dim_id(
1238                 __isl_keep isl_set *set, enum isl_dim_type type,
1239                 unsigned pos);
1240         const char *isl_basic_set_get_dim_name(
1241                 __isl_keep isl_basic_set *bset,
1242                 enum isl_dim_type type, unsigned pos);
1243         isl_bool isl_set_has_dim_name(__isl_keep isl_set *set,
1244                 enum isl_dim_type type, unsigned pos);
1245         const char *isl_set_get_dim_name(
1246                 __isl_keep isl_set *set,
1247                 enum isl_dim_type type, unsigned pos);
1249         #include <isl/map.h>
1250         __isl_give isl_map *isl_map_set_dim_id(
1251                 __isl_take isl_map *map, enum isl_dim_type type,
1252                 unsigned pos, __isl_take isl_id *id);
1253         isl_bool isl_basic_map_has_dim_id(
1254                 __isl_keep isl_basic_map *bmap,
1255                 enum isl_dim_type type, unsigned pos);
1256         isl_bool isl_map_has_dim_id(__isl_keep isl_map *map,
1257                 enum isl_dim_type type, unsigned pos);
1258         __isl_give isl_id *isl_map_get_dim_id(
1259                 __isl_keep isl_map *map, enum isl_dim_type type,
1260                 unsigned pos);
1261         __isl_give isl_id *isl_union_map_get_dim_id(
1262                 __isl_keep isl_union_map *umap,
1263                 enum isl_dim_type type, unsigned pos);
1264         const char *isl_basic_map_get_dim_name(
1265                 __isl_keep isl_basic_map *bmap,
1266                 enum isl_dim_type type, unsigned pos);
1267         isl_bool isl_map_has_dim_name(__isl_keep isl_map *map,
1268                 enum isl_dim_type type, unsigned pos);
1269         const char *isl_map_get_dim_name(
1270                 __isl_keep isl_map *map,
1271                 enum isl_dim_type type, unsigned pos);
1273         #include <isl/val.h>
1274         __isl_give isl_multi_val *isl_multi_val_set_dim_id(
1275                 __isl_take isl_multi_val *mv,
1276                 enum isl_dim_type type, unsigned pos,
1277                 __isl_take isl_id *id);
1278         __isl_give isl_id *isl_multi_val_get_dim_id(
1279                 __isl_keep isl_multi_val *mv,
1280                 enum isl_dim_type type, unsigned pos);
1281         __isl_give isl_multi_val *isl_multi_val_set_dim_name(
1282                 __isl_take isl_multi_val *mv,
1283                 enum isl_dim_type type, unsigned pos, const char *s);
1285         #include <isl/aff.h>
1286         __isl_give isl_aff *isl_aff_set_dim_id(
1287                 __isl_take isl_aff *aff, enum isl_dim_type type,
1288                 unsigned pos, __isl_take isl_id *id);
1289         __isl_give isl_multi_aff *isl_multi_aff_set_dim_id(
1290                 __isl_take isl_multi_aff *maff,
1291                 enum isl_dim_type type, unsigned pos,
1292                 __isl_take isl_id *id);
1293         __isl_give isl_pw_aff *isl_pw_aff_set_dim_id(
1294                 __isl_take isl_pw_aff *pma,
1295                 enum isl_dim_type type, unsigned pos,
1296                 __isl_take isl_id *id);
1297         __isl_give isl_multi_pw_aff *
1298         isl_multi_pw_aff_set_dim_id(
1299                 __isl_take isl_multi_pw_aff *mpa,
1300                 enum isl_dim_type type, unsigned pos,
1301                 __isl_take isl_id *id);
1302         __isl_give isl_multi_union_pw_aff *
1303         isl_multi_union_pw_aff_set_dim_id(
1304                 __isl_take isl_multi_union_pw_aff *mupa,
1305                 enum isl_dim_type type, unsigned pos,
1306                 __isl_take isl_id *id);
1307         __isl_give isl_id *isl_multi_aff_get_dim_id(
1308                 __isl_keep isl_multi_aff *ma,
1309                 enum isl_dim_type type, unsigned pos);
1310         isl_bool isl_pw_aff_has_dim_id(__isl_keep isl_pw_aff *pa,
1311                 enum isl_dim_type type, unsigned pos);
1312         __isl_give isl_id *isl_pw_aff_get_dim_id(
1313                 __isl_keep isl_pw_aff *pa,
1314                 enum isl_dim_type type, unsigned pos);
1315         __isl_give isl_id *isl_pw_multi_aff_get_dim_id(
1316                 __isl_keep isl_pw_multi_aff *pma,
1317                 enum isl_dim_type type, unsigned pos);
1318         __isl_give isl_id *isl_multi_pw_aff_get_dim_id(
1319                 __isl_keep isl_multi_pw_aff *mpa,
1320                 enum isl_dim_type type, unsigned pos);
1321         __isl_give isl_id *isl_multi_union_pw_aff_get_dim_id(
1322                 __isl_keep isl_multi_union_pw_aff *mupa,
1323                 enum isl_dim_type type, unsigned pos);
1324         __isl_give isl_aff *isl_aff_set_dim_name(
1325                 __isl_take isl_aff *aff, enum isl_dim_type type,
1326                 unsigned pos, const char *s);
1327         __isl_give isl_multi_aff *isl_multi_aff_set_dim_name(
1328                 __isl_take isl_multi_aff *maff,
1329                 enum isl_dim_type type, unsigned pos, const char *s);
1330         __isl_give isl_multi_pw_aff *
1331         isl_multi_pw_aff_set_dim_name(
1332                 __isl_take isl_multi_pw_aff *mpa,
1333                 enum isl_dim_type type, unsigned pos, const char *s);
1334         __isl_give isl_union_pw_aff *
1335         isl_union_pw_aff_set_dim_name(
1336                 __isl_take isl_union_pw_aff *upa,
1337                 enum isl_dim_type type, unsigned pos,
1338                 const char *s);
1339         __isl_give isl_union_pw_multi_aff *
1340         isl_union_pw_multi_aff_set_dim_name(
1341                 __isl_take isl_union_pw_multi_aff *upma,
1342                 enum isl_dim_type type, unsigned pos,
1343                 const char *s);
1344         __isl_give isl_multi_union_pw_aff *
1345         isl_multi_union_pw_aff_set_dim_name(
1346                 __isl_take isl_multi_union_pw_aff *mupa,
1347                 enum isl_dim_type type, unsigned pos,
1348         const char *isl_aff_get_dim_name(__isl_keep isl_aff *aff,
1349                 enum isl_dim_type type, unsigned pos);
1350         const char *isl_pw_aff_get_dim_name(
1351                 __isl_keep isl_pw_aff *pa,
1352                 enum isl_dim_type type, unsigned pos);
1353         const char *isl_pw_multi_aff_get_dim_name(
1354                 __isl_keep isl_pw_multi_aff *pma,
1355                 enum isl_dim_type type, unsigned pos);
1357         #include <isl/polynomial.h>
1358         __isl_give isl_qpolynomial *isl_qpolynomial_set_dim_name(
1359                 __isl_take isl_qpolynomial *qp,
1360                 enum isl_dim_type type, unsigned pos,
1361                 const char *s);
1362         __isl_give isl_pw_qpolynomial *
1363         isl_pw_qpolynomial_set_dim_name(
1364                 __isl_take isl_pw_qpolynomial *pwqp,
1365                 enum isl_dim_type type, unsigned pos,
1366                 const char *s);
1367         __isl_give isl_pw_qpolynomial_fold *
1368         isl_pw_qpolynomial_fold_set_dim_name(
1369                 __isl_take isl_pw_qpolynomial_fold *pwf,
1370                 enum isl_dim_type type, unsigned pos,
1371                 const char *s);
1372         __isl_give isl_union_pw_qpolynomial *
1373         isl_union_pw_qpolynomial_set_dim_name(
1374                 __isl_take isl_union_pw_qpolynomial *upwqp,
1375                 enum isl_dim_type type, unsigned pos,
1376                 const char *s);
1377         __isl_give isl_union_pw_qpolynomial_fold *
1378         isl_union_pw_qpolynomial_fold_set_dim_name(
1379                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
1380                 enum isl_dim_type type, unsigned pos,
1381                 const char *s);
1383 Note that C<isl_space_get_name> returns a pointer to some internal
1384 data structure, so the result can only be used while the
1385 corresponding C<isl_space> is alive.
1386 Also note that every function that operates on two sets or relations
1387 requires that both arguments have the same parameters.  This also
1388 means that if one of the arguments has named parameters, then the
1389 other needs to have named parameters too and the names need to match.
1390 Pairs of C<isl_set>, C<isl_map>, C<isl_union_set> and/or C<isl_union_map>
1391 arguments may have different parameters (as long as they are named),
1392 in which case the result will have as parameters the union of the parameters of
1393 the arguments.
1395 Given the identifier or name of a dimension (typically a parameter),
1396 its position can be obtained from the following functions.
1398         #include <isl/space.h>
1399         int isl_space_find_dim_by_id(__isl_keep isl_space *space,
1400                 enum isl_dim_type type, __isl_keep isl_id *id);
1401         int isl_space_find_dim_by_name(__isl_keep isl_space *space,
1402                 enum isl_dim_type type, const char *name);
1404         #include <isl/local_space.h>
1405         int isl_local_space_find_dim_by_name(
1406                 __isl_keep isl_local_space *ls,
1407                 enum isl_dim_type type, const char *name);
1409         #include <isl/val.h>
1410         int isl_multi_val_find_dim_by_id(
1411                 __isl_keep isl_multi_val *mv,
1412                 enum isl_dim_type type, __isl_keep isl_id *id);
1413         int isl_multi_val_find_dim_by_name(
1414                 __isl_keep isl_multi_val *mv,
1415                 enum isl_dim_type type, const char *name);
1417         #include <isl/set.h>
1418         int isl_set_find_dim_by_id(__isl_keep isl_set *set,
1419                 enum isl_dim_type type, __isl_keep isl_id *id);
1420         int isl_set_find_dim_by_name(__isl_keep isl_set *set,
1421                 enum isl_dim_type type, const char *name);
1423         #include <isl/map.h>
1424         int isl_map_find_dim_by_id(__isl_keep isl_map *map,
1425                 enum isl_dim_type type, __isl_keep isl_id *id);
1426         int isl_basic_map_find_dim_by_name(
1427                 __isl_keep isl_basic_map *bmap,
1428                 enum isl_dim_type type, const char *name);
1429         int isl_map_find_dim_by_name(__isl_keep isl_map *map,
1430                 enum isl_dim_type type, const char *name);
1431         int isl_union_map_find_dim_by_name(
1432                 __isl_keep isl_union_map *umap,
1433                 enum isl_dim_type type, const char *name);
1435         #include <isl/aff.h>
1436         int isl_multi_aff_find_dim_by_id(
1437                 __isl_keep isl_multi_aff *ma,
1438                 enum isl_dim_type type, __isl_keep isl_id *id);
1439         int isl_multi_pw_aff_find_dim_by_id(
1440                 __isl_keep isl_multi_pw_aff *mpa,
1441                 enum isl_dim_type type, __isl_keep isl_id *id);
1442         int isl_multi_union_pw_aff_find_dim_by_id(
1443                 __isl_keep isl_union_multi_pw_aff *mupa,
1444                 enum isl_dim_type type, __isl_keep isl_id *id);
1445         int isl_aff_find_dim_by_name(__isl_keep isl_aff *aff,
1446                 enum isl_dim_type type, const char *name);
1447         int isl_multi_aff_find_dim_by_name(
1448                 __isl_keep isl_multi_aff *ma,
1449                 enum isl_dim_type type, const char *name);
1450         int isl_pw_aff_find_dim_by_name(__isl_keep isl_pw_aff *pa,
1451                 enum isl_dim_type type, const char *name);
1452         int isl_multi_pw_aff_find_dim_by_name(
1453                 __isl_keep isl_multi_pw_aff *mpa,
1454                 enum isl_dim_type type, const char *name);
1455         int isl_pw_multi_aff_find_dim_by_name(
1456                 __isl_keep isl_pw_multi_aff *pma,
1457                 enum isl_dim_type type, const char *name);
1458         int isl_union_pw_aff_find_dim_by_name(
1459                 __isl_keep isl_union_pw_aff *upa,
1460                 enum isl_dim_type type, const char *name);
1461         int isl_union_pw_multi_aff_find_dim_by_name(
1462                 __isl_keep isl_union_pw_multi_aff *upma,
1463                 enum isl_dim_type type, const char *name);
1464         int isl_multi_union_pw_aff_find_dim_by_name(
1465                 __isl_keep isl_multi_union_pw_aff *mupa,
1466                 enum isl_dim_type type, const char *name);
1468         #include <isl/polynomial.h>
1469         int isl_pw_qpolynomial_find_dim_by_name(
1470                 __isl_keep isl_pw_qpolynomial *pwqp,
1471                 enum isl_dim_type type, const char *name);
1472         int isl_pw_qpolynomial_fold_find_dim_by_name(
1473                 __isl_keep isl_pw_qpolynomial_fold *pwf,
1474                 enum isl_dim_type type, const char *name);
1475         int isl_union_pw_qpolynomial_find_dim_by_name(
1476                 __isl_keep isl_union_pw_qpolynomial *upwqp,
1477                 enum isl_dim_type type, const char *name);
1478         int isl_union_pw_qpolynomial_fold_find_dim_by_name(
1479                 __isl_keep isl_union_pw_qpolynomial_fold *upwf,
1480                 enum isl_dim_type type, const char *name);
1482 The identifiers or names of entire spaces may be set or read off
1483 using the following functions.
1485         #include <isl/space.h>
1486         __isl_give isl_space *isl_space_set_tuple_id(
1487                 __isl_take isl_space *space,
1488                 enum isl_dim_type type, __isl_take isl_id *id);
1489         __isl_give isl_space *isl_space_reset_tuple_id(
1490                 __isl_take isl_space *space, enum isl_dim_type type);
1491         isl_bool isl_space_has_tuple_id(
1492                 __isl_keep isl_space *space,
1493                 enum isl_dim_type type);
1494         __isl_give isl_id *isl_space_get_tuple_id(
1495                 __isl_keep isl_space *space, enum isl_dim_type type);
1496         __isl_give isl_space *isl_space_set_tuple_name(
1497                 __isl_take isl_space *space,
1498                 enum isl_dim_type type, const char *s);
1499         isl_bool isl_space_has_tuple_name(
1500                 __isl_keep isl_space *space,
1501                 enum isl_dim_type type);
1502         __isl_keep const char *isl_space_get_tuple_name(
1503                 __isl_keep isl_space *space,
1504                 enum isl_dim_type type);
1506         #include <isl/local_space.h>
1507         __isl_give isl_local_space *isl_local_space_set_tuple_id(
1508                 __isl_take isl_local_space *ls,
1509                 enum isl_dim_type type, __isl_take isl_id *id);
1511         #include <isl/set.h>
1512         __isl_give isl_basic_set *isl_basic_set_set_tuple_id(
1513                 __isl_take isl_basic_set *bset,
1514                 __isl_take isl_id *id);
1515         __isl_give isl_set *isl_set_set_tuple_id(
1516                 __isl_take isl_set *set, __isl_take isl_id *id);
1517         __isl_give isl_set *isl_set_reset_tuple_id(
1518                 __isl_take isl_set *set);
1519         isl_bool isl_set_has_tuple_id(__isl_keep isl_set *set);
1520         __isl_give isl_id *isl_set_get_tuple_id(
1521                 __isl_keep isl_set *set);
1522         __isl_give isl_basic_set *isl_basic_set_set_tuple_name(
1523                 __isl_take isl_basic_set *set, const char *s);
1524         __isl_give isl_set *isl_set_set_tuple_name(
1525                 __isl_take isl_set *set, const char *s);
1526         const char *isl_basic_set_get_tuple_name(
1527                 __isl_keep isl_basic_set *bset);
1528         isl_bool isl_set_has_tuple_name(__isl_keep isl_set *set);
1529         const char *isl_set_get_tuple_name(
1530                 __isl_keep isl_set *set);
1532         #include <isl/map.h>
1533         __isl_give isl_basic_map *isl_basic_map_set_tuple_id(
1534                 __isl_take isl_basic_map *bmap,
1535                 enum isl_dim_type type, __isl_take isl_id *id);
1536         __isl_give isl_map *isl_map_set_tuple_id(
1537                 __isl_take isl_map *map, enum isl_dim_type type,
1538                 __isl_take isl_id *id);
1539         __isl_give isl_map *isl_map_reset_tuple_id(
1540                 __isl_take isl_map *map, enum isl_dim_type type);
1541         isl_bool isl_map_has_tuple_id(__isl_keep isl_map *map,
1542                 enum isl_dim_type type);
1543         __isl_give isl_id *isl_map_get_tuple_id(
1544                 __isl_keep isl_map *map, enum isl_dim_type type);
1545         __isl_give isl_map *isl_map_set_tuple_name(
1546                 __isl_take isl_map *map,
1547                 enum isl_dim_type type, const char *s);
1548         const char *isl_basic_map_get_tuple_name(
1549                 __isl_keep isl_basic_map *bmap,
1550                 enum isl_dim_type type);
1551         __isl_give isl_basic_map *isl_basic_map_set_tuple_name(
1552                 __isl_take isl_basic_map *bmap,
1553                 enum isl_dim_type type, const char *s);
1554         isl_bool isl_map_has_tuple_name(__isl_keep isl_map *map,
1555                 enum isl_dim_type type);
1556         const char *isl_map_get_tuple_name(
1557                 __isl_keep isl_map *map,
1558                 enum isl_dim_type type);
1560         #include <isl/val.h>
1561         __isl_give isl_multi_val *isl_multi_val_set_tuple_id(
1562                 __isl_take isl_multi_val *mv,
1563                 enum isl_dim_type type, __isl_take isl_id *id);
1564         __isl_give isl_multi_val *isl_multi_val_reset_tuple_id(
1565                 __isl_take isl_multi_val *mv,
1566                 enum isl_dim_type type);
1567         isl_bool isl_multi_val_has_tuple_id(
1568                 __isl_keep isl_multi_val *mv,
1569                 enum isl_dim_type type);
1570         __isl_give isl_id *isl_multi_val_get_tuple_id(
1571                 __isl_keep isl_multi_val *mv,
1572                 enum isl_dim_type type);
1573         __isl_give isl_multi_val *isl_multi_val_set_tuple_name(
1574                 __isl_take isl_multi_val *mv,
1575                 enum isl_dim_type type, const char *s);
1576         const char *isl_multi_val_get_tuple_name(
1577                 __isl_keep isl_multi_val *mv,
1578                 enum isl_dim_type type);
1580         #include <isl/aff.h>
1581         __isl_give isl_aff *isl_aff_set_tuple_id(
1582                 __isl_take isl_aff *aff,
1583                 enum isl_dim_type type, __isl_take isl_id *id);
1584         __isl_give isl_multi_aff *isl_multi_aff_set_tuple_id(
1585                 __isl_take isl_multi_aff *maff,
1586                 enum isl_dim_type type, __isl_take isl_id *id);
1587         __isl_give isl_pw_aff *isl_pw_aff_set_tuple_id(
1588                 __isl_take isl_pw_aff *pwaff,
1589                 enum isl_dim_type type, __isl_take isl_id *id);
1590         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_tuple_id(
1591                 __isl_take isl_pw_multi_aff *pma,
1592                 enum isl_dim_type type, __isl_take isl_id *id);
1593         __isl_give isl_multi_union_pw_aff *
1594         isl_multi_union_pw_aff_set_tuple_id(
1595                 __isl_take isl_multi_union_pw_aff *mupa,
1596                 enum isl_dim_type type, __isl_take isl_id *id);
1597         __isl_give isl_multi_aff *isl_multi_aff_reset_tuple_id(
1598                 __isl_take isl_multi_aff *ma,
1599                 enum isl_dim_type type);
1600         __isl_give isl_pw_aff *isl_pw_aff_reset_tuple_id(
1601                 __isl_take isl_pw_aff *pa,
1602                 enum isl_dim_type type);
1603         __isl_give isl_multi_pw_aff *
1604         isl_multi_pw_aff_reset_tuple_id(
1605                 __isl_take isl_multi_pw_aff *mpa,
1606                 enum isl_dim_type type);
1607         __isl_give isl_pw_multi_aff *
1608         isl_pw_multi_aff_reset_tuple_id(
1609                 __isl_take isl_pw_multi_aff *pma,
1610                 enum isl_dim_type type);
1611         __isl_give isl_multi_union_pw_aff *
1612         isl_multi_union_pw_aff_reset_tuple_id(
1613                 __isl_take isl_multi_union_pw_aff *mupa,
1614                 enum isl_dim_type type);
1615         isl_bool isl_multi_aff_has_tuple_id(
1616                 __isl_keep isl_multi_aff *ma,
1617                 enum isl_dim_type type);
1618         __isl_give isl_id *isl_multi_aff_get_tuple_id(
1619                 __isl_keep isl_multi_aff *ma,
1620                 enum isl_dim_type type);
1621         isl_bool isl_pw_aff_has_tuple_id(__isl_keep isl_pw_aff *pa,
1622                 enum isl_dim_type type);
1623         __isl_give isl_id *isl_pw_aff_get_tuple_id(
1624                 __isl_keep isl_pw_aff *pa,
1625                 enum isl_dim_type type);
1626         isl_bool isl_pw_multi_aff_has_tuple_id(
1627                 __isl_keep isl_pw_multi_aff *pma,
1628                 enum isl_dim_type type);
1629         __isl_give isl_id *isl_pw_multi_aff_get_tuple_id(
1630                 __isl_keep isl_pw_multi_aff *pma,
1631                 enum isl_dim_type type);
1632         isl_bool isl_multi_pw_aff_has_tuple_id(
1633                 __isl_keep isl_multi_pw_aff *mpa,
1634                 enum isl_dim_type type);
1635         __isl_give isl_id *isl_multi_pw_aff_get_tuple_id(
1636                 __isl_keep isl_multi_pw_aff *mpa,
1637                 enum isl_dim_type type);
1638         isl_bool isl_multi_union_pw_aff_has_tuple_id(
1639                 __isl_keep isl_multi_union_pw_aff *mupa,
1640                 enum isl_dim_type type);
1641         __isl_give isl_id *isl_multi_union_pw_aff_get_tuple_id(
1642                 __isl_keep isl_multi_union_pw_aff *mupa,
1643                 enum isl_dim_type type);
1644         __isl_give isl_multi_aff *isl_multi_aff_set_tuple_name(
1645                 __isl_take isl_multi_aff *maff,
1646                 enum isl_dim_type type, const char *s);
1647         __isl_give isl_multi_pw_aff *
1648         isl_multi_pw_aff_set_tuple_name(
1649                 __isl_take isl_multi_pw_aff *mpa,
1650                 enum isl_dim_type type, const char *s);
1651         __isl_give isl_multi_union_pw_aff *
1652         isl_multi_union_pw_aff_set_tuple_name(
1653                 __isl_take isl_multi_union_pw_aff *mupa,
1654                 enum isl_dim_type type, const char *s);
1655         const char *isl_multi_aff_get_tuple_name(
1656                 __isl_keep isl_multi_aff *multi,
1657                 enum isl_dim_type type);
1658         isl_bool isl_pw_multi_aff_has_tuple_name(
1659                 __isl_keep isl_pw_multi_aff *pma,
1660                 enum isl_dim_type type);
1661         const char *isl_pw_multi_aff_get_tuple_name(
1662                 __isl_keep isl_pw_multi_aff *pma,
1663                 enum isl_dim_type type);
1664         const char *isl_multi_union_pw_aff_get_tuple_name(
1665                 __isl_keep isl_multi_union_pw_aff *mupa,
1666                 enum isl_dim_type type);
1668 The C<type> argument needs to be one of C<isl_dim_in>, C<isl_dim_out>
1669 or C<isl_dim_set>.  As with C<isl_space_get_name>,
1670 the C<isl_space_get_tuple_name> function returns a pointer to some internal
1671 data structure.
1672 Binary operations require the corresponding spaces of their arguments
1673 to have the same name.
1675 To keep the names of all parameters and tuples, but reset the user pointers
1676 of all the corresponding identifiers, use the following function.
1678         #include <isl/space.h>
1679         __isl_give isl_space *isl_space_reset_user(
1680                 __isl_take isl_space *space);
1682         #include <isl/set.h>
1683         __isl_give isl_set *isl_set_reset_user(
1684                 __isl_take isl_set *set);
1686         #include <isl/map.h>
1687         __isl_give isl_map *isl_map_reset_user(
1688                 __isl_take isl_map *map);
1690         #include <isl/union_set.h>
1691         __isl_give isl_union_set *isl_union_set_reset_user(
1692                 __isl_take isl_union_set *uset);
1694         #include <isl/union_map.h>
1695         __isl_give isl_union_map *isl_union_map_reset_user(
1696                 __isl_take isl_union_map *umap);
1698         #include <isl/val.h>
1699         __isl_give isl_multi_val *isl_multi_val_reset_user(
1700                 __isl_take isl_multi_val *mv);
1702         #include <isl/aff.h>
1703         __isl_give isl_multi_aff *isl_multi_aff_reset_user(
1704                 __isl_take isl_multi_aff *ma);
1705         __isl_give isl_pw_aff *isl_pw_aff_reset_user(
1706                 __isl_take isl_pw_aff *pa);
1707         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_reset_user(
1708                 __isl_take isl_multi_pw_aff *mpa);
1709         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_user(
1710                 __isl_take isl_pw_multi_aff *pma);
1711         __isl_give isl_union_pw_aff *isl_union_pw_aff_reset_user(
1712                 __isl_take isl_union_pw_aff *upa);
1713         __isl_give isl_multi_union_pw_aff *
1714         isl_multi_union_pw_aff_reset_user(
1715                 __isl_take isl_multi_union_pw_aff *mupa);
1716         __isl_give isl_union_pw_multi_aff *
1717         isl_union_pw_multi_aff_reset_user(
1718                 __isl_take isl_union_pw_multi_aff *upma);
1720         #include <isl/polynomial.h>
1721         __isl_give isl_pw_qpolynomial *
1722         isl_pw_qpolynomial_reset_user(
1723                 __isl_take isl_pw_qpolynomial *pwqp);
1724         __isl_give isl_union_pw_qpolynomial *
1725         isl_union_pw_qpolynomial_reset_user(
1726                 __isl_take isl_union_pw_qpolynomial *upwqp);
1727         __isl_give isl_pw_qpolynomial_fold *
1728         isl_pw_qpolynomial_fold_reset_user(
1729                 __isl_take isl_pw_qpolynomial_fold *pwf);
1730         __isl_give isl_union_pw_qpolynomial_fold *
1731         isl_union_pw_qpolynomial_fold_reset_user(
1732                 __isl_take isl_union_pw_qpolynomial_fold *upwf);
1734 Spaces can be nested.  In particular, the domain of a set or
1735 the domain or range of a relation can be a nested relation.
1736 This process is also called I<wrapping>.
1737 The functions for detecting, constructing and deconstructing
1738 such nested spaces can be found in the wrapping properties
1739 of L</"Unary Properties">, the wrapping operations
1740 of L</"Unary Operations"> and the Cartesian product operations
1741 of L</"Basic Operations">.
1743 Spaces can be created from other spaces
1744 using the functions described in L</"Unary Operations">
1745 and L</"Binary Operations">.
1747 =head2 Local Spaces
1749 A local space is essentially a space with
1750 zero or more existentially quantified variables.
1751 The local space of various objects can be obtained
1752 using the following functions.
1754         #include <isl/constraint.h>
1755         __isl_give isl_local_space *isl_constraint_get_local_space(
1756                 __isl_keep isl_constraint *constraint);
1758         #include <isl/set.h>
1759         __isl_give isl_local_space *isl_basic_set_get_local_space(
1760                 __isl_keep isl_basic_set *bset);
1762         #include <isl/map.h>
1763         __isl_give isl_local_space *isl_basic_map_get_local_space(
1764                 __isl_keep isl_basic_map *bmap);
1766         #include <isl/aff.h>
1767         __isl_give isl_local_space *isl_aff_get_domain_local_space(
1768                 __isl_keep isl_aff *aff);
1769         __isl_give isl_local_space *isl_aff_get_local_space(
1770                 __isl_keep isl_aff *aff);
1772 A new local space can be created from a space using
1774         #include <isl/local_space.h>
1775         __isl_give isl_local_space *isl_local_space_from_space(
1776                 __isl_take isl_space *space);
1778 They can be inspected, modified, copied and freed using the following functions.
1780         #include <isl/local_space.h>
1781         isl_bool isl_local_space_is_params(
1782                 __isl_keep isl_local_space *ls);
1783         isl_bool isl_local_space_is_set(
1784                 __isl_keep isl_local_space *ls);
1785         __isl_give isl_space *isl_local_space_get_space(
1786                 __isl_keep isl_local_space *ls);
1787         __isl_give isl_aff *isl_local_space_get_div(
1788                 __isl_keep isl_local_space *ls, int pos);
1789         __isl_give isl_local_space *isl_local_space_copy(
1790                 __isl_keep isl_local_space *ls);
1791         __isl_null isl_local_space *isl_local_space_free(
1792                 __isl_take isl_local_space *ls);
1794 Note that C<isl_local_space_get_div> can only be used on local spaces
1795 of sets.
1797 Two local spaces can be compared using
1799         isl_bool isl_local_space_is_equal(
1800                 __isl_keep isl_local_space *ls1,
1801                 __isl_keep isl_local_space *ls2);
1803 Local spaces can be created from other local spaces
1804 using the functions described in L</"Unary Operations">
1805 and L</"Binary Operations">.
1807 =head2 Creating New Sets and Relations
1809 C<isl> has functions for creating some standard sets and relations.
1811 =over
1813 =item * Empty sets and relations
1815         __isl_give isl_basic_set *isl_basic_set_empty(
1816                 __isl_take isl_space *space);
1817         __isl_give isl_basic_map *isl_basic_map_empty(
1818                 __isl_take isl_space *space);
1819         __isl_give isl_set *isl_set_empty(
1820                 __isl_take isl_space *space);
1821         __isl_give isl_map *isl_map_empty(
1822                 __isl_take isl_space *space);
1823         __isl_give isl_union_set *isl_union_set_empty(
1824                 __isl_take isl_space *space);
1825         __isl_give isl_union_map *isl_union_map_empty(
1826                 __isl_take isl_space *space);
1828 For C<isl_union_set>s and C<isl_union_map>s, the space
1829 is only used to specify the parameters.
1831 =item * Universe sets and relations
1833         __isl_give isl_basic_set *isl_basic_set_universe(
1834                 __isl_take isl_space *space);
1835         __isl_give isl_basic_map *isl_basic_map_universe(
1836                 __isl_take isl_space *space);
1837         __isl_give isl_set *isl_set_universe(
1838                 __isl_take isl_space *space);
1839         __isl_give isl_map *isl_map_universe(
1840                 __isl_take isl_space *space);
1841         __isl_give isl_union_set *isl_union_set_universe(
1842                 __isl_take isl_union_set *uset);
1843         __isl_give isl_union_map *isl_union_map_universe(
1844                 __isl_take isl_union_map *umap);
1846 The sets and relations constructed by the functions above
1847 contain all integer values, while those constructed by the
1848 functions below only contain non-negative values.
1850         __isl_give isl_basic_set *isl_basic_set_nat_universe(
1851                 __isl_take isl_space *space);
1852         __isl_give isl_basic_map *isl_basic_map_nat_universe(
1853                 __isl_take isl_space *space);
1854         __isl_give isl_set *isl_set_nat_universe(
1855                 __isl_take isl_space *space);
1856         __isl_give isl_map *isl_map_nat_universe(
1857                 __isl_take isl_space *space);
1859 =item * Identity relations
1861         __isl_give isl_basic_map *isl_basic_map_identity(
1862                 __isl_take isl_space *space);
1863         __isl_give isl_map *isl_map_identity(
1864                 __isl_take isl_space *space);
1866 The number of input and output dimensions in C<space> needs
1867 to be the same.
1869 =item * Lexicographic order
1871         __isl_give isl_map *isl_map_lex_lt(
1872                 __isl_take isl_space *set_space);
1873         __isl_give isl_map *isl_map_lex_le(
1874                 __isl_take isl_space *set_space);
1875         __isl_give isl_map *isl_map_lex_gt(
1876                 __isl_take isl_space *set_space);
1877         __isl_give isl_map *isl_map_lex_ge(
1878                 __isl_take isl_space *set_space);
1879         __isl_give isl_map *isl_map_lex_lt_first(
1880                 __isl_take isl_space *space, unsigned n);
1881         __isl_give isl_map *isl_map_lex_le_first(
1882                 __isl_take isl_space *space, unsigned n);
1883         __isl_give isl_map *isl_map_lex_gt_first(
1884                 __isl_take isl_space *space, unsigned n);
1885         __isl_give isl_map *isl_map_lex_ge_first(
1886                 __isl_take isl_space *space, unsigned n);
1888 The first four functions take a space for a B<set>
1889 and return relations that express that the elements in the domain
1890 are lexicographically less
1891 (C<isl_map_lex_lt>), less or equal (C<isl_map_lex_le>),
1892 greater (C<isl_map_lex_gt>) or greater or equal (C<isl_map_lex_ge>)
1893 than the elements in the range.
1894 The last four functions take a space for a map
1895 and return relations that express that the first C<n> dimensions
1896 in the domain are lexicographically less
1897 (C<isl_map_lex_lt_first>), less or equal (C<isl_map_lex_le_first>),
1898 greater (C<isl_map_lex_gt_first>) or greater or equal (C<isl_map_lex_ge_first>)
1899 than the first C<n> dimensions in the range.
1901 =back
1903 A basic set or relation can be converted to a set or relation
1904 using the following functions.
1906         __isl_give isl_set *isl_set_from_basic_set(
1907                 __isl_take isl_basic_set *bset);
1908         __isl_give isl_map *isl_map_from_basic_map(
1909                 __isl_take isl_basic_map *bmap);
1911 Sets and relations can be converted to union sets and relations
1912 using the following functions.
1914         __isl_give isl_union_set *isl_union_set_from_basic_set(
1915                 __isl_take isl_basic_set *bset);
1916         __isl_give isl_union_map *isl_union_map_from_basic_map(
1917                 __isl_take isl_basic_map *bmap);
1918         __isl_give isl_union_set *isl_union_set_from_set(
1919                 __isl_take isl_set *set);
1920         __isl_give isl_union_map *isl_union_map_from_map(
1921                 __isl_take isl_map *map);
1923 The inverse conversions below can only be used if the input
1924 union set or relation is known to contain elements in exactly one
1925 space.
1927         __isl_give isl_set *isl_set_from_union_set(
1928                 __isl_take isl_union_set *uset);
1929         __isl_give isl_map *isl_map_from_union_map(
1930                 __isl_take isl_union_map *umap);
1932 Sets and relations can be copied and freed again using the following
1933 functions.
1935         __isl_give isl_basic_set *isl_basic_set_copy(
1936                 __isl_keep isl_basic_set *bset);
1937         __isl_give isl_set *isl_set_copy(__isl_keep isl_set *set);
1938         __isl_give isl_union_set *isl_union_set_copy(
1939                 __isl_keep isl_union_set *uset);
1940         __isl_give isl_basic_map *isl_basic_map_copy(
1941                 __isl_keep isl_basic_map *bmap);
1942         __isl_give isl_map *isl_map_copy(__isl_keep isl_map *map);
1943         __isl_give isl_union_map *isl_union_map_copy(
1944                 __isl_keep isl_union_map *umap);
1945         __isl_null isl_basic_set *isl_basic_set_free(
1946                 __isl_take isl_basic_set *bset);
1947         __isl_null isl_set *isl_set_free(__isl_take isl_set *set);
1948         __isl_null isl_union_set *isl_union_set_free(
1949                 __isl_take isl_union_set *uset);
1950         __isl_null isl_basic_map *isl_basic_map_free(
1951                 __isl_take isl_basic_map *bmap);
1952         __isl_null isl_map *isl_map_free(__isl_take isl_map *map);
1953         __isl_null isl_union_map *isl_union_map_free(
1954                 __isl_take isl_union_map *umap);
1956 Other sets and relations can be constructed by starting
1957 from a universe set or relation, adding equality and/or
1958 inequality constraints and then projecting out the
1959 existentially quantified variables, if any.
1960 Constraints can be constructed, manipulated and
1961 added to (or removed from) (basic) sets and relations
1962 using the following functions.
1964         #include <isl/constraint.h>
1965         __isl_give isl_constraint *isl_constraint_alloc_equality(
1966                 __isl_take isl_local_space *ls);
1967         __isl_give isl_constraint *isl_constraint_alloc_inequality(
1968                 __isl_take isl_local_space *ls);
1969         __isl_give isl_constraint *isl_constraint_set_constant_si(
1970                 __isl_take isl_constraint *constraint, int v);
1971         __isl_give isl_constraint *isl_constraint_set_constant_val(
1972                 __isl_take isl_constraint *constraint,
1973                 __isl_take isl_val *v);
1974         __isl_give isl_constraint *isl_constraint_set_coefficient_si(
1975                 __isl_take isl_constraint *constraint,
1976                 enum isl_dim_type type, int pos, int v);
1977         __isl_give isl_constraint *
1978         isl_constraint_set_coefficient_val(
1979                 __isl_take isl_constraint *constraint,
1980                 enum isl_dim_type type, int pos,
1981                 __isl_take isl_val *v);
1982         __isl_give isl_basic_map *isl_basic_map_add_constraint(
1983                 __isl_take isl_basic_map *bmap,
1984                 __isl_take isl_constraint *constraint);
1985         __isl_give isl_basic_set *isl_basic_set_add_constraint(
1986                 __isl_take isl_basic_set *bset,
1987                 __isl_take isl_constraint *constraint);
1988         __isl_give isl_map *isl_map_add_constraint(
1989                 __isl_take isl_map *map,
1990                 __isl_take isl_constraint *constraint);
1991         __isl_give isl_set *isl_set_add_constraint(
1992                 __isl_take isl_set *set,
1993                 __isl_take isl_constraint *constraint);
1995 For example, to create a set containing the even integers
1996 between 10 and 42, you would use the following code.
1998         isl_space *space;
1999         isl_local_space *ls;
2000         isl_constraint *c;
2001         isl_basic_set *bset;
2003         space = isl_space_set_alloc(ctx, 0, 2);
2004         bset = isl_basic_set_universe(isl_space_copy(space));
2005         ls = isl_local_space_from_space(space);
2007         c = isl_constraint_alloc_equality(isl_local_space_copy(ls));
2008         c = isl_constraint_set_coefficient_si(c, isl_dim_set, 0, -1);
2009         c = isl_constraint_set_coefficient_si(c, isl_dim_set, 1, 2);
2010         bset = isl_basic_set_add_constraint(bset, c);
2012         c = isl_constraint_alloc_inequality(isl_local_space_copy(ls));
2013         c = isl_constraint_set_constant_si(c, -10);
2014         c = isl_constraint_set_coefficient_si(c, isl_dim_set, 0, 1);
2015         bset = isl_basic_set_add_constraint(bset, c);
2017         c = isl_constraint_alloc_inequality(ls);
2018         c = isl_constraint_set_constant_si(c, 42);
2019         c = isl_constraint_set_coefficient_si(c, isl_dim_set, 0, -1);
2020         bset = isl_basic_set_add_constraint(bset, c);
2022         bset = isl_basic_set_project_out(bset, isl_dim_set, 1, 1);
2024 Or, alternatively,
2026         isl_basic_set *bset;
2027         bset = isl_basic_set_read_from_str(ctx,
2028                 "{[i] : exists (a : i = 2a and i >= 10 and i <= 42)}");
2030 A basic set or relation can also be constructed from two matrices
2031 describing the equalities and the inequalities.
2033         __isl_give isl_basic_set *isl_basic_set_from_constraint_matrices(
2034                 __isl_take isl_space *space,
2035                 __isl_take isl_mat *eq, __isl_take isl_mat *ineq,
2036                 enum isl_dim_type c1,
2037                 enum isl_dim_type c2, enum isl_dim_type c3,
2038                 enum isl_dim_type c4);
2039         __isl_give isl_basic_map *isl_basic_map_from_constraint_matrices(
2040                 __isl_take isl_space *space,
2041                 __isl_take isl_mat *eq, __isl_take isl_mat *ineq,
2042                 enum isl_dim_type c1,
2043                 enum isl_dim_type c2, enum isl_dim_type c3,
2044                 enum isl_dim_type c4, enum isl_dim_type c5);
2046 The C<isl_dim_type> arguments indicate the order in which
2047 different kinds of variables appear in the input matrices
2048 and should be a permutation of C<isl_dim_cst>, C<isl_dim_param>,
2049 C<isl_dim_set> and C<isl_dim_div> for sets and
2050 of C<isl_dim_cst>, C<isl_dim_param>,
2051 C<isl_dim_in>, C<isl_dim_out> and C<isl_dim_div> for relations.
2053 A (basic or union) set or relation can also be constructed from a
2054 (union) (piecewise) (multiple) affine expression
2055 or a list of affine expressions
2056 (See L</"Functions">), provided these affine expressions do not
2057 involve any NaN.
2059         __isl_give isl_basic_map *isl_basic_map_from_aff(
2060                 __isl_take isl_aff *aff);
2061         __isl_give isl_map *isl_map_from_aff(
2062                 __isl_take isl_aff *aff);
2063         __isl_give isl_set *isl_set_from_pw_aff(
2064                 __isl_take isl_pw_aff *pwaff);
2065         __isl_give isl_map *isl_map_from_pw_aff(
2066                 __isl_take isl_pw_aff *pwaff);
2067         __isl_give isl_basic_map *isl_basic_map_from_aff_list(
2068                 __isl_take isl_space *domain_space,
2069                 __isl_take isl_aff_list *list);
2070         __isl_give isl_basic_map *isl_basic_map_from_multi_aff(
2071                 __isl_take isl_multi_aff *maff)
2072         __isl_give isl_map *isl_map_from_multi_aff(
2073                 __isl_take isl_multi_aff *maff)
2074         __isl_give isl_set *isl_set_from_pw_multi_aff(
2075                 __isl_take isl_pw_multi_aff *pma);
2076         __isl_give isl_map *isl_map_from_pw_multi_aff(
2077                 __isl_take isl_pw_multi_aff *pma);
2078         __isl_give isl_set *isl_set_from_multi_pw_aff(
2079                 __isl_take isl_multi_pw_aff *mpa);
2080         __isl_give isl_map *isl_map_from_multi_pw_aff(
2081                 __isl_take isl_multi_pw_aff *mpa);
2082         __isl_give isl_union_map *isl_union_map_from_union_pw_aff(
2083                 __isl_take isl_union_pw_aff *upa);
2084         __isl_give isl_union_map *
2085         isl_union_map_from_union_pw_multi_aff(
2086                 __isl_take isl_union_pw_multi_aff *upma);
2087         __isl_give isl_union_map *
2088         isl_union_map_from_multi_union_pw_aff(
2089                 __isl_take isl_multi_union_pw_aff *mupa);
2091 The C<domain_space> argument describes the domain of the resulting
2092 basic relation.  It is required because the C<list> may consist
2093 of zero affine expressions.
2094 The C<mupa> passed to C<isl_union_map_from_multi_union_pw_aff>
2095 is not allowed to be zero-dimensional.  The domain of the result
2096 is the shared domain of the union piecewise affine elements.
2098 =head2 Inspecting Sets and Relations
2100 Usually, the user should not have to care about the actual constraints
2101 of the sets and maps, but should instead apply the abstract operations
2102 explained in the following sections.
2103 Occasionally, however, it may be required to inspect the individual
2104 coefficients of the constraints.  This section explains how to do so.
2105 In these cases, it may also be useful to have C<isl> compute
2106 an explicit representation of the existentially quantified variables.
2108         __isl_give isl_set *isl_set_compute_divs(
2109                 __isl_take isl_set *set);
2110         __isl_give isl_map *isl_map_compute_divs(
2111                 __isl_take isl_map *map);
2112         __isl_give isl_union_set *isl_union_set_compute_divs(
2113                 __isl_take isl_union_set *uset);
2114         __isl_give isl_union_map *isl_union_map_compute_divs(
2115                 __isl_take isl_union_map *umap);
2117 This explicit representation defines the existentially quantified
2118 variables as integer divisions of the other variables, possibly
2119 including earlier existentially quantified variables.
2120 An explicitly represented existentially quantified variable therefore
2121 has a unique value when the values of the other variables are known.
2123 Alternatively, the existentially quantified variables can be removed
2124 using the following functions, which compute an overapproximation.
2126         #include <isl/set.h>
2127         __isl_give isl_basic_set *isl_basic_set_remove_divs(
2128                 __isl_take isl_basic_set *bset);
2129         __isl_give isl_set *isl_set_remove_divs(
2130                 __isl_take isl_set *set);
2132         #include <isl/map.h>
2133         __isl_give isl_basic_map *isl_basic_map_remove_divs(
2134                 __isl_take isl_basic_map *bmap);
2135         __isl_give isl_map *isl_map_remove_divs(
2136                 __isl_take isl_map *map);
2138         #include <isl/union_set.h>
2139         __isl_give isl_union_set *isl_union_set_remove_divs(
2140                 __isl_take isl_union_set *bset);
2142         #include <isl/union_map.h>
2143         __isl_give isl_union_map *isl_union_map_remove_divs(
2144                 __isl_take isl_union_map *bmap);
2146 It is also possible to only remove those divs that are defined
2147 in terms of a given range of dimensions or only those for which
2148 no explicit representation is known.
2150         __isl_give isl_basic_set *
2151         isl_basic_set_remove_divs_involving_dims(
2152                 __isl_take isl_basic_set *bset,
2153                 enum isl_dim_type type,
2154                 unsigned first, unsigned n);
2155         __isl_give isl_basic_map *
2156         isl_basic_map_remove_divs_involving_dims(
2157                 __isl_take isl_basic_map *bmap,
2158                 enum isl_dim_type type,
2159                 unsigned first, unsigned n);
2160         __isl_give isl_set *isl_set_remove_divs_involving_dims(
2161                 __isl_take isl_set *set, enum isl_dim_type type,
2162                 unsigned first, unsigned n);
2163         __isl_give isl_map *isl_map_remove_divs_involving_dims(
2164                 __isl_take isl_map *map, enum isl_dim_type type,
2165                 unsigned first, unsigned n);
2167         __isl_give isl_basic_set *
2168         isl_basic_set_remove_unknown_divs(
2169                 __isl_take isl_basic_set *bset);
2170         __isl_give isl_set *isl_set_remove_unknown_divs(
2171                 __isl_take isl_set *set);
2172         __isl_give isl_map *isl_map_remove_unknown_divs(
2173                 __isl_take isl_map *map);
2175 To iterate over all the sets or maps in a union set or map, use
2177         isl_stat isl_union_set_foreach_set(
2178                 __isl_keep isl_union_set *uset,
2179                 isl_stat (*fn)(__isl_take isl_set *set, void *user),
2180                 void *user);
2181         isl_stat isl_union_map_foreach_map(
2182                 __isl_keep isl_union_map *umap,
2183                 isl_stat (*fn)(__isl_take isl_map *map, void *user),
2184                 void *user);
2186 These functions call the callback function once for each
2187 (pair of) space(s) for which there are elements in the input.
2188 The argument to the callback contains all elements in the input
2189 with that (pair of) space(s).
2191 The number of sets or maps in a union set or map can be obtained
2192 from
2194         int isl_union_set_n_set(__isl_keep isl_union_set *uset);
2195         int isl_union_map_n_map(__isl_keep isl_union_map *umap);
2197 To extract the set or map in a given space from a union, use
2199         __isl_give isl_set *isl_union_set_extract_set(
2200                 __isl_keep isl_union_set *uset,
2201                 __isl_take isl_space *space);
2202         __isl_give isl_map *isl_union_map_extract_map(
2203                 __isl_keep isl_union_map *umap,
2204                 __isl_take isl_space *space);
2206 To iterate over all the basic sets or maps in a set or map, use
2208         isl_stat isl_set_foreach_basic_set(__isl_keep isl_set *set,
2209                 isl_stat (*fn)(__isl_take isl_basic_set *bset,
2210                         void *user),
2211                 void *user);
2212         isl_stat isl_map_foreach_basic_map(__isl_keep isl_map *map,
2213                 isl_stat (*fn)(__isl_take isl_basic_map *bmap,
2214                         void *user),
2215                 void *user);
2217 The callback function C<fn> should return 0 if successful and
2218 -1 if an error occurs.  In the latter case, or if any other error
2219 occurs, the above functions will return -1.
2221 It should be noted that C<isl> does not guarantee that
2222 the basic sets or maps passed to C<fn> are disjoint.
2223 If this is required, then the user should call one of
2224 the following functions first.
2226         __isl_give isl_set *isl_set_make_disjoint(
2227                 __isl_take isl_set *set);
2228         __isl_give isl_map *isl_map_make_disjoint(
2229                 __isl_take isl_map *map);
2231 The number of basic sets in a set can be obtained
2232 or the number of basic maps in a map can be obtained
2233 from
2235         #include <isl/set.h>
2236         int isl_set_n_basic_set(__isl_keep isl_set *set);
2238         #include <isl/map.h>
2239         int isl_map_n_basic_map(__isl_keep isl_map *map);
2241 It is also possible to obtain a list of basic sets from a set
2242 or union set
2244         #include <isl/set.h>
2245         __isl_give isl_basic_set_list *isl_set_get_basic_set_list(
2246                 __isl_keep isl_set *set);
2248         #include <isl/union_set.h>
2249         __isl_give isl_basic_set_list *
2250         isl_union_set_get_basic_set_list(
2251                 __isl_keep isl_union_set *uset);
2253 The returned list can be manipulated using the functions in L<"Lists">.
2255 To iterate over the constraints of a basic set or map, use
2257         #include <isl/constraint.h>
2259         int isl_basic_set_n_constraint(
2260                 __isl_keep isl_basic_set *bset);
2261         isl_stat isl_basic_set_foreach_constraint(
2262                 __isl_keep isl_basic_set *bset,
2263                 isl_stat (*fn)(__isl_take isl_constraint *c,
2264                         void *user),
2265                 void *user);
2266         int isl_basic_map_n_constraint(
2267                 __isl_keep isl_basic_map *bmap);
2268         isl_stat isl_basic_map_foreach_constraint(
2269                 __isl_keep isl_basic_map *bmap,
2270                 isl_stat (*fn)(__isl_take isl_constraint *c,
2271                         void *user),
2272                 void *user);
2273         __isl_null isl_constraint *isl_constraint_free(
2274                 __isl_take isl_constraint *c);
2276 Again, the callback function C<fn> should return 0 if successful and
2277 -1 if an error occurs.  In the latter case, or if any other error
2278 occurs, the above functions will return -1.
2279 The constraint C<c> represents either an equality or an inequality.
2280 Use the following function to find out whether a constraint
2281 represents an equality.  If not, it represents an inequality.
2283         isl_bool isl_constraint_is_equality(
2284                 __isl_keep isl_constraint *constraint);
2286 It is also possible to obtain a list of constraints from a basic
2287 map or set
2289         #include <isl/constraint.h>
2290         __isl_give isl_constraint_list *
2291         isl_basic_map_get_constraint_list(
2292                 __isl_keep isl_basic_map *bmap);
2293         __isl_give isl_constraint_list *
2294         isl_basic_set_get_constraint_list(
2295                 __isl_keep isl_basic_set *bset);
2297 These functions require that all existentially quantified variables
2298 have an explicit representation.
2299 The returned list can be manipulated using the functions in L<"Lists">.
2301 The coefficients of the constraints can be inspected using
2302 the following functions.
2304         isl_bool isl_constraint_is_lower_bound(
2305                 __isl_keep isl_constraint *constraint,
2306                 enum isl_dim_type type, unsigned pos);
2307         isl_bool isl_constraint_is_upper_bound(
2308                 __isl_keep isl_constraint *constraint,
2309                 enum isl_dim_type type, unsigned pos);
2310         __isl_give isl_val *isl_constraint_get_constant_val(
2311                 __isl_keep isl_constraint *constraint);
2312         __isl_give isl_val *isl_constraint_get_coefficient_val(
2313                 __isl_keep isl_constraint *constraint,
2314                 enum isl_dim_type type, int pos);
2316 The explicit representations of the existentially quantified
2317 variables can be inspected using the following function.
2318 Note that the user is only allowed to use this function
2319 if the inspected set or map is the result of a call
2320 to C<isl_set_compute_divs> or C<isl_map_compute_divs>.
2321 The existentially quantified variable is equal to the floor
2322 of the returned affine expression.  The affine expression
2323 itself can be inspected using the functions in
2324 L</"Functions">.
2326         __isl_give isl_aff *isl_constraint_get_div(
2327                 __isl_keep isl_constraint *constraint, int pos);
2329 To obtain the constraints of a basic set or map in matrix
2330 form, use the following functions.
2332         __isl_give isl_mat *isl_basic_set_equalities_matrix(
2333                 __isl_keep isl_basic_set *bset,
2334                 enum isl_dim_type c1, enum isl_dim_type c2,
2335                 enum isl_dim_type c3, enum isl_dim_type c4);
2336         __isl_give isl_mat *isl_basic_set_inequalities_matrix(
2337                 __isl_keep isl_basic_set *bset,
2338                 enum isl_dim_type c1, enum isl_dim_type c2,
2339                 enum isl_dim_type c3, enum isl_dim_type c4);
2340         __isl_give isl_mat *isl_basic_map_equalities_matrix(
2341                 __isl_keep isl_basic_map *bmap,
2342                 enum isl_dim_type c1,
2343                 enum isl_dim_type c2, enum isl_dim_type c3,
2344                 enum isl_dim_type c4, enum isl_dim_type c5);
2345         __isl_give isl_mat *isl_basic_map_inequalities_matrix(
2346                 __isl_keep isl_basic_map *bmap,
2347                 enum isl_dim_type c1,
2348                 enum isl_dim_type c2, enum isl_dim_type c3,
2349                 enum isl_dim_type c4, enum isl_dim_type c5);
2351 The C<isl_dim_type> arguments dictate the order in which
2352 different kinds of variables appear in the resulting matrix.
2353 For set inputs, they should be a permutation of
2354 C<isl_dim_cst>, C<isl_dim_param>, C<isl_dim_set> and C<isl_dim_div>.
2355 For map inputs, they should be a permutation of
2356 C<isl_dim_cst>, C<isl_dim_param>,
2357 C<isl_dim_in>, C<isl_dim_out> and C<isl_dim_div>.
2359 =head2 Points
2361 Points are elements of a set.  They can be used to construct
2362 simple sets (boxes) or they can be used to represent the
2363 individual elements of a set.
2364 The zero point (the origin) can be created using
2366         __isl_give isl_point *isl_point_zero(__isl_take isl_space *space);
2368 The coordinates of a point can be inspected, set and changed
2369 using
2371         __isl_give isl_val *isl_point_get_coordinate_val(
2372                 __isl_keep isl_point *pnt,
2373                 enum isl_dim_type type, int pos);
2374         __isl_give isl_point *isl_point_set_coordinate_val(
2375                 __isl_take isl_point *pnt,
2376                 enum isl_dim_type type, int pos,
2377                 __isl_take isl_val *v);
2379         __isl_give isl_point *isl_point_add_ui(
2380                 __isl_take isl_point *pnt,
2381                 enum isl_dim_type type, int pos, unsigned val);
2382         __isl_give isl_point *isl_point_sub_ui(
2383                 __isl_take isl_point *pnt,
2384                 enum isl_dim_type type, int pos, unsigned val);
2386 Points can be copied or freed using
2388         __isl_give isl_point *isl_point_copy(
2389                 __isl_keep isl_point *pnt);
2390         __isl_null isl_point *isl_point_free(
2391                 __isl_take isl_point *pnt);
2393 A singleton set can be created from a point using
2395         __isl_give isl_basic_set *isl_basic_set_from_point(
2396                 __isl_take isl_point *pnt);
2397         __isl_give isl_set *isl_set_from_point(
2398                 __isl_take isl_point *pnt);
2399         __isl_give isl_union_set *isl_union_set_from_point(
2400                 __isl_take isl_point *pnt);
2402 and a box can be created from two opposite extremal points using
2404         __isl_give isl_basic_set *isl_basic_set_box_from_points(
2405                 __isl_take isl_point *pnt1,
2406                 __isl_take isl_point *pnt2);
2407         __isl_give isl_set *isl_set_box_from_points(
2408                 __isl_take isl_point *pnt1,
2409                 __isl_take isl_point *pnt2);
2411 All elements of a B<bounded> (union) set can be enumerated using
2412 the following functions.
2414         isl_stat isl_set_foreach_point(__isl_keep isl_set *set,
2415                 isl_stat (*fn)(__isl_take isl_point *pnt,
2416                         void *user),
2417                 void *user);
2418         isl_stat isl_union_set_foreach_point(
2419                 __isl_keep isl_union_set *uset,
2420                 isl_stat (*fn)(__isl_take isl_point *pnt,
2421                         void *user),
2422                 void *user);
2424 The function C<fn> is called for each integer point in
2425 C<set> with as second argument the last argument of
2426 the C<isl_set_foreach_point> call.  The function C<fn>
2427 should return C<0> on success and C<-1> on failure.
2428 In the latter case, C<isl_set_foreach_point> will stop
2429 enumerating and return C<-1> as well.
2430 If the enumeration is performed successfully and to completion,
2431 then C<isl_set_foreach_point> returns C<0>.
2433 To obtain a single point of a (basic or union) set, use
2435         __isl_give isl_point *isl_basic_set_sample_point(
2436                 __isl_take isl_basic_set *bset);
2437         __isl_give isl_point *isl_set_sample_point(
2438                 __isl_take isl_set *set);
2439         __isl_give isl_point *isl_union_set_sample_point(
2440                 __isl_take isl_union_set *uset);
2442 If C<set> does not contain any (integer) points, then the
2443 resulting point will be ``void'', a property that can be
2444 tested using
2446         isl_bool isl_point_is_void(__isl_keep isl_point *pnt);
2448 =head2 Functions
2450 Besides sets and relation, C<isl> also supports various types of functions.
2451 Each of these types is derived from the value type (see L</"Values">)
2452 or from one of two primitive function types
2453 through the application of zero or more type constructors.
2454 We first describe the primitive type and then we describe
2455 the types derived from these primitive types.
2457 =head3 Primitive Functions
2459 C<isl> support two primitive function types, quasi-affine
2460 expressions and quasipolynomials.
2461 A quasi-affine expression is defined either over a parameter
2462 space or over a set and is composed of integer constants,
2463 parameters and set variables, addition, subtraction and
2464 integer division by an integer constant.
2465 For example, the quasi-affine expression
2467         [n] -> { [x] -> [2*floor((4 n + x)/9] }
2469 maps C<x> to C<2*floor((4 n + x)/9>.
2470 A quasipolynomial is a polynomial expression in quasi-affine
2471 expression.  That is, it additionally allows for multiplication.
2472 Note, though, that it is not allowed to construct an integer
2473 division of an expression involving multiplications.
2474 Here is an example of a quasipolynomial that is not
2475 quasi-affine expression
2477         [n] -> { [x] -> (n*floor((4 n + x)/9) }
2479 Note that the external representations of quasi-affine expressions
2480 and quasipolynomials are different.  Quasi-affine expressions
2481 use a notation with square brackets just like binary relations,
2482 while quasipolynomials do not.  This might change at some point.
2484 If a primitive function is defined over a parameter space,
2485 then the space of the function itself is that of a set.
2486 If it is defined over a set, then the space of the function
2487 is that of a relation.  In both cases, the set space (or
2488 the output space) is single-dimensional, anonymous and unstructured.
2489 To create functions with multiple dimensions or with other kinds
2490 of set or output spaces, use multiple expressions
2491 (see L</"Multiple Expressions">).
2493 =over
2495 =item * Quasi-affine Expressions
2497 Besides the expressions described above, a quasi-affine
2498 expression can also be set to NaN.  Such expressions
2499 typically represent a failure to represent a result
2500 as a quasi-affine expression.
2502 The zero quasi affine expression or the quasi affine expression
2503 that is equal to a given value or
2504 a specified dimension on a given domain can be created using
2506         #include <isl/aff.h>
2507         __isl_give isl_aff *isl_aff_zero_on_domain(
2508                 __isl_take isl_local_space *ls);
2509         __isl_give isl_aff *isl_aff_val_on_domain(
2510                 __isl_take isl_local_space *ls,
2511                 __isl_take isl_val *val);
2512         __isl_give isl_aff *isl_aff_var_on_domain(
2513                 __isl_take isl_local_space *ls,
2514                 enum isl_dim_type type, unsigned pos);
2515         __isl_give isl_aff *isl_aff_nan_on_domain(
2516                 __isl_take isl_local_space *ls);
2518 Quasi affine expressions can be copied and freed using
2520         #include <isl/aff.h>
2521         __isl_give isl_aff *isl_aff_copy(
2522                 __isl_keep isl_aff *aff);
2523         __isl_null isl_aff *isl_aff_free(
2524                 __isl_take isl_aff *aff);
2526 A (rational) bound on a dimension can be extracted from an C<isl_constraint>
2527 using the following function.  The constraint is required to have
2528 a non-zero coefficient for the specified dimension.
2530         #include <isl/constraint.h>
2531         __isl_give isl_aff *isl_constraint_get_bound(
2532                 __isl_keep isl_constraint *constraint,
2533                 enum isl_dim_type type, int pos);
2535 The entire affine expression of the constraint can also be extracted
2536 using the following function.
2538         #include <isl/constraint.h>
2539         __isl_give isl_aff *isl_constraint_get_aff(
2540                 __isl_keep isl_constraint *constraint);
2542 Conversely, an equality constraint equating
2543 the affine expression to zero or an inequality constraint enforcing
2544 the affine expression to be non-negative, can be constructed using
2546         __isl_give isl_constraint *isl_equality_from_aff(
2547                 __isl_take isl_aff *aff);
2548         __isl_give isl_constraint *isl_inequality_from_aff(
2549                 __isl_take isl_aff *aff);
2551 The coefficients and the integer divisions of an affine expression
2552 can be inspected using the following functions.
2554         #include <isl/aff.h>
2555         __isl_give isl_val *isl_aff_get_constant_val(
2556                 __isl_keep isl_aff *aff);
2557         __isl_give isl_val *isl_aff_get_coefficient_val(
2558                 __isl_keep isl_aff *aff,
2559                 enum isl_dim_type type, int pos);
2560         int isl_aff_coefficient_sgn(__isl_keep isl_aff *aff,
2561                 enum isl_dim_type type, int pos);
2562         __isl_give isl_val *isl_aff_get_denominator_val(
2563                 __isl_keep isl_aff *aff);
2564         __isl_give isl_aff *isl_aff_get_div(
2565                 __isl_keep isl_aff *aff, int pos);
2567 They can be modified using the following functions.
2569         #include <isl/aff.h>
2570         __isl_give isl_aff *isl_aff_set_constant_si(
2571                 __isl_take isl_aff *aff, int v);
2572         __isl_give isl_aff *isl_aff_set_constant_val(
2573                 __isl_take isl_aff *aff, __isl_take isl_val *v);
2574         __isl_give isl_aff *isl_aff_set_coefficient_si(
2575                 __isl_take isl_aff *aff,
2576                 enum isl_dim_type type, int pos, int v);
2577         __isl_give isl_aff *isl_aff_set_coefficient_val(
2578                 __isl_take isl_aff *aff,
2579                 enum isl_dim_type type, int pos,
2580                 __isl_take isl_val *v);
2582         __isl_give isl_aff *isl_aff_add_constant_si(
2583                 __isl_take isl_aff *aff, int v);
2584         __isl_give isl_aff *isl_aff_add_constant_val(
2585                 __isl_take isl_aff *aff, __isl_take isl_val *v);
2586         __isl_give isl_aff *isl_aff_add_constant_num_si(
2587                 __isl_take isl_aff *aff, int v);
2588         __isl_give isl_aff *isl_aff_add_coefficient_si(
2589                 __isl_take isl_aff *aff,
2590                 enum isl_dim_type type, int pos, int v);
2591         __isl_give isl_aff *isl_aff_add_coefficient_val(
2592                 __isl_take isl_aff *aff,
2593                 enum isl_dim_type type, int pos,
2594                 __isl_take isl_val *v);
2596 Note that C<isl_aff_set_constant_si> and C<isl_aff_set_coefficient_si>
2597 set the I<numerator> of the constant or coefficient, while
2598 C<isl_aff_set_constant_val> and C<isl_aff_set_coefficient_val> set
2599 the constant or coefficient as a whole.
2600 The C<add_constant> and C<add_coefficient> functions add an integer
2601 or rational value to
2602 the possibly rational constant or coefficient.
2603 The C<add_constant_num> functions add an integer value to
2604 the numerator.
2606 =item * Quasipolynomials
2608 Some simple quasipolynomials can be created using the following functions.
2610         #include <isl/polynomial.h>
2611         __isl_give isl_qpolynomial *isl_qpolynomial_zero_on_domain(
2612                 __isl_take isl_space *domain);
2613         __isl_give isl_qpolynomial *isl_qpolynomial_one_on_domain(
2614                 __isl_take isl_space *domain);
2615         __isl_give isl_qpolynomial *isl_qpolynomial_infty_on_domain(
2616                 __isl_take isl_space *domain);
2617         __isl_give isl_qpolynomial *isl_qpolynomial_neginfty_on_domain(
2618                 __isl_take isl_space *domain);
2619         __isl_give isl_qpolynomial *isl_qpolynomial_nan_on_domain(
2620                 __isl_take isl_space *domain);
2621         __isl_give isl_qpolynomial *isl_qpolynomial_val_on_domain(
2622                 __isl_take isl_space *domain,
2623                 __isl_take isl_val *val);
2624         __isl_give isl_qpolynomial *isl_qpolynomial_var_on_domain(
2625                 __isl_take isl_space *domain,
2626                 enum isl_dim_type type, unsigned pos);
2627         __isl_give isl_qpolynomial *isl_qpolynomial_from_aff(
2628                 __isl_take isl_aff *aff);
2630 Recall that the space in which a quasipolynomial lives is a map space
2631 with a one-dimensional range.  The C<domain> argument in some of
2632 the functions above corresponds to the domain of this map space.
2634 Quasipolynomials can be copied and freed again using the following
2635 functions.
2637         #include <isl/polynomial.h>
2638         __isl_give isl_qpolynomial *isl_qpolynomial_copy(
2639                 __isl_keep isl_qpolynomial *qp);
2640         __isl_null isl_qpolynomial *isl_qpolynomial_free(
2641                 __isl_take isl_qpolynomial *qp);
2643 The constant term of a quasipolynomial can be extracted using
2645         __isl_give isl_val *isl_qpolynomial_get_constant_val(
2646                 __isl_keep isl_qpolynomial *qp);
2648 To iterate over all terms in a quasipolynomial,
2651         isl_stat isl_qpolynomial_foreach_term(
2652                 __isl_keep isl_qpolynomial *qp,
2653                 isl_stat (*fn)(__isl_take isl_term *term,
2654                           void *user), void *user);
2656 The terms themselves can be inspected and freed using
2657 these functions
2659         unsigned isl_term_dim(__isl_keep isl_term *term,
2660                 enum isl_dim_type type);
2661         __isl_give isl_val *isl_term_get_coefficient_val(
2662                 __isl_keep isl_term *term);
2663         int isl_term_get_exp(__isl_keep isl_term *term,
2664                 enum isl_dim_type type, unsigned pos);
2665         __isl_give isl_aff *isl_term_get_div(
2666                 __isl_keep isl_term *term, unsigned pos);
2667         void isl_term_free(__isl_take isl_term *term);
2669 Each term is a product of parameters, set variables and
2670 integer divisions.  The function C<isl_term_get_exp>
2671 returns the exponent of a given dimensions in the given term.
2673 =back
2675 =head3 Reductions
2677 A reduction represents a maximum or a minimum of its
2678 base expressions.
2679 The only reduction type defined by C<isl> is
2680 C<isl_qpolynomial_fold>.
2682 There are currently no functions to directly create such
2683 objects, but they do appear in the piecewise quasipolynomial
2684 reductions returned by the C<isl_pw_qpolynomial_bound> function.
2686 L</"Bounds on Piecewise Quasipolynomials and Piecewise Quasipolynomial Reductions">.
2688 Reductions can be copied and freed using
2689 the following functions.
2691         #include <isl/polynomial.h>
2692         __isl_give isl_qpolynomial_fold *
2693         isl_qpolynomial_fold_copy(
2694                 __isl_keep isl_qpolynomial_fold *fold);
2695         void isl_qpolynomial_fold_free(
2696                 __isl_take isl_qpolynomial_fold *fold);
2698 To iterate over all quasipolynomials in a reduction, use
2700         isl_stat isl_qpolynomial_fold_foreach_qpolynomial(
2701                 __isl_keep isl_qpolynomial_fold *fold,
2702                 isl_stat (*fn)(__isl_take isl_qpolynomial *qp,
2703                           void *user), void *user);
2705 =head3 Multiple Expressions
2707 A multiple expression represents a sequence of zero or
2708 more base expressions, all defined on the same domain space.
2709 The domain space of the multiple expression is the same
2710 as that of the base expressions, but the range space
2711 can be any space.  In case the base expressions have
2712 a set space, the corresponding multiple expression
2713 also has a set space.
2714 Objects of the value type do not have an associated space.
2715 The space of a multiple value is therefore always a set space.
2716 Similarly, the space of a multiple union piecewise
2717 affine expression is always a set space.
2719 The multiple expression types defined by C<isl>
2720 are C<isl_multi_val>, C<isl_multi_aff>, C<isl_multi_pw_aff>,
2721 C<isl_multi_union_pw_aff>.
2723 A multiple expression with the value zero for
2724 each output (or set) dimension can be created
2725 using the following functions.
2727         #include <isl/val.h>
2728         __isl_give isl_multi_val *isl_multi_val_zero(
2729                 __isl_take isl_space *space);
2731         #include <isl/aff.h>
2732         __isl_give isl_multi_aff *isl_multi_aff_zero(
2733                 __isl_take isl_space *space);
2734         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_zero(
2735                 __isl_take isl_space *space);
2736         __isl_give isl_multi_union_pw_aff *
2737         isl_multi_union_pw_aff_zero(
2738                 __isl_take isl_space *space);
2740 Since there is no canonical way of representing a zero
2741 value of type C<isl_union_pw_aff>, the space passed
2742 to C<isl_multi_union_pw_aff_zero> needs to be zero-dimensional.
2744 An identity function can be created using the following
2745 functions.  The space needs to be that of a relation
2746 with the same number of input and output dimensions.
2748         #include <isl/aff.h>
2749         __isl_give isl_multi_aff *isl_multi_aff_identity(
2750                 __isl_take isl_space *space);
2751         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_identity(
2752                 __isl_take isl_space *space);
2754 A function that performs a projection on a universe
2755 relation or set can be created using the following functions.
2756 See also the corresponding
2757 projection operations in L</"Unary Operations">.
2759         #include <isl/aff.h>
2760         __isl_give isl_multi_aff *isl_multi_aff_domain_map(
2761                 __isl_take isl_space *space);
2762         __isl_give isl_multi_aff *isl_multi_aff_range_map(
2763                 __isl_take isl_space *space);
2764         __isl_give isl_multi_aff *isl_multi_aff_project_out_map(
2765                 __isl_take isl_space *space,
2766                 enum isl_dim_type type,
2767                 unsigned first, unsigned n);
2769 A multiple expression can be created from a single
2770 base expression using the following functions.
2771 The space of the created multiple expression is the same
2772 as that of the base expression, except for
2773 C<isl_multi_union_pw_aff_from_union_pw_aff> where the input
2774 lives in a parameter space and the output lives
2775 in a single-dimensional set space.
2777         #include <isl/aff.h>
2778         __isl_give isl_multi_aff *isl_multi_aff_from_aff(
2779                 __isl_take isl_aff *aff);
2780         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_pw_aff(
2781                 __isl_take isl_pw_aff *pa);
2782         __isl_give isl_multi_union_pw_aff *
2783         isl_multi_union_pw_aff_from_union_pw_aff(
2784                 __isl_take isl_union_pw_aff *upa);
2786 A multiple expression can be created from a list
2787 of base expression in a specified space.
2788 The domain of this space needs to be the same
2789 as the domains of the base expressions in the list.
2790 If the base expressions have a set space (or no associated space),
2791 then this space also needs to be a set space.
2793         #include <isl/val.h>
2794         __isl_give isl_multi_val *isl_multi_val_from_val_list(
2795                 __isl_take isl_space *space,
2796                 __isl_take isl_val_list *list);
2798         #include <isl/aff.h>
2799         __isl_give isl_multi_aff *isl_multi_aff_from_aff_list(
2800                 __isl_take isl_space *space,
2801                 __isl_take isl_aff_list *list);
2802         __isl_give isl_multi_pw_aff *
2803         isl_multi_pw_aff_from_pw_aff_list(
2804                 __isl_take isl_space *space,
2805                 __isl_take isl_pw_aff_list *list);
2806         __isl_give isl_multi_union_pw_aff *
2807         isl_multi_union_pw_aff_from_union_pw_aff_list(
2808                 __isl_take isl_space *space,
2809                 __isl_take isl_union_pw_aff_list *list);
2811 As a convenience, a multiple piecewise expression can
2812 also be created from a multiple expression.
2813 Each piecewise expression in the result has a single
2814 universe cell.
2816         #include <isl/aff.h>
2817         __isl_give isl_multi_pw_aff *
2818         isl_multi_pw_aff_from_multi_aff(
2819                 __isl_take isl_multi_aff *ma);
2821 Similarly, a multiple union expression can be
2822 created from a multiple expression.
2824         #include <isl/aff.h>
2825         __isl_give isl_multi_union_pw_aff *
2826         isl_multi_union_pw_aff_from_multi_aff(
2827                 __isl_take isl_multi_aff *ma);
2828         __isl_give isl_multi_union_pw_aff *
2829         isl_multi_union_pw_aff_from_multi_pw_aff(
2830                 __isl_take isl_multi_pw_aff *mpa);
2832 A multiple quasi-affine expression can be created from
2833 a multiple value with a given domain space using the following
2834 function.
2836         #include <isl/aff.h>
2837         __isl_give isl_multi_aff *
2838         isl_multi_aff_multi_val_on_space(
2839                 __isl_take isl_space *space,
2840                 __isl_take isl_multi_val *mv);
2842 Similarly,
2843 a multiple union piecewise affine expression can be created from
2844 a multiple value with a given domain or
2845 a multiple affine expression with a given domain
2846 using the following functions.
2848         #include <isl/aff.h>
2849         __isl_give isl_multi_union_pw_aff *
2850         isl_multi_union_pw_aff_multi_val_on_domain(
2851                 __isl_take isl_union_set *domain,
2852                 __isl_take isl_multi_val *mv);
2853         __isl_give isl_multi_union_pw_aff *
2854         isl_multi_union_pw_aff_multi_aff_on_domain(
2855                 __isl_take isl_union_set *domain,
2856                 __isl_take isl_multi_aff *ma);
2858 Multiple expressions can be copied and freed using
2859 the following functions.
2861         #include <isl/val.h>
2862         __isl_give isl_multi_val *isl_multi_val_copy(
2863                 __isl_keep isl_multi_val *mv);
2864         __isl_null isl_multi_val *isl_multi_val_free(
2865                 __isl_take isl_multi_val *mv);
2867         #include <isl/aff.h>
2868         __isl_give isl_multi_aff *isl_multi_aff_copy(
2869                 __isl_keep isl_multi_aff *maff);
2870         __isl_null isl_multi_aff *isl_multi_aff_free(
2871                 __isl_take isl_multi_aff *maff);
2872         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_copy(
2873                 __isl_keep isl_multi_pw_aff *mpa);
2874         __isl_null isl_multi_pw_aff *isl_multi_pw_aff_free(
2875                 __isl_take isl_multi_pw_aff *mpa);
2876         __isl_give isl_multi_union_pw_aff *
2877         isl_multi_union_pw_aff_copy(
2878                 __isl_keep isl_multi_union_pw_aff *mupa);
2879         __isl_null isl_multi_union_pw_aff *
2880         isl_multi_union_pw_aff_free(
2881                 __isl_take isl_multi_union_pw_aff *mupa);
2883 The base expression at a given position of a multiple
2884 expression can be extracted using the following functions.
2886         #include <isl/val.h>
2887         __isl_give isl_val *isl_multi_val_get_val(
2888                 __isl_keep isl_multi_val *mv, int pos);
2890         #include <isl/aff.h>
2891         __isl_give isl_aff *isl_multi_aff_get_aff(
2892                 __isl_keep isl_multi_aff *multi, int pos);
2893         __isl_give isl_pw_aff *isl_multi_pw_aff_get_pw_aff(
2894                 __isl_keep isl_multi_pw_aff *mpa, int pos);
2895         __isl_give isl_union_pw_aff *
2896         isl_multi_union_pw_aff_get_union_pw_aff(
2897                 __isl_keep isl_multi_union_pw_aff *mupa, int pos);
2899 It can be replaced using the following functions.
2901         #include <isl/val.h>
2902         __isl_give isl_multi_val *isl_multi_val_set_val(
2903                 __isl_take isl_multi_val *mv, int pos,
2904                 __isl_take isl_val *val);
2906         #include <isl/aff.h>
2907         __isl_give isl_multi_aff *isl_multi_aff_set_aff(
2908                 __isl_take isl_multi_aff *multi, int pos,
2909                 __isl_take isl_aff *aff);
2910         __isl_give isl_multi_union_pw_aff *
2911         isl_multi_union_pw_aff_set_union_pw_aff(
2912                 __isl_take isl_multi_union_pw_aff *mupa, int pos,
2913                 __isl_take isl_union_pw_aff *upa);
2915 As a convenience, a sequence of base expressions that have
2916 their domains in a given space can be extracted from a sequence
2917 of union expressions using the following function.
2919         #include <isl/aff.h>
2920         __isl_give isl_multi_pw_aff *
2921         isl_multi_union_pw_aff_extract_multi_pw_aff(
2922                 __isl_keep isl_multi_union_pw_aff *mupa,
2923                 __isl_take isl_space *space);
2925 Note that there is a difference between C<isl_multi_union_pw_aff>
2926 and C<isl_union_pw_multi_aff> objects.  The first is a sequence
2927 of unions of piecewise expressions, while the second is a union
2928 of piecewise sequences.  In particular, multiple affine expressions
2929 in an C<isl_union_pw_multi_aff> may live in different spaces,
2930 while there is only a single multiple expression in
2931 an C<isl_multi_union_pw_aff>, which can therefore only live
2932 in a single space.  This means that not every
2933 C<isl_union_pw_multi_aff> can be converted to
2934 an C<isl_multi_union_pw_aff>.  Conversely, a zero-dimensional
2935 C<isl_multi_union_pw_aff> carries no information
2936 about any possible domain and therefore cannot be converted
2937 to an C<isl_union_pw_multi_aff>.  Moreover, the elements
2938 of an C<isl_multi_union_pw_aff> may be defined over different domains,
2939 while each multiple expression inside an C<isl_union_pw_multi_aff>
2940 has a single domain.  The conversion of an C<isl_union_pw_multi_aff>
2941 of dimension greater than one may therefore not be exact.
2942 The following functions can
2943 be used to perform these conversions when they are possible.
2945         #include <isl/aff.h>
2946         __isl_give isl_multi_union_pw_aff *
2947         isl_multi_union_pw_aff_from_union_pw_multi_aff(
2948                 __isl_take isl_union_pw_multi_aff *upma);
2949         __isl_give isl_union_pw_multi_aff *
2950         isl_union_pw_multi_aff_from_multi_union_pw_aff(
2951                 __isl_take isl_multi_union_pw_aff *mupa);
2953 =head3 Piecewise Expressions
2955 A piecewise expression is an expression that is described
2956 using zero or more base expression defined over the same
2957 number of cells in the domain space of the base expressions.
2958 All base expressions are defined over the same
2959 domain space and the cells are disjoint.
2960 The space of a piecewise expression is the same as
2961 that of the base expressions.
2962 If the union of the cells is a strict subset of the domain
2963 space, then the value of the piecewise expression outside
2964 this union is different for types derived from quasi-affine
2965 expressions and those derived from quasipolynomials.
2966 Piecewise expressions derived from quasi-affine expressions
2967 are considered to be undefined outside the union of their cells.
2968 Piecewise expressions derived from quasipolynomials
2969 are considered to be zero outside the union of their cells.
2971 Piecewise quasipolynomials are mainly used by the C<barvinok>
2972 library for representing the number of elements in a parametric set or map.
2973 For example, the piecewise quasipolynomial
2975         [n] -> { [x] -> ((1 + n) - x) : x <= n and x >= 0 }
2977 represents the number of points in the map
2979         [n] -> { [x] -> [y] : x,y >= 0 and 0 <= x + y <= n }
2981 The piecewise expression types defined by C<isl>
2982 are C<isl_pw_aff>, C<isl_pw_multi_aff>,
2983 C<isl_pw_qpolynomial> and C<isl_pw_qpolynomial_fold>.
2985 A piecewise expression with no cells can be created using
2986 the following functions.
2988         #include <isl/aff.h>
2989         __isl_give isl_pw_aff *isl_pw_aff_empty(
2990                 __isl_take isl_space *space);
2991         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_empty(
2992                 __isl_take isl_space *space);
2994 A piecewise expression with a single universe cell can be
2995 created using the following functions.
2997         #include <isl/aff.h>
2998         __isl_give isl_pw_aff *isl_pw_aff_from_aff(
2999                 __isl_take isl_aff *aff);
3000         __isl_give isl_pw_multi_aff *
3001         isl_pw_multi_aff_from_multi_aff(
3002                 __isl_take isl_multi_aff *ma);
3004         #include <isl/polynomial.h>
3005         __isl_give isl_pw_qpolynomial *
3006         isl_pw_qpolynomial_from_qpolynomial(
3007                 __isl_take isl_qpolynomial *qp);
3009 A piecewise expression with a single specified cell can be
3010 created using the following functions.
3012         #include <isl/aff.h>
3013         __isl_give isl_pw_aff *isl_pw_aff_alloc(
3014                 __isl_take isl_set *set, __isl_take isl_aff *aff);
3015         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_alloc(
3016                 __isl_take isl_set *set,
3017                 __isl_take isl_multi_aff *maff);
3019         #include <isl/polynomial.h>
3020         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_alloc(
3021                 __isl_take isl_set *set,
3022                 __isl_take isl_qpolynomial *qp);
3024 The following convenience functions first create a base expression and
3025 then create a piecewise expression over a universe domain.
3027         #include <isl/aff.h>
3028         __isl_give isl_pw_aff *isl_pw_aff_zero_on_domain(
3029                 __isl_take isl_local_space *ls);
3030         __isl_give isl_pw_aff *isl_pw_aff_var_on_domain(
3031                 __isl_take isl_local_space *ls,
3032                 enum isl_dim_type type, unsigned pos);
3033         __isl_give isl_pw_aff *isl_pw_aff_nan_on_domain(
3034                 __isl_take isl_local_space *ls);
3035         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_zero(
3036                 __isl_take isl_space *space);
3037         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_identity(
3038                 __isl_take isl_space *space);
3039         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_range_map(
3040                 __isl_take isl_space *space);
3041         __isl_give isl_pw_multi_aff *
3042         isl_pw_multi_aff_project_out_map(
3043                 __isl_take isl_space *space,
3044                 enum isl_dim_type type,
3045                 unsigned first, unsigned n);
3047         #include <isl/polynomial.h>
3048         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_zero(
3049                 __isl_take isl_space *space);
3051 The following convenience functions first create a base expression and
3052 then create a piecewise expression over a given domain.
3054         #include <isl/aff.h>
3055         __isl_give isl_pw_aff *isl_pw_aff_val_on_domain(
3056                 __isl_take isl_set *domain,
3057                 __isl_take isl_val *v);
3058         __isl_give isl_pw_multi_aff *
3059         isl_pw_multi_aff_multi_val_on_domain(
3060                 __isl_take isl_set *domain,
3061                 __isl_take isl_multi_val *mv);
3063 As a convenience, a piecewise multiple expression can
3064 also be created from a piecewise expression.
3065 Each multiple expression in the result is derived
3066 from the corresponding base expression.
3068         #include <isl/aff.h>
3069         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_pw_aff(
3070                 __isl_take isl_pw_aff *pa);
3072 Similarly, a piecewise quasipolynomial can be
3073 created from a piecewise quasi-affine expression using
3074 the following function.
3076         #include <isl/polynomial.h>
3077         __isl_give isl_pw_qpolynomial *
3078         isl_pw_qpolynomial_from_pw_aff(
3079                 __isl_take isl_pw_aff *pwaff);
3081 Piecewise expressions can be copied and freed using the following functions.
3083         #include <isl/aff.h>
3084         __isl_give isl_pw_aff *isl_pw_aff_copy(
3085                 __isl_keep isl_pw_aff *pwaff);
3086         __isl_null isl_pw_aff *isl_pw_aff_free(
3087                 __isl_take isl_pw_aff *pwaff);
3088         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_copy(
3089                 __isl_keep isl_pw_multi_aff *pma);
3090         __isl_null isl_pw_multi_aff *isl_pw_multi_aff_free(
3091                 __isl_take isl_pw_multi_aff *pma);
3093         #include <isl/polynomial.h>
3094         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_copy(
3095                 __isl_keep isl_pw_qpolynomial *pwqp);
3096         __isl_null isl_pw_qpolynomial *isl_pw_qpolynomial_free(
3097                 __isl_take isl_pw_qpolynomial *pwqp);
3098         __isl_give isl_pw_qpolynomial_fold *
3099         isl_pw_qpolynomial_fold_copy(
3100                 __isl_keep isl_pw_qpolynomial_fold *pwf);
3101         __isl_null isl_pw_qpolynomial_fold *
3102         isl_pw_qpolynomial_fold_free(
3103                 __isl_take isl_pw_qpolynomial_fold *pwf);
3105 To iterate over the different cells of a piecewise expression,
3106 use the following functions.
3108         #include <isl/aff.h>
3109         isl_bool isl_pw_aff_is_empty(__isl_keep isl_pw_aff *pwaff);
3110         int isl_pw_aff_n_piece(__isl_keep isl_pw_aff *pwaff);
3111         isl_stat isl_pw_aff_foreach_piece(
3112                 __isl_keep isl_pw_aff *pwaff,
3113                 isl_stat (*fn)(__isl_take isl_set *set,
3114                           __isl_take isl_aff *aff,
3115                           void *user), void *user);
3116         int isl_pw_multi_aff_n_piece(
3117                 __isl_keep isl_pw_multi_aff *pma);
3118         isl_stat isl_pw_multi_aff_foreach_piece(
3119                 __isl_keep isl_pw_multi_aff *pma,
3120                 isl_stat (*fn)(__isl_take isl_set *set,
3121                             __isl_take isl_multi_aff *maff,
3122                             void *user), void *user);
3124         #include <isl/polynomial.h>
3125         int isl_pw_qpolynomial_n_piece(
3126                 __isl_keep isl_pw_qpolynomial *pwqp);
3127         isl_stat isl_pw_qpolynomial_foreach_piece(
3128                 __isl_keep isl_pw_qpolynomial *pwqp,
3129                 isl_stat (*fn)(__isl_take isl_set *set,
3130                           __isl_take isl_qpolynomial *qp,
3131                           void *user), void *user);
3132         isl_stat isl_pw_qpolynomial_foreach_lifted_piece(
3133                 __isl_keep isl_pw_qpolynomial *pwqp,
3134                 isl_stat (*fn)(__isl_take isl_set *set,
3135                           __isl_take isl_qpolynomial *qp,
3136                           void *user), void *user);
3137         int isl_pw_qpolynomial_fold_n_piece(
3138                 __isl_keep isl_pw_qpolynomial_fold *pwf);
3139         isl_stat isl_pw_qpolynomial_fold_foreach_piece(
3140                 __isl_keep isl_pw_qpolynomial_fold *pwf,
3141                 isl_stat (*fn)(__isl_take isl_set *set,
3142                           __isl_take isl_qpolynomial_fold *fold,
3143                           void *user), void *user);
3144         isl_stat isl_pw_qpolynomial_fold_foreach_lifted_piece(
3145                 __isl_keep isl_pw_qpolynomial_fold *pwf,
3146                 isl_stat (*fn)(__isl_take isl_set *set,
3147                           __isl_take isl_qpolynomial_fold *fold,
3148                           void *user), void *user);
3150 As usual, the function C<fn> should return C<0> on success
3151 and C<-1> on failure.  The difference between
3152 C<isl_pw_qpolynomial_foreach_piece> and
3153 C<isl_pw_qpolynomial_foreach_lifted_piece> is that
3154 C<isl_pw_qpolynomial_foreach_lifted_piece> will first
3155 compute unique representations for all existentially quantified
3156 variables and then turn these existentially quantified variables
3157 into extra set variables, adapting the associated quasipolynomial
3158 accordingly.  This means that the C<set> passed to C<fn>
3159 will not have any existentially quantified variables, but that
3160 the dimensions of the sets may be different for different
3161 invocations of C<fn>.
3162 Similarly for C<isl_pw_qpolynomial_fold_foreach_piece>
3163 and C<isl_pw_qpolynomial_fold_foreach_lifted_piece>.
3165 A piecewise expression consisting of the expressions at a given
3166 position of a piecewise multiple expression can be extracted
3167 using the following function.
3169         #include <isl/aff.h>
3170         __isl_give isl_pw_aff *isl_pw_multi_aff_get_pw_aff(
3171                 __isl_keep isl_pw_multi_aff *pma, int pos);
3173 These expressions can be replaced using the following function.
3175         #include <isl/aff.h>
3176         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_pw_aff(
3177                 __isl_take isl_pw_multi_aff *pma, unsigned pos,
3178                 __isl_take isl_pw_aff *pa);
3180 Note that there is a difference between C<isl_multi_pw_aff> and
3181 C<isl_pw_multi_aff> objects.  The first is a sequence of piecewise
3182 affine expressions, while the second is a piecewise sequence
3183 of affine expressions.  In particular, each of the piecewise
3184 affine expressions in an C<isl_multi_pw_aff> may have a different
3185 domain, while all multiple expressions associated to a cell
3186 in an C<isl_pw_multi_aff> have the same domain.
3187 It is possible to convert between the two, but when converting
3188 an C<isl_multi_pw_aff> to an C<isl_pw_multi_aff>, the domain
3189 of the result is the intersection of the domains of the input.
3190 The reverse conversion is exact.
3192         #include <isl/aff.h>
3193         __isl_give isl_pw_multi_aff *
3194         isl_pw_multi_aff_from_multi_pw_aff(
3195                 __isl_take isl_multi_pw_aff *mpa);
3196         __isl_give isl_multi_pw_aff *
3197         isl_multi_pw_aff_from_pw_multi_aff(
3198                 __isl_take isl_pw_multi_aff *pma);
3200 =head3 Union Expressions
3202 A union expression collects base expressions defined
3203 over different domains.  The space of a union expression
3204 is that of the shared parameter space.
3206 The union expression types defined by C<isl>
3207 are C<isl_union_pw_aff>, C<isl_union_pw_multi_aff>,
3208 C<isl_union_pw_qpolynomial> and C<isl_union_pw_qpolynomial_fold>.
3209 In case of
3210 C<isl_union_pw_aff>,
3211 C<isl_union_pw_qpolynomial> and C<isl_union_pw_qpolynomial_fold>,
3212 there can be at most one base expression for a given domain space.
3213 In case of
3214 C<isl_union_pw_multi_aff>,
3215 there can be multiple such expressions for a given domain space,
3216 but the domains of these expressions need to be disjoint.
3218 An empty union expression can be created using the following functions.
3220         #include <isl/aff.h>
3221         __isl_give isl_union_pw_aff *isl_union_pw_aff_empty(
3222                 __isl_take isl_space *space);
3223         __isl_give isl_union_pw_multi_aff *
3224         isl_union_pw_multi_aff_empty(
3225                 __isl_take isl_space *space);
3227         #include <isl/polynomial.h>
3228         __isl_give isl_union_pw_qpolynomial *
3229         isl_union_pw_qpolynomial_zero(
3230                 __isl_take isl_space *space);
3232 A union expression containing a single base expression
3233 can be created using the following functions.
3235         #include <isl/aff.h>
3236         __isl_give isl_union_pw_aff *
3237         isl_union_pw_aff_from_pw_aff(
3238                 __isl_take isl_pw_aff *pa);
3239         __isl_give isl_union_pw_multi_aff *
3240         isl_union_pw_multi_aff_from_aff(
3241                 __isl_take isl_aff *aff);
3242         __isl_give isl_union_pw_multi_aff *
3243         isl_union_pw_multi_aff_from_pw_multi_aff(
3244                 __isl_take isl_pw_multi_aff *pma);
3246         #include <isl/polynomial.h>
3247         __isl_give isl_union_pw_qpolynomial *
3248         isl_union_pw_qpolynomial_from_pw_qpolynomial(
3249                 __isl_take isl_pw_qpolynomial *pwqp);
3251 The following functions create a base expression on each
3252 of the sets in the union set and collect the results.
3254         #include <isl/aff.h>
3255         __isl_give isl_union_pw_multi_aff *
3256         isl_union_pw_multi_aff_from_union_pw_aff(
3257                 __isl_take isl_union_pw_aff *upa);
3258         __isl_give isl_union_pw_aff *
3259         isl_union_pw_multi_aff_get_union_pw_aff(
3260                 __isl_keep isl_union_pw_multi_aff *upma, int pos);
3261         __isl_give isl_union_pw_aff *
3262         isl_union_pw_aff_val_on_domain(
3263                 __isl_take isl_union_set *domain,
3264                 __isl_take isl_val *v);
3265         __isl_give isl_union_pw_multi_aff *
3266         isl_union_pw_multi_aff_multi_val_on_domain(
3267                 __isl_take isl_union_set *domain,
3268                 __isl_take isl_multi_val *mv);
3270 An C<isl_union_pw_aff> that is equal to a (parametric) affine
3271 expression on a given domain can be created using the following
3272 function.
3274         #include <isl/aff.h>
3275         __isl_give isl_union_pw_aff *
3276         isl_union_pw_aff_aff_on_domain(
3277                 __isl_take isl_union_set *domain,
3278                 __isl_take isl_aff *aff);
3280 A base expression can be added to a union expression using
3281 the following functions.
3283         #include <isl/aff.h>
3284         __isl_give isl_union_pw_aff *
3285         isl_union_pw_aff_add_pw_aff(
3286                 __isl_take isl_union_pw_aff *upa,
3287                 __isl_take isl_pw_aff *pa);
3288         __isl_give isl_union_pw_multi_aff *
3289         isl_union_pw_multi_aff_add_pw_multi_aff(
3290                 __isl_take isl_union_pw_multi_aff *upma,
3291                 __isl_take isl_pw_multi_aff *pma);
3293         #include <isl/polynomial.h>
3294         __isl_give isl_union_pw_qpolynomial *
3295         isl_union_pw_qpolynomial_add_pw_qpolynomial(
3296                 __isl_take isl_union_pw_qpolynomial *upwqp,
3297                 __isl_take isl_pw_qpolynomial *pwqp);
3299 Union expressions can be copied and freed using
3300 the following functions.
3302         #include <isl/aff.h>
3303         __isl_give isl_union_pw_aff *isl_union_pw_aff_copy(
3304                 __isl_keep isl_union_pw_aff *upa);
3305         __isl_null isl_union_pw_aff *isl_union_pw_aff_free(
3306                 __isl_take isl_union_pw_aff *upa);
3307         __isl_give isl_union_pw_multi_aff *
3308         isl_union_pw_multi_aff_copy(
3309                 __isl_keep isl_union_pw_multi_aff *upma);
3310         __isl_null isl_union_pw_multi_aff *
3311         isl_union_pw_multi_aff_free(
3312                 __isl_take isl_union_pw_multi_aff *upma);
3314         #include <isl/polynomial.h>
3315         __isl_give isl_union_pw_qpolynomial *
3316         isl_union_pw_qpolynomial_copy(
3317                 __isl_keep isl_union_pw_qpolynomial *upwqp);
3318         __isl_null isl_union_pw_qpolynomial *
3319         isl_union_pw_qpolynomial_free(
3320                 __isl_take isl_union_pw_qpolynomial *upwqp);
3321         __isl_give isl_union_pw_qpolynomial_fold *
3322         isl_union_pw_qpolynomial_fold_copy(
3323                 __isl_keep isl_union_pw_qpolynomial_fold *upwf);
3324         __isl_null isl_union_pw_qpolynomial_fold *
3325         isl_union_pw_qpolynomial_fold_free(
3326                 __isl_take isl_union_pw_qpolynomial_fold *upwf);
3328 To iterate over the base expressions in a union expression,
3329 use the following functions.
3331         #include <isl/aff.h>
3332         int isl_union_pw_aff_n_pw_aff(
3333                 __isl_keep isl_union_pw_aff *upa);
3334         isl_stat isl_union_pw_aff_foreach_pw_aff(
3335                 __isl_keep isl_union_pw_aff *upa,
3336                 isl_stat (*fn)(__isl_take isl_pw_aff *pa,
3337                         void *user), void *user);
3338         int isl_union_pw_multi_aff_n_pw_multi_aff(
3339                 __isl_keep isl_union_pw_multi_aff *upma);
3340         isl_stat isl_union_pw_multi_aff_foreach_pw_multi_aff(
3341                 __isl_keep isl_union_pw_multi_aff *upma,
3342                 isl_stat (*fn)(__isl_take isl_pw_multi_aff *pma,
3343                             void *user), void *user);
3345         #include <isl/polynomial.h>
3346         int isl_union_pw_qpolynomial_n_pw_qpolynomial(
3347                 __isl_keep isl_union_pw_qpolynomial *upwqp);
3348         isl_stat isl_union_pw_qpolynomial_foreach_pw_qpolynomial(
3349                 __isl_keep isl_union_pw_qpolynomial *upwqp,
3350                 isl_stat (*fn)(__isl_take isl_pw_qpolynomial *pwqp,
3351                             void *user), void *user);
3352         int isl_union_pw_qpolynomial_fold_n_pw_qpolynomial_fold(
3353                 __isl_keep isl_union_pw_qpolynomial_fold *upwf);
3354         isl_stat isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold(
3355                 __isl_keep isl_union_pw_qpolynomial_fold *upwf,
3356                 isl_stat (*fn)(__isl_take isl_pw_qpolynomial_fold *pwf,
3357                             void *user), void *user);
3359 To extract the base expression in a given space from a union, use
3360 the following functions.
3362         #include <isl/aff.h>
3363         __isl_give isl_pw_aff *isl_union_pw_aff_extract_pw_aff(
3364                 __isl_keep isl_union_pw_aff *upa,
3365                 __isl_take isl_space *space);
3366         __isl_give isl_pw_multi_aff *
3367         isl_union_pw_multi_aff_extract_pw_multi_aff(
3368                 __isl_keep isl_union_pw_multi_aff *upma,
3369                 __isl_take isl_space *space);
3371         #include <isl/polynomial.h>
3372         __isl_give isl_pw_qpolynomial *
3373         isl_union_pw_qpolynomial_extract_pw_qpolynomial(
3374                 __isl_keep isl_union_pw_qpolynomial *upwqp,
3375                 __isl_take isl_space *space);
3377 =head2 Input and Output
3379 For set and relation,
3380 C<isl> supports its own input/output format, which is similar
3381 to the C<Omega> format, but also supports the C<PolyLib> format
3382 in some cases.
3383 For other object types, typically only an C<isl> format is supported.
3385 =head3 C<isl> format
3387 The C<isl> format is similar to that of C<Omega>, but has a different
3388 syntax for describing the parameters and allows for the definition
3389 of an existentially quantified variable as the integer division
3390 of an affine expression.
3391 For example, the set of integers C<i> between C<0> and C<n>
3392 such that C<i % 10 <= 6> can be described as
3394         [n] -> { [i] : exists (a = [i/10] : 0 <= i and i <= n and
3395                                 i - 10 a <= 6) }
3397 A set or relation can have several disjuncts, separated
3398 by the keyword C<or>.  Each disjunct is either a conjunction
3399 of constraints or a projection (C<exists>) of a conjunction
3400 of constraints.  The constraints are separated by the keyword
3401 C<and>.
3403 =head3 C<PolyLib> format
3405 If the represented set is a union, then the first line
3406 contains a single number representing the number of disjuncts.
3407 Otherwise, a line containing the number C<1> is optional.
3409 Each disjunct is represented by a matrix of constraints.
3410 The first line contains two numbers representing
3411 the number of rows and columns,
3412 where the number of rows is equal to the number of constraints
3413 and the number of columns is equal to two plus the number of variables.
3414 The following lines contain the actual rows of the constraint matrix.
3415 In each row, the first column indicates whether the constraint
3416 is an equality (C<0>) or inequality (C<1>).  The final column
3417 corresponds to the constant term.
3419 If the set is parametric, then the coefficients of the parameters
3420 appear in the last columns before the constant column.
3421 The coefficients of any existentially quantified variables appear
3422 between those of the set variables and those of the parameters.
3424 =head3 Extended C<PolyLib> format
3426 The extended C<PolyLib> format is nearly identical to the
3427 C<PolyLib> format.  The only difference is that the line
3428 containing the number of rows and columns of a constraint matrix
3429 also contains four additional numbers:
3430 the number of output dimensions, the number of input dimensions,
3431 the number of local dimensions (i.e., the number of existentially
3432 quantified variables) and the number of parameters.
3433 For sets, the number of ``output'' dimensions is equal
3434 to the number of set dimensions, while the number of ``input''
3435 dimensions is zero.
3437 =head3 Input
3439 Objects can be read from input using the following functions.
3441         #include <isl/val.h>
3442         __isl_give isl_val *isl_val_read_from_str(isl_ctx *ctx,
3443                 const char *str);
3444         __isl_give isl_multi_val *isl_multi_val_read_from_str(
3445                 isl_ctx *ctx, const char *str);
3447         #include <isl/set.h>
3448         __isl_give isl_basic_set *isl_basic_set_read_from_file(
3449                 isl_ctx *ctx, FILE *input);
3450         __isl_give isl_basic_set *isl_basic_set_read_from_str(
3451                 isl_ctx *ctx, const char *str);
3452         __isl_give isl_set *isl_set_read_from_file(isl_ctx *ctx,
3453                 FILE *input);
3454         __isl_give isl_set *isl_set_read_from_str(isl_ctx *ctx,
3455                 const char *str);
3457         #include <isl/map.h>
3458         __isl_give isl_basic_map *isl_basic_map_read_from_file(
3459                 isl_ctx *ctx, FILE *input);
3460         __isl_give isl_basic_map *isl_basic_map_read_from_str(
3461                 isl_ctx *ctx, const char *str);
3462         __isl_give isl_map *isl_map_read_from_file(
3463                 isl_ctx *ctx, FILE *input);
3464         __isl_give isl_map *isl_map_read_from_str(isl_ctx *ctx,
3465                 const char *str);
3467         #include <isl/union_set.h>
3468         __isl_give isl_union_set *isl_union_set_read_from_file(
3469                 isl_ctx *ctx, FILE *input);
3470         __isl_give isl_union_set *isl_union_set_read_from_str(
3471                 isl_ctx *ctx, const char *str);
3473         #include <isl/union_map.h>
3474         __isl_give isl_union_map *isl_union_map_read_from_file(
3475                 isl_ctx *ctx, FILE *input);
3476         __isl_give isl_union_map *isl_union_map_read_from_str(
3477                 isl_ctx *ctx, const char *str);
3479         #include <isl/aff.h>
3480         __isl_give isl_aff *isl_aff_read_from_str(
3481                 isl_ctx *ctx, const char *str);
3482         __isl_give isl_multi_aff *isl_multi_aff_read_from_str(
3483                 isl_ctx *ctx, const char *str);
3484         __isl_give isl_pw_aff *isl_pw_aff_read_from_str(
3485                 isl_ctx *ctx, const char *str);
3486         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_read_from_str(
3487                 isl_ctx *ctx, const char *str);
3488         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_read_from_str(
3489                 isl_ctx *ctx, const char *str);
3490         __isl_give isl_union_pw_aff *
3491         isl_union_pw_aff_read_from_str(
3492                 isl_ctx *ctx, const char *str);
3493         __isl_give isl_union_pw_multi_aff *
3494         isl_union_pw_multi_aff_read_from_str(
3495                 isl_ctx *ctx, const char *str);
3496         __isl_give isl_multi_union_pw_aff *
3497         isl_multi_union_pw_aff_read_from_str(
3498                 isl_ctx *ctx, const char *str);
3500         #include <isl/polynomial.h>
3501         __isl_give isl_union_pw_qpolynomial *
3502         isl_union_pw_qpolynomial_read_from_str(
3503                 isl_ctx *ctx, const char *str);
3505 For sets and relations,
3506 the input format is autodetected and may be either the C<PolyLib> format
3507 or the C<isl> format.
3509 =head3 Output
3511 Before anything can be printed, an C<isl_printer> needs to
3512 be created.
3514         __isl_give isl_printer *isl_printer_to_file(isl_ctx *ctx,
3515                 FILE *file);
3516         __isl_give isl_printer *isl_printer_to_str(isl_ctx *ctx);
3517         __isl_null isl_printer *isl_printer_free(
3518                 __isl_take isl_printer *printer);
3520 C<isl_printer_to_file> prints to the given file, while
3521 C<isl_printer_to_str> prints to a string that can be extracted
3522 using the following function.
3524         #include <isl/printer.h>
3525         __isl_give char *isl_printer_get_str(
3526                 __isl_keep isl_printer *printer);
3528 The printer can be inspected using the following functions.
3530         FILE *isl_printer_get_file(
3531                 __isl_keep isl_printer *printer);
3532         int isl_printer_get_output_format(
3533                 __isl_keep isl_printer *p);
3534         int isl_printer_get_yaml_style(__isl_keep isl_printer *p);
3536 The behavior of the printer can be modified in various ways
3538         __isl_give isl_printer *isl_printer_set_output_format(
3539                 __isl_take isl_printer *p, int output_format);
3540         __isl_give isl_printer *isl_printer_set_indent(
3541                 __isl_take isl_printer *p, int indent);
3542         __isl_give isl_printer *isl_printer_set_indent_prefix(
3543                 __isl_take isl_printer *p, const char *prefix);
3544         __isl_give isl_printer *isl_printer_indent(
3545                 __isl_take isl_printer *p, int indent);
3546         __isl_give isl_printer *isl_printer_set_prefix(
3547                 __isl_take isl_printer *p, const char *prefix);
3548         __isl_give isl_printer *isl_printer_set_suffix(
3549                 __isl_take isl_printer *p, const char *suffix);
3550         __isl_give isl_printer *isl_printer_set_yaml_style(
3551                 __isl_take isl_printer *p, int yaml_style);
3553 The C<output_format> may be either C<ISL_FORMAT_ISL>, C<ISL_FORMAT_OMEGA>,
3554 C<ISL_FORMAT_POLYLIB>, C<ISL_FORMAT_EXT_POLYLIB> or C<ISL_FORMAT_LATEX>
3555 and defaults to C<ISL_FORMAT_ISL>.
3556 Each line in the output is prefixed by C<indent_prefix>,
3557 indented by C<indent> (set by C<isl_printer_set_indent>) spaces
3558 (default: 0), prefixed by C<prefix> and suffixed by C<suffix>.
3559 In the C<PolyLib> format output,
3560 the coefficients of the existentially quantified variables
3561 appear between those of the set variables and those
3562 of the parameters.
3563 The function C<isl_printer_indent> increases the indentation
3564 by the specified amount (which may be negative).
3565 The YAML style may be either C<ISL_YAML_STYLE_BLOCK> or
3566 C<ISL_YAML_STYLE_FLOW> and when we are printing something
3567 in YAML format.
3569 To actually print something, use
3571         #include <isl/printer.h>
3572         __isl_give isl_printer *isl_printer_print_double(
3573                 __isl_take isl_printer *p, double d);
3575         #include <isl/val.h>
3576         __isl_give isl_printer *isl_printer_print_val(
3577                 __isl_take isl_printer *p, __isl_keep isl_val *v);
3579         #include <isl/set.h>
3580         __isl_give isl_printer *isl_printer_print_basic_set(
3581                 __isl_take isl_printer *printer,
3582                 __isl_keep isl_basic_set *bset);
3583         __isl_give isl_printer *isl_printer_print_set(
3584                 __isl_take isl_printer *printer,
3585                 __isl_keep isl_set *set);
3587         #include <isl/map.h>
3588         __isl_give isl_printer *isl_printer_print_basic_map(
3589                 __isl_take isl_printer *printer,
3590                 __isl_keep isl_basic_map *bmap);
3591         __isl_give isl_printer *isl_printer_print_map(
3592                 __isl_take isl_printer *printer,
3593                 __isl_keep isl_map *map);
3595         #include <isl/union_set.h>
3596         __isl_give isl_printer *isl_printer_print_union_set(
3597                 __isl_take isl_printer *p,
3598                 __isl_keep isl_union_set *uset);
3600         #include <isl/union_map.h>
3601         __isl_give isl_printer *isl_printer_print_union_map(
3602                 __isl_take isl_printer *p,
3603                 __isl_keep isl_union_map *umap);
3605         #include <isl/val.h>
3606         __isl_give isl_printer *isl_printer_print_multi_val(
3607                 __isl_take isl_printer *p,
3608                 __isl_keep isl_multi_val *mv);
3610         #include <isl/aff.h>
3611         __isl_give isl_printer *isl_printer_print_aff(
3612                 __isl_take isl_printer *p, __isl_keep isl_aff *aff);
3613         __isl_give isl_printer *isl_printer_print_multi_aff(
3614                 __isl_take isl_printer *p,
3615                 __isl_keep isl_multi_aff *maff);
3616         __isl_give isl_printer *isl_printer_print_pw_aff(
3617                 __isl_take isl_printer *p,
3618                 __isl_keep isl_pw_aff *pwaff);
3619         __isl_give isl_printer *isl_printer_print_pw_multi_aff(
3620                 __isl_take isl_printer *p,
3621                 __isl_keep isl_pw_multi_aff *pma);
3622         __isl_give isl_printer *isl_printer_print_multi_pw_aff(
3623                 __isl_take isl_printer *p,
3624                 __isl_keep isl_multi_pw_aff *mpa);
3625         __isl_give isl_printer *isl_printer_print_union_pw_aff(
3626                 __isl_take isl_printer *p,
3627                 __isl_keep isl_union_pw_aff *upa);
3628         __isl_give isl_printer *isl_printer_print_union_pw_multi_aff(
3629                 __isl_take isl_printer *p,
3630                 __isl_keep isl_union_pw_multi_aff *upma);
3631         __isl_give isl_printer *
3632         isl_printer_print_multi_union_pw_aff(
3633                 __isl_take isl_printer *p,
3634                 __isl_keep isl_multi_union_pw_aff *mupa);
3636         #include <isl/polynomial.h>
3637         __isl_give isl_printer *isl_printer_print_qpolynomial(
3638                 __isl_take isl_printer *p,
3639                 __isl_keep isl_qpolynomial *qp);
3640         __isl_give isl_printer *isl_printer_print_pw_qpolynomial(
3641                 __isl_take isl_printer *p,
3642                 __isl_keep isl_pw_qpolynomial *pwqp);
3643         __isl_give isl_printer *isl_printer_print_union_pw_qpolynomial(
3644                 __isl_take isl_printer *p,
3645                 __isl_keep isl_union_pw_qpolynomial *upwqp);
3647         __isl_give isl_printer *
3648         isl_printer_print_pw_qpolynomial_fold(
3649                 __isl_take isl_printer *p,
3650                 __isl_keep isl_pw_qpolynomial_fold *pwf);
3651         __isl_give isl_printer *
3652         isl_printer_print_union_pw_qpolynomial_fold(
3653                 __isl_take isl_printer *p,
3654                 __isl_keep isl_union_pw_qpolynomial_fold *upwf);
3656 For C<isl_printer_print_qpolynomial>,
3657 C<isl_printer_print_pw_qpolynomial> and
3658 C<isl_printer_print_pw_qpolynomial_fold>,
3659 the output format of the printer
3660 needs to be set to either C<ISL_FORMAT_ISL> or C<ISL_FORMAT_C>.
3661 For C<isl_printer_print_union_pw_qpolynomial> and
3662 C<isl_printer_print_union_pw_qpolynomial_fold>, only C<ISL_FORMAT_ISL>
3663 is supported.
3664 In case of printing in C<ISL_FORMAT_C>, the user may want
3665 to set the names of all dimensions first.
3667 C<isl> also provides limited support for printing YAML documents,
3668 just enough for the internal use for printing such documents.
3670         #include <isl/printer.h>
3671         __isl_give isl_printer *isl_printer_yaml_start_mapping(
3672                 __isl_take isl_printer *p);
3673         __isl_give isl_printer *isl_printer_yaml_end_mapping(
3674                 __isl_take isl_printer *p);
3675         __isl_give isl_printer *isl_printer_yaml_start_sequence(
3676                 __isl_take isl_printer *p);
3677         __isl_give isl_printer *isl_printer_yaml_end_sequence(
3678                 __isl_take isl_printer *p);
3679         __isl_give isl_printer *isl_printer_yaml_next(
3680                 __isl_take isl_printer *p);
3682 A document is started by a call to either
3683 C<isl_printer_yaml_start_mapping> or C<isl_printer_yaml_start_sequence>.
3684 Anything printed to the printer after such a call belong to the
3685 first key of the mapping or the first element in the sequence.
3686 The function C<isl_printer_yaml_next> moves to the value if
3687 we are currently printing a mapping key, the next key if we
3688 are printing a value or the next element if we are printing
3689 an element in a sequence.
3690 Nested mappings and sequences are initiated by the same
3691 C<isl_printer_yaml_start_mapping> or C<isl_printer_yaml_start_sequence>.
3692 Each call to these functions needs to have a corresponding call to
3693 C<isl_printer_yaml_end_mapping> or C<isl_printer_yaml_end_sequence>.
3695 When called on a file printer, the following function flushes
3696 the file.  When called on a string printer, the buffer is cleared.
3698         __isl_give isl_printer *isl_printer_flush(
3699                 __isl_take isl_printer *p);
3701 The following functions allow the user to attach
3702 notes to a printer in order to keep track of additional state.
3704         #include <isl/printer.h>
3705         isl_bool isl_printer_has_note(__isl_keep isl_printer *p,
3706                 __isl_keep isl_id *id);
3707         __isl_give isl_id *isl_printer_get_note(
3708                 __isl_keep isl_printer *p, __isl_take isl_id *id);
3709         __isl_give isl_printer *isl_printer_set_note(
3710                 __isl_take isl_printer *p,
3711                 __isl_take isl_id *id, __isl_take isl_id *note);
3713 C<isl_printer_set_note> associates the given note to the given
3714 identifier in the printer.
3715 C<isl_printer_get_note> retrieves a note associated to an
3716 identifier, while
3717 C<isl_printer_has_note> checks if there is such a note.
3718 C<isl_printer_get_note> fails if the requested note does not exist.
3720 Alternatively, a string representation can be obtained
3721 directly using the following functions, which always print
3722 in isl format.
3724         #include <isl/id.h>
3725         __isl_give char *isl_id_to_str(
3726                 __isl_keep isl_id *id);
3728         #include <isl/space.h>
3729         __isl_give char *isl_space_to_str(
3730                 __isl_keep isl_space *space);
3732         #include <isl/val.h>
3733         __isl_give char *isl_val_to_str(__isl_keep isl_val *v);
3734         __isl_give char *isl_multi_val_to_str(
3735                 __isl_keep isl_multi_val *mv);
3737         #include <isl/set.h>
3738         __isl_give char *isl_basic_set_to_str(
3739                 __isl_keep isl_basic_set *bset);
3740         __isl_give char *isl_set_to_str(
3741                 __isl_keep isl_set *set);
3743         #include <isl/union_set.h>
3744         __isl_give char *isl_union_set_to_str(
3745                 __isl_keep isl_union_set *uset);
3747         #include <isl/map.h>
3748         __isl_give char *isl_basic_map_to_str(
3749                 __isl_keep isl_basic_map *bmap);
3750         __isl_give char *isl_map_to_str(
3751                 __isl_keep isl_map *map);
3753         #include <isl/union_map.h>
3754         __isl_give char *isl_union_map_to_str(
3755                 __isl_keep isl_union_map *umap);
3757         #include <isl/aff.h>
3758         __isl_give char *isl_aff_to_str(__isl_keep isl_aff *aff);
3759         __isl_give char *isl_pw_aff_to_str(
3760                 __isl_keep isl_pw_aff *pa);
3761         __isl_give char *isl_multi_aff_to_str(
3762                 __isl_keep isl_multi_aff *ma);
3763         __isl_give char *isl_pw_multi_aff_to_str(
3764                 __isl_keep isl_pw_multi_aff *pma);
3765         __isl_give char *isl_multi_pw_aff_to_str(
3766                 __isl_keep isl_multi_pw_aff *mpa);
3767         __isl_give char *isl_union_pw_aff_to_str(
3768                 __isl_keep isl_union_pw_aff *upa);
3769         __isl_give char *isl_union_pw_multi_aff_to_str(
3770                 __isl_keep isl_union_pw_multi_aff *upma);
3771         __isl_give char *isl_multi_union_pw_aff_to_str(
3772                 __isl_keep isl_multi_union_pw_aff *mupa);
3774         #include <isl/point.h>
3775         __isl_give char *isl_point_to_str(
3776                 __isl_keep isl_point *pnt);
3778         #include <isl/polynomial.h>
3779         __isl_give char *isl_pw_qpolynomial_to_str(
3780                 __isl_keep isl_pw_qpolynomial *pwqp);
3781         __isl_give char *isl_union_pw_qpolynomial_to_str(
3782                 __isl_keep isl_union_pw_qpolynomial *upwqp);
3784 =head2 Properties
3786 =head3 Unary Properties
3788 =over
3790 =item * Emptiness
3792 The following functions test whether the given set or relation
3793 contains any integer points.  The ``plain'' variants do not perform
3794 any computations, but simply check if the given set or relation
3795 is already known to be empty.
3797         isl_bool isl_basic_set_plain_is_empty(
3798                 __isl_keep isl_basic_set *bset);
3799         isl_bool isl_basic_set_is_empty(
3800                 __isl_keep isl_basic_set *bset);
3801         isl_bool isl_set_plain_is_empty(
3802                 __isl_keep isl_set *set);
3803         isl_bool isl_set_is_empty(__isl_keep isl_set *set);
3804         isl_bool isl_union_set_is_empty(
3805                 __isl_keep isl_union_set *uset);
3806         isl_bool isl_basic_map_plain_is_empty(
3807                 __isl_keep isl_basic_map *bmap);
3808         isl_bool isl_basic_map_is_empty(
3809                 __isl_keep isl_basic_map *bmap);
3810         isl_bool isl_map_plain_is_empty(
3811                 __isl_keep isl_map *map);
3812         isl_bool isl_map_is_empty(__isl_keep isl_map *map);
3813         isl_bool isl_union_map_is_empty(
3814                 __isl_keep isl_union_map *umap);
3816 =item * Universality
3818         isl_bool isl_basic_set_plain_is_universe(
3819                 __isl_keep isl_basic_set *bset);
3820         isl_bool isl_basic_set_is_universe(
3821                 __isl_keep isl_basic_set *bset);
3822         isl_bool isl_basic_map_plain_is_universe(
3823                 __isl_keep isl_basic_map *bmap);
3824         isl_bool isl_basic_map_is_universe(
3825                 __isl_keep isl_basic_map *bmap);
3826         isl_bool isl_set_plain_is_universe(
3827                 __isl_keep isl_set *set);
3828         isl_bool isl_map_plain_is_universe(
3829                 __isl_keep isl_map *map);
3831 =item * Single-valuedness
3833         #include <isl/set.h>
3834         isl_bool isl_set_is_singleton(__isl_keep isl_set *set);
3836         #include <isl/map.h>
3837         isl_bool isl_basic_map_is_single_valued(
3838                 __isl_keep isl_basic_map *bmap);
3839         isl_bool isl_map_plain_is_single_valued(
3840                 __isl_keep isl_map *map);
3841         isl_bool isl_map_is_single_valued(__isl_keep isl_map *map);
3843         #include <isl/union_map.h>
3844         isl_bool isl_union_map_is_single_valued(
3845                 __isl_keep isl_union_map *umap);
3847 =item * Injectivity
3849         isl_bool isl_map_plain_is_injective(
3850                 __isl_keep isl_map *map);
3851         isl_bool isl_map_is_injective(
3852                 __isl_keep isl_map *map);
3853         isl_bool isl_union_map_plain_is_injective(
3854                 __isl_keep isl_union_map *umap);
3855         isl_bool isl_union_map_is_injective(
3856                 __isl_keep isl_union_map *umap);
3858 =item * Bijectivity
3860         isl_bool isl_map_is_bijective(
3861                 __isl_keep isl_map *map);
3862         isl_bool isl_union_map_is_bijective(
3863                 __isl_keep isl_union_map *umap);
3865 =item * Identity
3867 The following functions test whether the given relation
3868 only maps elements to themselves.
3870         #include <isl/map.h>
3871         isl_bool isl_map_is_identity(
3872                 __isl_keep isl_map *map);
3874         #include <isl/union_map.h>
3875         isl_bool isl_union_map_is_identity(
3876                 __isl_keep isl_union_map *umap);
3878 =item * Position
3880         __isl_give isl_val *
3881         isl_basic_map_plain_get_val_if_fixed(
3882                 __isl_keep isl_basic_map *bmap,
3883                 enum isl_dim_type type, unsigned pos);
3884         __isl_give isl_val *isl_set_plain_get_val_if_fixed(
3885                 __isl_keep isl_set *set,
3886                 enum isl_dim_type type, unsigned pos);
3887         __isl_give isl_val *isl_map_plain_get_val_if_fixed(
3888                 __isl_keep isl_map *map,
3889                 enum isl_dim_type type, unsigned pos);
3891 If the set or relation obviously lies on a hyperplane where the given dimension
3892 has a fixed value, then return that value.
3893 Otherwise return NaN.
3895 =item * Stride
3897         isl_stat isl_set_dim_residue_class_val(
3898                 __isl_keep isl_set *set,
3899                 int pos, __isl_give isl_val **modulo,
3900                 __isl_give isl_val **residue);
3902 Check if the values of the given set dimension are equal to a fixed
3903 value modulo some integer value.  If so, assign the modulo to C<*modulo>
3904 and the fixed value to C<*residue>.  If the given dimension attains only
3905 a single value, then assign C<0> to C<*modulo> and the fixed value to
3906 C<*residue>.
3907 If the dimension does not attain only a single value and if no modulo
3908 can be found then assign C<1> to C<*modulo> and C<1> to C<*residue>.
3910 =item * Dependence
3912 To check whether the description of a set, relation or function depends
3913 on one or more given dimensions,
3914 the following functions can be used.
3916         #include <isl/constraint.h>
3917         isl_bool isl_constraint_involves_dims(
3918                 __isl_keep isl_constraint *constraint,
3919                 enum isl_dim_type type, unsigned first, unsigned n);
3921         #include <isl/set.h>
3922         isl_bool isl_basic_set_involves_dims(
3923                 __isl_keep isl_basic_set *bset,
3924                 enum isl_dim_type type, unsigned first, unsigned n);
3925         isl_bool isl_set_involves_dims(__isl_keep isl_set *set,
3926                 enum isl_dim_type type, unsigned first, unsigned n);
3928         #include <isl/map.h>
3929         isl_bool isl_basic_map_involves_dims(
3930                 __isl_keep isl_basic_map *bmap,
3931                 enum isl_dim_type type, unsigned first, unsigned n);
3932         isl_bool isl_map_involves_dims(__isl_keep isl_map *map,
3933                 enum isl_dim_type type, unsigned first, unsigned n);
3935         #include <isl/union_map.h>
3936         isl_bool isl_union_map_involves_dims(
3937                 __isl_keep isl_union_map *umap,
3938                 enum isl_dim_type type, unsigned first, unsigned n);
3940         #include <isl/aff.h>
3941         isl_bool isl_aff_involves_dims(__isl_keep isl_aff *aff,
3942                 enum isl_dim_type type, unsigned first, unsigned n);
3943         isl_bool isl_pw_aff_involves_dims(
3944                 __isl_keep isl_pw_aff *pwaff,
3945                 enum isl_dim_type type, unsigned first, unsigned n);
3946         isl_bool isl_multi_aff_involves_dims(
3947                 __isl_keep isl_multi_aff *ma,
3948                 enum isl_dim_type type, unsigned first, unsigned n);
3949         isl_bool isl_multi_pw_aff_involves_dims(
3950                 __isl_keep isl_multi_pw_aff *mpa,
3951                 enum isl_dim_type type, unsigned first, unsigned n);
3953         #include <isl/polynomial.h>
3954         isl_bool isl_qpolynomial_involves_dims(
3955                 __isl_keep isl_qpolynomial *qp,
3956                 enum isl_dim_type type, unsigned first, unsigned n);
3958 Similarly, the following functions can be used to check whether
3959 a given dimension is involved in any lower or upper bound.
3961         #include <isl/set.h>
3962         isl_bool isl_set_dim_has_any_lower_bound(
3963                 __isl_keep isl_set *set,
3964                 enum isl_dim_type type, unsigned pos);
3965         isl_bool isl_set_dim_has_any_upper_bound(
3966                 __isl_keep isl_set *set,
3967                 enum isl_dim_type type, unsigned pos);
3969 Note that these functions return true even if there is a bound on
3970 the dimension on only some of the basic sets of C<set>.
3971 To check if they have a bound for all of the basic sets in C<set>,
3972 use the following functions instead.
3974         #include <isl/set.h>
3975         isl_bool isl_set_dim_has_lower_bound(
3976                 __isl_keep isl_set *set,
3977                 enum isl_dim_type type, unsigned pos);
3978         isl_bool isl_set_dim_has_upper_bound(
3979                 __isl_keep isl_set *set,
3980                 enum isl_dim_type type, unsigned pos);
3982 =item * Space
3984 To check whether a set is a parameter domain, use this function:
3986         isl_bool isl_set_is_params(__isl_keep isl_set *set);
3987         isl_bool isl_union_set_is_params(
3988                 __isl_keep isl_union_set *uset);
3990 =item * Wrapping
3992 The following functions check whether the space of the given
3993 (basic) set or relation domain and/or range is a wrapped relation.
3995         #include <isl/space.h>
3996         isl_bool isl_space_is_wrapping(
3997                 __isl_keep isl_space *space);
3998         isl_bool isl_space_domain_is_wrapping(
3999                 __isl_keep isl_space *space);
4000         isl_bool isl_space_range_is_wrapping(
4001                 __isl_keep isl_space *space);
4002         isl_bool isl_space_is_product(
4003                 __isl_keep isl_space *space);
4005         #include <isl/set.h>
4006         isl_bool isl_basic_set_is_wrapping(
4007                 __isl_keep isl_basic_set *bset);
4008         isl_bool isl_set_is_wrapping(__isl_keep isl_set *set);
4010         #include <isl/map.h>
4011         isl_bool isl_map_domain_is_wrapping(
4012                 __isl_keep isl_map *map);
4013         isl_bool isl_map_range_is_wrapping(
4014                 __isl_keep isl_map *map);
4015         isl_bool isl_map_is_product(__isl_keep isl_map *map);
4017         #include <isl/val.h>
4018         isl_bool isl_multi_val_range_is_wrapping(
4019                 __isl_keep isl_multi_val *mv);
4021         #include <isl/aff.h>
4022         isl_bool isl_multi_aff_range_is_wrapping(
4023                 __isl_keep isl_multi_aff *ma);
4024         isl_bool isl_multi_pw_aff_range_is_wrapping(
4025                 __isl_keep isl_multi_pw_aff *mpa);
4026         isl_bool isl_multi_union_pw_aff_range_is_wrapping(
4027                 __isl_keep isl_multi_union_pw_aff *mupa);
4029 The input to C<isl_space_is_wrapping> should
4030 be the space of a set, while that of
4031 C<isl_space_domain_is_wrapping> and
4032 C<isl_space_range_is_wrapping> should be the space of a relation.
4033 The input to C<isl_space_is_product> can be either the space
4034 of a set or that of a binary relation.
4035 In case the input is the space of a binary relation, it checks
4036 whether both domain and range are wrapping.
4038 =item * Internal Product
4040         isl_bool isl_basic_map_can_zip(
4041                 __isl_keep isl_basic_map *bmap);
4042         isl_bool isl_map_can_zip(__isl_keep isl_map *map);
4044 Check whether the product of domain and range of the given relation
4045 can be computed,
4046 i.e., whether both domain and range are nested relations.
4048 =item * Currying
4050         #include <isl/space.h>
4051         isl_bool isl_space_can_curry(
4052                 __isl_keep isl_space *space);
4054         #include <isl/map.h>
4055         isl_bool isl_basic_map_can_curry(
4056                 __isl_keep isl_basic_map *bmap);
4057         isl_bool isl_map_can_curry(__isl_keep isl_map *map);
4059 Check whether the domain of the (basic) relation is a wrapped relation.
4061         #include <isl/space.h>
4062         __isl_give isl_space *isl_space_uncurry(
4063                 __isl_take isl_space *space);
4065         #include <isl/map.h>
4066         isl_bool isl_basic_map_can_uncurry(
4067                 __isl_keep isl_basic_map *bmap);
4068         isl_bool isl_map_can_uncurry(__isl_keep isl_map *map);
4070 Check whether the range of the (basic) relation is a wrapped relation.
4072         #include <isl/space.h>
4073         isl_bool isl_space_can_range_curry(
4074                 __isl_keep isl_space *space);
4076         #include <isl/map.h>
4077         isl_bool isl_map_can_range_curry(
4078                 __isl_keep isl_map *map);
4080 Check whether the domain of the relation wrapped in the range of
4081 the input is itself a wrapped relation.
4083 =item * Special Values
4085         #include <isl/aff.h>
4086         isl_bool isl_aff_is_cst(__isl_keep isl_aff *aff);
4087         isl_bool isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff);
4088         isl_bool isl_multi_pw_aff_is_cst(
4089                 __isl_keep isl_multi_pw_aff *mpa);
4091 Check whether the given expression is a constant.
4093         #include <isl/val.h>
4094         isl_bool isl_multi_val_involves_nan(
4095                 __isl_keep isl_multi_val *mv);
4097         #include <isl/aff.h>
4098         isl_bool isl_aff_is_nan(__isl_keep isl_aff *aff);
4099         isl_bool isl_multi_aff_involves_nan(
4100                 __isl_keep isl_multi_aff *ma);
4101         isl_bool isl_pw_aff_involves_nan(
4102                 __isl_keep isl_pw_aff *pa);
4103         isl_bool isl_pw_multi_aff_involves_nan(
4104                 __isl_keep isl_pw_multi_aff *pma);
4105         isl_bool isl_multi_pw_aff_involves_nan(
4106                 __isl_keep isl_multi_pw_aff *mpa);
4107         isl_bool isl_union_pw_aff_involves_nan(
4108                 __isl_keep isl_union_pw_aff *upa);
4109         isl_bool isl_union_pw_multi_aff_involves_nan(
4110                 __isl_keep isl_union_pw_multi_aff *upma);
4111         isl_bool isl_multi_union_pw_aff_involves_nan(
4112                 __isl_keep isl_multi_union_pw_aff *mupa);
4114         #include <isl/polynomial.h>
4115         isl_bool isl_qpolynomial_is_nan(
4116                 __isl_keep isl_qpolynomial *qp);
4117         isl_bool isl_qpolynomial_fold_is_nan(
4118                 __isl_keep isl_qpolynomial_fold *fold);
4119         isl_bool isl_pw_qpolynomial_involves_nan(
4120                 __isl_keep isl_pw_qpolynomial *pwqp);
4121         isl_bool isl_pw_qpolynomial_fold_involves_nan(
4122                 __isl_keep isl_pw_qpolynomial_fold *pwf);
4123         isl_bool isl_union_pw_qpolynomial_involves_nan(
4124                 __isl_keep isl_union_pw_qpolynomial *upwqp);
4125         isl_bool isl_union_pw_qpolynomial_fold_involves_nan(
4126                 __isl_keep isl_union_pw_qpolynomial_fold *upwf);
4128 Check whether the given expression is equal to or involves NaN.
4130         #include <isl/aff.h>
4131         isl_bool isl_aff_plain_is_zero(
4132                 __isl_keep isl_aff *aff);
4134 Check whether the affine expression is obviously zero.
4136 =back
4138 =head3 Binary Properties
4140 =over
4142 =item * Equality
4144 The following functions check whether two objects
4145 represent the same set, relation or function.
4146 The C<plain> variants only return true if the objects
4147 are obviously the same.  That is, they may return false
4148 even if the objects are the same, but they will never
4149 return true if the objects are not the same.
4151         #include <isl/set.h>
4152         isl_bool isl_basic_set_plain_is_equal(
4153                 __isl_keep isl_basic_set *bset1,
4154                 __isl_keep isl_basic_set *bset2);
4155         isl_bool isl_basic_set_is_equal(
4156                 __isl_keep isl_basic_set *bset1,
4157                 __isl_keep isl_basic_set *bset2);
4158         isl_bool isl_set_plain_is_equal(
4159                 __isl_keep isl_set *set1,
4160                 __isl_keep isl_set *set2);
4161         isl_bool isl_set_is_equal(__isl_keep isl_set *set1,
4162                 __isl_keep isl_set *set2);
4164         #include <isl/map.h>
4165         isl_bool isl_basic_map_is_equal(
4166                 __isl_keep isl_basic_map *bmap1,
4167                 __isl_keep isl_basic_map *bmap2);
4168         isl_bool isl_map_is_equal(__isl_keep isl_map *map1,
4169                 __isl_keep isl_map *map2);
4170         isl_bool isl_map_plain_is_equal(
4171                 __isl_keep isl_map *map1,
4172                 __isl_keep isl_map *map2);
4174         #include <isl/union_set.h>
4175         isl_bool isl_union_set_is_equal(
4176                 __isl_keep isl_union_set *uset1,
4177                 __isl_keep isl_union_set *uset2);
4179         #include <isl/union_map.h>
4180         isl_bool isl_union_map_is_equal(
4181                 __isl_keep isl_union_map *umap1,
4182                 __isl_keep isl_union_map *umap2);
4184         #include <isl/aff.h>
4185         isl_bool isl_aff_plain_is_equal(
4186                 __isl_keep isl_aff *aff1,
4187                 __isl_keep isl_aff *aff2);
4188         isl_bool isl_multi_aff_plain_is_equal(
4189                 __isl_keep isl_multi_aff *maff1,
4190                 __isl_keep isl_multi_aff *maff2);
4191         isl_bool isl_pw_aff_plain_is_equal(
4192                 __isl_keep isl_pw_aff *pwaff1,
4193                 __isl_keep isl_pw_aff *pwaff2);
4194         isl_bool isl_pw_aff_is_equal(
4195                 __isl_keep isl_pw_aff *pa1,
4196                 __isl_keep isl_pw_aff *pa2);
4197         isl_bool isl_pw_multi_aff_plain_is_equal(
4198                 __isl_keep isl_pw_multi_aff *pma1,
4199                 __isl_keep isl_pw_multi_aff *pma2);
4200         isl_bool isl_pw_multi_aff_is_equal(
4201                 __isl_keep isl_pw_multi_aff *pma1,
4202                 __isl_keep isl_pw_multi_aff *pma2);
4203         isl_bool isl_multi_pw_aff_plain_is_equal(
4204                 __isl_keep isl_multi_pw_aff *mpa1,
4205                 __isl_keep isl_multi_pw_aff *mpa2);
4206         isl_bool isl_multi_pw_aff_is_equal(
4207                 __isl_keep isl_multi_pw_aff *mpa1,
4208                 __isl_keep isl_multi_pw_aff *mpa2);
4209         isl_bool isl_union_pw_aff_plain_is_equal(
4210                 __isl_keep isl_union_pw_aff *upa1,
4211                 __isl_keep isl_union_pw_aff *upa2);
4212         isl_bool isl_union_pw_multi_aff_plain_is_equal(
4213                 __isl_keep isl_union_pw_multi_aff *upma1,
4214                 __isl_keep isl_union_pw_multi_aff *upma2);
4215         isl_bool isl_multi_union_pw_aff_plain_is_equal(
4216                 __isl_keep isl_multi_union_pw_aff *mupa1,
4217                 __isl_keep isl_multi_union_pw_aff *mupa2);
4219         #include <isl/polynomial.h>
4220         isl_bool isl_union_pw_qpolynomial_plain_is_equal(
4221                 __isl_keep isl_union_pw_qpolynomial *upwqp1,
4222                 __isl_keep isl_union_pw_qpolynomial *upwqp2);
4223         isl_bool isl_union_pw_qpolynomial_fold_plain_is_equal(
4224                 __isl_keep isl_union_pw_qpolynomial_fold *upwf1,
4225                 __isl_keep isl_union_pw_qpolynomial_fold *upwf2);
4227 =item * Disjointness
4229         #include <isl/set.h>
4230         isl_bool isl_basic_set_is_disjoint(
4231                 __isl_keep isl_basic_set *bset1,
4232                 __isl_keep isl_basic_set *bset2);
4233         isl_bool isl_set_plain_is_disjoint(
4234                 __isl_keep isl_set *set1,
4235                 __isl_keep isl_set *set2);
4236         isl_bool isl_set_is_disjoint(__isl_keep isl_set *set1,
4237                 __isl_keep isl_set *set2);
4239         #include <isl/map.h>
4240         isl_bool isl_basic_map_is_disjoint(
4241                 __isl_keep isl_basic_map *bmap1,
4242                 __isl_keep isl_basic_map *bmap2);
4243         isl_bool isl_map_is_disjoint(__isl_keep isl_map *map1,
4244                 __isl_keep isl_map *map2);
4246         #include <isl/union_set.h>
4247         isl_bool isl_union_set_is_disjoint(
4248                 __isl_keep isl_union_set *uset1,
4249                 __isl_keep isl_union_set *uset2);
4251         #include <isl/union_map.h>
4252         isl_bool isl_union_map_is_disjoint(
4253                 __isl_keep isl_union_map *umap1,
4254                 __isl_keep isl_union_map *umap2);
4256 =item * Subset
4258         isl_bool isl_basic_set_is_subset(
4259                 __isl_keep isl_basic_set *bset1,
4260                 __isl_keep isl_basic_set *bset2);
4261         isl_bool isl_set_is_subset(__isl_keep isl_set *set1,
4262                 __isl_keep isl_set *set2);
4263         isl_bool isl_set_is_strict_subset(
4264                 __isl_keep isl_set *set1,
4265                 __isl_keep isl_set *set2);
4266         isl_bool isl_union_set_is_subset(
4267                 __isl_keep isl_union_set *uset1,
4268                 __isl_keep isl_union_set *uset2);
4269         isl_bool isl_union_set_is_strict_subset(
4270                 __isl_keep isl_union_set *uset1,
4271                 __isl_keep isl_union_set *uset2);
4272         isl_bool isl_basic_map_is_subset(
4273                 __isl_keep isl_basic_map *bmap1,
4274                 __isl_keep isl_basic_map *bmap2);
4275         isl_bool isl_basic_map_is_strict_subset(
4276                 __isl_keep isl_basic_map *bmap1,
4277                 __isl_keep isl_basic_map *bmap2);
4278         isl_bool isl_map_is_subset(
4279                 __isl_keep isl_map *map1,
4280                 __isl_keep isl_map *map2);
4281         isl_bool isl_map_is_strict_subset(
4282                 __isl_keep isl_map *map1,
4283                 __isl_keep isl_map *map2);
4284         isl_bool isl_union_map_is_subset(
4285                 __isl_keep isl_union_map *umap1,
4286                 __isl_keep isl_union_map *umap2);
4287         isl_bool isl_union_map_is_strict_subset(
4288                 __isl_keep isl_union_map *umap1,
4289                 __isl_keep isl_union_map *umap2);
4291 Check whether the first argument is a (strict) subset of the
4292 second argument.
4294 =item * Order
4296 Every comparison function returns a negative value if the first
4297 argument is considered smaller than the second, a positive value
4298 if the first argument is considered greater and zero if the two
4299 constraints are considered the same by the comparison criterion.
4301         #include <isl/constraint.h>
4302         int isl_constraint_plain_cmp(
4303                 __isl_keep isl_constraint *c1,
4304                 __isl_keep isl_constraint *c2);
4306 This function is useful for sorting C<isl_constraint>s.
4307 The order depends on the internal representation of the inputs.
4308 The order is fixed over different calls to the function (assuming
4309 the internal representation of the inputs has not changed), but may
4310 change over different versions of C<isl>.
4312         #include <isl/constraint.h>
4313         int isl_constraint_cmp_last_non_zero(
4314                 __isl_keep isl_constraint *c1,
4315                 __isl_keep isl_constraint *c2);
4317 This function can be used to sort constraints that live in the same
4318 local space.  Constraints that involve ``earlier'' dimensions or
4319 that have a smaller coefficient for the shared latest dimension
4320 are considered smaller than other constraints.
4321 This function only defines a B<partial> order.
4323         #include <isl/set.h>
4324         int isl_set_plain_cmp(__isl_keep isl_set *set1,
4325                 __isl_keep isl_set *set2);
4327 This function is useful for sorting C<isl_set>s.
4328 The order depends on the internal representation of the inputs.
4329 The order is fixed over different calls to the function (assuming
4330 the internal representation of the inputs has not changed), but may
4331 change over different versions of C<isl>.
4333         #include <isl/aff.h>
4334         int isl_multi_aff_plain_cmp(
4335                 __isl_keep isl_multi_aff *ma1,
4336                 __isl_keep isl_multi_aff *ma2);
4337         int isl_pw_aff_plain_cmp(__isl_keep isl_pw_aff *pa1,
4338                 __isl_keep isl_pw_aff *pa2);
4340 The functions C<isl_multi_aff_plain_cmp> and
4341 C<isl_pw_aff_plain_cmp> can be used to sort C<isl_multi_aff>s and
4342 C<isl_pw_aff>s.  The order is not strictly defined.
4343 The current order sorts expressions that only involve
4344 earlier dimensions before those that involve later dimensions.
4346 =back
4348 =head2 Unary Operations
4350 =over
4352 =item * Complement
4354         __isl_give isl_set *isl_set_complement(
4355                 __isl_take isl_set *set);
4356         __isl_give isl_map *isl_map_complement(
4357                 __isl_take isl_map *map);
4359 =item * Inverse map
4361         #include <isl/space.h>
4362         __isl_give isl_space *isl_space_reverse(
4363                 __isl_take isl_space *space);
4365         #include <isl/map.h>
4366         __isl_give isl_basic_map *isl_basic_map_reverse(
4367                 __isl_take isl_basic_map *bmap);
4368         __isl_give isl_map *isl_map_reverse(
4369                 __isl_take isl_map *map);
4371         #include <isl/union_map.h>
4372         __isl_give isl_union_map *isl_union_map_reverse(
4373                 __isl_take isl_union_map *umap);
4375 =item * Projection
4377         #include <isl/space.h>
4378         __isl_give isl_space *isl_space_domain(
4379                 __isl_take isl_space *space);
4380         __isl_give isl_space *isl_space_range(
4381                 __isl_take isl_space *space);
4382         __isl_give isl_space *isl_space_params(
4383                 __isl_take isl_space *space);
4385         #include <isl/local_space.h>
4386         __isl_give isl_local_space *isl_local_space_domain(
4387                 __isl_take isl_local_space *ls);
4388         __isl_give isl_local_space *isl_local_space_range(
4389                 __isl_take isl_local_space *ls);
4391         #include <isl/set.h>
4392         __isl_give isl_basic_set *isl_basic_set_project_out(
4393                 __isl_take isl_basic_set *bset,
4394                 enum isl_dim_type type, unsigned first, unsigned n);
4395         __isl_give isl_set *isl_set_project_out(__isl_take isl_set *set,
4396                 enum isl_dim_type type, unsigned first, unsigned n);
4397         __isl_give isl_map *isl_set_project_onto_map(
4398                 __isl_take isl_set *set,
4399                 enum isl_dim_type type, unsigned first,
4400                 unsigned n);
4401         __isl_give isl_basic_set *isl_basic_set_params(
4402                 __isl_take isl_basic_set *bset);
4403         __isl_give isl_set *isl_set_params(__isl_take isl_set *set);
4405 The function C<isl_set_project_onto_map> returns a relation
4406 that projects the input set onto the given set dimensions.
4408         #include <isl/map.h>
4409         __isl_give isl_basic_map *isl_basic_map_project_out(
4410                 __isl_take isl_basic_map *bmap,
4411                 enum isl_dim_type type, unsigned first, unsigned n);
4412         __isl_give isl_map *isl_map_project_out(__isl_take isl_map *map,
4413                 enum isl_dim_type type, unsigned first, unsigned n);
4414         __isl_give isl_basic_set *isl_basic_map_domain(
4415                 __isl_take isl_basic_map *bmap);
4416         __isl_give isl_basic_set *isl_basic_map_range(
4417                 __isl_take isl_basic_map *bmap);
4418         __isl_give isl_set *isl_map_params(__isl_take isl_map *map);
4419         __isl_give isl_set *isl_map_domain(
4420                 __isl_take isl_map *bmap);
4421         __isl_give isl_set *isl_map_range(
4422                 __isl_take isl_map *map);
4424         #include <isl/union_set.h>
4425         __isl_give isl_union_set *isl_union_set_project_out(
4426                 __isl_take isl_union_set *uset,
4427                 enum isl_dim_type type,
4428                 unsigned first, unsigned n);
4429         __isl_give isl_set *isl_union_set_params(
4430                 __isl_take isl_union_set *uset);
4432 The function C<isl_union_set_project_out> can only project out
4433 parameters.
4435         #include <isl/union_map.h>
4436         __isl_give isl_union_map *isl_union_map_project_out(
4437                 __isl_take isl_union_map *umap,
4438                 enum isl_dim_type type, unsigned first, unsigned n);
4439         __isl_give isl_set *isl_union_map_params(
4440                 __isl_take isl_union_map *umap);
4441         __isl_give isl_union_set *isl_union_map_domain(
4442                 __isl_take isl_union_map *umap);
4443         __isl_give isl_union_set *isl_union_map_range(
4444                 __isl_take isl_union_map *umap);
4446 The function C<isl_union_map_project_out> can only project out
4447 parameters.
4449         #include <isl/aff.h>
4450         __isl_give isl_aff *isl_aff_project_domain_on_params(
4451                 __isl_take isl_aff *aff);
4452         __isl_give isl_pw_aff *
4453         isl_pw_aff_project_domain_on_params(
4454                 __isl_take isl_pw_aff *pa);
4455         __isl_give isl_pw_multi_aff *
4456         isl_pw_multi_aff_project_domain_on_params(
4457                 __isl_take isl_pw_multi_aff *pma);
4458         __isl_give isl_set *isl_pw_aff_domain(
4459                 __isl_take isl_pw_aff *pwaff);
4460         __isl_give isl_set *isl_pw_multi_aff_domain(
4461                 __isl_take isl_pw_multi_aff *pma);
4462         __isl_give isl_set *isl_multi_pw_aff_domain(
4463                 __isl_take isl_multi_pw_aff *mpa);
4464         __isl_give isl_union_set *isl_union_pw_aff_domain(
4465                 __isl_take isl_union_pw_aff *upa);
4466         __isl_give isl_union_set *isl_union_pw_multi_aff_domain(
4467                 __isl_take isl_union_pw_multi_aff *upma);
4468         __isl_give isl_union_set *
4469         isl_multi_union_pw_aff_domain(
4470                 __isl_take isl_multi_union_pw_aff *mupa);
4471         __isl_give isl_set *isl_pw_aff_params(
4472                 __isl_take isl_pw_aff *pwa);
4474 The function C<isl_multi_union_pw_aff_domain> requires its
4475 input to have at least one set dimension.
4477         #include <isl/polynomial.h>
4478         __isl_give isl_qpolynomial *
4479         isl_qpolynomial_project_domain_on_params(
4480                 __isl_take isl_qpolynomial *qp);
4481         __isl_give isl_pw_qpolynomial *
4482         isl_pw_qpolynomial_project_domain_on_params(
4483                 __isl_take isl_pw_qpolynomial *pwqp);
4484         __isl_give isl_pw_qpolynomial_fold *
4485         isl_pw_qpolynomial_fold_project_domain_on_params(
4486                 __isl_take isl_pw_qpolynomial_fold *pwf);
4487         __isl_give isl_set *isl_pw_qpolynomial_domain(
4488                 __isl_take isl_pw_qpolynomial *pwqp);
4489         __isl_give isl_union_set *isl_union_pw_qpolynomial_fold_domain(
4490                 __isl_take isl_union_pw_qpolynomial_fold *upwf);
4491         __isl_give isl_union_set *isl_union_pw_qpolynomial_domain(
4492                 __isl_take isl_union_pw_qpolynomial *upwqp);
4494         #include <isl/space.h>
4495         __isl_give isl_space *isl_space_domain_map(
4496                 __isl_take isl_space *space);
4497         __isl_give isl_space *isl_space_range_map(
4498                 __isl_take isl_space *space);
4500         #include <isl/map.h>
4501         __isl_give isl_map *isl_set_wrapped_domain_map(
4502                 __isl_take isl_set *set);
4503         __isl_give isl_basic_map *isl_basic_map_domain_map(
4504                 __isl_take isl_basic_map *bmap);
4505         __isl_give isl_basic_map *isl_basic_map_range_map(
4506                 __isl_take isl_basic_map *bmap);
4507         __isl_give isl_map *isl_map_domain_map(__isl_take isl_map *map);
4508         __isl_give isl_map *isl_map_range_map(__isl_take isl_map *map);
4510         #include <isl/union_map.h>
4511         __isl_give isl_union_map *isl_union_map_domain_map(
4512                 __isl_take isl_union_map *umap);
4513         __isl_give isl_union_pw_multi_aff *
4514         isl_union_map_domain_map_union_pw_multi_aff(
4515                 __isl_take isl_union_map *umap);
4516         __isl_give isl_union_map *isl_union_map_range_map(
4517                 __isl_take isl_union_map *umap);
4518         __isl_give isl_union_map *
4519         isl_union_set_wrapped_domain_map(
4520                 __isl_take isl_union_set *uset);
4522 The functions above construct a (basic, regular or union) relation
4523 that maps (a wrapped version of) the input relation to its domain or range.
4524 C<isl_set_wrapped_domain_map> maps the input set to the domain
4525 of its wrapped relation.
4527 =item * Elimination
4529         __isl_give isl_basic_set *isl_basic_set_eliminate(
4530                 __isl_take isl_basic_set *bset,
4531                 enum isl_dim_type type,
4532                 unsigned first, unsigned n);
4533         __isl_give isl_set *isl_set_eliminate(
4534                 __isl_take isl_set *set, enum isl_dim_type type,
4535                 unsigned first, unsigned n);
4536         __isl_give isl_basic_map *isl_basic_map_eliminate(
4537                 __isl_take isl_basic_map *bmap,
4538                 enum isl_dim_type type,
4539                 unsigned first, unsigned n);
4540         __isl_give isl_map *isl_map_eliminate(
4541                 __isl_take isl_map *map, enum isl_dim_type type,
4542                 unsigned first, unsigned n);
4544 Eliminate the coefficients for the given dimensions from the constraints,
4545 without removing the dimensions.
4547 =item * Constructing a set from a parameter domain
4549 A zero-dimensional space or (basic) set can be constructed
4550 on a given parameter domain using the following functions.
4552         #include <isl/space.h>
4553         __isl_give isl_space *isl_space_set_from_params(
4554                 __isl_take isl_space *space);
4556         #include <isl/set.h>
4557         __isl_give isl_basic_set *isl_basic_set_from_params(
4558                 __isl_take isl_basic_set *bset);
4559         __isl_give isl_set *isl_set_from_params(
4560                 __isl_take isl_set *set);
4562 =item * Constructing a relation from one or two sets
4564 Create a relation with the given set(s) as domain and/or range.
4565 If only the domain or the range is specified, then
4566 the range or domain of the created relation is a zero-dimensional
4567 flat anonymous space.
4569         #include <isl/space.h>
4570         __isl_give isl_space *isl_space_from_domain(
4571                 __isl_take isl_space *space);
4572         __isl_give isl_space *isl_space_from_range(
4573                 __isl_take isl_space *space);
4574         __isl_give isl_space *isl_space_map_from_set(
4575                 __isl_take isl_space *space);
4576         __isl_give isl_space *isl_space_map_from_domain_and_range(
4577                 __isl_take isl_space *domain,
4578                 __isl_take isl_space *range);
4580         #include <isl/local_space.h>
4581         __isl_give isl_local_space *isl_local_space_from_domain(
4582                 __isl_take isl_local_space *ls);
4584         #include <isl/map.h>
4585         __isl_give isl_map *isl_map_from_domain(
4586                 __isl_take isl_set *set);
4587         __isl_give isl_map *isl_map_from_range(
4588                 __isl_take isl_set *set);
4590         #include <isl/union_map.h>
4591         __isl_give isl_union_map *
4592         isl_union_map_from_domain_and_range(
4593                 __isl_take isl_union_set *domain,
4594                 __isl_take isl_union_set *range);
4596         #include <isl/val.h>
4597         __isl_give isl_multi_val *isl_multi_val_from_range(
4598                 __isl_take isl_multi_val *mv);
4600         #include <isl/aff.h>
4601         __isl_give isl_multi_aff *isl_multi_aff_from_range(
4602                 __isl_take isl_multi_aff *ma);
4603         __isl_give isl_pw_aff *isl_pw_aff_from_range(
4604                 __isl_take isl_pw_aff *pwa);
4605         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_range(
4606                 __isl_take isl_multi_pw_aff *mpa);
4607         __isl_give isl_multi_union_pw_aff *
4608         isl_multi_union_pw_aff_from_range(
4609                 __isl_take isl_multi_union_pw_aff *mupa);
4610         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_domain(
4611                 __isl_take isl_set *set);
4612         __isl_give isl_union_pw_multi_aff *
4613         isl_union_pw_multi_aff_from_domain(
4614                 __isl_take isl_union_set *uset);
4616         #include <isl/polynomial.h>
4617         __isl_give isl_pw_qpolynomial *
4618         isl_pw_qpolynomial_from_range(
4619                 __isl_take isl_pw_qpolynomial *pwqp);
4620         __isl_give isl_pw_qpolynomial_fold *
4621         isl_pw_qpolynomial_fold_from_range(
4622                 __isl_take isl_pw_qpolynomial_fold *pwf);
4624 =item * Slicing
4626         #include <isl/set.h>
4627         __isl_give isl_basic_set *isl_basic_set_fix_si(
4628                 __isl_take isl_basic_set *bset,
4629                 enum isl_dim_type type, unsigned pos, int value);
4630         __isl_give isl_basic_set *isl_basic_set_fix_val(
4631                 __isl_take isl_basic_set *bset,
4632                 enum isl_dim_type type, unsigned pos,
4633                 __isl_take isl_val *v);
4634         __isl_give isl_set *isl_set_fix_si(__isl_take isl_set *set,
4635                 enum isl_dim_type type, unsigned pos, int value);
4636         __isl_give isl_set *isl_set_fix_val(
4637                 __isl_take isl_set *set,
4638                 enum isl_dim_type type, unsigned pos,
4639                 __isl_take isl_val *v);
4641         #include <isl/map.h>
4642         __isl_give isl_basic_map *isl_basic_map_fix_si(
4643                 __isl_take isl_basic_map *bmap,
4644                 enum isl_dim_type type, unsigned pos, int value);
4645         __isl_give isl_basic_map *isl_basic_map_fix_val(
4646                 __isl_take isl_basic_map *bmap,
4647                 enum isl_dim_type type, unsigned pos,
4648                 __isl_take isl_val *v);
4649         __isl_give isl_map *isl_map_fix_si(__isl_take isl_map *map,
4650                 enum isl_dim_type type, unsigned pos, int value);
4651         __isl_give isl_map *isl_map_fix_val(
4652                 __isl_take isl_map *map,
4653                 enum isl_dim_type type, unsigned pos,
4654                 __isl_take isl_val *v);
4656         #include <isl/aff.h>
4657         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_fix_si(
4658                 __isl_take isl_pw_multi_aff *pma,
4659                 enum isl_dim_type type, unsigned pos, int value);
4661         #include <isl/polynomial.h>
4662         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_fix_val(
4663                 __isl_take isl_pw_qpolynomial *pwqp,
4664                 enum isl_dim_type type, unsigned n,
4665                 __isl_take isl_val *v);
4667 Intersect the set, relation or function domain
4668 with the hyperplane where the given
4669 dimension has the fixed given value.
4671         #include <isl/set.h>
4672         __isl_give isl_basic_set *
4673         isl_basic_set_lower_bound_val(
4674                 __isl_take isl_basic_set *bset,
4675                 enum isl_dim_type type, unsigned pos,
4676                 __isl_take isl_val *value);
4677         __isl_give isl_basic_set *
4678         isl_basic_set_upper_bound_val(
4679                 __isl_take isl_basic_set *bset,
4680                 enum isl_dim_type type, unsigned pos,
4681                 __isl_take isl_val *value);
4682         __isl_give isl_set *isl_set_lower_bound_si(
4683                 __isl_take isl_set *set,
4684                 enum isl_dim_type type, unsigned pos, int value);
4685         __isl_give isl_set *isl_set_lower_bound_val(
4686                 __isl_take isl_set *set,
4687                 enum isl_dim_type type, unsigned pos,
4688                 __isl_take isl_val *value);
4689         __isl_give isl_set *isl_set_upper_bound_si(
4690                 __isl_take isl_set *set,
4691                 enum isl_dim_type type, unsigned pos, int value);
4692         __isl_give isl_set *isl_set_upper_bound_val(
4693                 __isl_take isl_set *set,
4694                 enum isl_dim_type type, unsigned pos,
4695                 __isl_take isl_val *value);
4697         #include <isl/map.h>
4698         __isl_give isl_basic_map *isl_basic_map_lower_bound_si(
4699                 __isl_take isl_basic_map *bmap,
4700                 enum isl_dim_type type, unsigned pos, int value);
4701         __isl_give isl_basic_map *isl_basic_map_upper_bound_si(
4702                 __isl_take isl_basic_map *bmap,
4703                 enum isl_dim_type type, unsigned pos, int value);
4704         __isl_give isl_map *isl_map_lower_bound_si(
4705                 __isl_take isl_map *map,
4706                 enum isl_dim_type type, unsigned pos, int value);
4707         __isl_give isl_map *isl_map_upper_bound_si(
4708                 __isl_take isl_map *map,
4709                 enum isl_dim_type type, unsigned pos, int value);
4711 Intersect the set or relation with the half-space where the given
4712 dimension has a value bounded by the fixed given integer value.
4714         __isl_give isl_set *isl_set_equate(__isl_take isl_set *set,
4715                 enum isl_dim_type type1, int pos1,
4716                 enum isl_dim_type type2, int pos2);
4717         __isl_give isl_basic_map *isl_basic_map_equate(
4718                 __isl_take isl_basic_map *bmap,
4719                 enum isl_dim_type type1, int pos1,
4720                 enum isl_dim_type type2, int pos2);
4721         __isl_give isl_map *isl_map_equate(__isl_take isl_map *map,
4722                 enum isl_dim_type type1, int pos1,
4723                 enum isl_dim_type type2, int pos2);
4725 Intersect the set or relation with the hyperplane where the given
4726 dimensions are equal to each other.
4728         __isl_give isl_map *isl_map_oppose(__isl_take isl_map *map,
4729                 enum isl_dim_type type1, int pos1,
4730                 enum isl_dim_type type2, int pos2);
4732 Intersect the relation with the hyperplane where the given
4733 dimensions have opposite values.
4735         __isl_give isl_map *isl_map_order_le(
4736                 __isl_take isl_map *map,
4737                 enum isl_dim_type type1, int pos1,
4738                 enum isl_dim_type type2, int pos2);
4739         __isl_give isl_basic_map *isl_basic_map_order_ge(
4740                 __isl_take isl_basic_map *bmap,
4741                 enum isl_dim_type type1, int pos1,
4742                 enum isl_dim_type type2, int pos2);
4743         __isl_give isl_map *isl_map_order_ge(
4744                 __isl_take isl_map *map,
4745                 enum isl_dim_type type1, int pos1,
4746                 enum isl_dim_type type2, int pos2);
4747         __isl_give isl_map *isl_map_order_lt(__isl_take isl_map *map,
4748                 enum isl_dim_type type1, int pos1,
4749                 enum isl_dim_type type2, int pos2);
4750         __isl_give isl_basic_map *isl_basic_map_order_gt(
4751                 __isl_take isl_basic_map *bmap,
4752                 enum isl_dim_type type1, int pos1,
4753                 enum isl_dim_type type2, int pos2);
4754         __isl_give isl_map *isl_map_order_gt(__isl_take isl_map *map,
4755                 enum isl_dim_type type1, int pos1,
4756                 enum isl_dim_type type2, int pos2);
4758 Intersect the relation with the half-space where the given
4759 dimensions satisfy the given ordering.
4761 =item * Locus
4763         #include <isl/aff.h>
4764         __isl_give isl_basic_set *isl_aff_zero_basic_set(
4765                 __isl_take isl_aff *aff);
4766         __isl_give isl_basic_set *isl_aff_neg_basic_set(
4767                 __isl_take isl_aff *aff);
4768         __isl_give isl_set *isl_pw_aff_pos_set(
4769                 __isl_take isl_pw_aff *pa);
4770         __isl_give isl_set *isl_pw_aff_nonneg_set(
4771                 __isl_take isl_pw_aff *pwaff);
4772         __isl_give isl_set *isl_pw_aff_zero_set(
4773                 __isl_take isl_pw_aff *pwaff);
4774         __isl_give isl_set *isl_pw_aff_non_zero_set(
4775                 __isl_take isl_pw_aff *pwaff);
4776         __isl_give isl_union_set *
4777         isl_union_pw_aff_zero_union_set(
4778                 __isl_take isl_union_pw_aff *upa);
4779         __isl_give isl_union_set *
4780         isl_multi_union_pw_aff_zero_union_set(
4781                 __isl_take isl_multi_union_pw_aff *mupa);
4783 The function C<isl_aff_neg_basic_set> returns a basic set
4784 containing those elements in the domain space
4785 of C<aff> where C<aff> is negative.
4786 The function C<isl_pw_aff_nonneg_set> returns a set
4787 containing those elements in the domain
4788 of C<pwaff> where C<pwaff> is non-negative.
4789 The function C<isl_multi_union_pw_aff_zero_union_set>
4790 returns a union set containing those elements
4791 in the domains of its elements where they are all zero.
4793 =item * Identity
4795         __isl_give isl_map *isl_set_identity(
4796                 __isl_take isl_set *set);
4797         __isl_give isl_union_map *isl_union_set_identity(
4798                 __isl_take isl_union_set *uset);
4799         __isl_give isl_union_pw_multi_aff *
4800         isl_union_set_identity_union_pw_multi_aff(
4801                 __isl_take isl_union_set *uset);
4803 Construct an identity relation on the given (union) set.
4805 =item * Function Extraction
4807 A piecewise quasi affine expression that is equal to 1 on a set
4808 and 0 outside the set can be created using the following function.
4810         #include <isl/aff.h>
4811         __isl_give isl_pw_aff *isl_set_indicator_function(
4812                 __isl_take isl_set *set);
4814 A piecewise multiple quasi affine expression can be extracted
4815 from an C<isl_set> or C<isl_map>, provided the C<isl_set> is a singleton
4816 and the C<isl_map> is single-valued.
4817 In case of a conversion from an C<isl_union_map>
4818 to an C<isl_union_pw_multi_aff>, these properties need to hold
4819 in each domain space.
4820 A conversion to a C<isl_multi_union_pw_aff> additionally
4821 requires that the input is non-empty and involves only a single
4822 range space.
4824         #include <isl/aff.h>
4825         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_set(
4826                 __isl_take isl_set *set);
4827         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_map(
4828                 __isl_take isl_map *map);
4830         __isl_give isl_union_pw_multi_aff *
4831         isl_union_pw_multi_aff_from_union_set(
4832                 __isl_take isl_union_set *uset);
4833         __isl_give isl_union_pw_multi_aff *
4834         isl_union_pw_multi_aff_from_union_map(
4835                 __isl_take isl_union_map *umap);
4837         __isl_give isl_multi_union_pw_aff *
4838         isl_multi_union_pw_aff_from_union_map(
4839                 __isl_take isl_union_map *umap);
4841 =item * Deltas
4843         __isl_give isl_basic_set *isl_basic_map_deltas(
4844                 __isl_take isl_basic_map *bmap);
4845         __isl_give isl_set *isl_map_deltas(__isl_take isl_map *map);
4846         __isl_give isl_union_set *isl_union_map_deltas(
4847                 __isl_take isl_union_map *umap);
4849 These functions return a (basic) set containing the differences
4850 between image elements and corresponding domain elements in the input.
4852         __isl_give isl_basic_map *isl_basic_map_deltas_map(
4853                 __isl_take isl_basic_map *bmap);
4854         __isl_give isl_map *isl_map_deltas_map(
4855                 __isl_take isl_map *map);
4856         __isl_give isl_union_map *isl_union_map_deltas_map(
4857                 __isl_take isl_union_map *umap);
4859 The functions above construct a (basic, regular or union) relation
4860 that maps (a wrapped version of) the input relation to its delta set.
4862 =item * Coalescing
4864 Simplify the representation of a set, relation or functions by trying
4865 to combine pairs of basic sets or relations into a single
4866 basic set or relation.
4868         #include <isl/set.h>
4869         __isl_give isl_set *isl_set_coalesce(__isl_take isl_set *set);
4871         #include <isl/map.h>
4872         __isl_give isl_map *isl_map_coalesce(__isl_take isl_map *map);
4874         #include <isl/union_set.h>
4875         __isl_give isl_union_set *isl_union_set_coalesce(
4876                 __isl_take isl_union_set *uset);
4878         #include <isl/union_map.h>
4879         __isl_give isl_union_map *isl_union_map_coalesce(
4880                 __isl_take isl_union_map *umap);
4882         #include <isl/aff.h>
4883         __isl_give isl_pw_aff *isl_pw_aff_coalesce(
4884                 __isl_take isl_pw_aff *pwqp);
4885         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_coalesce(
4886                 __isl_take isl_pw_multi_aff *pma);
4887         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_coalesce(
4888                 __isl_take isl_multi_pw_aff *mpa);
4889         __isl_give isl_union_pw_aff *isl_union_pw_aff_coalesce(
4890                 __isl_take isl_union_pw_aff *upa);
4891         __isl_give isl_union_pw_multi_aff *
4892         isl_union_pw_multi_aff_coalesce(
4893                 __isl_take isl_union_pw_multi_aff *upma);
4894         __isl_give isl_multi_union_pw_aff *
4895         isl_multi_union_pw_aff_coalesce(
4896                 __isl_take isl_multi_union_pw_aff *aff);
4898         #include <isl/polynomial.h>
4899         __isl_give isl_pw_qpolynomial_fold *
4900         isl_pw_qpolynomial_fold_coalesce(
4901                 __isl_take isl_pw_qpolynomial_fold *pwf);
4902         __isl_give isl_union_pw_qpolynomial *
4903         isl_union_pw_qpolynomial_coalesce(
4904                 __isl_take isl_union_pw_qpolynomial *upwqp);
4905         __isl_give isl_union_pw_qpolynomial_fold *
4906         isl_union_pw_qpolynomial_fold_coalesce(
4907                 __isl_take isl_union_pw_qpolynomial_fold *upwf);
4909 One of the methods for combining pairs of basic sets or relations
4910 can result in coefficients that are much larger than those that appear
4911 in the constraints of the input.  By default, the coefficients are
4912 not allowed to grow larger, but this can be changed by unsetting
4913 the following option.
4915         isl_stat isl_options_set_coalesce_bounded_wrapping(
4916                 isl_ctx *ctx, int val);
4917         int isl_options_get_coalesce_bounded_wrapping(
4918                 isl_ctx *ctx);
4920 =item * Detecting equalities
4922         __isl_give isl_basic_set *isl_basic_set_detect_equalities(
4923                 __isl_take isl_basic_set *bset);
4924         __isl_give isl_basic_map *isl_basic_map_detect_equalities(
4925                 __isl_take isl_basic_map *bmap);
4926         __isl_give isl_set *isl_set_detect_equalities(
4927                 __isl_take isl_set *set);
4928         __isl_give isl_map *isl_map_detect_equalities(
4929                 __isl_take isl_map *map);
4930         __isl_give isl_union_set *isl_union_set_detect_equalities(
4931                 __isl_take isl_union_set *uset);
4932         __isl_give isl_union_map *isl_union_map_detect_equalities(
4933                 __isl_take isl_union_map *umap);
4935 Simplify the representation of a set or relation by detecting implicit
4936 equalities.
4938 =item * Removing redundant constraints
4940         #include <isl/set.h>
4941         __isl_give isl_basic_set *isl_basic_set_remove_redundancies(
4942                 __isl_take isl_basic_set *bset);
4943         __isl_give isl_set *isl_set_remove_redundancies(
4944                 __isl_take isl_set *set);
4946         #include <isl/union_set.h>
4947         __isl_give isl_union_set *
4948         isl_union_set_remove_redundancies(
4949                 __isl_take isl_union_set *uset);
4951         #include <isl/map.h>
4952         __isl_give isl_basic_map *isl_basic_map_remove_redundancies(
4953                 __isl_take isl_basic_map *bmap);
4954         __isl_give isl_map *isl_map_remove_redundancies(
4955                 __isl_take isl_map *map);
4957         #include <isl/union_map.h>
4958         __isl_give isl_union_map *
4959         isl_union_map_remove_redundancies(
4960                 __isl_take isl_union_map *umap);
4962 =item * Convex hull
4964         __isl_give isl_basic_set *isl_set_convex_hull(
4965                 __isl_take isl_set *set);
4966         __isl_give isl_basic_map *isl_map_convex_hull(
4967                 __isl_take isl_map *map);
4969 If the input set or relation has any existentially quantified
4970 variables, then the result of these operations is currently undefined.
4972 =item * Simple hull
4974         #include <isl/set.h>
4975         __isl_give isl_basic_set *
4976         isl_set_unshifted_simple_hull(
4977                 __isl_take isl_set *set);
4978         __isl_give isl_basic_set *isl_set_simple_hull(
4979                 __isl_take isl_set *set);
4980         __isl_give isl_basic_set *
4981         isl_set_plain_unshifted_simple_hull(
4982                 __isl_take isl_set *set);
4983         __isl_give isl_basic_set *
4984         isl_set_unshifted_simple_hull_from_set_list(
4985                 __isl_take isl_set *set,
4986                 __isl_take isl_set_list *list);
4988         #include <isl/map.h>
4989         __isl_give isl_basic_map *
4990         isl_map_unshifted_simple_hull(
4991                 __isl_take isl_map *map);
4992         __isl_give isl_basic_map *isl_map_simple_hull(
4993                 __isl_take isl_map *map);
4994         __isl_give isl_basic_map *
4995         isl_map_plain_unshifted_simple_hull(
4996                 __isl_take isl_map *map);
4997                 __isl_give isl_basic_map *
4998         isl_map_unshifted_simple_hull_from_map_list(
4999                 __isl_take isl_map *map,
5000                 __isl_take isl_map_list *list);
5002         #include <isl/union_map.h>
5003         __isl_give isl_union_map *isl_union_map_simple_hull(
5004                 __isl_take isl_union_map *umap);
5006 These functions compute a single basic set or relation
5007 that contains the whole input set or relation.
5008 In particular, the output is described by translates
5009 of the constraints describing the basic sets or relations in the input.
5010 In case of C<isl_set_unshifted_simple_hull>, only the original
5011 constraints are used, without any translation.
5012 In case of C<isl_set_plain_unshifted_simple_hull> and
5013 C<isl_map_plain_unshifted_simple_hull>, the result is described
5014 by original constraints that are obviously satisfied
5015 by the entire input set or relation.
5016 In case of C<isl_set_unshifted_simple_hull_from_set_list> and
5017 C<isl_map_unshifted_simple_hull_from_map_list>, the
5018 constraints are taken from the elements of the second argument.
5020 =begin latex
5022 (See \autoref{s:simple hull}.)
5024 =end latex
5026 =item * Affine hull
5028         __isl_give isl_basic_set *isl_basic_set_affine_hull(
5029                 __isl_take isl_basic_set *bset);
5030         __isl_give isl_basic_set *isl_set_affine_hull(
5031                 __isl_take isl_set *set);
5032         __isl_give isl_union_set *isl_union_set_affine_hull(
5033                 __isl_take isl_union_set *uset);
5034         __isl_give isl_basic_map *isl_basic_map_affine_hull(
5035                 __isl_take isl_basic_map *bmap);
5036         __isl_give isl_basic_map *isl_map_affine_hull(
5037                 __isl_take isl_map *map);
5038         __isl_give isl_union_map *isl_union_map_affine_hull(
5039                 __isl_take isl_union_map *umap);
5041 In case of union sets and relations, the affine hull is computed
5042 per space.
5044 =item * Polyhedral hull
5046         __isl_give isl_basic_set *isl_set_polyhedral_hull(
5047                 __isl_take isl_set *set);
5048         __isl_give isl_basic_map *isl_map_polyhedral_hull(
5049                 __isl_take isl_map *map);
5050         __isl_give isl_union_set *isl_union_set_polyhedral_hull(
5051                 __isl_take isl_union_set *uset);
5052         __isl_give isl_union_map *isl_union_map_polyhedral_hull(
5053                 __isl_take isl_union_map *umap);
5055 These functions compute a single basic set or relation
5056 not involving any existentially quantified variables
5057 that contains the whole input set or relation.
5058 In case of union sets and relations, the polyhedral hull is computed
5059 per space.
5061 =item * Other approximations
5063         #include <isl/set.h>
5064         __isl_give isl_basic_set *
5065         isl_basic_set_drop_constraints_involving_dims(
5066                 __isl_take isl_basic_set *bset,
5067                 enum isl_dim_type type,
5068                 unsigned first, unsigned n);
5069         __isl_give isl_basic_set *
5070         isl_basic_set_drop_constraints_not_involving_dims(
5071                 __isl_take isl_basic_set *bset,
5072                 enum isl_dim_type type,
5073                 unsigned first, unsigned n);
5074         __isl_give isl_set *
5075         isl_set_drop_constraints_involving_dims(
5076                 __isl_take isl_set *set,
5077                 enum isl_dim_type type,
5078                 unsigned first, unsigned n);
5079         __isl_give isl_set *
5080         isl_set_drop_constraints_not_involving_dims(
5081                 __isl_take isl_set *set,
5082                 enum isl_dim_type type,
5083                 unsigned first, unsigned n);
5085         #include <isl/map.h>
5086         __isl_give isl_basic_map *
5087         isl_basic_map_drop_constraints_involving_dims(
5088                 __isl_take isl_basic_map *bmap,
5089                 enum isl_dim_type type,
5090                 unsigned first, unsigned n);
5091         __isl_give isl_basic_map *
5092         isl_basic_map_drop_constraints_not_involving_dims(
5093                 __isl_take isl_basic_map *bmap,
5094                 enum isl_dim_type type,
5095                 unsigned first, unsigned n);
5096         __isl_give isl_map *
5097         isl_map_drop_constraints_involving_dims(
5098                 __isl_take isl_map *map,
5099                 enum isl_dim_type type,
5100                 unsigned first, unsigned n);
5101         __isl_give isl_map *
5102         isl_map_drop_constraints_not_involving_dims(
5103                 __isl_take isl_map *map,
5104                 enum isl_dim_type type,
5105                 unsigned first, unsigned n);
5107 These functions drop any constraints (not) involving the specified dimensions.
5108 Note that the result depends on the representation of the input.
5110         #include <isl/polynomial.h>
5111         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_to_polynomial(
5112                 __isl_take isl_pw_qpolynomial *pwqp, int sign);
5113         __isl_give isl_union_pw_qpolynomial *
5114         isl_union_pw_qpolynomial_to_polynomial(
5115                 __isl_take isl_union_pw_qpolynomial *upwqp, int sign);
5117 Approximate each quasipolynomial by a polynomial.  If C<sign> is positive,
5118 the polynomial will be an overapproximation.  If C<sign> is negative,
5119 it will be an underapproximation.  If C<sign> is zero, the approximation
5120 will lie somewhere in between.
5122 =item * Feasibility
5124         __isl_give isl_basic_set *isl_basic_set_sample(
5125                 __isl_take isl_basic_set *bset);
5126         __isl_give isl_basic_set *isl_set_sample(
5127                 __isl_take isl_set *set);
5128         __isl_give isl_basic_map *isl_basic_map_sample(
5129                 __isl_take isl_basic_map *bmap);
5130         __isl_give isl_basic_map *isl_map_sample(
5131                 __isl_take isl_map *map);
5133 If the input (basic) set or relation is non-empty, then return
5134 a singleton subset of the input.  Otherwise, return an empty set.
5136 =item * Optimization
5138         #include <isl/ilp.h>
5139         __isl_give isl_val *isl_basic_set_max_val(
5140                 __isl_keep isl_basic_set *bset,
5141                 __isl_keep isl_aff *obj);
5142         __isl_give isl_val *isl_set_min_val(
5143                 __isl_keep isl_set *set,
5144                 __isl_keep isl_aff *obj);
5145         __isl_give isl_val *isl_set_max_val(
5146                 __isl_keep isl_set *set,
5147                 __isl_keep isl_aff *obj);
5148         __isl_give isl_multi_val *
5149         isl_union_set_min_multi_union_pw_aff(
5150                 __isl_keep isl_union_set *set,
5151                 __isl_keep isl_multi_union_pw_aff *obj);
5153 Compute the minimum or maximum of the integer affine expression C<obj>
5154 over the points in C<set>, returning the result in C<opt>.
5155 The result is C<NULL> in case of an error, the optimal value in case
5156 there is one, negative infinity or infinity if the problem is unbounded and
5157 NaN if the problem is empty.
5159 =item * Parametric optimization
5161         __isl_give isl_pw_aff *isl_set_dim_min(
5162                 __isl_take isl_set *set, int pos);
5163         __isl_give isl_pw_aff *isl_set_dim_max(
5164                 __isl_take isl_set *set, int pos);
5165         __isl_give isl_pw_aff *isl_map_dim_min(
5166                 __isl_take isl_map *map, int pos);
5167         __isl_give isl_pw_aff *isl_map_dim_max(
5168                 __isl_take isl_map *map, int pos);
5170 Compute the minimum or maximum of the given set or output dimension
5171 as a function of the parameters (and input dimensions), but independently
5172 of the other set or output dimensions.
5173 For lexicographic optimization, see L<"Lexicographic Optimization">.
5175 =item * Dual
5177 The following functions compute either the set of (rational) coefficient
5178 values of valid constraints for the given set or the set of (rational)
5179 values satisfying the constraints with coefficients from the given set.
5180 Internally, these two sets of functions perform essentially the
5181 same operations, except that the set of coefficients is assumed to
5182 be a cone, while the set of values may be any polyhedron.
5183 The current implementation is based on the Farkas lemma and
5184 Fourier-Motzkin elimination, but this may change or be made optional
5185 in future.  In particular, future implementations may use different
5186 dualization algorithms or skip the elimination step.
5188         #include <isl/set.h>
5189         __isl_give isl_basic_set *isl_basic_set_coefficients(
5190                 __isl_take isl_basic_set *bset);
5191         __isl_give isl_basic_set_list *
5192         isl_basic_set_list_coefficients(
5193                 __isl_take isl_basic_set_list *list);
5194         __isl_give isl_basic_set *isl_set_coefficients(
5195                 __isl_take isl_set *set);
5196         __isl_give isl_union_set *isl_union_set_coefficients(
5197                 __isl_take isl_union_set *bset);
5198         __isl_give isl_basic_set *isl_basic_set_solutions(
5199                 __isl_take isl_basic_set *bset);
5200         __isl_give isl_basic_set *isl_set_solutions(
5201                 __isl_take isl_set *set);
5202         __isl_give isl_union_set *isl_union_set_solutions(
5203                 __isl_take isl_union_set *bset);
5205 =item * Power
5207         __isl_give isl_map *isl_map_fixed_power_val(
5208                 __isl_take isl_map *map,
5209                 __isl_take isl_val *exp);
5210         __isl_give isl_union_map *
5211         isl_union_map_fixed_power_val(
5212                 __isl_take isl_union_map *umap,
5213                 __isl_take isl_val *exp);
5215 Compute the given power of C<map>, where C<exp> is assumed to be non-zero.
5216 If the exponent C<exp> is negative, then the -C<exp> th power of the inverse
5217 of C<map> is computed.
5219         __isl_give isl_map *isl_map_power(__isl_take isl_map *map,
5220                 int *exact);
5221         __isl_give isl_union_map *isl_union_map_power(
5222                 __isl_take isl_union_map *umap, int *exact);
5224 Compute a parametric representation for all positive powers I<k> of C<map>.
5225 The result maps I<k> to a nested relation corresponding to the
5226 I<k>th power of C<map>.
5227 The result may be an overapproximation.  If the result is known to be exact,
5228 then C<*exact> is set to C<1>.
5230 =item * Transitive closure
5232         __isl_give isl_map *isl_map_transitive_closure(
5233                 __isl_take isl_map *map, int *exact);
5234         __isl_give isl_union_map *isl_union_map_transitive_closure(
5235                 __isl_take isl_union_map *umap, int *exact);
5237 Compute the transitive closure of C<map>.
5238 The result may be an overapproximation.  If the result is known to be exact,
5239 then C<*exact> is set to C<1>.
5241 =item * Reaching path lengths
5243         __isl_give isl_map *isl_map_reaching_path_lengths(
5244                 __isl_take isl_map *map, int *exact);
5246 Compute a relation that maps each element in the range of C<map>
5247 to the lengths of all paths composed of edges in C<map> that
5248 end up in the given element.
5249 The result may be an overapproximation.  If the result is known to be exact,
5250 then C<*exact> is set to C<1>.
5251 To compute the I<maximal> path length, the resulting relation
5252 should be postprocessed by C<isl_map_lexmax>.
5253 In particular, if the input relation is a dependence relation
5254 (mapping sources to sinks), then the maximal path length corresponds
5255 to the free schedule.
5256 Note, however, that C<isl_map_lexmax> expects the maximum to be
5257 finite, so if the path lengths are unbounded (possibly due to
5258 the overapproximation), then you will get an error message.
5260 =item * Wrapping
5262         #include <isl/space.h>
5263         __isl_give isl_space *isl_space_wrap(
5264                 __isl_take isl_space *space);
5265         __isl_give isl_space *isl_space_unwrap(
5266                 __isl_take isl_space *space);
5268         #include <isl/local_space.h>
5269         __isl_give isl_local_space *isl_local_space_wrap(
5270                 __isl_take isl_local_space *ls);
5272         #include <isl/set.h>
5273         __isl_give isl_basic_map *isl_basic_set_unwrap(
5274                 __isl_take isl_basic_set *bset);
5275         __isl_give isl_map *isl_set_unwrap(
5276                 __isl_take isl_set *set);
5278         #include <isl/map.h>
5279         __isl_give isl_basic_set *isl_basic_map_wrap(
5280                 __isl_take isl_basic_map *bmap);
5281         __isl_give isl_set *isl_map_wrap(
5282                 __isl_take isl_map *map);
5284         #include <isl/union_set.h>
5285         __isl_give isl_union_map *isl_union_set_unwrap(
5286                 __isl_take isl_union_set *uset);
5288         #include <isl/union_map.h>
5289         __isl_give isl_union_set *isl_union_map_wrap(
5290                 __isl_take isl_union_map *umap);
5292 The input to C<isl_space_unwrap> should
5293 be the space of a set, while that of
5294 C<isl_space_wrap> should be the space of a relation.
5295 Conversely, the output of C<isl_space_unwrap> is the space
5296 of a relation, while that of C<isl_space_wrap> is the space of a set.
5298 =item * Flattening
5300 Remove any internal structure of domain (and range) of the given
5301 set or relation.  If there is any such internal structure in the input,
5302 then the name of the space is also removed.
5304         #include <isl/local_space.h>
5305         __isl_give isl_local_space *
5306         isl_local_space_flatten_domain(
5307                 __isl_take isl_local_space *ls);
5308         __isl_give isl_local_space *
5309         isl_local_space_flatten_range(
5310                 __isl_take isl_local_space *ls);
5312         #include <isl/set.h>
5313         __isl_give isl_basic_set *isl_basic_set_flatten(
5314                 __isl_take isl_basic_set *bset);
5315         __isl_give isl_set *isl_set_flatten(
5316                 __isl_take isl_set *set);
5318         #include <isl/map.h>
5319         __isl_give isl_basic_map *isl_basic_map_flatten_domain(
5320                 __isl_take isl_basic_map *bmap);
5321         __isl_give isl_basic_map *isl_basic_map_flatten_range(
5322                 __isl_take isl_basic_map *bmap);
5323         __isl_give isl_map *isl_map_flatten_range(
5324                 __isl_take isl_map *map);
5325         __isl_give isl_map *isl_map_flatten_domain(
5326                 __isl_take isl_map *map);
5327         __isl_give isl_basic_map *isl_basic_map_flatten(
5328                 __isl_take isl_basic_map *bmap);
5329         __isl_give isl_map *isl_map_flatten(
5330                 __isl_take isl_map *map);
5332         #include <isl/val.h>
5333         __isl_give isl_multi_val *isl_multi_val_flatten_range(
5334                 __isl_take isl_multi_val *mv);
5336         #include <isl/aff.h>
5337         __isl_give isl_multi_aff *isl_multi_aff_flatten_domain(
5338                 __isl_take isl_multi_aff *ma);
5339         __isl_give isl_multi_aff *isl_multi_aff_flatten_range(
5340                 __isl_take isl_multi_aff *ma);
5341         __isl_give isl_multi_pw_aff *
5342         isl_multi_pw_aff_flatten_range(
5343                 __isl_take isl_multi_pw_aff *mpa);
5344         __isl_give isl_multi_union_pw_aff *
5345         isl_multi_union_pw_aff_flatten_range(
5346                 __isl_take isl_multi_union_pw_aff *mupa);
5348         #include <isl/map.h>
5349         __isl_give isl_map *isl_set_flatten_map(
5350                 __isl_take isl_set *set);
5352 The function above constructs a relation
5353 that maps the input set to a flattened version of the set.
5355 =item * Lifting
5357 Lift the input set to a space with extra dimensions corresponding
5358 to the existentially quantified variables in the input.
5359 In particular, the result lives in a wrapped map where the domain
5360 is the original space and the range corresponds to the original
5361 existentially quantified variables.
5363         #include <isl/set.h>
5364         __isl_give isl_basic_set *isl_basic_set_lift(
5365                 __isl_take isl_basic_set *bset);
5366         __isl_give isl_set *isl_set_lift(
5367                 __isl_take isl_set *set);
5368         __isl_give isl_union_set *isl_union_set_lift(
5369                 __isl_take isl_union_set *uset);
5371 Given a local space that contains the existentially quantified
5372 variables of a set, a basic relation that, when applied to
5373 a basic set, has essentially the same effect as C<isl_basic_set_lift>,
5374 can be constructed using the following function.
5376         #include <isl/local_space.h>
5377         __isl_give isl_basic_map *isl_local_space_lifting(
5378                 __isl_take isl_local_space *ls);
5380         #include <isl/aff.h>
5381         __isl_give isl_multi_aff *isl_multi_aff_lift(
5382                 __isl_take isl_multi_aff *maff,
5383                 __isl_give isl_local_space **ls);
5385 If the C<ls> argument of C<isl_multi_aff_lift> is not C<NULL>,
5386 then it is assigned the local space that lies at the basis of
5387 the lifting applied.
5389 =item * Internal Product
5391         #include <isl/space.h>
5392         __isl_give isl_space *isl_space_zip(
5393                 __isl_take isl_space *space);
5395         #include <isl/map.h>
5396         __isl_give isl_basic_map *isl_basic_map_zip(
5397                 __isl_take isl_basic_map *bmap);
5398         __isl_give isl_map *isl_map_zip(
5399                 __isl_take isl_map *map);
5401         #include <isl/union_map.h>
5402         __isl_give isl_union_map *isl_union_map_zip(
5403                 __isl_take isl_union_map *umap);
5405 Given a relation with nested relations for domain and range,
5406 interchange the range of the domain with the domain of the range.
5408 =item * Currying
5410         #include <isl/space.h>
5411         __isl_give isl_space *isl_space_curry(
5412                 __isl_take isl_space *space);
5413         __isl_give isl_space *isl_space_uncurry(
5414                 __isl_take isl_space *space);
5416         #include <isl/map.h>
5417         __isl_give isl_basic_map *isl_basic_map_curry(
5418                 __isl_take isl_basic_map *bmap);
5419         __isl_give isl_basic_map *isl_basic_map_uncurry(
5420                 __isl_take isl_basic_map *bmap);
5421         __isl_give isl_map *isl_map_curry(
5422                 __isl_take isl_map *map);
5423         __isl_give isl_map *isl_map_uncurry(
5424                 __isl_take isl_map *map);
5426         #include <isl/union_map.h>
5427         __isl_give isl_union_map *isl_union_map_curry(
5428                 __isl_take isl_union_map *umap);
5429         __isl_give isl_union_map *isl_union_map_uncurry(
5430                 __isl_take isl_union_map *umap);
5432 Given a relation with a nested relation for domain,
5433 the C<curry> functions
5434 move the range of the nested relation out of the domain
5435 and use it as the domain of a nested relation in the range,
5436 with the original range as range of this nested relation.
5437 The C<uncurry> functions perform the inverse operation.
5439         #include <isl/space.h>
5440         __isl_give isl_space *isl_space_range_curry(
5441                 __isl_take isl_space *space);
5443         #include <isl/map.h>
5444         __isl_give isl_map *isl_map_range_curry(
5445                 __isl_take isl_map *map);
5447         #include <isl/union_map.h>
5448         __isl_give isl_union_map *isl_union_map_range_curry(
5449                 __isl_take isl_union_map *umap);
5451 These functions apply the currying to the relation that
5452 is nested inside the range of the input.
5454 =item * Aligning parameters
5456 Change the order of the parameters of the given set, relation
5457 or function
5458 such that the first parameters match those of C<model>.
5459 This may involve the introduction of extra parameters.
5460 All parameters need to be named.
5462         #include <isl/space.h>
5463         __isl_give isl_space *isl_space_align_params(
5464                 __isl_take isl_space *space1,
5465                 __isl_take isl_space *space2)
5467         #include <isl/set.h>
5468         __isl_give isl_basic_set *isl_basic_set_align_params(
5469                 __isl_take isl_basic_set *bset,
5470                 __isl_take isl_space *model);
5471         __isl_give isl_set *isl_set_align_params(
5472                 __isl_take isl_set *set,
5473                 __isl_take isl_space *model);
5475         #include <isl/map.h>
5476         __isl_give isl_basic_map *isl_basic_map_align_params(
5477                 __isl_take isl_basic_map *bmap,
5478                 __isl_take isl_space *model);
5479         __isl_give isl_map *isl_map_align_params(
5480                 __isl_take isl_map *map,
5481                 __isl_take isl_space *model);
5483         #include <isl/val.h>
5484         __isl_give isl_multi_val *isl_multi_val_align_params(
5485                 __isl_take isl_multi_val *mv,
5486                 __isl_take isl_space *model);
5488         #include <isl/aff.h>
5489         __isl_give isl_aff *isl_aff_align_params(
5490                 __isl_take isl_aff *aff,
5491                 __isl_take isl_space *model);
5492         __isl_give isl_multi_aff *isl_multi_aff_align_params(
5493                 __isl_take isl_multi_aff *multi,
5494                 __isl_take isl_space *model);
5495         __isl_give isl_pw_aff *isl_pw_aff_align_params(
5496                 __isl_take isl_pw_aff *pwaff,
5497                 __isl_take isl_space *model);
5498         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_align_params(
5499                 __isl_take isl_pw_multi_aff *pma,
5500                 __isl_take isl_space *model);
5501         __isl_give isl_union_pw_aff *
5502         isl_union_pw_aff_align_params(
5503                 __isl_take isl_union_pw_aff *upa,
5504                 __isl_take isl_space *model);
5505         __isl_give isl_union_pw_multi_aff *
5506         isl_union_pw_multi_aff_align_params(
5507                 __isl_take isl_union_pw_multi_aff *upma,
5508                 __isl_take isl_space *model);
5509         __isl_give isl_multi_union_pw_aff *
5510         isl_multi_union_pw_aff_align_params(
5511                 __isl_take isl_multi_union_pw_aff *mupa,
5512                 __isl_take isl_space *model);
5514         #include <isl/polynomial.h>
5515         __isl_give isl_qpolynomial *isl_qpolynomial_align_params(
5516                 __isl_take isl_qpolynomial *qp,
5517                 __isl_take isl_space *model);
5519 =item * Unary Arithmetic Operations
5521         #include <isl/set.h>
5522         __isl_give isl_set *isl_set_neg(
5523                 __isl_take isl_set *set);
5524         #include <isl/map.h>
5525         __isl_give isl_map *isl_map_neg(
5526                 __isl_take isl_map *map);
5528 C<isl_set_neg> constructs a set containing the opposites of
5529 the elements in its argument.
5530 The domain of the result of C<isl_map_neg> is the same
5531 as the domain of its argument.  The corresponding range
5532 elements are the opposites of the corresponding range
5533 elements in the argument.
5535         #include <isl/val.h>
5536         __isl_give isl_multi_val *isl_multi_val_neg(
5537                 __isl_take isl_multi_val *mv);
5539         #include <isl/aff.h>
5540         __isl_give isl_aff *isl_aff_neg(
5541                 __isl_take isl_aff *aff);
5542         __isl_give isl_multi_aff *isl_multi_aff_neg(
5543                 __isl_take isl_multi_aff *ma);
5544         __isl_give isl_pw_aff *isl_pw_aff_neg(
5545                 __isl_take isl_pw_aff *pwaff);
5546         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_neg(
5547                 __isl_take isl_pw_multi_aff *pma);
5548         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_neg(
5549                 __isl_take isl_multi_pw_aff *mpa);
5550         __isl_give isl_union_pw_aff *isl_union_pw_aff_neg(
5551                 __isl_take isl_union_pw_aff *upa);
5552         __isl_give isl_union_pw_multi_aff *
5553         isl_union_pw_multi_aff_neg(
5554                 __isl_take isl_union_pw_multi_aff *upma);
5555         __isl_give isl_multi_union_pw_aff *
5556         isl_multi_union_pw_aff_neg(
5557                 __isl_take isl_multi_union_pw_aff *mupa);
5558         __isl_give isl_aff *isl_aff_ceil(
5559                 __isl_take isl_aff *aff);
5560         __isl_give isl_pw_aff *isl_pw_aff_ceil(
5561                 __isl_take isl_pw_aff *pwaff);
5562         __isl_give isl_aff *isl_aff_floor(
5563                 __isl_take isl_aff *aff);
5564         __isl_give isl_multi_aff *isl_multi_aff_floor(
5565                 __isl_take isl_multi_aff *ma);
5566         __isl_give isl_pw_aff *isl_pw_aff_floor(
5567                 __isl_take isl_pw_aff *pwaff);
5568         __isl_give isl_union_pw_aff *isl_union_pw_aff_floor(
5569                 __isl_take isl_union_pw_aff *upa);
5570         __isl_give isl_multi_union_pw_aff *
5571         isl_multi_union_pw_aff_floor(
5572                 __isl_take isl_multi_union_pw_aff *mupa);
5574         #include <isl/aff.h>
5575         __isl_give isl_pw_aff *isl_pw_aff_list_min(
5576                 __isl_take isl_pw_aff_list *list);
5577         __isl_give isl_pw_aff *isl_pw_aff_list_max(
5578                 __isl_take isl_pw_aff_list *list);
5580         #include <isl/polynomial.h>
5581         __isl_give isl_qpolynomial *isl_qpolynomial_neg(
5582                 __isl_take isl_qpolynomial *qp);
5583         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_neg(
5584                 __isl_take isl_pw_qpolynomial *pwqp);
5585         __isl_give isl_union_pw_qpolynomial *
5586         isl_union_pw_qpolynomial_neg(
5587                 __isl_take isl_union_pw_qpolynomial *upwqp);
5588         __isl_give isl_qpolynomial *isl_qpolynomial_pow(
5589                 __isl_take isl_qpolynomial *qp,
5590                 unsigned exponent);
5591         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_pow(
5592                 __isl_take isl_pw_qpolynomial *pwqp,
5593                 unsigned exponent);
5595 =item * Evaluation
5597 The following functions evaluate a function in a point.
5599         #include <isl/polynomial.h>
5600         __isl_give isl_val *isl_pw_qpolynomial_eval(
5601                 __isl_take isl_pw_qpolynomial *pwqp,
5602                 __isl_take isl_point *pnt);
5603         __isl_give isl_val *isl_pw_qpolynomial_fold_eval(
5604                 __isl_take isl_pw_qpolynomial_fold *pwf,
5605                 __isl_take isl_point *pnt);
5606         __isl_give isl_val *isl_union_pw_qpolynomial_eval(
5607                 __isl_take isl_union_pw_qpolynomial *upwqp,
5608                 __isl_take isl_point *pnt);
5609         __isl_give isl_val *isl_union_pw_qpolynomial_fold_eval(
5610                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
5611                 __isl_take isl_point *pnt);
5613 =item * Dimension manipulation
5615 It is usually not advisable to directly change the (input or output)
5616 space of a set or a relation as this removes the name and the internal
5617 structure of the space.  However, the functions below can be useful
5618 to add new parameters, assuming
5619 C<isl_set_align_params> and C<isl_map_align_params>
5620 are not sufficient.
5622         #include <isl/space.h>
5623         __isl_give isl_space *isl_space_add_dims(
5624                 __isl_take isl_space *space,
5625                 enum isl_dim_type type, unsigned n);
5626         __isl_give isl_space *isl_space_insert_dims(
5627                 __isl_take isl_space *space,
5628                 enum isl_dim_type type, unsigned pos, unsigned n);
5629         __isl_give isl_space *isl_space_drop_dims(
5630                 __isl_take isl_space *space,
5631                 enum isl_dim_type type, unsigned first, unsigned n);
5632         __isl_give isl_space *isl_space_move_dims(
5633                 __isl_take isl_space *space,
5634                 enum isl_dim_type dst_type, unsigned dst_pos,
5635                 enum isl_dim_type src_type, unsigned src_pos,
5636                 unsigned n);
5638         #include <isl/local_space.h>
5639         __isl_give isl_local_space *isl_local_space_add_dims(
5640                 __isl_take isl_local_space *ls,
5641                 enum isl_dim_type type, unsigned n);
5642         __isl_give isl_local_space *isl_local_space_insert_dims(
5643                 __isl_take isl_local_space *ls,
5644                 enum isl_dim_type type, unsigned first, unsigned n);
5645         __isl_give isl_local_space *isl_local_space_drop_dims(
5646                 __isl_take isl_local_space *ls,
5647                 enum isl_dim_type type, unsigned first, unsigned n);
5649         #include <isl/set.h>
5650         __isl_give isl_basic_set *isl_basic_set_add_dims(
5651                 __isl_take isl_basic_set *bset,
5652                 enum isl_dim_type type, unsigned n);
5653         __isl_give isl_set *isl_set_add_dims(
5654                 __isl_take isl_set *set,
5655                 enum isl_dim_type type, unsigned n);
5656         __isl_give isl_basic_set *isl_basic_set_insert_dims(
5657                 __isl_take isl_basic_set *bset,
5658                 enum isl_dim_type type, unsigned pos,
5659                 unsigned n);
5660         __isl_give isl_set *isl_set_insert_dims(
5661                 __isl_take isl_set *set,
5662                 enum isl_dim_type type, unsigned pos, unsigned n);
5663         __isl_give isl_basic_set *isl_basic_set_move_dims(
5664                 __isl_take isl_basic_set *bset,
5665                 enum isl_dim_type dst_type, unsigned dst_pos,
5666                 enum isl_dim_type src_type, unsigned src_pos,
5667                 unsigned n);
5668         __isl_give isl_set *isl_set_move_dims(
5669                 __isl_take isl_set *set,
5670                 enum isl_dim_type dst_type, unsigned dst_pos,
5671                 enum isl_dim_type src_type, unsigned src_pos,
5672                 unsigned n);
5674         #include <isl/map.h>
5675         __isl_give isl_basic_map *isl_basic_map_add_dims(
5676                 __isl_take isl_basic_map *bmap,
5677                 enum isl_dim_type type, unsigned n);
5678         __isl_give isl_map *isl_map_add_dims(
5679                 __isl_take isl_map *map,
5680                 enum isl_dim_type type, unsigned n);
5681         __isl_give isl_basic_map *isl_basic_map_insert_dims(
5682                 __isl_take isl_basic_map *bmap,
5683                 enum isl_dim_type type, unsigned pos,
5684                 unsigned n);
5685         __isl_give isl_map *isl_map_insert_dims(
5686                 __isl_take isl_map *map,
5687                 enum isl_dim_type type, unsigned pos, unsigned n);
5688         __isl_give isl_basic_map *isl_basic_map_move_dims(
5689                 __isl_take isl_basic_map *bmap,
5690                 enum isl_dim_type dst_type, unsigned dst_pos,
5691                 enum isl_dim_type src_type, unsigned src_pos,
5692                 unsigned n);
5693         __isl_give isl_map *isl_map_move_dims(
5694                 __isl_take isl_map *map,
5695                 enum isl_dim_type dst_type, unsigned dst_pos,
5696                 enum isl_dim_type src_type, unsigned src_pos,
5697                 unsigned n);
5699         #include <isl/val.h>
5700         __isl_give isl_multi_val *isl_multi_val_insert_dims(
5701                 __isl_take isl_multi_val *mv,
5702                 enum isl_dim_type type, unsigned first, unsigned n);
5703         __isl_give isl_multi_val *isl_multi_val_add_dims(
5704                 __isl_take isl_multi_val *mv,
5705                 enum isl_dim_type type, unsigned n);
5706         __isl_give isl_multi_val *isl_multi_val_drop_dims(
5707                 __isl_take isl_multi_val *mv,
5708                 enum isl_dim_type type, unsigned first, unsigned n);
5710         #include <isl/aff.h>
5711         __isl_give isl_aff *isl_aff_insert_dims(
5712                 __isl_take isl_aff *aff,
5713                 enum isl_dim_type type, unsigned first, unsigned n);
5714         __isl_give isl_multi_aff *isl_multi_aff_insert_dims(
5715                 __isl_take isl_multi_aff *ma,
5716                 enum isl_dim_type type, unsigned first, unsigned n);
5717         __isl_give isl_pw_aff *isl_pw_aff_insert_dims(
5718                 __isl_take isl_pw_aff *pwaff,
5719                 enum isl_dim_type type, unsigned first, unsigned n);
5720         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_insert_dims(
5721                 __isl_take isl_multi_pw_aff *mpa,
5722                 enum isl_dim_type type, unsigned first, unsigned n);
5723         __isl_give isl_aff *isl_aff_add_dims(
5724                 __isl_take isl_aff *aff,
5725                 enum isl_dim_type type, unsigned n);
5726         __isl_give isl_multi_aff *isl_multi_aff_add_dims(
5727                 __isl_take isl_multi_aff *ma,
5728                 enum isl_dim_type type, unsigned n);
5729         __isl_give isl_pw_aff *isl_pw_aff_add_dims(
5730                 __isl_take isl_pw_aff *pwaff,
5731                 enum isl_dim_type type, unsigned n);
5732         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_add_dims(
5733                 __isl_take isl_multi_pw_aff *mpa,
5734                 enum isl_dim_type type, unsigned n);
5735         __isl_give isl_aff *isl_aff_drop_dims(
5736                 __isl_take isl_aff *aff,
5737                 enum isl_dim_type type, unsigned first, unsigned n);
5738         __isl_give isl_multi_aff *isl_multi_aff_drop_dims(
5739                 __isl_take isl_multi_aff *maff,
5740                 enum isl_dim_type type, unsigned first, unsigned n);
5741         __isl_give isl_pw_aff *isl_pw_aff_drop_dims(
5742                 __isl_take isl_pw_aff *pwaff,
5743                 enum isl_dim_type type, unsigned first, unsigned n);
5744         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_drop_dims(
5745                 __isl_take isl_pw_multi_aff *pma,
5746                 enum isl_dim_type type, unsigned first, unsigned n);
5747         __isl_give isl_union_pw_aff *isl_union_pw_aff_drop_dims(
5748                 __isl_take isl_union_pw_aff *upa,
5749                 enum isl_dim_type type, unsigned first, unsigned n);
5750         __isl_give isl_union_pw_multi_aff *
5751                 isl_union_pw_multi_aff_drop_dims(
5752                 __isl_take isl_union_pw_multi_aff *upma,
5753                 enum isl_dim_type type,
5754                 unsigned first, unsigned n);
5755         __isl_give isl_multi_union_pw_aff *
5756         isl_multi_union_pw_aff_drop_dims(
5757                 __isl_take isl_multi_union_pw_aff *mupa,
5758                 enum isl_dim_type type, unsigned first,
5759                 unsigned n);
5760         __isl_give isl_aff *isl_aff_move_dims(
5761                 __isl_take isl_aff *aff,
5762                 enum isl_dim_type dst_type, unsigned dst_pos,
5763                 enum isl_dim_type src_type, unsigned src_pos,
5764                 unsigned n);
5765         __isl_give isl_multi_aff *isl_multi_aff_move_dims(
5766                 __isl_take isl_multi_aff *ma,
5767                 enum isl_dim_type dst_type, unsigned dst_pos,
5768                 enum isl_dim_type src_type, unsigned src_pos,
5769                 unsigned n);
5770         __isl_give isl_pw_aff *isl_pw_aff_move_dims(
5771                 __isl_take isl_pw_aff *pa,
5772                 enum isl_dim_type dst_type, unsigned dst_pos,
5773                 enum isl_dim_type src_type, unsigned src_pos,
5774                 unsigned n);
5775         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_move_dims(
5776                 __isl_take isl_multi_pw_aff *pma,
5777                 enum isl_dim_type dst_type, unsigned dst_pos,
5778                 enum isl_dim_type src_type, unsigned src_pos,
5779                 unsigned n);
5781         #include <isl/polynomial.h>
5782         __isl_give isl_union_pw_qpolynomial *
5783         isl_union_pw_qpolynomial_drop_dims(
5784                 __isl_take isl_union_pw_qpolynomial *upwqp,
5785                 enum isl_dim_type type,
5786                 unsigned first, unsigned n);
5787         __isl_give isl_union_pw_qpolynomial_fold *
5788                 isl_union_pw_qpolynomial_fold_drop_dims(
5789                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
5790                 enum isl_dim_type type,
5791                 unsigned first, unsigned n);
5793 The operations on union expressions can only manipulate parameters.
5795 =back
5797 =head2 Binary Operations
5799 The two arguments of a binary operation not only need to live
5800 in the same C<isl_ctx>, they currently also need to have
5801 the same (number of) parameters.
5803 =head3 Basic Operations
5805 =over
5807 =item * Intersection
5809         #include <isl/local_space.h>
5810         __isl_give isl_local_space *isl_local_space_intersect(
5811                 __isl_take isl_local_space *ls1,
5812                 __isl_take isl_local_space *ls2);
5814         #include <isl/set.h>
5815         __isl_give isl_basic_set *isl_basic_set_intersect_params(
5816                 __isl_take isl_basic_set *bset1,
5817                 __isl_take isl_basic_set *bset2);
5818         __isl_give isl_basic_set *isl_basic_set_intersect(
5819                 __isl_take isl_basic_set *bset1,
5820                 __isl_take isl_basic_set *bset2);
5821         __isl_give isl_basic_set *isl_basic_set_list_intersect(
5822                 __isl_take struct isl_basic_set_list *list);
5823         __isl_give isl_set *isl_set_intersect_params(
5824                 __isl_take isl_set *set,
5825                 __isl_take isl_set *params);
5826         __isl_give isl_set *isl_set_intersect(
5827                 __isl_take isl_set *set1,
5828                 __isl_take isl_set *set2);
5830         #include <isl/map.h>
5831         __isl_give isl_basic_map *isl_basic_map_intersect_domain(
5832                 __isl_take isl_basic_map *bmap,
5833                 __isl_take isl_basic_set *bset);
5834         __isl_give isl_basic_map *isl_basic_map_intersect_range(
5835                 __isl_take isl_basic_map *bmap,
5836                 __isl_take isl_basic_set *bset);
5837         __isl_give isl_basic_map *isl_basic_map_intersect(
5838                 __isl_take isl_basic_map *bmap1,
5839                 __isl_take isl_basic_map *bmap2);
5840         __isl_give isl_basic_map *isl_basic_map_list_intersect(
5841                 __isl_take isl_basic_map_list *list);
5842         __isl_give isl_map *isl_map_intersect_params(
5843                 __isl_take isl_map *map,
5844                 __isl_take isl_set *params);
5845         __isl_give isl_map *isl_map_intersect_domain(
5846                 __isl_take isl_map *map,
5847                 __isl_take isl_set *set);
5848         __isl_give isl_map *isl_map_intersect_range(
5849                 __isl_take isl_map *map,
5850                 __isl_take isl_set *set);
5851         __isl_give isl_map *isl_map_intersect(
5852                 __isl_take isl_map *map1,
5853                 __isl_take isl_map *map2);
5854         __isl_give isl_map *
5855         isl_map_intersect_domain_factor_range(
5856                 __isl_take isl_map *map,
5857                 __isl_take isl_map *factor);
5858         __isl_give isl_map *
5859         isl_map_intersect_range_factor_range(
5860                 __isl_take isl_map *map,
5861                 __isl_take isl_map *factor);
5863         #include <isl/union_set.h>
5864         __isl_give isl_union_set *isl_union_set_intersect_params(
5865                 __isl_take isl_union_set *uset,
5866                 __isl_take isl_set *set);
5867         __isl_give isl_union_set *isl_union_set_intersect(
5868                 __isl_take isl_union_set *uset1,
5869                 __isl_take isl_union_set *uset2);
5871         #include <isl/union_map.h>
5872         __isl_give isl_union_map *isl_union_map_intersect_params(
5873                 __isl_take isl_union_map *umap,
5874                 __isl_take isl_set *set);
5875         __isl_give isl_union_map *isl_union_map_intersect_domain(
5876                 __isl_take isl_union_map *umap,
5877                 __isl_take isl_union_set *uset);
5878         __isl_give isl_union_map *isl_union_map_intersect_range(
5879                 __isl_take isl_union_map *umap,
5880                 __isl_take isl_union_set *uset);
5881         __isl_give isl_union_map *isl_union_map_intersect(
5882                 __isl_take isl_union_map *umap1,
5883                 __isl_take isl_union_map *umap2);
5884         __isl_give isl_union_map *
5885         isl_union_map_intersect_range_factor_range(
5886                 __isl_take isl_union_map *umap,
5887                 __isl_take isl_union_map *factor);
5889         #include <isl/aff.h>
5890         __isl_give isl_pw_aff *isl_pw_aff_intersect_domain(
5891                 __isl_take isl_pw_aff *pa,
5892                 __isl_take isl_set *set);
5893         __isl_give isl_multi_pw_aff *
5894         isl_multi_pw_aff_intersect_domain(
5895                 __isl_take isl_multi_pw_aff *mpa,
5896                 __isl_take isl_set *domain);
5897         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_domain(
5898                 __isl_take isl_pw_multi_aff *pma,
5899                 __isl_take isl_set *set);
5900         __isl_give isl_union_pw_aff *isl_union_pw_aff_intersect_domain(
5901                 __isl_take isl_union_pw_aff *upa,
5902                 __isl_take isl_union_set *uset);
5903         __isl_give isl_union_pw_multi_aff *
5904         isl_union_pw_multi_aff_intersect_domain(
5905                 __isl_take isl_union_pw_multi_aff *upma,
5906                 __isl_take isl_union_set *uset);
5907         __isl_give isl_multi_union_pw_aff *
5908         isl_multi_union_pw_aff_intersect_domain(
5909                 __isl_take isl_multi_union_pw_aff *mupa,
5910                 __isl_take isl_union_set *uset);
5911         __isl_give isl_pw_aff *isl_pw_aff_intersect_params(
5912                 __isl_take isl_pw_aff *pa,
5913                 __isl_take isl_set *set);
5914         __isl_give isl_multi_pw_aff *
5915         isl_multi_pw_aff_intersect_params(
5916                 __isl_take isl_multi_pw_aff *mpa,
5917                 __isl_take isl_set *set);
5918         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_params(
5919                 __isl_take isl_pw_multi_aff *pma,
5920                 __isl_take isl_set *set);
5921         __isl_give isl_union_pw_aff *
5922         isl_union_pw_aff_intersect_params(
5923                 __isl_take isl_union_pw_aff *upa,
5924         __isl_give isl_union_pw_multi_aff *
5925         isl_union_pw_multi_aff_intersect_params(
5926                 __isl_take isl_union_pw_multi_aff *upma,
5927                 __isl_take isl_set *set);
5928         __isl_give isl_multi_union_pw_aff *
5929         isl_multi_union_pw_aff_intersect_params(
5930                 __isl_take isl_multi_union_pw_aff *mupa,
5931                 __isl_take isl_set *params);
5932         isl_multi_union_pw_aff_intersect_range(
5933                 __isl_take isl_multi_union_pw_aff *mupa,
5934                 __isl_take isl_set *set);
5936         #include <isl/polynomial.h>
5937         __isl_give isl_pw_qpolynomial *
5938         isl_pw_qpolynomial_intersect_domain(
5939                 __isl_take isl_pw_qpolynomial *pwpq,
5940                 __isl_take isl_set *set);
5941         __isl_give isl_union_pw_qpolynomial *
5942         isl_union_pw_qpolynomial_intersect_domain(
5943                 __isl_take isl_union_pw_qpolynomial *upwpq,
5944                 __isl_take isl_union_set *uset);
5945         __isl_give isl_union_pw_qpolynomial_fold *
5946         isl_union_pw_qpolynomial_fold_intersect_domain(
5947                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
5948                 __isl_take isl_union_set *uset);
5949         __isl_give isl_pw_qpolynomial *
5950         isl_pw_qpolynomial_intersect_params(
5951                 __isl_take isl_pw_qpolynomial *pwpq,
5952                 __isl_take isl_set *set);
5953         __isl_give isl_pw_qpolynomial_fold *
5954         isl_pw_qpolynomial_fold_intersect_params(
5955                 __isl_take isl_pw_qpolynomial_fold *pwf,
5956                 __isl_take isl_set *set);
5957         __isl_give isl_union_pw_qpolynomial *
5958         isl_union_pw_qpolynomial_intersect_params(
5959                 __isl_take isl_union_pw_qpolynomial *upwpq,
5960                 __isl_take isl_set *set);
5961         __isl_give isl_union_pw_qpolynomial_fold *
5962         isl_union_pw_qpolynomial_fold_intersect_params(
5963                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
5964                 __isl_take isl_set *set);
5966 The second argument to the C<_params> functions needs to be
5967 a parametric (basic) set.  For the other functions, a parametric set
5968 for either argument is only allowed if the other argument is
5969 a parametric set as well.
5970 The list passed to C<isl_basic_set_list_intersect> needs to have
5971 at least one element and all elements need to live in the same space.
5972 The function C<isl_multi_union_pw_aff_intersect_range>
5973 restricts the input function to those shared domain elements
5974 that map to the specified range.
5976 =item * Union
5978         #include <isl/set.h>
5979         __isl_give isl_set *isl_basic_set_union(
5980                 __isl_take isl_basic_set *bset1,
5981                 __isl_take isl_basic_set *bset2);
5982         __isl_give isl_set *isl_set_union(
5983                 __isl_take isl_set *set1,
5984                 __isl_take isl_set *set2);
5985         __isl_give isl_set *isl_set_list_union(
5986                 __isl_take isl_set_list *list);
5988         #include <isl/map.h>
5989         __isl_give isl_map *isl_basic_map_union(
5990                 __isl_take isl_basic_map *bmap1,
5991                 __isl_take isl_basic_map *bmap2);
5992         __isl_give isl_map *isl_map_union(
5993                 __isl_take isl_map *map1,
5994                 __isl_take isl_map *map2);
5996         #include <isl/union_set.h>
5997         __isl_give isl_union_set *isl_union_set_union(
5998                 __isl_take isl_union_set *uset1,
5999                 __isl_take isl_union_set *uset2);
6000         __isl_give isl_union_set *isl_union_set_list_union(
6001                 __isl_take isl_union_set_list *list);
6003         #include <isl/union_map.h>
6004         __isl_give isl_union_map *isl_union_map_union(
6005                 __isl_take isl_union_map *umap1,
6006                 __isl_take isl_union_map *umap2);
6008 The list passed to C<isl_set_list_union> needs to have
6009 at least one element and all elements need to live in the same space.
6011 =item * Set difference
6013         #include <isl/set.h>
6014         __isl_give isl_set *isl_set_subtract(
6015                 __isl_take isl_set *set1,
6016                 __isl_take isl_set *set2);
6018         #include <isl/map.h>
6019         __isl_give isl_map *isl_map_subtract(
6020                 __isl_take isl_map *map1,
6021                 __isl_take isl_map *map2);
6022         __isl_give isl_map *isl_map_subtract_domain(
6023                 __isl_take isl_map *map,
6024                 __isl_take isl_set *dom);
6025         __isl_give isl_map *isl_map_subtract_range(
6026                 __isl_take isl_map *map,
6027                 __isl_take isl_set *dom);
6029         #include <isl/union_set.h>
6030         __isl_give isl_union_set *isl_union_set_subtract(
6031                 __isl_take isl_union_set *uset1,
6032                 __isl_take isl_union_set *uset2);
6034         #include <isl/union_map.h>
6035         __isl_give isl_union_map *isl_union_map_subtract(
6036                 __isl_take isl_union_map *umap1,
6037                 __isl_take isl_union_map *umap2);
6038         __isl_give isl_union_map *isl_union_map_subtract_domain(
6039                 __isl_take isl_union_map *umap,
6040                 __isl_take isl_union_set *dom);
6041         __isl_give isl_union_map *isl_union_map_subtract_range(
6042                 __isl_take isl_union_map *umap,
6043                 __isl_take isl_union_set *dom);
6045         #include <isl/aff.h>
6046         __isl_give isl_pw_aff *isl_pw_aff_subtract_domain(
6047                 __isl_take isl_pw_aff *pa,
6048                 __isl_take isl_set *set);
6049         __isl_give isl_pw_multi_aff *
6050         isl_pw_multi_aff_subtract_domain(
6051                 __isl_take isl_pw_multi_aff *pma,
6052                 __isl_take isl_set *set);
6053         __isl_give isl_union_pw_aff *
6054         isl_union_pw_aff_subtract_domain(
6055                 __isl_take isl_union_pw_aff *upa,
6056                 __isl_take isl_union_set *uset);
6057         __isl_give isl_union_pw_multi_aff *
6058         isl_union_pw_multi_aff_subtract_domain(
6059                 __isl_take isl_union_pw_multi_aff *upma,
6060                 __isl_take isl_set *set);
6062         #include <isl/polynomial.h>
6063         __isl_give isl_pw_qpolynomial *
6064         isl_pw_qpolynomial_subtract_domain(
6065                 __isl_take isl_pw_qpolynomial *pwpq,
6066                 __isl_take isl_set *set);
6067         __isl_give isl_pw_qpolynomial_fold *
6068         isl_pw_qpolynomial_fold_subtract_domain(
6069                 __isl_take isl_pw_qpolynomial_fold *pwf,
6070                 __isl_take isl_set *set);
6071         __isl_give isl_union_pw_qpolynomial *
6072         isl_union_pw_qpolynomial_subtract_domain(
6073                 __isl_take isl_union_pw_qpolynomial *upwpq,
6074                 __isl_take isl_union_set *uset);
6075         __isl_give isl_union_pw_qpolynomial_fold *
6076         isl_union_pw_qpolynomial_fold_subtract_domain(
6077                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
6078                 __isl_take isl_union_set *uset);
6080 =item * Application
6082         #include <isl/space.h>
6083         __isl_give isl_space *isl_space_join(
6084                 __isl_take isl_space *left,
6085                 __isl_take isl_space *right);
6087         #include <isl/map.h>
6088         __isl_give isl_basic_set *isl_basic_set_apply(
6089                 __isl_take isl_basic_set *bset,
6090                 __isl_take isl_basic_map *bmap);
6091         __isl_give isl_set *isl_set_apply(
6092                 __isl_take isl_set *set,
6093                 __isl_take isl_map *map);
6094         __isl_give isl_union_set *isl_union_set_apply(
6095                 __isl_take isl_union_set *uset,
6096                 __isl_take isl_union_map *umap);
6097         __isl_give isl_basic_map *isl_basic_map_apply_domain(
6098                 __isl_take isl_basic_map *bmap1,
6099                 __isl_take isl_basic_map *bmap2);
6100         __isl_give isl_basic_map *isl_basic_map_apply_range(
6101                 __isl_take isl_basic_map *bmap1,
6102                 __isl_take isl_basic_map *bmap2);
6103         __isl_give isl_map *isl_map_apply_domain(
6104                 __isl_take isl_map *map1,
6105                 __isl_take isl_map *map2);
6106         __isl_give isl_map *isl_map_apply_range(
6107                 __isl_take isl_map *map1,
6108                 __isl_take isl_map *map2);
6110         #include <isl/union_map.h>
6111         __isl_give isl_union_map *isl_union_map_apply_domain(
6112                 __isl_take isl_union_map *umap1,
6113                 __isl_take isl_union_map *umap2);
6114         __isl_give isl_union_map *isl_union_map_apply_range(
6115                 __isl_take isl_union_map *umap1,
6116                 __isl_take isl_union_map *umap2);
6118         #include <isl/aff.h>
6119         __isl_give isl_union_pw_aff *
6120         isl_multi_union_pw_aff_apply_aff(
6121                 __isl_take isl_multi_union_pw_aff *mupa,
6122                 __isl_take isl_aff *aff);
6123         __isl_give isl_union_pw_aff *
6124         isl_multi_union_pw_aff_apply_pw_aff(
6125                 __isl_take isl_multi_union_pw_aff *mupa,
6126                 __isl_take isl_pw_aff *pa);
6127         __isl_give isl_multi_union_pw_aff *
6128         isl_multi_union_pw_aff_apply_multi_aff(
6129                 __isl_take isl_multi_union_pw_aff *mupa,
6130                 __isl_take isl_multi_aff *ma);
6131         __isl_give isl_multi_union_pw_aff *
6132         isl_multi_union_pw_aff_apply_pw_multi_aff(
6133                 __isl_take isl_multi_union_pw_aff *mupa,
6134                 __isl_take isl_pw_multi_aff *pma);
6136 The result of C<isl_multi_union_pw_aff_apply_aff> is defined
6137 over the shared domain of the elements of the input.  The dimension is
6138 required to be greater than zero.
6139 The C<isl_multi_union_pw_aff> argument of
6140 C<isl_multi_union_pw_aff_apply_multi_aff> is allowed to be zero-dimensional,
6141 but only if the range of the C<isl_multi_aff> argument
6142 is also zero-dimensional.
6143 Similarly for C<isl_multi_union_pw_aff_apply_pw_multi_aff>.
6145         #include <isl/polynomial.h>
6146         __isl_give isl_pw_qpolynomial_fold *
6147         isl_set_apply_pw_qpolynomial_fold(
6148                 __isl_take isl_set *set,
6149                 __isl_take isl_pw_qpolynomial_fold *pwf,
6150                 int *tight);
6151         __isl_give isl_pw_qpolynomial_fold *
6152         isl_map_apply_pw_qpolynomial_fold(
6153                 __isl_take isl_map *map,
6154                 __isl_take isl_pw_qpolynomial_fold *pwf,
6155                 int *tight);
6156         __isl_give isl_union_pw_qpolynomial_fold *
6157         isl_union_set_apply_union_pw_qpolynomial_fold(
6158                 __isl_take isl_union_set *uset,
6159                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
6160                 int *tight);
6161         __isl_give isl_union_pw_qpolynomial_fold *
6162         isl_union_map_apply_union_pw_qpolynomial_fold(
6163                 __isl_take isl_union_map *umap,
6164                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
6165                 int *tight);
6167 The functions taking a map
6168 compose the given map with the given piecewise quasipolynomial reduction.
6169 That is, compute a bound (of the same type as C<pwf> or C<upwf> itself)
6170 over all elements in the intersection of the range of the map
6171 and the domain of the piecewise quasipolynomial reduction
6172 as a function of an element in the domain of the map.
6173 The functions taking a set compute a bound over all elements in the
6174 intersection of the set and the domain of the
6175 piecewise quasipolynomial reduction.
6177 =item * Preimage
6179         #include <isl/set.h>
6180         __isl_give isl_basic_set *
6181         isl_basic_set_preimage_multi_aff(
6182                 __isl_take isl_basic_set *bset,
6183                 __isl_take isl_multi_aff *ma);
6184         __isl_give isl_set *isl_set_preimage_multi_aff(
6185                 __isl_take isl_set *set,
6186                 __isl_take isl_multi_aff *ma);
6187         __isl_give isl_set *isl_set_preimage_pw_multi_aff(
6188                 __isl_take isl_set *set,
6189                 __isl_take isl_pw_multi_aff *pma);
6190         __isl_give isl_set *isl_set_preimage_multi_pw_aff(
6191                 __isl_take isl_set *set,
6192                 __isl_take isl_multi_pw_aff *mpa);
6194         #include <isl/union_set.h>
6195         __isl_give isl_union_set *
6196         isl_union_set_preimage_multi_aff(
6197                 __isl_take isl_union_set *uset,
6198                 __isl_take isl_multi_aff *ma);
6199         __isl_give isl_union_set *
6200         isl_union_set_preimage_pw_multi_aff(
6201                 __isl_take isl_union_set *uset,
6202                 __isl_take isl_pw_multi_aff *pma);
6203         __isl_give isl_union_set *
6204         isl_union_set_preimage_union_pw_multi_aff(
6205                 __isl_take isl_union_set *uset,
6206                 __isl_take isl_union_pw_multi_aff *upma);
6208         #include <isl/map.h>
6209         __isl_give isl_basic_map *
6210         isl_basic_map_preimage_domain_multi_aff(
6211                 __isl_take isl_basic_map *bmap,
6212                 __isl_take isl_multi_aff *ma);
6213         __isl_give isl_map *isl_map_preimage_domain_multi_aff(
6214                 __isl_take isl_map *map,
6215                 __isl_take isl_multi_aff *ma);
6216         __isl_give isl_map *isl_map_preimage_range_multi_aff(
6217                 __isl_take isl_map *map,
6218                 __isl_take isl_multi_aff *ma);
6219         __isl_give isl_map *
6220         isl_map_preimage_domain_pw_multi_aff(
6221                 __isl_take isl_map *map,
6222                 __isl_take isl_pw_multi_aff *pma);
6223         __isl_give isl_map *
6224         isl_map_preimage_range_pw_multi_aff(
6225                 __isl_take isl_map *map,
6226                 __isl_take isl_pw_multi_aff *pma);
6227         __isl_give isl_map *
6228         isl_map_preimage_domain_multi_pw_aff(
6229                 __isl_take isl_map *map,
6230                 __isl_take isl_multi_pw_aff *mpa);
6231         __isl_give isl_basic_map *
6232         isl_basic_map_preimage_range_multi_aff(
6233                 __isl_take isl_basic_map *bmap,
6234                 __isl_take isl_multi_aff *ma);
6236         #include <isl/union_map.h>
6237         __isl_give isl_union_map *
6238         isl_union_map_preimage_domain_multi_aff(
6239                 __isl_take isl_union_map *umap,
6240                 __isl_take isl_multi_aff *ma);
6241         __isl_give isl_union_map *
6242         isl_union_map_preimage_range_multi_aff(
6243                 __isl_take isl_union_map *umap,
6244                 __isl_take isl_multi_aff *ma);
6245         __isl_give isl_union_map *
6246         isl_union_map_preimage_domain_pw_multi_aff(
6247                 __isl_take isl_union_map *umap,
6248                 __isl_take isl_pw_multi_aff *pma);
6249         __isl_give isl_union_map *
6250         isl_union_map_preimage_range_pw_multi_aff(
6251                 __isl_take isl_union_map *umap,
6252                 __isl_take isl_pw_multi_aff *pma);
6253         __isl_give isl_union_map *
6254         isl_union_map_preimage_domain_union_pw_multi_aff(
6255                 __isl_take isl_union_map *umap,
6256                 __isl_take isl_union_pw_multi_aff *upma);
6257         __isl_give isl_union_map *
6258         isl_union_map_preimage_range_union_pw_multi_aff(
6259                 __isl_take isl_union_map *umap,
6260                 __isl_take isl_union_pw_multi_aff *upma);
6262 These functions compute the preimage of the given set or map domain/range under
6263 the given function.  In other words, the expression is plugged
6264 into the set description or into the domain/range of the map.
6266 =item * Pullback
6268         #include <isl/aff.h>
6269         __isl_give isl_aff *isl_aff_pullback_aff(
6270                 __isl_take isl_aff *aff1,
6271                 __isl_take isl_aff *aff2);
6272         __isl_give isl_aff *isl_aff_pullback_multi_aff(
6273                 __isl_take isl_aff *aff,
6274                 __isl_take isl_multi_aff *ma);
6275         __isl_give isl_pw_aff *isl_pw_aff_pullback_multi_aff(
6276                 __isl_take isl_pw_aff *pa,
6277                 __isl_take isl_multi_aff *ma);
6278         __isl_give isl_pw_aff *isl_pw_aff_pullback_pw_multi_aff(
6279                 __isl_take isl_pw_aff *pa,
6280                 __isl_take isl_pw_multi_aff *pma);
6281         __isl_give isl_pw_aff *isl_pw_aff_pullback_multi_pw_aff(
6282                 __isl_take isl_pw_aff *pa,
6283                 __isl_take isl_multi_pw_aff *mpa);
6284         __isl_give isl_multi_aff *isl_multi_aff_pullback_multi_aff(
6285                 __isl_take isl_multi_aff *ma1,
6286                 __isl_take isl_multi_aff *ma2);
6287         __isl_give isl_pw_multi_aff *
6288         isl_pw_multi_aff_pullback_multi_aff(
6289                 __isl_take isl_pw_multi_aff *pma,
6290                 __isl_take isl_multi_aff *ma);
6291         __isl_give isl_multi_pw_aff *
6292         isl_multi_pw_aff_pullback_multi_aff(
6293                 __isl_take isl_multi_pw_aff *mpa,
6294                 __isl_take isl_multi_aff *ma);
6295         __isl_give isl_pw_multi_aff *
6296         isl_pw_multi_aff_pullback_pw_multi_aff(
6297                 __isl_take isl_pw_multi_aff *pma1,
6298                 __isl_take isl_pw_multi_aff *pma2);
6299         __isl_give isl_multi_pw_aff *
6300         isl_multi_pw_aff_pullback_pw_multi_aff(
6301                 __isl_take isl_multi_pw_aff *mpa,
6302                 __isl_take isl_pw_multi_aff *pma);
6303         __isl_give isl_multi_pw_aff *
6304         isl_multi_pw_aff_pullback_multi_pw_aff(
6305                 __isl_take isl_multi_pw_aff *mpa1,
6306                 __isl_take isl_multi_pw_aff *mpa2);
6307         __isl_give isl_union_pw_aff *
6308         isl_union_pw_aff_pullback_union_pw_multi_aff(
6309                 __isl_take isl_union_pw_aff *upa,
6310                 __isl_take isl_union_pw_multi_aff *upma);
6311         __isl_give isl_union_pw_multi_aff *
6312         isl_union_pw_multi_aff_pullback_union_pw_multi_aff(
6313                 __isl_take isl_union_pw_multi_aff *upma1,
6314                 __isl_take isl_union_pw_multi_aff *upma2);
6315         __isl_give isl_multi_union_pw_aff *
6316         isl_multi_union_pw_aff_pullback_union_pw_multi_aff(
6317                 __isl_take isl_multi_union_pw_aff *mupa,
6318                 __isl_take isl_union_pw_multi_aff *upma);
6320 These functions precompose the first expression by the second function.
6321 In other words, the second function is plugged
6322 into the first expression.
6324 =item * Locus
6326         #include <isl/aff.h>
6327         __isl_give isl_basic_set *isl_aff_eq_basic_set(
6328                 __isl_take isl_aff *aff1,
6329                 __isl_take isl_aff *aff2);
6330         __isl_give isl_set *isl_aff_eq_set(
6331                 __isl_take isl_aff *aff1,
6332                 __isl_take isl_aff *aff2);
6333         __isl_give isl_basic_set *isl_aff_le_basic_set(
6334                 __isl_take isl_aff *aff1,
6335                 __isl_take isl_aff *aff2);
6336         __isl_give isl_set *isl_aff_le_set(
6337                 __isl_take isl_aff *aff1,
6338                 __isl_take isl_aff *aff2);
6339         __isl_give isl_basic_set *isl_aff_lt_basic_set(
6340                 __isl_take isl_aff *aff1,
6341                 __isl_take isl_aff *aff2);
6342         __isl_give isl_set *isl_aff_lt_set(
6343                 __isl_take isl_aff *aff1,
6344                 __isl_take isl_aff *aff2);
6345         __isl_give isl_basic_set *isl_aff_ge_basic_set(
6346                 __isl_take isl_aff *aff1,
6347                 __isl_take isl_aff *aff2);
6348         __isl_give isl_set *isl_aff_ge_set(
6349                 __isl_take isl_aff *aff1,
6350                 __isl_take isl_aff *aff2);
6351         __isl_give isl_basic_set *isl_aff_gt_basic_set(
6352                 __isl_take isl_aff *aff1,
6353                 __isl_take isl_aff *aff2);
6354         __isl_give isl_set *isl_pw_aff_eq_set(
6355                 __isl_take isl_pw_aff *pwaff1,
6356                 __isl_take isl_pw_aff *pwaff2);
6357         __isl_give isl_set *isl_pw_aff_ne_set(
6358                 __isl_take isl_pw_aff *pwaff1,
6359                 __isl_take isl_pw_aff *pwaff2);
6360         __isl_give isl_set *isl_pw_aff_le_set(
6361                 __isl_take isl_pw_aff *pwaff1,
6362                 __isl_take isl_pw_aff *pwaff2);
6363         __isl_give isl_set *isl_pw_aff_lt_set(
6364                 __isl_take isl_pw_aff *pwaff1,
6365                 __isl_take isl_pw_aff *pwaff2);
6366         __isl_give isl_set *isl_pw_aff_ge_set(
6367                 __isl_take isl_pw_aff *pwaff1,
6368                 __isl_take isl_pw_aff *pwaff2);
6369         __isl_give isl_set *isl_pw_aff_gt_set(
6370                 __isl_take isl_pw_aff *pwaff1,
6371                 __isl_take isl_pw_aff *pwaff2);
6373         __isl_give isl_set *isl_multi_aff_lex_le_set(
6374                 __isl_take isl_multi_aff *ma1,
6375                 __isl_take isl_multi_aff *ma2);
6376         __isl_give isl_set *isl_multi_aff_lex_lt_set(
6377                 __isl_take isl_multi_aff *ma1,
6378                 __isl_take isl_multi_aff *ma2);
6379         __isl_give isl_set *isl_multi_aff_lex_ge_set(
6380                 __isl_take isl_multi_aff *ma1,
6381                 __isl_take isl_multi_aff *ma2);
6382         __isl_give isl_set *isl_multi_aff_lex_gt_set(
6383                 __isl_take isl_multi_aff *ma1,
6384                 __isl_take isl_multi_aff *ma2);
6386         __isl_give isl_set *isl_pw_aff_list_eq_set(
6387                 __isl_take isl_pw_aff_list *list1,
6388                 __isl_take isl_pw_aff_list *list2);
6389         __isl_give isl_set *isl_pw_aff_list_ne_set(
6390                 __isl_take isl_pw_aff_list *list1,
6391                 __isl_take isl_pw_aff_list *list2);
6392         __isl_give isl_set *isl_pw_aff_list_le_set(
6393                 __isl_take isl_pw_aff_list *list1,
6394                 __isl_take isl_pw_aff_list *list2);
6395         __isl_give isl_set *isl_pw_aff_list_lt_set(
6396                 __isl_take isl_pw_aff_list *list1,
6397                 __isl_take isl_pw_aff_list *list2);
6398         __isl_give isl_set *isl_pw_aff_list_ge_set(
6399                 __isl_take isl_pw_aff_list *list1,
6400                 __isl_take isl_pw_aff_list *list2);
6401         __isl_give isl_set *isl_pw_aff_list_gt_set(
6402                 __isl_take isl_pw_aff_list *list1,
6403                 __isl_take isl_pw_aff_list *list2);
6405 The function C<isl_aff_ge_basic_set> returns a basic set
6406 containing those elements in the shared space
6407 of C<aff1> and C<aff2> where C<aff1> is greater than or equal to C<aff2>.
6408 The function C<isl_pw_aff_ge_set> returns a set
6409 containing those elements in the shared domain
6410 of C<pwaff1> and C<pwaff2> where C<pwaff1> is
6411 greater than or equal to C<pwaff2>.
6412 The function C<isl_multi_aff_lex_le_set> returns a set
6413 containing those elements in the shared domain space
6414 where C<ma1> is lexicographically smaller than or
6415 equal to C<ma2>.
6416 The functions operating on C<isl_pw_aff_list> apply the corresponding
6417 C<isl_pw_aff> function to each pair of elements in the two lists.
6419         #include <isl/aff.h>
6420         __isl_give isl_map *isl_pw_aff_eq_map(
6421                 __isl_take isl_pw_aff *pa1,
6422                 __isl_take isl_pw_aff *pa2);
6423         __isl_give isl_map *isl_pw_aff_lt_map(
6424                 __isl_take isl_pw_aff *pa1,
6425                 __isl_take isl_pw_aff *pa2);
6426         __isl_give isl_map *isl_pw_aff_gt_map(
6427                 __isl_take isl_pw_aff *pa1,
6428                 __isl_take isl_pw_aff *pa2);
6430         __isl_give isl_map *isl_multi_pw_aff_eq_map(
6431                 __isl_take isl_multi_pw_aff *mpa1,
6432                 __isl_take isl_multi_pw_aff *mpa2);
6433         __isl_give isl_map *isl_multi_pw_aff_lex_lt_map(
6434                 __isl_take isl_multi_pw_aff *mpa1,
6435                 __isl_take isl_multi_pw_aff *mpa2);
6436         __isl_give isl_map *isl_multi_pw_aff_lex_gt_map(
6437                 __isl_take isl_multi_pw_aff *mpa1,
6438                 __isl_take isl_multi_pw_aff *mpa2);
6440 These functions return a map between domain elements of the arguments
6441 where the function values satisfy the given relation.
6443         #include <isl/union_map.h>
6444         __isl_give isl_union_map *
6445         isl_union_map_eq_at_multi_union_pw_aff(
6446                 __isl_take isl_union_map *umap,
6447                 __isl_take isl_multi_union_pw_aff *mupa);
6448         __isl_give isl_union_map *
6449         isl_union_map_lex_lt_at_multi_union_pw_aff(
6450                 __isl_take isl_union_map *umap,
6451                 __isl_take isl_multi_union_pw_aff *mupa);
6452         __isl_give isl_union_map *
6453         isl_union_map_lex_gt_at_multi_union_pw_aff(
6454                 __isl_take isl_union_map *umap,
6455                 __isl_take isl_multi_union_pw_aff *mupa);
6457 These functions select the subset of elements in the union map
6458 that have an equal or lexicographically smaller function value.
6460 =item * Cartesian Product
6462         #include <isl/space.h>
6463         __isl_give isl_space *isl_space_product(
6464                 __isl_take isl_space *space1,
6465                 __isl_take isl_space *space2);
6466         __isl_give isl_space *isl_space_domain_product(
6467                 __isl_take isl_space *space1,
6468                 __isl_take isl_space *space2);
6469         __isl_give isl_space *isl_space_range_product(
6470                 __isl_take isl_space *space1,
6471                 __isl_take isl_space *space2);
6473 The functions
6474 C<isl_space_product>, C<isl_space_domain_product>
6475 and C<isl_space_range_product> take pairs or relation spaces and
6476 produce a single relations space, where either the domain, the range
6477 or both domain and range are wrapped spaces of relations between
6478 the domains and/or ranges of the input spaces.
6479 If the product is only constructed over the domain or the range
6480 then the ranges or the domains of the inputs should be the same.
6481 The function C<isl_space_product> also accepts a pair of set spaces,
6482 in which case it returns a wrapped space of a relation between the
6483 two input spaces.
6485         #include <isl/set.h>
6486         __isl_give isl_set *isl_set_product(
6487                 __isl_take isl_set *set1,
6488                 __isl_take isl_set *set2);
6490         #include <isl/map.h>
6491         __isl_give isl_basic_map *isl_basic_map_domain_product(
6492                 __isl_take isl_basic_map *bmap1,
6493                 __isl_take isl_basic_map *bmap2);
6494         __isl_give isl_basic_map *isl_basic_map_range_product(
6495                 __isl_take isl_basic_map *bmap1,
6496                 __isl_take isl_basic_map *bmap2);
6497         __isl_give isl_basic_map *isl_basic_map_product(
6498                 __isl_take isl_basic_map *bmap1,
6499                 __isl_take isl_basic_map *bmap2);
6500         __isl_give isl_map *isl_map_domain_product(
6501                 __isl_take isl_map *map1,
6502                 __isl_take isl_map *map2);
6503         __isl_give isl_map *isl_map_range_product(
6504                 __isl_take isl_map *map1,
6505                 __isl_take isl_map *map2);
6506         __isl_give isl_map *isl_map_product(
6507                 __isl_take isl_map *map1,
6508                 __isl_take isl_map *map2);
6510         #include <isl/union_set.h>
6511         __isl_give isl_union_set *isl_union_set_product(
6512                 __isl_take isl_union_set *uset1,
6513                 __isl_take isl_union_set *uset2);
6515         #include <isl/union_map.h>
6516         __isl_give isl_union_map *isl_union_map_domain_product(
6517                 __isl_take isl_union_map *umap1,
6518                 __isl_take isl_union_map *umap2);
6519         __isl_give isl_union_map *isl_union_map_range_product(
6520                 __isl_take isl_union_map *umap1,
6521                 __isl_take isl_union_map *umap2);
6522         __isl_give isl_union_map *isl_union_map_product(
6523                 __isl_take isl_union_map *umap1,
6524                 __isl_take isl_union_map *umap2);
6526         #include <isl/val.h>
6527         __isl_give isl_multi_val *isl_multi_val_range_product(
6528                 __isl_take isl_multi_val *mv1,
6529                 __isl_take isl_multi_val *mv2);
6530         __isl_give isl_multi_val *isl_multi_val_product(
6531                 __isl_take isl_multi_val *mv1,
6532                 __isl_take isl_multi_val *mv2);
6534         #include <isl/aff.h>
6535         __isl_give isl_multi_aff *isl_multi_aff_range_product(
6536                 __isl_take isl_multi_aff *ma1,
6537                 __isl_take isl_multi_aff *ma2);
6538         __isl_give isl_multi_aff *isl_multi_aff_product(
6539                 __isl_take isl_multi_aff *ma1,
6540                 __isl_take isl_multi_aff *ma2);
6541         __isl_give isl_multi_pw_aff *
6542         isl_multi_pw_aff_range_product(
6543                 __isl_take isl_multi_pw_aff *mpa1,
6544                 __isl_take isl_multi_pw_aff *mpa2);
6545         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_product(
6546                 __isl_take isl_multi_pw_aff *mpa1,
6547                 __isl_take isl_multi_pw_aff *mpa2);
6548         __isl_give isl_pw_multi_aff *
6549         isl_pw_multi_aff_range_product(
6550                 __isl_take isl_pw_multi_aff *pma1,
6551                 __isl_take isl_pw_multi_aff *pma2);
6552         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_product(
6553                 __isl_take isl_pw_multi_aff *pma1,
6554                 __isl_take isl_pw_multi_aff *pma2);
6555         __isl_give isl_multi_union_pw_aff *
6556         isl_multi_union_pw_aff_range_product(
6557                 __isl_take isl_multi_union_pw_aff *mupa1,
6558                 __isl_take isl_multi_union_pw_aff *mupa2);
6560 The above functions compute the cross product of the given
6561 sets, relations or functions.  The domains and ranges of the results
6562 are wrapped maps between domains and ranges of the inputs.
6563 To obtain a ``flat'' product, use the following functions
6564 instead.
6566         #include <isl/set.h>
6567         __isl_give isl_basic_set *isl_basic_set_flat_product(
6568                 __isl_take isl_basic_set *bset1,
6569                 __isl_take isl_basic_set *bset2);
6570         __isl_give isl_set *isl_set_flat_product(
6571                 __isl_take isl_set *set1,
6572                 __isl_take isl_set *set2);
6574         #include <isl/map.h>
6575         __isl_give isl_basic_map *isl_basic_map_flat_range_product(
6576                 __isl_take isl_basic_map *bmap1,
6577                 __isl_take isl_basic_map *bmap2);
6578         __isl_give isl_map *isl_map_flat_domain_product(
6579                 __isl_take isl_map *map1,
6580                 __isl_take isl_map *map2);
6581         __isl_give isl_map *isl_map_flat_range_product(
6582                 __isl_take isl_map *map1,
6583                 __isl_take isl_map *map2);
6584         __isl_give isl_basic_map *isl_basic_map_flat_product(
6585                 __isl_take isl_basic_map *bmap1,
6586                 __isl_take isl_basic_map *bmap2);
6587         __isl_give isl_map *isl_map_flat_product(
6588                 __isl_take isl_map *map1,
6589                 __isl_take isl_map *map2);
6591         #include <isl/union_map.h>
6592         __isl_give isl_union_map *
6593         isl_union_map_flat_domain_product(
6594                 __isl_take isl_union_map *umap1,
6595                 __isl_take isl_union_map *umap2);
6596         __isl_give isl_union_map *
6597         isl_union_map_flat_range_product(
6598                 __isl_take isl_union_map *umap1,
6599                 __isl_take isl_union_map *umap2);
6601         #include <isl/val.h>
6602         __isl_give isl_multi_val *isl_multi_val_flat_range_product(
6603                 __isl_take isl_multi_val *mv1,
6604                 __isl_take isl_multi_aff *mv2);
6606         #include <isl/aff.h>
6607         __isl_give isl_multi_aff *isl_multi_aff_flat_range_product(
6608                 __isl_take isl_multi_aff *ma1,
6609                 __isl_take isl_multi_aff *ma2);
6610         __isl_give isl_pw_multi_aff *
6611         isl_pw_multi_aff_flat_range_product(
6612                 __isl_take isl_pw_multi_aff *pma1,
6613                 __isl_take isl_pw_multi_aff *pma2);
6614         __isl_give isl_multi_pw_aff *
6615         isl_multi_pw_aff_flat_range_product(
6616                 __isl_take isl_multi_pw_aff *mpa1,
6617                 __isl_take isl_multi_pw_aff *mpa2);
6618         __isl_give isl_union_pw_multi_aff *
6619         isl_union_pw_multi_aff_flat_range_product(
6620                 __isl_take isl_union_pw_multi_aff *upma1,
6621                 __isl_take isl_union_pw_multi_aff *upma2);
6622         __isl_give isl_multi_union_pw_aff *
6623         isl_multi_union_pw_aff_flat_range_product(
6624                 __isl_take isl_multi_union_pw_aff *mupa1,
6625                 __isl_take isl_multi_union_pw_aff *mupa2);
6627         #include <isl/space.h>
6628         __isl_give isl_space *isl_space_factor_domain(
6629                 __isl_take isl_space *space);
6630         __isl_give isl_space *isl_space_factor_range(
6631                 __isl_take isl_space *space);
6632         __isl_give isl_space *isl_space_domain_factor_domain(
6633                 __isl_take isl_space *space);
6634         __isl_give isl_space *isl_space_domain_factor_range(
6635                 __isl_take isl_space *space);
6636         __isl_give isl_space *isl_space_range_factor_domain(
6637                 __isl_take isl_space *space);
6638         __isl_give isl_space *isl_space_range_factor_range(
6639                 __isl_take isl_space *space);
6641 The functions C<isl_space_range_factor_domain> and
6642 C<isl_space_range_factor_range> extract the two arguments from
6643 the result of a call to C<isl_space_range_product>.
6645 The arguments of a call to a product can be extracted
6646 from the result using the following functions.
6648         #include <isl/map.h>
6649         __isl_give isl_map *isl_map_factor_domain(
6650                 __isl_take isl_map *map);
6651         __isl_give isl_map *isl_map_factor_range(
6652                 __isl_take isl_map *map);
6653         __isl_give isl_map *isl_map_domain_factor_domain(
6654                 __isl_take isl_map *map);
6655         __isl_give isl_map *isl_map_domain_factor_range(
6656                 __isl_take isl_map *map);
6657         __isl_give isl_map *isl_map_range_factor_domain(
6658                 __isl_take isl_map *map);
6659         __isl_give isl_map *isl_map_range_factor_range(
6660                 __isl_take isl_map *map);
6662         #include <isl/union_map.h>
6663         __isl_give isl_union_map *isl_union_map_factor_domain(
6664                 __isl_take isl_union_map *umap);
6665         __isl_give isl_union_map *isl_union_map_factor_range(
6666                 __isl_take isl_union_map *umap);
6667         __isl_give isl_union_map *
6668         isl_union_map_domain_factor_domain(
6669                 __isl_take isl_union_map *umap);
6670         __isl_give isl_union_map *
6671         isl_union_map_domain_factor_range(
6672                 __isl_take isl_union_map *umap);
6673         __isl_give isl_union_map *
6674         isl_union_map_range_factor_domain(
6675                 __isl_take isl_union_map *umap);
6676         __isl_give isl_union_map *
6677         isl_union_map_range_factor_range(
6678                 __isl_take isl_union_map *umap);
6680         #include <isl/val.h>
6681         __isl_give isl_multi_val *isl_multi_val_factor_range(
6682                 __isl_take isl_multi_val *mv);
6683         __isl_give isl_multi_val *
6684         isl_multi_val_range_factor_domain(
6685                 __isl_take isl_multi_val *mv);
6686         __isl_give isl_multi_val *
6687         isl_multi_val_range_factor_range(
6688                 __isl_take isl_multi_val *mv);
6690         #include <isl/aff.h>
6691         __isl_give isl_multi_aff *isl_multi_aff_factor_range(
6692                 __isl_take isl_multi_aff *ma);
6693         __isl_give isl_multi_aff *
6694         isl_multi_aff_range_factor_domain(
6695                 __isl_take isl_multi_aff *ma);
6696         __isl_give isl_multi_aff *
6697         isl_multi_aff_range_factor_range(
6698                 __isl_take isl_multi_aff *ma);
6699         __isl_give isl_multi_pw_aff *
6700         isl_multi_pw_aff_factor_range(
6701                 __isl_take isl_multi_pw_aff *mpa);
6702         __isl_give isl_multi_pw_aff *
6703         isl_multi_pw_aff_range_factor_domain(
6704                 __isl_take isl_multi_pw_aff *mpa);
6705         __isl_give isl_multi_pw_aff *
6706         isl_multi_pw_aff_range_factor_range(
6707                 __isl_take isl_multi_pw_aff *mpa);
6708         __isl_give isl_multi_union_pw_aff *
6709         isl_multi_union_pw_aff_factor_range(
6710                 __isl_take isl_multi_union_pw_aff *mupa);
6711         __isl_give isl_multi_union_pw_aff *
6712         isl_multi_union_pw_aff_range_factor_domain(
6713                 __isl_take isl_multi_union_pw_aff *mupa);
6714         __isl_give isl_multi_union_pw_aff *
6715         isl_multi_union_pw_aff_range_factor_range(
6716                 __isl_take isl_multi_union_pw_aff *mupa);
6718 The splice functions are a generalization of the flat product functions,
6719 where the second argument may be inserted at any position inside
6720 the first argument rather than being placed at the end.
6721 The functions C<isl_multi_val_factor_range>,
6722 C<isl_multi_aff_factor_range>,
6723 C<isl_multi_pw_aff_factor_range> and
6724 C<isl_multi_union_pw_aff_factor_range>
6725 take functions that live in a set space.
6727         #include <isl/val.h>
6728         __isl_give isl_multi_val *isl_multi_val_range_splice(
6729                 __isl_take isl_multi_val *mv1, unsigned pos,
6730                 __isl_take isl_multi_val *mv2);
6732         #include <isl/aff.h>
6733         __isl_give isl_multi_aff *isl_multi_aff_range_splice(
6734                 __isl_take isl_multi_aff *ma1, unsigned pos,
6735                 __isl_take isl_multi_aff *ma2);
6736         __isl_give isl_multi_aff *isl_multi_aff_splice(
6737                 __isl_take isl_multi_aff *ma1,
6738                 unsigned in_pos, unsigned out_pos,
6739                 __isl_take isl_multi_aff *ma2);
6740         __isl_give isl_multi_pw_aff *
6741         isl_multi_pw_aff_range_splice(
6742                 __isl_take isl_multi_pw_aff *mpa1, unsigned pos,
6743                 __isl_take isl_multi_pw_aff *mpa2);
6744         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_splice(
6745                 __isl_take isl_multi_pw_aff *mpa1,
6746                 unsigned in_pos, unsigned out_pos,
6747                 __isl_take isl_multi_pw_aff *mpa2);
6748         __isl_give isl_multi_union_pw_aff *
6749         isl_multi_union_pw_aff_range_splice(
6750                 __isl_take isl_multi_union_pw_aff *mupa1,
6751                 unsigned pos,
6752                 __isl_take isl_multi_union_pw_aff *mupa2);
6754 =item * Simplification
6756 When applied to a set or relation,
6757 the gist operation returns a set or relation that has the
6758 same intersection with the context as the input set or relation.
6759 Any implicit equality in the intersection is made explicit in the result,
6760 while all inequalities that are redundant with respect to the intersection
6761 are removed.
6762 In case of union sets and relations, the gist operation is performed
6763 per space.
6765 When applied to a function,
6766 the gist operation applies the set gist operation to each of
6767 the cells in the domain of the input piecewise expression.
6768 The context is also exploited
6769 to simplify the expression associated to each cell.
6771         #include <isl/set.h>
6772         __isl_give isl_basic_set *isl_basic_set_gist(
6773                 __isl_take isl_basic_set *bset,
6774                 __isl_take isl_basic_set *context);
6775         __isl_give isl_set *isl_set_gist(__isl_take isl_set *set,
6776                 __isl_take isl_set *context);
6777         __isl_give isl_set *isl_set_gist_params(
6778                 __isl_take isl_set *set,
6779                 __isl_take isl_set *context);
6781         #include <isl/map.h>
6782         __isl_give isl_basic_map *isl_basic_map_gist(
6783                 __isl_take isl_basic_map *bmap,
6784                 __isl_take isl_basic_map *context);
6785         __isl_give isl_basic_map *isl_basic_map_gist_domain(
6786                 __isl_take isl_basic_map *bmap,
6787                 __isl_take isl_basic_set *context);
6788         __isl_give isl_map *isl_map_gist(__isl_take isl_map *map,
6789                 __isl_take isl_map *context);
6790         __isl_give isl_map *isl_map_gist_params(
6791                 __isl_take isl_map *map,
6792                 __isl_take isl_set *context);
6793         __isl_give isl_map *isl_map_gist_domain(
6794                 __isl_take isl_map *map,
6795                 __isl_take isl_set *context);
6796         __isl_give isl_map *isl_map_gist_range(
6797                 __isl_take isl_map *map,
6798                 __isl_take isl_set *context);
6800         #include <isl/union_set.h>
6801         __isl_give isl_union_set *isl_union_set_gist(
6802                 __isl_take isl_union_set *uset,
6803                 __isl_take isl_union_set *context);
6804         __isl_give isl_union_set *isl_union_set_gist_params(
6805                 __isl_take isl_union_set *uset,
6806                 __isl_take isl_set *set);
6808         #include <isl/union_map.h>
6809         __isl_give isl_union_map *isl_union_map_gist(
6810                 __isl_take isl_union_map *umap,
6811                 __isl_take isl_union_map *context);
6812         __isl_give isl_union_map *isl_union_map_gist_params(
6813                 __isl_take isl_union_map *umap,
6814                 __isl_take isl_set *set);
6815         __isl_give isl_union_map *isl_union_map_gist_domain(
6816                 __isl_take isl_union_map *umap,
6817                 __isl_take isl_union_set *uset);
6818         __isl_give isl_union_map *isl_union_map_gist_range(
6819                 __isl_take isl_union_map *umap,
6820                 __isl_take isl_union_set *uset);
6822         #include <isl/aff.h>
6823         __isl_give isl_aff *isl_aff_gist_params(
6824                 __isl_take isl_aff *aff,
6825                 __isl_take isl_set *context);
6826         __isl_give isl_aff *isl_aff_gist(__isl_take isl_aff *aff,
6827                 __isl_take isl_set *context);
6828         __isl_give isl_multi_aff *isl_multi_aff_gist_params(
6829                 __isl_take isl_multi_aff *maff,
6830                 __isl_take isl_set *context);
6831         __isl_give isl_multi_aff *isl_multi_aff_gist(
6832                 __isl_take isl_multi_aff *maff,
6833                 __isl_take isl_set *context);
6834         __isl_give isl_pw_aff *isl_pw_aff_gist_params(
6835                 __isl_take isl_pw_aff *pwaff,
6836                 __isl_take isl_set *context);
6837         __isl_give isl_pw_aff *isl_pw_aff_gist(
6838                 __isl_take isl_pw_aff *pwaff,
6839                 __isl_take isl_set *context);
6840         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_gist_params(
6841                 __isl_take isl_pw_multi_aff *pma,
6842                 __isl_take isl_set *set);
6843         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_gist(
6844                 __isl_take isl_pw_multi_aff *pma,
6845                 __isl_take isl_set *set);
6846         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_gist_params(
6847                 __isl_take isl_multi_pw_aff *mpa,
6848                 __isl_take isl_set *set);
6849         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_gist(
6850                 __isl_take isl_multi_pw_aff *mpa,
6851                 __isl_take isl_set *set);
6852         __isl_give isl_union_pw_aff *isl_union_pw_aff_gist(
6853                 __isl_take isl_union_pw_aff *upa,
6854                 __isl_take isl_union_set *context);
6855         __isl_give isl_union_pw_aff *isl_union_pw_aff_gist_params(
6856                 __isl_take isl_union_pw_aff *upa,
6857                 __isl_take isl_set *context);
6858         __isl_give isl_union_pw_multi_aff *
6859         isl_union_pw_multi_aff_gist_params(
6860                 __isl_take isl_union_pw_multi_aff *upma,
6861                 __isl_take isl_set *context);
6862         __isl_give isl_union_pw_multi_aff *
6863         isl_union_pw_multi_aff_gist(
6864                 __isl_take isl_union_pw_multi_aff *upma,
6865                 __isl_take isl_union_set *context);
6866         __isl_give isl_multi_union_pw_aff *
6867         isl_multi_union_pw_aff_gist_params(
6868                 __isl_take isl_multi_union_pw_aff *aff,
6869                 __isl_take isl_set *context);
6870         __isl_give isl_multi_union_pw_aff *
6871         isl_multi_union_pw_aff_gist(
6872                 __isl_take isl_multi_union_pw_aff *aff,
6873                 __isl_take isl_union_set *context);
6875         #include <isl/polynomial.h>
6876         __isl_give isl_qpolynomial *isl_qpolynomial_gist_params(
6877                 __isl_take isl_qpolynomial *qp,
6878                 __isl_take isl_set *context);
6879         __isl_give isl_qpolynomial *isl_qpolynomial_gist(
6880                 __isl_take isl_qpolynomial *qp,
6881                 __isl_take isl_set *context);
6882         __isl_give isl_qpolynomial_fold *
6883         isl_qpolynomial_fold_gist_params(
6884                 __isl_take isl_qpolynomial_fold *fold,
6885                 __isl_take isl_set *context);
6886         __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_gist(
6887                 __isl_take isl_qpolynomial_fold *fold,
6888                 __isl_take isl_set *context);
6889         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_gist_params(
6890                 __isl_take isl_pw_qpolynomial *pwqp,
6891                 __isl_take isl_set *context);
6892         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_gist(
6893                 __isl_take isl_pw_qpolynomial *pwqp,
6894                 __isl_take isl_set *context);
6895         __isl_give isl_pw_qpolynomial_fold *
6896         isl_pw_qpolynomial_fold_gist(
6897                 __isl_take isl_pw_qpolynomial_fold *pwf,
6898                 __isl_take isl_set *context);
6899         __isl_give isl_pw_qpolynomial_fold *
6900         isl_pw_qpolynomial_fold_gist_params(
6901                 __isl_take isl_pw_qpolynomial_fold *pwf,
6902                 __isl_take isl_set *context);
6903         __isl_give isl_union_pw_qpolynomial *
6904         isl_union_pw_qpolynomial_gist_params(
6905                 __isl_take isl_union_pw_qpolynomial *upwqp,
6906                 __isl_take isl_set *context);
6907         __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_gist(
6908                 __isl_take isl_union_pw_qpolynomial *upwqp,
6909                 __isl_take isl_union_set *context);
6910         __isl_give isl_union_pw_qpolynomial_fold *
6911         isl_union_pw_qpolynomial_fold_gist(
6912                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
6913                 __isl_take isl_union_set *context);
6914         __isl_give isl_union_pw_qpolynomial_fold *
6915         isl_union_pw_qpolynomial_fold_gist_params(
6916                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
6917                 __isl_take isl_set *context);
6919 =item * Binary Arithmetic Operations
6921         #include <isl/set.h>
6922         __isl_give isl_set *isl_set_sum(
6923                 __isl_take isl_set *set1,
6924                 __isl_take isl_set *set2);
6925         #include <isl/map.h>
6926         __isl_give isl_map *isl_map_sum(
6927                 __isl_take isl_map *map1,
6928                 __isl_take isl_map *map2);
6930 C<isl_set_sum> computes the Minkowski sum of its two arguments,
6931 i.e., the set containing the sums of pairs of elements from
6932 C<set1> and C<set2>.
6933 The domain of the result of C<isl_map_sum> is the intersection
6934 of the domains of its two arguments.  The corresponding range
6935 elements are the sums of the corresponding range elements
6936 in the two arguments.
6938         #include <isl/val.h>
6939         __isl_give isl_multi_val *isl_multi_val_add(
6940                 __isl_take isl_multi_val *mv1,
6941                 __isl_take isl_multi_val *mv2);
6942         __isl_give isl_multi_val *isl_multi_val_sub(
6943                 __isl_take isl_multi_val *mv1,
6944                 __isl_take isl_multi_val *mv2);
6946         #include <isl/aff.h>
6947         __isl_give isl_aff *isl_aff_add(
6948                 __isl_take isl_aff *aff1,
6949                 __isl_take isl_aff *aff2);
6950         __isl_give isl_multi_aff *isl_multi_aff_add(
6951                 __isl_take isl_multi_aff *maff1,
6952                 __isl_take isl_multi_aff *maff2);
6953         __isl_give isl_pw_aff *isl_pw_aff_add(
6954                 __isl_take isl_pw_aff *pwaff1,
6955                 __isl_take isl_pw_aff *pwaff2);
6956         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_add(
6957                 __isl_take isl_multi_pw_aff *mpa1,
6958                 __isl_take isl_multi_pw_aff *mpa2);
6959         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_add(
6960                 __isl_take isl_pw_multi_aff *pma1,
6961                 __isl_take isl_pw_multi_aff *pma2);
6962         __isl_give isl_union_pw_aff *isl_union_pw_aff_add(
6963                 __isl_take isl_union_pw_aff *upa1,
6964                 __isl_take isl_union_pw_aff *upa2);
6965         __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_add(
6966                 __isl_take isl_union_pw_multi_aff *upma1,
6967                 __isl_take isl_union_pw_multi_aff *upma2);
6968         __isl_give isl_multi_union_pw_aff *
6969         isl_multi_union_pw_aff_add(
6970                 __isl_take isl_multi_union_pw_aff *mupa1,
6971                 __isl_take isl_multi_union_pw_aff *mupa2);
6972         __isl_give isl_pw_aff *isl_pw_aff_min(
6973                 __isl_take isl_pw_aff *pwaff1,
6974                 __isl_take isl_pw_aff *pwaff2);
6975         __isl_give isl_pw_aff *isl_pw_aff_max(
6976                 __isl_take isl_pw_aff *pwaff1,
6977                 __isl_take isl_pw_aff *pwaff2);
6978         __isl_give isl_aff *isl_aff_sub(
6979                 __isl_take isl_aff *aff1,
6980                 __isl_take isl_aff *aff2);
6981         __isl_give isl_multi_aff *isl_multi_aff_sub(
6982                 __isl_take isl_multi_aff *ma1,
6983                 __isl_take isl_multi_aff *ma2);
6984         __isl_give isl_pw_aff *isl_pw_aff_sub(
6985                 __isl_take isl_pw_aff *pwaff1,
6986                 __isl_take isl_pw_aff *pwaff2);
6987         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_sub(
6988                 __isl_take isl_multi_pw_aff *mpa1,
6989                 __isl_take isl_multi_pw_aff *mpa2);
6990         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_sub(
6991                 __isl_take isl_pw_multi_aff *pma1,
6992                 __isl_take isl_pw_multi_aff *pma2);
6993         __isl_give isl_union_pw_aff *isl_union_pw_aff_sub(
6994                 __isl_take isl_union_pw_aff *upa1,
6995                 __isl_take isl_union_pw_aff *upa2);
6996         __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_sub(
6997                 __isl_take isl_union_pw_multi_aff *upma1,
6998                 __isl_take isl_union_pw_multi_aff *upma2);
6999         __isl_give isl_multi_union_pw_aff *
7000         isl_multi_union_pw_aff_sub(
7001                 __isl_take isl_multi_union_pw_aff *mupa1,
7002                 __isl_take isl_multi_union_pw_aff *mupa2);
7004 C<isl_aff_sub> subtracts the second argument from the first.
7006         #include <isl/polynomial.h>
7007         __isl_give isl_qpolynomial *isl_qpolynomial_add(
7008                 __isl_take isl_qpolynomial *qp1,
7009                 __isl_take isl_qpolynomial *qp2);
7010         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add(
7011                 __isl_take isl_pw_qpolynomial *pwqp1,
7012                 __isl_take isl_pw_qpolynomial *pwqp2);
7013         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_disjoint(
7014                 __isl_take isl_pw_qpolynomial *pwqp1,
7015                 __isl_take isl_pw_qpolynomial *pwqp2);
7016         __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add(
7017                 __isl_take isl_pw_qpolynomial_fold *pwf1,
7018                 __isl_take isl_pw_qpolynomial_fold *pwf2);
7019         __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_add(
7020                 __isl_take isl_union_pw_qpolynomial *upwqp1,
7021                 __isl_take isl_union_pw_qpolynomial *upwqp2);
7022         __isl_give isl_qpolynomial *isl_qpolynomial_sub(
7023                 __isl_take isl_qpolynomial *qp1,
7024                 __isl_take isl_qpolynomial *qp2);
7025         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_sub(
7026                 __isl_take isl_pw_qpolynomial *pwqp1,
7027                 __isl_take isl_pw_qpolynomial *pwqp2);
7028         __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_sub(
7029                 __isl_take isl_union_pw_qpolynomial *upwqp1,
7030                 __isl_take isl_union_pw_qpolynomial *upwqp2);
7031         __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_fold(
7032                 __isl_take isl_pw_qpolynomial_fold *pwf1,
7033                 __isl_take isl_pw_qpolynomial_fold *pwf2);
7034         __isl_give isl_union_pw_qpolynomial_fold *
7035         isl_union_pw_qpolynomial_fold_fold(
7036                 __isl_take isl_union_pw_qpolynomial_fold *upwf1,
7037                 __isl_take isl_union_pw_qpolynomial_fold *upwf2);
7039         #include <isl/aff.h>
7040         __isl_give isl_pw_aff *isl_pw_aff_union_add(
7041                 __isl_take isl_pw_aff *pwaff1,
7042                 __isl_take isl_pw_aff *pwaff2);
7043         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_add(
7044                 __isl_take isl_pw_multi_aff *pma1,
7045                 __isl_take isl_pw_multi_aff *pma2);
7046         __isl_give isl_union_pw_aff *isl_union_pw_aff_union_add(
7047                 __isl_take isl_union_pw_aff *upa1,
7048                 __isl_take isl_union_pw_aff *upa2);
7049         __isl_give isl_union_pw_multi_aff *
7050         isl_union_pw_multi_aff_union_add(
7051                 __isl_take isl_union_pw_multi_aff *upma1,
7052                 __isl_take isl_union_pw_multi_aff *upma2);
7053         __isl_give isl_multi_union_pw_aff *
7054         isl_multi_union_pw_aff_union_add(
7055                 __isl_take isl_multi_union_pw_aff *mupa1,
7056                 __isl_take isl_multi_union_pw_aff *mupa2);
7057         __isl_give isl_pw_aff *isl_pw_aff_union_min(
7058                 __isl_take isl_pw_aff *pwaff1,
7059                 __isl_take isl_pw_aff *pwaff2);
7060         __isl_give isl_pw_aff *isl_pw_aff_union_max(
7061                 __isl_take isl_pw_aff *pwaff1,
7062                 __isl_take isl_pw_aff *pwaff2);
7064 The function C<isl_pw_aff_union_max> computes a piecewise quasi-affine
7065 expression with a domain that is the union of those of C<pwaff1> and
7066 C<pwaff2> and such that on each cell, the quasi-affine expression is
7067 the maximum of those of C<pwaff1> and C<pwaff2>.  If only one of
7068 C<pwaff1> or C<pwaff2> is defined on a given cell, then the
7069 associated expression is the defined one.
7070 This in contrast to the C<isl_pw_aff_max> function, which is
7071 only defined on the shared definition domain of the arguments.
7073         #include <isl/val.h>
7074         __isl_give isl_multi_val *isl_multi_val_add_val(
7075                 __isl_take isl_multi_val *mv,
7076                 __isl_take isl_val *v);
7077         __isl_give isl_multi_val *isl_multi_val_mod_val(
7078                 __isl_take isl_multi_val *mv,
7079                 __isl_take isl_val *v);
7080         __isl_give isl_multi_val *isl_multi_val_scale_val(
7081                 __isl_take isl_multi_val *mv,
7082                 __isl_take isl_val *v);
7083         __isl_give isl_multi_val *isl_multi_val_scale_down_val(
7084                 __isl_take isl_multi_val *mv,
7085                 __isl_take isl_val *v);
7087         #include <isl/aff.h>
7088         __isl_give isl_aff *isl_aff_mod_val(__isl_take isl_aff *aff,
7089                 __isl_take isl_val *mod);
7090         __isl_give isl_pw_aff *isl_pw_aff_mod_val(
7091                 __isl_take isl_pw_aff *pa,
7092                 __isl_take isl_val *mod);
7093         __isl_give isl_union_pw_aff *isl_union_pw_aff_mod_val(
7094                 __isl_take isl_union_pw_aff *upa,
7095                 __isl_take isl_val *f);
7096         __isl_give isl_aff *isl_aff_scale_val(__isl_take isl_aff *aff,
7097                 __isl_take isl_val *v);
7098         __isl_give isl_multi_aff *isl_multi_aff_scale_val(
7099                 __isl_take isl_multi_aff *ma,
7100                 __isl_take isl_val *v);
7101         __isl_give isl_pw_aff *isl_pw_aff_scale_val(
7102                 __isl_take isl_pw_aff *pa, __isl_take isl_val *v);
7103         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_scale_val(
7104                 __isl_take isl_multi_pw_aff *mpa,
7105                 __isl_take isl_val *v);
7106         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_val(
7107                 __isl_take isl_pw_multi_aff *pma,
7108                 __isl_take isl_val *v);
7109         __isl_give isl_union_pw_multi_aff *
7110         __isl_give isl_union_pw_aff *isl_union_pw_aff_scale_val(
7111                 __isl_take isl_union_pw_aff *upa,
7112                 __isl_take isl_val *f);
7113         isl_union_pw_multi_aff_scale_val(
7114                 __isl_take isl_union_pw_multi_aff *upma,
7115                 __isl_take isl_val *val);
7116         __isl_give isl_multi_union_pw_aff *
7117         isl_multi_union_pw_aff_scale_val(
7118                 __isl_take isl_multi_union_pw_aff *mupa,
7119                 __isl_take isl_val *v);
7120         __isl_give isl_aff *isl_aff_scale_down_ui(
7121                 __isl_take isl_aff *aff, unsigned f);
7122         __isl_give isl_aff *isl_aff_scale_down_val(
7123                 __isl_take isl_aff *aff, __isl_take isl_val *v);
7124         __isl_give isl_multi_aff *isl_multi_aff_scale_down_val(
7125                 __isl_take isl_multi_aff *ma,
7126                 __isl_take isl_val *v);
7127         __isl_give isl_pw_aff *isl_pw_aff_scale_down_val(
7128                 __isl_take isl_pw_aff *pa,
7129                 __isl_take isl_val *f);
7130         __isl_give isl_multi_pw_aff *isl_multi_pw_aff_scale_down_val(
7131                 __isl_take isl_multi_pw_aff *mpa,
7132                 __isl_take isl_val *v);
7133         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_down_val(
7134                 __isl_take isl_pw_multi_aff *pma,
7135                 __isl_take isl_val *v);
7136         __isl_give isl_union_pw_aff *isl_union_pw_aff_scale_down_val(
7137                 __isl_take isl_union_pw_aff *upa,
7138                 __isl_take isl_val *v);
7139         __isl_give isl_union_pw_multi_aff *
7140         isl_union_pw_multi_aff_scale_down_val(
7141                 __isl_take isl_union_pw_multi_aff *upma,
7142                 __isl_take isl_val *val);
7143         __isl_give isl_multi_union_pw_aff *
7144         isl_multi_union_pw_aff_scale_down_val(
7145                 __isl_take isl_multi_union_pw_aff *mupa,
7146                 __isl_take isl_val *v);
7148         #include <isl/polynomial.h>
7149         __isl_give isl_qpolynomial *isl_qpolynomial_scale_val(
7150                 __isl_take isl_qpolynomial *qp,
7151                 __isl_take isl_val *v);
7152         __isl_give isl_qpolynomial_fold *
7153         isl_qpolynomial_fold_scale_val(
7154                 __isl_take isl_qpolynomial_fold *fold,
7155                 __isl_take isl_val *v);
7156         __isl_give isl_pw_qpolynomial *
7157         isl_pw_qpolynomial_scale_val(
7158                 __isl_take isl_pw_qpolynomial *pwqp,
7159                 __isl_take isl_val *v);
7160         __isl_give isl_pw_qpolynomial_fold *
7161         isl_pw_qpolynomial_fold_scale_val(
7162                 __isl_take isl_pw_qpolynomial_fold *pwf,
7163                 __isl_take isl_val *v);
7164         __isl_give isl_union_pw_qpolynomial *
7165         isl_union_pw_qpolynomial_scale_val(
7166                 __isl_take isl_union_pw_qpolynomial *upwqp,
7167                 __isl_take isl_val *v);
7168         __isl_give isl_union_pw_qpolynomial_fold *
7169         isl_union_pw_qpolynomial_fold_scale_val(
7170                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
7171                 __isl_take isl_val *v);
7172         __isl_give isl_qpolynomial *
7173         isl_qpolynomial_scale_down_val(
7174                 __isl_take isl_qpolynomial *qp,
7175                 __isl_take isl_val *v);
7176         __isl_give isl_qpolynomial_fold *
7177         isl_qpolynomial_fold_scale_down_val(
7178                 __isl_take isl_qpolynomial_fold *fold,
7179                 __isl_take isl_val *v);
7180         __isl_give isl_pw_qpolynomial *
7181         isl_pw_qpolynomial_scale_down_val(
7182                 __isl_take isl_pw_qpolynomial *pwqp,
7183                 __isl_take isl_val *v);
7184         __isl_give isl_pw_qpolynomial_fold *
7185         isl_pw_qpolynomial_fold_scale_down_val(
7186                 __isl_take isl_pw_qpolynomial_fold *pwf,
7187                 __isl_take isl_val *v);
7188         __isl_give isl_union_pw_qpolynomial *
7189         isl_union_pw_qpolynomial_scale_down_val(
7190                 __isl_take isl_union_pw_qpolynomial *upwqp,
7191                 __isl_take isl_val *v);
7192         __isl_give isl_union_pw_qpolynomial_fold *
7193         isl_union_pw_qpolynomial_fold_scale_down_val(
7194                 __isl_take isl_union_pw_qpolynomial_fold *upwf,
7195                 __isl_take isl_val *v);
7197         #include <isl/val.h>
7198         __isl_give isl_multi_val *isl_multi_val_mod_multi_val(
7199                 __isl_take isl_multi_val *mv1,
7200                 __isl_take isl_multi_val *mv2);
7201         __isl_give isl_multi_val *isl_multi_val_scale_multi_val(
7202                 __isl_take isl_multi_val *mv1,
7203                 __isl_take isl_multi_val *mv2);
7204         __isl_give isl_multi_val *
7205         isl_multi_val_scale_down_multi_val(
7206                 __isl_take isl_multi_val *mv1,
7207                 __isl_take isl_multi_val *mv2);
7209         #include <isl/aff.h>
7210         __isl_give isl_multi_aff *isl_multi_aff_mod_multi_val(
7211                 __isl_take isl_multi_aff *ma,
7212                 __isl_take isl_multi_val *mv);
7213         __isl_give isl_multi_union_pw_aff *
7214         isl_multi_union_pw_aff_mod_multi_val(
7215                 __isl_take isl_multi_union_pw_aff *upma,
7216                 __isl_take isl_multi_val *mv);
7217         __isl_give isl_multi_pw_aff *
7218         isl_multi_pw_aff_mod_multi_val(
7219                 __isl_take isl_multi_pw_aff *mpa,
7220                 __isl_take isl_multi_val *mv);
7221         __isl_give isl_multi_aff *isl_multi_aff_scale_multi_val(
7222                 __isl_take isl_multi_aff *ma,
7223                 __isl_take isl_multi_val *mv);
7224         __isl_give isl_pw_multi_aff *
7225         isl_pw_multi_aff_scale_multi_val(
7226                 __isl_take isl_pw_multi_aff *pma,
7227                 __isl_take isl_multi_val *mv);
7228         __isl_give isl_multi_pw_aff *
7229         isl_multi_pw_aff_scale_multi_val(
7230                 __isl_take isl_multi_pw_aff *mpa,
7231                 __isl_take isl_multi_val *mv);
7232         __isl_give isl_multi_union_pw_aff *
7233         isl_multi_union_pw_aff_scale_multi_val(
7234                 __isl_take isl_multi_union_pw_aff *mupa,
7235                 __isl_take isl_multi_val *mv);
7236         __isl_give isl_union_pw_multi_aff *
7237         isl_union_pw_multi_aff_scale_multi_val(
7238                 __isl_take isl_union_pw_multi_aff *upma,
7239                 __isl_take isl_multi_val *mv);
7240         __isl_give isl_multi_aff *
7241         isl_multi_aff_scale_down_multi_val(
7242                 __isl_take isl_multi_aff *ma,
7243                 __isl_take isl_multi_val *mv);
7244         __isl_give isl_multi_pw_aff *
7245         isl_multi_pw_aff_scale_down_multi_val(
7246                 __isl_take isl_multi_pw_aff *mpa,
7247                 __isl_take isl_multi_val *mv);
7248         __isl_give isl_multi_union_pw_aff *
7249         isl_multi_union_pw_aff_scale_down_multi_val(
7250                 __isl_take isl_multi_union_pw_aff *mupa,
7251                 __isl_take isl_multi_val *mv);
7253 C<isl_multi_aff_scale_multi_val> scales the elements of C<ma>
7254 by the corresponding elements of C<mv>.
7256         #include <isl/aff.h>
7257         __isl_give isl_aff *isl_aff_mul(
7258                 __isl_take isl_aff *aff1,
7259                 __isl_take isl_aff *aff2);
7260         __isl_give isl_aff *isl_aff_div(
7261                 __isl_take isl_aff *aff1,
7262                 __isl_take isl_aff *aff2);
7263         __isl_give isl_pw_aff *isl_pw_aff_mul(
7264                 __isl_take isl_pw_aff *pwaff1,
7265                 __isl_take isl_pw_aff *pwaff2);
7266         __isl_give isl_pw_aff *isl_pw_aff_div(
7267                 __isl_take isl_pw_aff *pa1,
7268                 __isl_take isl_pw_aff *pa2);
7269         __isl_give isl_pw_aff *isl_pw_aff_tdiv_q(
7270                 __isl_take isl_pw_aff *pa1,
7271                 __isl_take isl_pw_aff *pa2);
7272         __isl_give isl_pw_aff *isl_pw_aff_tdiv_r(
7273                 __isl_take isl_pw_aff *pa1,
7274                 __isl_take isl_pw_aff *pa2);
7276 When multiplying two affine expressions, at least one of the two needs
7277 to be a constant.  Similarly, when dividing an affine expression by another,
7278 the second expression needs to be a constant.
7279 C<isl_pw_aff_tdiv_q> computes the quotient of an integer division with
7280 rounding towards zero.  C<isl_pw_aff_tdiv_r> computes the corresponding
7281 remainder.
7283         #include <isl/polynomial.h>
7284         __isl_give isl_qpolynomial *isl_qpolynomial_mul(
7285                 __isl_take isl_qpolynomial *qp1,
7286                 __isl_take isl_qpolynomial *qp2);
7287         __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul(
7288                 __isl_take isl_pw_qpolynomial *pwqp1,
7289                 __isl_take isl_pw_qpolynomial *pwqp2);
7290         __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_mul(
7291                 __isl_take isl_union_pw_qpolynomial *upwqp1,
7292                 __isl_take isl_union_pw_qpolynomial *upwqp2);
7294 =back
7296 =head3 Lexicographic Optimization
7298 Given a (basic) set C<set> (or C<bset>) and a zero-dimensional domain C<dom>,
7299 the following functions
7300 compute a set that contains the lexicographic minimum or maximum
7301 of the elements in C<set> (or C<bset>) for those values of the parameters
7302 that satisfy C<dom>.
7303 If C<empty> is not C<NULL>, then C<*empty> is assigned a set
7304 that contains the parameter values in C<dom> for which C<set> (or C<bset>)
7305 has no elements.
7306 In other words, the union of the parameter values
7307 for which the result is non-empty and of C<*empty>
7308 is equal to C<dom>.
7310         #include <isl/set.h>
7311         __isl_give isl_set *isl_basic_set_partial_lexmin(
7312                 __isl_take isl_basic_set *bset,
7313                 __isl_take isl_basic_set *dom,
7314                 __isl_give isl_set **empty);
7315         __isl_give isl_set *isl_basic_set_partial_lexmax(
7316                 __isl_take isl_basic_set *bset,
7317                 __isl_take isl_basic_set *dom,
7318                 __isl_give isl_set **empty);
7319         __isl_give isl_set *isl_set_partial_lexmin(
7320                 __isl_take isl_set *set, __isl_take isl_set *dom,
7321                 __isl_give isl_set **empty);
7322         __isl_give isl_set *isl_set_partial_lexmax(
7323                 __isl_take isl_set *set, __isl_take isl_set *dom,
7324                 __isl_give isl_set **empty);
7326 Given a (basic) set C<set> (or C<bset>), the following functions simply
7327 return a set containing the lexicographic minimum or maximum
7328 of the elements in C<set> (or C<bset>).
7329 In case of union sets, the optimum is computed per space.
7331         #include <isl/set.h>
7332         __isl_give isl_set *isl_basic_set_lexmin(
7333                 __isl_take isl_basic_set *bset);
7334         __isl_give isl_set *isl_basic_set_lexmax(
7335                 __isl_take isl_basic_set *bset);
7336         __isl_give isl_set *isl_set_lexmin(
7337                 __isl_take isl_set *set);
7338         __isl_give isl_set *isl_set_lexmax(
7339                 __isl_take isl_set *set);
7340         __isl_give isl_union_set *isl_union_set_lexmin(
7341                 __isl_take isl_union_set *uset);
7342         __isl_give isl_union_set *isl_union_set_lexmax(
7343                 __isl_take isl_union_set *uset);
7345 Given a (basic) relation C<map> (or C<bmap>) and a domain C<dom>,
7346 the following functions
7347 compute a relation that maps each element of C<dom>
7348 to the single lexicographic minimum or maximum
7349 of the elements that are associated to that same
7350 element in C<map> (or C<bmap>).
7351 If C<empty> is not C<NULL>, then C<*empty> is assigned a set
7352 that contains the elements in C<dom> that do not map
7353 to any elements in C<map> (or C<bmap>).
7354 In other words, the union of the domain of the result and of C<*empty>
7355 is equal to C<dom>.
7357         #include <isl/map.h>
7358         __isl_give isl_map *isl_basic_map_partial_lexmax(
7359                 __isl_take isl_basic_map *bmap,
7360                 __isl_take isl_basic_set *dom,
7361                 __isl_give isl_set **empty);
7362         __isl_give isl_map *isl_basic_map_partial_lexmin(
7363                 __isl_take isl_basic_map *bmap,
7364                 __isl_take isl_basic_set *dom,
7365                 __isl_give isl_set **empty);
7366         __isl_give isl_map *isl_map_partial_lexmax(
7367                 __isl_take isl_map *map, __isl_take isl_set *dom,
7368                 __isl_give isl_set **empty);
7369         __isl_give isl_map *isl_map_partial_lexmin(
7370                 __isl_take isl_map *map, __isl_take isl_set *dom,
7371                 __isl_give isl_set **empty);
7373 Given a (basic) map C<map> (or C<bmap>), the following functions simply
7374 return a map mapping each element in the domain of
7375 C<map> (or C<bmap>) to the lexicographic minimum or maximum
7376 of all elements associated to that element.
7377 In case of union relations, the optimum is computed per space.
7379         #include <isl/map.h>
7380         __isl_give isl_map *isl_basic_map_lexmin(
7381                 __isl_take isl_basic_map *bmap);
7382         __isl_give isl_map *isl_basic_map_lexmax(
7383                 __isl_take isl_basic_map *bmap);
7384         __isl_give isl_map *isl_map_lexmin(
7385                 __isl_take isl_map *map);
7386         __isl_give isl_map *isl_map_lexmax(
7387                 __isl_take isl_map *map);
7388         __isl_give isl_union_map *isl_union_map_lexmin(
7389                 __isl_take isl_union_map *umap);
7390         __isl_give isl_union_map *isl_union_map_lexmax(
7391                 __isl_take isl_union_map *umap);
7393 The following functions return their result in the form of
7394 a piecewise multi-affine expression,
7395 but are otherwise equivalent to the corresponding functions
7396 returning a basic set or relation.
7398         #include <isl/set.h>
7399         __isl_give isl_pw_multi_aff *
7400         isl_basic_set_partial_lexmin_pw_multi_aff(
7401                 __isl_take isl_basic_set *bset,
7402                 __isl_take isl_basic_set *dom,
7403                 __isl_give isl_set **empty);
7404         __isl_give isl_pw_multi_aff *
7405         isl_basic_set_partial_lexmax_pw_multi_aff(
7406                 __isl_take isl_basic_set *bset,
7407                 __isl_take isl_basic_set *dom,
7408                 __isl_give isl_set **empty);
7409         __isl_give isl_pw_multi_aff *isl_set_lexmin_pw_multi_aff(
7410                 __isl_take isl_set *set);
7411         __isl_give isl_pw_multi_aff *isl_set_lexmax_pw_multi_aff(
7412                 __isl_take isl_set *set);
7414         #include <isl/map.h>
7415         __isl_give isl_pw_multi_aff *
7416         isl_basic_map_lexmin_pw_multi_aff(
7417                 __isl_take isl_basic_map *bmap);
7418         __isl_give isl_pw_multi_aff *
7419         isl_basic_map_partial_lexmin_pw_multi_aff(
7420                 __isl_take isl_basic_map *bmap,
7421                 __isl_take isl_basic_set *dom,
7422                 __isl_give isl_set **empty);
7423         __isl_give isl_pw_multi_aff *
7424         isl_basic_map_partial_lexmax_pw_multi_aff(
7425                 __isl_take isl_basic_map *bmap,
7426                 __isl_take isl_basic_set *dom,
7427                 __isl_give isl_set **empty);
7428         __isl_give isl_pw_multi_aff *isl_map_lexmin_pw_multi_aff(
7429                 __isl_take isl_map *map);
7430         __isl_give isl_pw_multi_aff *isl_map_lexmax_pw_multi_aff(
7431                 __isl_take isl_map *map);
7433 The following functions return the lexicographic minimum or maximum
7434 on the shared domain of the inputs and the single defined function
7435 on those parts of the domain where only a single function is defined.
7437         #include <isl/aff.h>
7438         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_lexmin(
7439                 __isl_take isl_pw_multi_aff *pma1,
7440                 __isl_take isl_pw_multi_aff *pma2);
7441         __isl_give isl_pw_multi_aff *isl_pw_multi_aff_union_lexmax(
7442                 __isl_take isl_pw_multi_aff *pma1,
7443                 __isl_take isl_pw_multi_aff *pma2);
7445 If the input to a lexicographic optimization problem has
7446 multiple constraints with the same coefficients for the optimized
7447 variables, then, by default, this symmetry is exploited by
7448 replacing those constraints by a single constraint with
7449 an abstract bound, which is in turn bounded by the corresponding terms
7450 in the original constraints.
7451 Without this optimization, the solver would typically consider
7452 all possible orderings of those original bounds, resulting in a needless
7453 decomposition of the domain.
7454 However, the optimization can also result in slowdowns since
7455 an extra parameter is introduced that may get used in additional
7456 integer divisions.
7457 The following option determines whether symmetry detection is applied
7458 during lexicographic optimization.
7460         #include <isl/options.h>
7461         isl_stat isl_options_set_pip_symmetry(isl_ctx *ctx,
7462                 int val);
7463         int isl_options_get_pip_symmetry(isl_ctx *ctx);
7465 =begin latex
7467 See also \autoref{s:offline}.
7469 =end latex
7471 =head2 Ternary Operations
7473         #include <isl/aff.h>
7474         __isl_give isl_pw_aff *isl_pw_aff_cond(
7475                 __isl_take isl_pw_aff *cond,
7476                 __isl_take isl_pw_aff *pwaff_true,
7477                 __isl_take isl_pw_aff *pwaff_false);
7479 The function C<isl_pw_aff_cond> performs a conditional operator
7480 and returns an expression that is equal to C<pwaff_true>
7481 for elements where C<cond> is non-zero and equal to C<pwaff_false> for elements
7482 where C<cond> is zero.
7484 =head2 Lists
7486 Lists are defined over several element types, including
7487 C<isl_val>, C<isl_id>, C<isl_aff>, C<isl_pw_aff>, C<isl_union_pw_aff>,
7488 C<isl_union_pw_multi_aff>, C<isl_constraint>,
7489 C<isl_basic_set>, C<isl_set>, C<isl_basic_map>, C<isl_map>, C<isl_union_set>,
7490 C<isl_union_map>, C<isl_ast_expr> and C<isl_ast_node>.
7491 Here we take lists of C<isl_set>s as an example.
7492 Lists can be created, copied, modified and freed using the following functions.
7494         #include <isl/set.h>
7495         __isl_give isl_set_list *isl_set_list_from_set(
7496                 __isl_take isl_set *el);
7497         __isl_give isl_set_list *isl_set_list_alloc(
7498                 isl_ctx *ctx, int n);
7499         __isl_give isl_set_list *isl_set_list_copy(
7500                 __isl_keep isl_set_list *list);
7501         __isl_give isl_set_list *isl_set_list_insert(
7502                 __isl_take isl_set_list *list, unsigned pos,
7503                 __isl_take isl_set *el);
7504         __isl_give isl_set_list *isl_set_list_add(
7505                 __isl_take isl_set_list *list,
7506                 __isl_take isl_set *el);
7507         __isl_give isl_set_list *isl_set_list_drop(
7508                 __isl_take isl_set_list *list,
7509                 unsigned first, unsigned n);
7510         __isl_give isl_set_list *isl_set_list_set_set(
7511                 __isl_take isl_set_list *list, int index,
7512                 __isl_take isl_set *set);
7513         __isl_give isl_set_list *isl_set_list_concat(
7514                 __isl_take isl_set_list *list1,
7515                 __isl_take isl_set_list *list2);
7516         __isl_give isl_set_list *isl_set_list_map(
7517                 __isl_take isl_set_list *list,
7518                 __isl_give isl_set *(*fn)(__isl_take isl_set *el,
7519                         void *user),
7520                 void *user);
7521         __isl_give isl_set_list *isl_set_list_sort(
7522                 __isl_take isl_set_list *list,
7523                 int (*cmp)(__isl_keep isl_set *a,
7524                         __isl_keep isl_set *b, void *user),
7525                 void *user);
7526         __isl_null isl_set_list *isl_set_list_free(
7527                 __isl_take isl_set_list *list);
7529 C<isl_set_list_alloc> creates an empty list with an initial capacity
7530 for C<n> elements.  C<isl_set_list_insert> and C<isl_set_list_add>
7531 add elements to a list, increasing its capacity as needed.
7532 C<isl_set_list_from_set> creates a list with a single element.
7534 Lists can be inspected using the following functions.
7536         #include <isl/set.h>
7537         int isl_set_list_n_set(__isl_keep isl_set_list *list);
7538         __isl_give isl_set *isl_set_list_get_set(
7539                 __isl_keep isl_set_list *list, int index);
7540         isl_stat isl_set_list_foreach(__isl_keep isl_set_list *list,
7541                 isl_stat (*fn)(__isl_take isl_set *el, void *user),
7542                 void *user);
7543         isl_stat isl_set_list_foreach_scc(
7544                 __isl_keep isl_set_list *list,
7545                 isl_bool (*follows)(__isl_keep isl_set *a,
7546                         __isl_keep isl_set *b, void *user),
7547                 void *follows_user,
7548                 isl_stat (*fn)(__isl_take isl_set *el, void *user),
7549                 void *fn_user);
7551 The function C<isl_set_list_foreach_scc> calls C<fn> on each of the
7552 strongly connected components of the graph with as vertices the elements
7553 of C<list> and a directed edge from vertex C<b> to vertex C<a>
7554 iff C<follows(a, b)> returns C<isl_bool_true>.  The callbacks C<follows> and
7555 C<fn> should return C<isl_bool_error> or C<isl_stat_error> on error.
7557 Lists can be printed using
7559         #include <isl/set.h>
7560         __isl_give isl_printer *isl_printer_print_set_list(
7561                 __isl_take isl_printer *p,
7562                 __isl_keep isl_set_list *list);
7564 =head2 Associative arrays
7566 Associative arrays map isl objects of a specific type to isl objects
7567 of some (other) specific type.  They are defined for several pairs
7568 of types, including (C<isl_map>, C<isl_basic_set>),
7569 (C<isl_id>, C<isl_ast_expr>),
7570 (C<isl_id>, C<isl_id>) and
7571 (C<isl_id>, C<isl_pw_aff>).
7572 Here, we take associative arrays that map C<isl_id>s to C<isl_ast_expr>s
7573 as an example.
7575 Associative arrays can be created, copied and freed using
7576 the following functions.
7578         #include <isl/id_to_ast_expr.h>
7579         __isl_give isl_id_to_ast_expr *isl_id_to_ast_expr_alloc(
7580                 isl_ctx *ctx, int min_size);
7581         __isl_give isl_id_to_ast_expr *isl_id_to_ast_expr_copy(
7582                 __isl_keep isl_id_to_ast_expr *id2expr);
7583         __isl_null isl_id_to_ast_expr *isl_id_to_ast_expr_free(
7584                 __isl_take isl_id_to_ast_expr *id2expr);
7586 The C<min_size> argument to C<isl_id_to_ast_expr_alloc> can be used
7587 to specify the expected size of the associative array.
7588 The associative array will be grown automatically as needed.
7590 Associative arrays can be inspected using the following functions.
7592         #include <isl/id_to_ast_expr.h>
7593         __isl_give isl_maybe_isl_ast_expr
7594         isl_id_to_ast_expr_try_get(
7595                 __isl_keep isl_id_to_ast_expr *id2expr,
7596                 __isl_keep isl_id *key);
7597         isl_bool isl_id_to_ast_expr_has(
7598                 __isl_keep isl_id_to_ast_expr *id2expr,
7599                 __isl_keep isl_id *key);
7600         __isl_give isl_ast_expr *isl_id_to_ast_expr_get(
7601                 __isl_keep isl_id_to_ast_expr *id2expr,
7602                 __isl_take isl_id *key);
7603         isl_stat isl_id_to_ast_expr_foreach(
7604                 __isl_keep isl_id_to_ast_expr *id2expr,
7605                 isl_stat (*fn)(__isl_take isl_id *key,
7606                         __isl_take isl_ast_expr *val, void *user),
7607                 void *user);
7609 The function C<isl_id_to_ast_expr_try_get> returns a structure
7610 containing two elements, C<valid> and C<value>.
7611 If there is a value associated to the key, then C<valid>
7612 is set to C<isl_bool_true> and C<value> contains a copy of
7613 the associated value.  Otherwise C<value> is C<NULL> and
7614 C<valid> may be C<isl_bool_error> or C<isl_bool_false> depending
7615 on whether some error has occurred or there simply is no associated value.
7616 The function C<isl_id_to_ast_expr_has> returns the C<valid> field
7617 in the structure and
7618 the function C<isl_id_to_ast_expr_get> returns the C<value> field.
7620 Associative arrays can be modified using the following functions.
7622         #include <isl/id_to_ast_expr.h>
7623         __isl_give isl_id_to_ast_expr *isl_id_to_ast_expr_set(
7624                 __isl_take isl_id_to_ast_expr *id2expr,
7625                 __isl_take isl_id *key,
7626                 __isl_take isl_ast_expr *val);
7627         __isl_give isl_id_to_ast_expr *isl_id_to_ast_expr_drop(
7628                 __isl_take isl_id_to_ast_expr *id2expr,
7629                 __isl_take isl_id *key);
7631 Associative arrays can be printed using the following function.
7633         #include <isl/id_to_ast_expr.h>
7634         __isl_give isl_printer *isl_printer_print_id_to_ast_expr(
7635                 __isl_take isl_printer *p,
7636                 __isl_keep isl_id_to_ast_expr *id2expr);
7638 =head2 Vectors
7640 Vectors can be created, copied and freed using the following functions.
7642         #include <isl/vec.h>
7643         __isl_give isl_vec *isl_vec_alloc(isl_ctx *ctx,
7644                 unsigned size);
7645         __isl_give isl_vec *isl_vec_copy(__isl_keep isl_vec *vec);
7646         __isl_null isl_vec *isl_vec_free(__isl_take isl_vec *vec);
7648 Note that the elements of a newly created vector may have arbitrary values.
7649 The elements can be changed and inspected using the following functions.
7651         int isl_vec_size(__isl_keep isl_vec *vec);
7652         __isl_give isl_val *isl_vec_get_element_val(
7653                 __isl_keep isl_vec *vec, int pos);
7654         __isl_give isl_vec *isl_vec_set_element_si(
7655                 __isl_take isl_vec *vec, int pos, int v);
7656         __isl_give isl_vec *isl_vec_set_element_val(
7657                 __isl_take isl_vec *vec, int pos,
7658                 __isl_take isl_val *v);
7659         __isl_give isl_vec *isl_vec_set_si(__isl_take isl_vec *vec,
7660                 int v);
7661         __isl_give isl_vec *isl_vec_set_val(
7662                 __isl_take isl_vec *vec, __isl_take isl_val *v);
7663         int isl_vec_cmp_element(__isl_keep isl_vec *vec1,
7664                 __isl_keep isl_vec *vec2, int pos);
7666 C<isl_vec_get_element> will return a negative value if anything went wrong.
7667 In that case, the value of C<*v> is undefined.
7669 The following function can be used to concatenate two vectors.
7671         __isl_give isl_vec *isl_vec_concat(__isl_take isl_vec *vec1,
7672                 __isl_take isl_vec *vec2);
7674 =head2 Matrices
7676 Matrices can be created, copied and freed using the following functions.
7678         #include <isl/mat.h>
7679         __isl_give isl_mat *isl_mat_alloc(isl_ctx *ctx,
7680                 unsigned n_row, unsigned n_col);
7681         __isl_give isl_mat *isl_mat_copy(__isl_keep isl_mat *mat);
7682         __isl_null isl_mat *isl_mat_free(__isl_take isl_mat *mat);
7684 Note that the elements of a newly created matrix may have arbitrary values.
7685 The elements can be changed and inspected using the following functions.
7687         int isl_mat_rows(__isl_keep isl_mat *mat);
7688         int isl_mat_cols(__isl_keep isl_mat *mat);
7689         __isl_give isl_val *isl_mat_get_element_val(
7690                 __isl_keep isl_mat *mat, int row, int col);
7691         __isl_give isl_mat *isl_mat_set_element_si(__isl_take isl_mat *mat,
7692                 int row, int col, int v);
7693         __isl_give isl_mat *isl_mat_set_element_val(
7694                 __isl_take isl_mat *mat, int row, int col,
7695                 __isl_take isl_val *v);
7697 C<isl_mat_get_element> will return a negative value if anything went wrong.
7698 In that case, the value of C<*v> is undefined.
7700 The following function can be used to compute the (right) inverse
7701 of a matrix, i.e., a matrix such that the product of the original
7702 and the inverse (in that order) is a multiple of the identity matrix.
7703 The input matrix is assumed to be of full row-rank.
7705         __isl_give isl_mat *isl_mat_right_inverse(__isl_take isl_mat *mat);
7707 The following function can be used to compute the (right) kernel
7708 (or null space) of a matrix, i.e., a matrix such that the product of
7709 the original and the kernel (in that order) is the zero matrix.
7711         __isl_give isl_mat *isl_mat_right_kernel(__isl_take isl_mat *mat);
7713 =head2 Bounds on Piecewise Quasipolynomials and Piecewise Quasipolynomial Reductions
7715 The following functions determine
7716 an upper or lower bound on a quasipolynomial over its domain.
7718         __isl_give isl_pw_qpolynomial_fold *
7719         isl_pw_qpolynomial_bound(
7720                 __isl_take isl_pw_qpolynomial *pwqp,
7721                 enum isl_fold type, int *tight);
7723         __isl_give isl_union_pw_qpolynomial_fold *
7724         isl_union_pw_qpolynomial_bound(
7725                 __isl_take isl_union_pw_qpolynomial *upwqp,
7726                 enum isl_fold type, int *tight);
7728 The C<type> argument may be either C<isl_fold_min> or C<isl_fold_max>.
7729 If C<tight> is not C<NULL>, then C<*tight> is set to C<1>
7730 is the returned bound is known be tight, i.e., for each value
7731 of the parameters there is at least
7732 one element in the domain that reaches the bound.
7733 If the domain of C<pwqp> is not wrapping, then the bound is computed
7734 over all elements in that domain and the result has a purely parametric
7735 domain.  If the domain of C<pwqp> is wrapping, then the bound is
7736 computed over the range of the wrapped relation.  The domain of the
7737 wrapped relation becomes the domain of the result.
7739 =head2 Parametric Vertex Enumeration
7741 The parametric vertex enumeration described in this section
7742 is mainly intended to be used internally and by the C<barvinok>
7743 library.
7745         #include <isl/vertices.h>
7746         __isl_give isl_vertices *isl_basic_set_compute_vertices(
7747                 __isl_keep isl_basic_set *bset);
7749 The function C<isl_basic_set_compute_vertices> performs the
7750 actual computation of the parametric vertices and the chamber
7751 decomposition and stores the result in an C<isl_vertices> object.
7752 This information can be queried by either iterating over all
7753 the vertices or iterating over all the chambers or cells
7754 and then iterating over all vertices that are active on the chamber.
7756         isl_stat isl_vertices_foreach_vertex(
7757                 __isl_keep isl_vertices *vertices,
7758                 isl_stat (*fn)(__isl_take isl_vertex *vertex,
7759                         void *user), void *user);
7761         isl_stat isl_vertices_foreach_cell(
7762                 __isl_keep isl_vertices *vertices,
7763                 isl_stat (*fn)(__isl_take isl_cell *cell,
7764                         void *user), void *user);
7765         isl_stat isl_cell_foreach_vertex(__isl_keep isl_cell *cell,
7766                 isl_stat (*fn)(__isl_take isl_vertex *vertex,
7767                         void *user), void *user);
7769 Other operations that can be performed on an C<isl_vertices> object are
7770 the following.
7772         int isl_vertices_get_n_vertices(
7773                 __isl_keep isl_vertices *vertices);
7774         __isl_null isl_vertices *isl_vertices_free(
7775                 __isl_take isl_vertices *vertices);
7777 Vertices can be inspected and destroyed using the following functions.
7779         int isl_vertex_get_id(__isl_keep isl_vertex *vertex);
7780         __isl_give isl_basic_set *isl_vertex_get_domain(
7781                 __isl_keep isl_vertex *vertex);
7782         __isl_give isl_multi_aff *isl_vertex_get_expr(
7783                 __isl_keep isl_vertex *vertex);
7784         void isl_vertex_free(__isl_take isl_vertex *vertex);
7786 C<isl_vertex_get_expr> returns a multiple quasi-affine expression
7787 describing the vertex in terms of the parameters,
7788 while C<isl_vertex_get_domain> returns the activity domain
7789 of the vertex.
7791 Chambers can be inspected and destroyed using the following functions.
7793         __isl_give isl_basic_set *isl_cell_get_domain(
7794                 __isl_keep isl_cell *cell);
7795         void isl_cell_free(__isl_take isl_cell *cell);
7797 =head1 Polyhedral Compilation Library
7799 This section collects functionality in C<isl> that has been specifically
7800 designed for use during polyhedral compilation.
7802 =head2 Schedule Trees
7804 A schedule tree is a structured representation of a schedule,
7805 assigning a relative order to a set of domain elements.
7806 The relative order expressed by the schedule tree is
7807 defined recursively.  In particular, the order between
7808 two domain elements is determined by the node that is closest
7809 to the root that refers to both elements and that orders them apart.
7810 Each node in the tree is of one of several types.
7811 The root node is always of type C<isl_schedule_node_domain>
7812 (or C<isl_schedule_node_extension>)
7813 and it describes the (extra) domain elements to which the schedule applies.
7814 The other types of nodes are as follows.
7816 =over
7818 =item C<isl_schedule_node_band>
7820 A band of schedule dimensions.  Each schedule dimension is represented
7821 by a union piecewise quasi-affine expression.  If this expression
7822 assigns a different value to two domain elements, while all previous
7823 schedule dimensions in the same band assign them the same value,
7824 then the two domain elements are ordered according to these two
7825 different values.
7826 Each expression is required to be total in the domain elements
7827 that reach the band node.
7829 =item C<isl_schedule_node_expansion>
7831 An expansion node maps each of the domain elements that reach the node
7832 to one or more domain elements.  The image of this mapping forms
7833 the set of domain elements that reach the child of the expansion node.
7834 The function that maps each of the expanded domain elements
7835 to the original domain element from which it was expanded
7836 is called the contraction.
7838 =item C<isl_schedule_node_filter>
7840 A filter node does not impose any ordering, but rather intersects
7841 the set of domain elements that the current subtree refers to
7842 with a given union set.  The subtree of the filter node only
7843 refers to domain elements in the intersection.
7844 A filter node is typically only used as a child of a sequence or
7845 set node.
7847 =item C<isl_schedule_node_leaf>
7849 A leaf of the schedule tree.  Leaf nodes do not impose any ordering.
7851 =item C<isl_schedule_node_mark>
7853 A mark node can be used to attach any kind of information to a subtree
7854 of the schedule tree.
7856 =item C<isl_schedule_node_sequence>
7858 A sequence node has one or more children, each of which is a filter node.
7859 The filters on these filter nodes form a partition of
7860 the domain elements that the current subtree refers to.
7861 If two domain elements appear in distinct filters then the sequence
7862 node orders them according to the child positions of the corresponding
7863 filter nodes.
7865 =item C<isl_schedule_node_set>
7867 A set node is similar to a sequence node, except that
7868 it expresses that domain elements appearing in distinct filters
7869 may have any order.  The order of the children of a set node
7870 is therefore also immaterial.
7872 =back
7874 The following node types are only supported by the AST generator.
7876 =over
7878 =item C<isl_schedule_node_context>
7880 The context describes constraints on the parameters and
7881 the schedule dimensions of outer
7882 bands that the AST generator may assume to hold.  It is also the only
7883 kind of node that may introduce additional parameters.
7884 The space of the context is that of the flat product of the outer
7885 band nodes.  In particular, if there are no outer band nodes, then
7886 this space is the unnamed zero-dimensional space.
7887 Since a context node references the outer band nodes, any tree
7888 containing a context node is considered to be anchored.
7890 =item C<isl_schedule_node_extension>
7892 An extension node instructs the AST generator to add additional
7893 domain elements that need to be scheduled.
7894 The additional domain elements are described by the range of
7895 the extension map in terms of the outer schedule dimensions,
7896 i.e., the flat product of the outer band nodes.
7897 Note that domain elements are added whenever the AST generator
7898 reaches the extension node, meaning that there are still some
7899 active domain elements for which an AST needs to be generated.
7900 The conditions under which some domain elements are still active
7901 may however not be completely described by the outer AST nodes
7902 generated at that point.
7904 An extension node may also appear as the root of a schedule tree,
7905 when it is intended to be inserted into another tree
7906 using C<isl_schedule_node_graft_before> or C<isl_schedule_node_graft_after>.
7907 In this case, the domain of the extension node should
7908 correspond to the flat product of the outer band nodes
7909 in this other schedule tree at the point where the extension tree
7910 will be inserted.
7912 =item C<isl_schedule_node_guard>
7914 The guard describes constraints on the parameters and
7915 the schedule dimensions of outer
7916 bands that need to be enforced by the outer nodes
7917 in the generated AST.
7918 The space of the guard is that of the flat product of the outer
7919 band nodes.  In particular, if there are no outer band nodes, then
7920 this space is the unnamed zero-dimensional space.
7921 Since a guard node references the outer band nodes, any tree
7922 containing a guard node is considered to be anchored.
7924 =back
7926 Except for the C<isl_schedule_node_context> nodes,
7927 none of the nodes may introduce any parameters that were not
7928 already present in the root domain node.
7930 A schedule tree is encapsulated in an C<isl_schedule> object.
7931 The simplest such objects, those with a tree consisting of single domain node,
7932 can be created using the following functions with either an empty
7933 domain or a given domain.
7935         #include <isl/schedule.h>
7936         __isl_give isl_schedule *isl_schedule_empty(
7937                 __isl_take isl_space *space);
7938         __isl_give isl_schedule *isl_schedule_from_domain(
7939                 __isl_take isl_union_set *domain);
7941 The function C<isl_schedule_constraints_compute_schedule> described
7942 in L</"Scheduling"> can also be used to construct schedules.
7944 C<isl_schedule> objects may be copied and freed using the following functions.
7946         #include <isl/schedule.h>
7947         __isl_give isl_schedule *isl_schedule_copy(
7948                 __isl_keep isl_schedule *sched);
7949         __isl_null isl_schedule *isl_schedule_free(
7950                 __isl_take isl_schedule *sched);
7952 The following functions checks whether two C<isl_schedule> objects
7953 are obviously the same.
7955         #include <isl/schedule.h>
7956         isl_bool isl_schedule_plain_is_equal(
7957                 __isl_keep isl_schedule *schedule1,
7958                 __isl_keep isl_schedule *schedule2);
7960 The domain of the schedule, i.e., the domain described by the root node,
7961 can be obtained using the following function.
7963         #include <isl/schedule.h>
7964         __isl_give isl_union_set *isl_schedule_get_domain(
7965                 __isl_keep isl_schedule *schedule);
7967 An extra top-level band node (right underneath the domain node) can
7968 be introduced into the schedule using the following function.
7969 The schedule tree is assumed not to have any anchored nodes.
7971         #include <isl/schedule.h>
7972         __isl_give isl_schedule *
7973         isl_schedule_insert_partial_schedule(
7974                 __isl_take isl_schedule *schedule,
7975                 __isl_take isl_multi_union_pw_aff *partial);
7977 A top-level context node (right underneath the domain node) can
7978 be introduced into the schedule using the following function.
7980         #include <isl/schedule.h>
7981         __isl_give isl_schedule *isl_schedule_insert_context(
7982                 __isl_take isl_schedule *schedule,
7983                 __isl_take isl_set *context)
7985 A top-level guard node (right underneath the domain node) can
7986 be introduced into the schedule using the following function.
7988         #include <isl/schedule.h>
7989         __isl_give isl_schedule *isl_schedule_insert_guard(
7990                 __isl_take isl_schedule *schedule,
7991                 __isl_take isl_set *guard)
7993 A schedule that combines two schedules either in the given
7994 order or in an arbitrary order, i.e., with an C<isl_schedule_node_sequence>
7995 or an C<isl_schedule_node_set> node,
7996 can be created using the following functions.
7998         #include <isl/schedule.h>
7999         __isl_give isl_schedule *isl_schedule_sequence(
8000                 __isl_take isl_schedule *schedule1,
8001                 __isl_take isl_schedule *schedule2);
8002         __isl_give isl_schedule *isl_schedule_set(
8003                 __isl_take isl_schedule *schedule1,
8004                 __isl_take isl_schedule *schedule2);
8006 The domains of the two input schedules need to be disjoint.
8008 The following function can be used to restrict the domain
8009 of a schedule with a domain node as root to be a subset of the given union set.
8010 This operation may remove nodes in the tree that have become
8011 redundant.
8013         #include <isl/schedule.h>
8014         __isl_give isl_schedule *isl_schedule_intersect_domain(
8015                 __isl_take isl_schedule *schedule,
8016                 __isl_take isl_union_set *domain);
8018 The following function can be used to simplify the domain
8019 of a schedule with a domain node as root with respect to the given
8020 parameter domain.
8022         #include <isl/schedule.h>
8023         __isl_give isl_schedule *isl_schedule_gist_domain_params(
8024                 __isl_take isl_schedule *schedule,
8025                 __isl_take isl_set *context);
8027 The following function resets the user pointers on all parameter
8028 and tuple identifiers referenced by the nodes of the given schedule.
8030         #include <isl/schedule.h>
8031         __isl_give isl_schedule *isl_schedule_reset_user(
8032                 __isl_take isl_schedule *schedule);
8034 The following function aligns the parameters of all nodes
8035 in the given schedule to the given space.
8037         #include <isl/schedule.h>
8038         __isl_give isl_schedule *isl_schedule_align_params(
8039                 __isl_take isl_schedule *schedule,
8040                 __isl_take isl_space *space);
8042 The following function allows the user to plug in a given function
8043 in the iteration domains.  The input schedule is not allowed to contain
8044 any expansion nodes.
8046         #include <isl/schedule.h>
8047         __isl_give isl_schedule *
8048         isl_schedule_pullback_union_pw_multi_aff(
8049                 __isl_take isl_schedule *schedule,
8050                 __isl_take isl_union_pw_multi_aff *upma);
8052 The following function can be used to plug in the schedule C<expansion>
8053 in the leaves of C<schedule>, where C<contraction> describes how
8054 the domain elements of C<expansion> map to the domain elements
8055 at the original leaves of C<schedule>.
8056 The resulting schedule will contain expansion nodes, unless
8057 C<contraction> is an identity function.
8059         #include <isl/schedule.h>
8060         __isl_give isl_schedule *isl_schedule_expand(
8061                 __isl_take isl_schedule *schedule,
8062                 __isl_take isl_union_pw_multi_aff *contraction,
8063                 __isl_take isl_schedule *expansion);
8065 An C<isl_union_map> representation of the schedule can be obtained
8066 from an C<isl_schedule> using the following function.
8068         #include <isl/schedule.h>
8069         __isl_give isl_union_map *isl_schedule_get_map(
8070                 __isl_keep isl_schedule *sched);
8072 The resulting relation encodes the same relative ordering as
8073 the schedule by mapping the domain elements to a common schedule space.
8074 If the schedule_separate_components option is set, then the order
8075 of the children of a set node is explicitly encoded in the result.
8076 If the tree contains any expansion nodes, then the relation
8077 is formulated in terms of the expanded domain elements.
8079 Schedules can be read from input using the following functions.
8081         #include <isl/schedule.h>
8082         __isl_give isl_schedule *isl_schedule_read_from_file(
8083                 isl_ctx *ctx, FILE *input);
8084         __isl_give isl_schedule *isl_schedule_read_from_str(
8085                 isl_ctx *ctx, const char *str);
8087 A representation of the schedule can be printed using
8089         #include <isl/schedule.h>
8090         __isl_give isl_printer *isl_printer_print_schedule(
8091                 __isl_take isl_printer *p,
8092                 __isl_keep isl_schedule *schedule);
8093         __isl_give char *isl_schedule_to_str(
8094                 __isl_keep isl_schedule *schedule);
8096 C<isl_schedule_to_str> prints the schedule in flow format.
8098 The schedule tree can be traversed through the use of
8099 C<isl_schedule_node> objects that point to a particular
8100 position in the schedule tree.  Whenever a C<isl_schedule_node>
8101 is use to modify a node in the schedule tree, the original schedule
8102 tree is left untouched and the modifications are performed to a copy
8103 of the tree.  The returned C<isl_schedule_node> then points to
8104 this modified copy of the tree.
8106 The root of the schedule tree can be obtained using the following function.
8108         #include <isl/schedule.h>
8109         __isl_give isl_schedule_node *isl_schedule_get_root(
8110                 __isl_keep isl_schedule *schedule);
8112 A pointer to a newly created schedule tree with a single domain
8113 node can be created using the following functions.
8115         #include <isl/schedule_node.h>
8116         __isl_give isl_schedule_node *
8117         isl_schedule_node_from_domain(
8118                 __isl_take isl_union_set *domain);
8119         __isl_give isl_schedule_node *
8120         isl_schedule_node_from_extension(
8121                 __isl_take isl_union_map *extension);
8123 C<isl_schedule_node_from_extension> creates a tree with an extension
8124 node as root.
8126 Schedule nodes can be copied and freed using the following functions.
8128         #include <isl/schedule_node.h>
8129         __isl_give isl_schedule_node *isl_schedule_node_copy(
8130                 __isl_keep isl_schedule_node *node);
8131         __isl_null isl_schedule_node *isl_schedule_node_free(
8132                 __isl_take isl_schedule_node *node);
8134 The following functions can be used to check if two schedule
8135 nodes point to the same position in the same schedule.
8137         #include <isl/schedule_node.h>
8138         isl_bool isl_schedule_node_is_equal(
8139                 __isl_keep isl_schedule_node *node1,
8140                 __isl_keep isl_schedule_node *node2);
8142 The following properties can be obtained from a schedule node.
8144         #include <isl/schedule_node.h>
8145         enum isl_schedule_node_type isl_schedule_node_get_type(
8146                 __isl_keep isl_schedule_node *node);
8147         enum isl_schedule_node_type
8148         isl_schedule_node_get_parent_type(
8149                 __isl_keep isl_schedule_node *node);
8150         __isl_give isl_schedule *isl_schedule_node_get_schedule(
8151                 __isl_keep isl_schedule_node *node);
8153 The function C<isl_schedule_node_get_type> returns the type of
8154 the node, while C<isl_schedule_node_get_parent_type> returns
8155 type of the parent of the node, which is required to exist.
8156 The function C<isl_schedule_node_get_schedule> returns a copy
8157 to the schedule to which the node belongs.
8159 The following functions can be used to move the schedule node
8160 to a different position in the tree or to check if such a position
8161 exists.
8163         #include <isl/schedule_node.h>
8164         isl_bool isl_schedule_node_has_parent(
8165                 __isl_keep isl_schedule_node *node);
8166         __isl_give isl_schedule_node *isl_schedule_node_parent(
8167                 __isl_take isl_schedule_node *node);
8168         __isl_give isl_schedule_node *isl_schedule_node_root(
8169                 __isl_take isl_schedule_node *node);
8170         __isl_give isl_schedule_node *isl_schedule_node_ancestor(
8171                 __isl_take isl_schedule_node *node,
8172                 int generation);
8173         int isl_schedule_node_n_children(
8174                 __isl_keep isl_schedule_node *node);
8175         __isl_give isl_schedule_node *isl_schedule_node_child(
8176                 __isl_take isl_schedule_node *node, int pos);
8177         isl_bool isl_schedule_node_has_children(
8178                 __isl_keep isl_schedule_node *node);
8179         __isl_give isl_schedule_node *isl_schedule_node_first_child(
8180                 __isl_take isl_schedule_node *node);
8181         isl_bool isl_schedule_node_has_previous_sibling(
8182                 __isl_keep isl_schedule_node *node);
8183         __isl_give isl_schedule_node *
8184         isl_schedule_node_previous_sibling(
8185                 __isl_take isl_schedule_node *node);
8186         isl_bool isl_schedule_node_has_next_sibling(
8187                 __isl_keep isl_schedule_node *node);
8188         __isl_give isl_schedule_node *
8189         isl_schedule_node_next_sibling(
8190                 __isl_take isl_schedule_node *node);
8192 For C<isl_schedule_node_ancestor>, the ancestor of generation 0
8193 is the node itself, the ancestor of generation 1 is its parent and so on.
8195 It is also possible to query the number of ancestors of a node,
8196 the position of the current node
8197 within the children of its parent, the position of the subtree
8198 containing a node within the children of an ancestor
8199 or to obtain a copy of a given
8200 child without destroying the current node.
8201 Given two nodes that point to the same schedule, their closest
8202 shared ancestor can be obtained using
8203 C<isl_schedule_node_get_shared_ancestor>.
8205         #include <isl/schedule_node.h>
8206         int isl_schedule_node_get_tree_depth(
8207                 __isl_keep isl_schedule_node *node);
8208         int isl_schedule_node_get_child_position(
8209                 __isl_keep isl_schedule_node *node);
8210         int isl_schedule_node_get_ancestor_child_position(
8211                 __isl_keep isl_schedule_node *node,
8212                 __isl_keep isl_schedule_node *ancestor);
8213         __isl_give isl_schedule_node *isl_schedule_node_get_child(
8214                 __isl_keep isl_schedule_node *node, int pos);
8215         __isl_give isl_schedule_node *
8216         isl_schedule_node_get_shared_ancestor(
8217                 __isl_keep isl_schedule_node *node1,
8218                 __isl_keep isl_schedule_node *node2);
8220 All nodes in a schedule tree or
8221 all descendants of a specific node (including the node) can be visited
8222 in depth-first pre-order using the following functions.
8224         #include <isl/schedule.h>
8225         isl_stat isl_schedule_foreach_schedule_node_top_down(
8226                 __isl_keep isl_schedule *sched,
8227                 isl_bool (*fn)(__isl_keep isl_schedule_node *node,
8228                         void *user), void *user);
8230         #include <isl/schedule_node.h>
8231         isl_stat isl_schedule_node_foreach_descendant_top_down(
8232                 __isl_keep isl_schedule_node *node,
8233                 isl_bool (*fn)(__isl_keep isl_schedule_node *node,
8234                         void *user), void *user);
8236 The callback function is slightly different from the usual
8237 callbacks in that it not only indicates success (non-negative result)
8238 or failure (negative result), but also indicates whether the children
8239 of the given node should be visited.  In particular, if the callback
8240 returns a positive value, then the children are visited, but if
8241 the callback returns zero, then the children are not visited.
8243 The ancestors of a node in a schedule tree can be visited from
8244 the root down to and including the parent of the node using
8245 the following function.
8247         #include <isl/schedule_node.h>
8248         isl_stat isl_schedule_node_foreach_ancestor_top_down(
8249                 __isl_keep isl_schedule_node *node,
8250                 isl_stat (*fn)(__isl_keep isl_schedule_node *node,
8251                         void *user), void *user);
8253 The following functions allows for a depth-first post-order
8254 traversal of the nodes in a schedule tree or
8255 of the descendants of a specific node (including the node
8256 itself), where the user callback is allowed to modify the
8257 visited node.
8259         #include <isl/schedule.h>
8260         __isl_give isl_schedule *
8261         isl_schedule_map_schedule_node_bottom_up(
8262                 __isl_take isl_schedule *schedule,
8263                 __isl_give isl_schedule_node *(*fn)(
8264                         __isl_take isl_schedule_node *node,
8265                         void *user), void *user);
8267         #include <isl/schedule_node.h>
8268         __isl_give isl_schedule_node *
8269         isl_schedule_node_map_descendant_bottom_up(
8270                 __isl_take isl_schedule_node *node,
8271                 __isl_give isl_schedule_node *(*fn)(
8272                         __isl_take isl_schedule_node *node,
8273                         void *user), void *user);
8275 The traversal continues from the node returned by the callback function.
8276 It is the responsibility of the user to ensure that this does not
8277 lead to an infinite loop.  It is safest to always return a pointer
8278 to the same position (same ancestors and child positions) as the input node.
8280 The following function removes a node (along with its descendants)
8281 from a schedule tree and returns a pointer to the leaf at the
8282 same position in the updated tree.
8283 It is not allowed to remove the root of a schedule tree or
8284 a child of a set or sequence node.
8286         #include <isl/schedule_node.h>
8287         __isl_give isl_schedule_node *isl_schedule_node_cut(
8288                 __isl_take isl_schedule_node *node);
8290 The following function removes a single node
8291 from a schedule tree and returns a pointer to the child
8292 of the node, now located at the position of the original node
8293 or to a leaf node at that position if there was no child.
8294 It is not allowed to remove the root of a schedule tree,
8295 a set or sequence node, a child of a set or sequence node or
8296 a band node with an anchored subtree.
8298         #include <isl/schedule_node.h>
8299         __isl_give isl_schedule_node *isl_schedule_node_delete(
8300                 __isl_take isl_schedule_node *node);
8302 Most nodes in a schedule tree only contain local information.
8303 In some cases, however, a node may also refer to the schedule dimensions
8304 of its outer band nodes.
8305 This means that the position of the node within the tree should
8306 not be changed, or at least that no changes are performed to the
8307 outer band nodes.  The following function can be used to test
8308 whether the subtree rooted at a given node contains any such nodes.
8310         #include <isl/schedule_node.h>
8311         isl_bool isl_schedule_node_is_subtree_anchored(
8312                 __isl_keep isl_schedule_node *node);
8314 The following function resets the user pointers on all parameter
8315 and tuple identifiers referenced by the given schedule node.
8317         #include <isl/schedule_node.h>
8318         __isl_give isl_schedule_node *isl_schedule_node_reset_user(
8319                 __isl_take isl_schedule_node *node);
8321 The following function aligns the parameters of the given schedule
8322 node to the given space.
8324         #include <isl/schedule_node.h>
8325         __isl_give isl_schedule_node *
8326         isl_schedule_node_align_params(
8327                 __isl_take isl_schedule_node *node,
8328                 __isl_take isl_space *space);
8330 Several node types have their own functions for querying
8331 (and in some cases setting) some node type specific properties.
8333         #include <isl/schedule_node.h>
8334         __isl_give isl_space *isl_schedule_node_band_get_space(
8335                 __isl_keep isl_schedule_node *node);
8336         __isl_give isl_multi_union_pw_aff *
8337         isl_schedule_node_band_get_partial_schedule(
8338                 __isl_keep isl_schedule_node *node);
8339         __isl_give isl_union_map *
8340         isl_schedule_node_band_get_partial_schedule_union_map(
8341                 __isl_keep isl_schedule_node *node);
8342         unsigned isl_schedule_node_band_n_member(
8343                 __isl_keep isl_schedule_node *node);
8344         isl_bool isl_schedule_node_band_member_get_coincident(
8345                 __isl_keep isl_schedule_node *node, int pos);
8346         __isl_give isl_schedule_node *
8347         isl_schedule_node_band_member_set_coincident(
8348                 __isl_take isl_schedule_node *node, int pos,
8349                 int coincident);
8350         isl_bool isl_schedule_node_band_get_permutable(
8351                 __isl_keep isl_schedule_node *node);
8352         __isl_give isl_schedule_node *
8353         isl_schedule_node_band_set_permutable(
8354                 __isl_take isl_schedule_node *node, int permutable);
8355         enum isl_ast_loop_type
8356         isl_schedule_node_band_member_get_ast_loop_type(
8357                 __isl_keep isl_schedule_node *node, int pos);
8358         __isl_give isl_schedule_node *
8359         isl_schedule_node_band_member_set_ast_loop_type(
8360                 __isl_take isl_schedule_node *node, int pos,
8361                 enum isl_ast_loop_type type);
8362         __isl_give isl_union_set *
8363         enum isl_ast_loop_type
8364         isl_schedule_node_band_member_get_isolate_ast_loop_type(
8365                 __isl_keep isl_schedule_node *node, int pos);
8366         __isl_give isl_schedule_node *
8367         isl_schedule_node_band_member_set_isolate_ast_loop_type(
8368                 __isl_take isl_schedule_node *node, int pos,
8369                 enum isl_ast_loop_type type);
8370         isl_schedule_node_band_get_ast_build_options(
8371                 __isl_keep isl_schedule_node *node);
8372         __isl_give isl_schedule_node *
8373         isl_schedule_node_band_set_ast_build_options(
8374                 __isl_take isl_schedule_node *node,
8375                 __isl_take isl_union_set *options);
8376         __isl_give isl_set *
8377         isl_schedule_node_band_get_ast_isolate_option(
8378                 __isl_keep isl_schedule_node *node);
8380 The function C<isl_schedule_node_band_get_space> returns the space
8381 of the partial schedule of the band.
8382 The function C<isl_schedule_node_band_get_partial_schedule_union_map>
8383 returns a representation of the partial schedule of the band node
8384 in the form of an C<isl_union_map>.
8385 The coincident and permutable properties are set by
8386 C<isl_schedule_constraints_compute_schedule> on the schedule tree
8387 it produces.
8388 A scheduling dimension is considered to be ``coincident''
8389 if it satisfies the coincidence constraints within its band.
8390 That is, if the dependence distances of the coincidence
8391 constraints are all zero in that direction (for fixed
8392 iterations of outer bands).
8393 A band is marked permutable if it was produced using the Pluto-like scheduler.
8394 Note that the scheduler may have to resort to a Feautrier style scheduling
8395 step even if the default scheduler is used.
8396 An C<isl_ast_loop_type> is one of C<isl_ast_loop_default>,
8397 C<isl_ast_loop_atomic>, C<isl_ast_loop_unroll> or C<isl_ast_loop_separate>.
8398 For the meaning of these loop AST generation types and the difference
8399 between the regular loop AST generation type and the isolate
8400 loop AST generation type, see L</"AST Generation Options (Schedule Tree)">.
8401 The functions C<isl_schedule_node_band_member_get_ast_loop_type>
8402 and C<isl_schedule_node_band_member_get_isolate_ast_loop_type>
8403 may return C<isl_ast_loop_error> if an error occurs.
8404 The AST build options govern how an AST is generated for
8405 the individual schedule dimensions during AST generation.
8406 See L</"AST Generation Options (Schedule Tree)">.
8407 The isolate option for the given node can be extracted from these
8408 AST build options using the function
8409 C<isl_schedule_node_band_get_ast_isolate_option>.
8411         #include <isl/schedule_node.h>
8412         __isl_give isl_set *
8413         isl_schedule_node_context_get_context(
8414                 __isl_keep isl_schedule_node *node);
8416         #include <isl/schedule_node.h>
8417         __isl_give isl_union_set *
8418         isl_schedule_node_domain_get_domain(
8419                 __isl_keep isl_schedule_node *node);
8421         #include <isl/schedule_node.h>
8422         __isl_give isl_union_map *
8423         isl_schedule_node_expansion_get_expansion(
8424                 __isl_keep isl_schedule_node *node);
8425         __isl_give isl_union_pw_multi_aff *
8426         isl_schedule_node_expansion_get_contraction(
8427                 __isl_keep isl_schedule_node *node);
8429         #include <isl/schedule_node.h>
8430         __isl_give isl_union_map *
8431         isl_schedule_node_extension_get_extension(
8432                 __isl_keep isl_schedule_node *node);
8434         #include <isl/schedule_node.h>
8435         __isl_give isl_union_set *
8436         isl_schedule_node_filter_get_filter(
8437                 __isl_keep isl_schedule_node *node);
8439         #include <isl/schedule_node.h>
8440         __isl_give isl_set *isl_schedule_node_guard_get_guard(
8441                 __isl_keep isl_schedule_node *node);
8443         #include <isl/schedule_node.h>
8444         __isl_give isl_id *isl_schedule_node_mark_get_id(
8445                 __isl_keep isl_schedule_node *node);
8447 The following functions can be used to obtain an C<isl_multi_union_pw_aff>,
8448 an C<isl_union_pw_multi_aff> or C<isl_union_map> representation of
8449 partial schedules related to the node.
8451         #include <isl/schedule_node.h>
8452         __isl_give isl_multi_union_pw_aff *
8453         isl_schedule_node_get_prefix_schedule_multi_union_pw_aff(
8454                 __isl_keep isl_schedule_node *node);
8455         __isl_give isl_union_pw_multi_aff *
8456         isl_schedule_node_get_prefix_schedule_union_pw_multi_aff(
8457                 __isl_keep isl_schedule_node *node);
8458         __isl_give isl_union_map *
8459         isl_schedule_node_get_prefix_schedule_union_map(
8460                 __isl_keep isl_schedule_node *node);
8461         __isl_give isl_union_map *
8462         isl_schedule_node_get_prefix_schedule_relation(
8463                 __isl_keep isl_schedule_node *node);
8464         __isl_give isl_union_map *
8465         isl_schedule_node_get_subtree_schedule_union_map(
8466                 __isl_keep isl_schedule_node *node);
8468 In particular, the functions
8469 C<isl_schedule_node_get_prefix_schedule_multi_union_pw_aff>,
8470 C<isl_schedule_node_get_prefix_schedule_union_pw_multi_aff>
8471 and C<isl_schedule_node_get_prefix_schedule_union_map>
8472 return a relative ordering on the domain elements that reach the given
8473 node determined by its ancestors.
8474 The function C<isl_schedule_node_get_prefix_schedule_relation>
8475 additionally includes the domain constraints in the result.
8476 The function C<isl_schedule_node_get_subtree_schedule_union_map>
8477 returns a representation of the partial schedule defined by the
8478 subtree rooted at the given node.
8479 If the tree contains any expansion nodes, then the subtree schedule
8480 is formulated in terms of the expanded domain elements.
8481 The tree passed to functions returning a prefix schedule
8482 may only contain extension nodes if these would not affect
8483 the result of these functions.  That is, if one of the ancestors
8484 is an extension node, then all of the domain elements that were
8485 added by the extension node need to have been filtered out
8486 by filter nodes between the extension node and the input node.
8487 The tree passed to C<isl_schedule_node_get_subtree_schedule_union_map>
8488 may not contain in extension nodes in the selected subtree.
8490 The expansion/contraction defined by an entire subtree, combining
8491 the expansions/contractions
8492 on the expansion nodes in the subtree, can be obtained using
8493 the following functions.
8495         #include <isl/schedule_node.h>
8496         __isl_give isl_union_map *
8497         isl_schedule_node_get_subtree_expansion(
8498                 __isl_keep isl_schedule_node *node);
8499         __isl_give isl_union_pw_multi_aff *
8500         isl_schedule_node_get_subtree_contraction(
8501                 __isl_keep isl_schedule_node *node);
8503 The total number of outer band members of given node, i.e.,
8504 the shared output dimension of the maps in the result
8505 of C<isl_schedule_node_get_prefix_schedule_union_map> can be obtained
8506 using the following function.
8508         #include <isl/schedule_node.h>
8509         int isl_schedule_node_get_schedule_depth(
8510                 __isl_keep isl_schedule_node *node);
8512 The following functions return the elements that reach the given node
8513 or the union of universes in the spaces that contain these elements.
8515         #include <isl/schedule_node.h>
8516         __isl_give isl_union_set *
8517         isl_schedule_node_get_domain(
8518                 __isl_keep isl_schedule_node *node);
8519         __isl_give isl_union_set *
8520         isl_schedule_node_get_universe_domain(
8521                 __isl_keep isl_schedule_node *node);
8523 The input tree of C<isl_schedule_node_get_domain>
8524 may only contain extension nodes if these would not affect
8525 the result of this function.  That is, if one of the ancestors
8526 is an extension node, then all of the domain elements that were
8527 added by the extension node need to have been filtered out
8528 by filter nodes between the extension node and the input node.
8530 The following functions can be used to introduce additional nodes
8531 in the schedule tree.  The new node is introduced at the point
8532 in the tree where the C<isl_schedule_node> points to and
8533 the results points to the new node.
8535         #include <isl/schedule_node.h>
8536         __isl_give isl_schedule_node *
8537         isl_schedule_node_insert_partial_schedule(
8538                 __isl_take isl_schedule_node *node,
8539                 __isl_take isl_multi_union_pw_aff *schedule);
8541 This function inserts a new band node with (the greatest integer
8542 part of) the given partial schedule.
8543 The subtree rooted at the given node is assumed not to have
8544 any anchored nodes.
8546         #include <isl/schedule_node.h>
8547         __isl_give isl_schedule_node *
8548         isl_schedule_node_insert_context(
8549                 __isl_take isl_schedule_node *node,
8550                 __isl_take isl_set *context);
8552 This function inserts a new context node with the given context constraints.
8554         #include <isl/schedule_node.h>
8555         __isl_give isl_schedule_node *
8556         isl_schedule_node_insert_filter(
8557                 __isl_take isl_schedule_node *node,
8558                 __isl_take isl_union_set *filter);
8560 This function inserts a new filter node with the given filter.
8561 If the original node already pointed to a filter node, then the
8562 two filter nodes are merged into one.
8564         #include <isl/schedule_node.h>
8565         __isl_give isl_schedule_node *
8566         isl_schedule_node_insert_guard(
8567                 __isl_take isl_schedule_node *node,
8568                 __isl_take isl_set *guard);
8570 This function inserts a new guard node with the given guard constraints.
8572         #include <isl/schedule_node.h>
8573         __isl_give isl_schedule_node *
8574         isl_schedule_node_insert_mark(
8575                 __isl_take isl_schedule_node *node,
8576                 __isl_take isl_id *mark);
8578 This function inserts a new mark node with the give mark identifier.
8580         #include <isl/schedule_node.h>
8581         __isl_give isl_schedule_node *
8582         isl_schedule_node_insert_sequence(
8583                 __isl_take isl_schedule_node *node,
8584                 __isl_take isl_union_set_list *filters);
8585         __isl_give isl_schedule_node *
8586         isl_schedule_node_insert_set(
8587                 __isl_take isl_schedule_node *node,
8588                 __isl_take isl_union_set_list *filters);
8590 These functions insert a new sequence or set node with the given
8591 filters as children.
8593         #include <isl/schedule_node.h>
8594         __isl_give isl_schedule_node *isl_schedule_node_group(
8595                 __isl_take isl_schedule_node *node,
8596                 __isl_take isl_id *group_id);
8598 This function introduces an expansion node in between the current
8599 node and its parent that expands instances of a space with tuple
8600 identifier C<group_id> to the original domain elements that reach
8601 the node.  The group instances are identified by the prefix schedule
8602 of those domain elements.  The ancestors of the node are adjusted
8603 to refer to the group instances instead of the original domain
8604 elements.  The return value points to the same node in the updated
8605 schedule tree as the input node, i.e., to the child of the newly
8606 introduced expansion node.  Grouping instances of different statements
8607 ensures that they will be treated as a single statement by the
8608 AST generator up to the point of the expansion node.
8610 The following function can be used to flatten a nested
8611 sequence.
8613         #include <isl/schedule_node.h>
8614         __isl_give isl_schedule_node *
8615         isl_schedule_node_sequence_splice_child(
8616                 __isl_take isl_schedule_node *node, int pos);
8618 That is, given a sequence node C<node> that has another sequence node
8619 in its child at position C<pos> (in particular, the child of that filter
8620 node is a sequence node), attach the children of that other sequence
8621 node as children of C<node>, replacing the original child at position
8622 C<pos>.
8624 The partial schedule of a band node can be scaled (down) or reduced using
8625 the following functions.
8627         #include <isl/schedule_node.h>
8628         __isl_give isl_schedule_node *
8629         isl_schedule_node_band_scale(
8630                 __isl_take isl_schedule_node *node,
8631                 __isl_take isl_multi_val *mv);
8632         __isl_give isl_schedule_node *
8633         isl_schedule_node_band_scale_down(
8634                 __isl_take isl_schedule_node *node,
8635                 __isl_take isl_multi_val *mv);
8636         __isl_give isl_schedule_node *
8637         isl_schedule_node_band_mod(
8638                 __isl_take isl_schedule_node *node,
8639                 __isl_take isl_multi_val *mv);
8641 The spaces of the two arguments need to match.
8642 After scaling, the partial schedule is replaced by its greatest
8643 integer part to ensure that the schedule remains integral.
8645 The partial schedule of a band node can be shifted by an
8646 C<isl_multi_union_pw_aff> with a domain that is a superset
8647 of the domain of the partial schedule using
8648 the following function.
8650         #include <isl/schedule_node.h>
8651         __isl_give isl_schedule_node *
8652         isl_schedule_node_band_shift(
8653                 __isl_take isl_schedule_node *node,
8654                 __isl_take isl_multi_union_pw_aff *shift);
8656 A band node can be tiled using the following function.
8658         #include <isl/schedule_node.h>
8659         __isl_give isl_schedule_node *isl_schedule_node_band_tile(
8660                 __isl_take isl_schedule_node *node,
8661                 __isl_take isl_multi_val *sizes);
8663         isl_stat isl_options_set_tile_scale_tile_loops(isl_ctx *ctx,
8664                 int val);
8665         int isl_options_get_tile_scale_tile_loops(isl_ctx *ctx);
8666         isl_stat isl_options_set_tile_shift_point_loops(isl_ctx *ctx,
8667                 int val);
8668         int isl_options_get_tile_shift_point_loops(isl_ctx *ctx);
8670 The C<isl_schedule_node_band_tile> function tiles
8671 the band using the given tile sizes inside its schedule.
8672 A new child band node is created to represent the point loops and it is
8673 inserted between the modified band and its children.
8674 The subtree rooted at the given node is assumed not to have
8675 any anchored nodes.
8676 The C<tile_scale_tile_loops> option specifies whether the tile
8677 loops iterators should be scaled by the tile sizes.
8678 If the C<tile_shift_point_loops> option is set, then the point loops
8679 are shifted to start at zero.
8681 A band node can be split into two nested band nodes
8682 using the following function.
8684         #include <isl/schedule_node.h>
8685         __isl_give isl_schedule_node *isl_schedule_node_band_split(
8686                 __isl_take isl_schedule_node *node, int pos);
8688 The resulting outer band node contains the first C<pos> dimensions of
8689 the schedule of C<node> while the inner band contains the remaining dimensions.
8690 The schedules of the two band nodes live in anonymous spaces.
8691 The loop AST generation type options and the isolate option
8692 are split over the the two band nodes.
8694 A band node can be moved down to the leaves of the subtree rooted
8695 at the band node using the following function.
8697         #include <isl/schedule_node.h>
8698         __isl_give isl_schedule_node *isl_schedule_node_band_sink(
8699                 __isl_take isl_schedule_node *node);
8701 The subtree rooted at the given node is assumed not to have
8702 any anchored nodes.
8703 The result points to the node in the resulting tree that is in the same
8704 position as the node pointed to by C<node> in the original tree.
8706         #include <isl/schedule_node.h>
8707         __isl_give isl_schedule_node *
8708         isl_schedule_node_order_before(
8709                 __isl_take isl_schedule_node *node,
8710                 __isl_take isl_union_set *filter);
8711         __isl_give isl_schedule_node *
8712         isl_schedule_node_order_after(
8713                 __isl_take isl_schedule_node *node,
8714                 __isl_take isl_union_set *filter);
8716 These functions split the domain elements that reach C<node>
8717 into those that satisfy C<filter> and those that do not and
8718 arranges for the elements that do satisfy the filter to be
8719 executed before (in case of C<isl_schedule_node_order_before>)
8720 or after (in case of C<isl_schedule_node_order_after>)
8721 those that do not.  The order is imposed by
8722 a sequence node, possibly reusing the grandparent of C<node>
8723 on two copies of the subtree attached to the original C<node>.
8724 Both copies are simplified with respect to their filter.
8726 Return a pointer to the copy of the subtree that does not
8727 satisfy C<filter>.  If there is no such copy (because all
8728 reaching domain elements satisfy the filter), then return
8729 the original pointer.
8731         #include <isl/schedule_node.h>
8732         __isl_give isl_schedule_node *
8733         isl_schedule_node_graft_before(
8734                 __isl_take isl_schedule_node *node,
8735                 __isl_take isl_schedule_node *graft);
8736         __isl_give isl_schedule_node *
8737         isl_schedule_node_graft_after(
8738                 __isl_take isl_schedule_node *node,
8739                 __isl_take isl_schedule_node *graft);
8741 This function inserts the C<graft> tree into the tree containing C<node>
8742 such that it is executed before (in case of C<isl_schedule_node_graft_before>)
8743 or after (in case of C<isl_schedule_node_graft_after>) C<node>.
8744 The root node of C<graft>
8745 should be an extension node where the domain of the extension
8746 is the flat product of all outer band nodes of C<node>.
8747 The root node may also be a domain node.
8748 The elements of the domain or the range of the extension may not
8749 intersect with the domain elements that reach "node".
8750 The schedule tree of C<graft> may not be anchored.
8752 The schedule tree of C<node> is modified to include an extension node
8753 corresponding to the root node of C<graft> as a child of the original
8754 parent of C<node>.  The original node that C<node> points to and the
8755 child of the root node of C<graft> are attached to this extension node
8756 through a sequence, with appropriate filters and with the child
8757 of C<graft> appearing before or after the original C<node>.
8759 If C<node> already appears inside a sequence that is the child of
8760 an extension node and if the spaces of the new domain elements
8761 do not overlap with those of the original domain elements,
8762 then that extension node is extended with the new extension
8763 rather than introducing a new segment of extension and sequence nodes.
8765 Return a pointer to the same node in the modified tree that
8766 C<node> pointed to in the original tree.
8768 A representation of the schedule node can be printed using
8770         #include <isl/schedule_node.h>
8771         __isl_give isl_printer *isl_printer_print_schedule_node(
8772                 __isl_take isl_printer *p,
8773                 __isl_keep isl_schedule_node *node);
8774         __isl_give char *isl_schedule_node_to_str(
8775                 __isl_keep isl_schedule_node *node);
8777 C<isl_schedule_node_to_str> prints the schedule node in block format.
8779 =head2 Dependence Analysis
8781 C<isl> contains specialized functionality for performing
8782 array dataflow analysis.  That is, given a I<sink> access relation,
8783 a collection of possible I<source> accesses and
8784 a collection of I<kill> accesses,
8785 C<isl> can compute relations that describe
8786 for each iteration of the sink access, which iterations
8787 of which of the source access relations may have
8788 accessed the same data element before the given iteration
8789 of the sink access without any intermediate kill of that data element.
8790 The resulting dependence relations map source iterations
8791 to either the corresponding sink iterations or
8792 pairs of corresponding sink iterations and accessed data elements.
8793 To compute standard flow dependences, the sink should be
8794 a read, while the sources should be writes.
8795 If no kills are specified,
8796 then memory based dependence analysis is performed.
8797 If, on the other hand, all sources are also kills,
8798 then value based dependence analysis is performed.
8799 If any of the source accesses are marked as being I<must>
8800 accesses, then they are also treated as kills.
8801 Furthermore, the specification of must-sources results
8802 in the computation of must-dependences.
8803 Only dependences originating in a must access not coscheduled
8804 with any other access to the same element and without
8805 any may accesses between the must access and the sink access
8806 are considered to be must dependences.
8808 =head3 High-level Interface
8810 A high-level interface to dependence analysis is provided
8811 by the following function.
8813         #include <isl/flow.h>
8814         __isl_give isl_union_flow *
8815         isl_union_access_info_compute_flow(
8816                 __isl_take isl_union_access_info *access);
8818 The input C<isl_union_access_info> object describes the sink
8819 access relations, the source access relations and a schedule,
8820 while the output C<isl_union_flow> object describes
8821 the resulting dependence relations and the subsets of the
8822 sink relations for which no source was found.
8824 An C<isl_union_access_info> is created, modified, copied and freed using
8825 the following functions.
8827         #include <isl/flow.h>
8828         __isl_give isl_union_access_info *
8829         isl_union_access_info_from_sink(
8830                 __isl_take isl_union_map *sink);
8831         __isl_give isl_union_access_info *
8832         isl_union_access_info_set_kill(
8833                 __isl_take isl_union_access_info *access,
8834                 __isl_take isl_union_map *kill);
8835         __isl_give isl_union_access_info *
8836         isl_union_access_info_set_may_source(
8837                 __isl_take isl_union_access_info *access,
8838                 __isl_take isl_union_map *may_source);
8839         __isl_give isl_union_access_info *
8840         isl_union_access_info_set_must_source(
8841                 __isl_take isl_union_access_info *access,
8842                 __isl_take isl_union_map *must_source);
8843         __isl_give isl_union_access_info *
8844         isl_union_access_info_set_schedule(
8845                 __isl_take isl_union_access_info *access,
8846                 __isl_take isl_schedule *schedule);
8847         __isl_give isl_union_access_info *
8848         isl_union_access_info_set_schedule_map(
8849                 __isl_take isl_union_access_info *access,
8850                 __isl_take isl_union_map *schedule_map);
8851         __isl_give isl_union_access_info *
8852         isl_union_access_info_copy(
8853                 __isl_keep isl_union_access_info *access);
8854         __isl_null isl_union_access_info *
8855         isl_union_access_info_free(
8856                 __isl_take isl_union_access_info *access);
8858 The may sources set by C<isl_union_access_info_set_may_source>
8859 do not need to include the must sources set by
8860 C<isl_union_access_info_set_must_source> as a subset.
8861 The kills set by C<isl_union_access_info_set_kill> may overlap
8862 with the may-sources and/or must-sources.
8863 The user is free not to call one (or more) of these functions,
8864 in which case the corresponding set is kept to its empty default.
8865 Similarly, the default schedule initialized by
8866 C<isl_union_access_info_from_sink> is empty.
8867 The current schedule is determined by the last call to either
8868 C<isl_union_access_info_set_schedule> or
8869 C<isl_union_access_info_set_schedule_map>.
8870 The domain of the schedule corresponds to the domains of
8871 the access relations.  In particular, the domains of the access
8872 relations are effectively intersected with the domain of the schedule
8873 and only the resulting accesses are considered by the dependence analysis.
8875 An C<isl_union_access_info> object can be read from input
8876 using the following function.
8878         #include <isl/flow.h>
8879         __isl_give isl_union_access_info *
8880         isl_union_access_info_read_from_file(isl_ctx *ctx,
8881                 FILE *input);
8883 A representation of the information contained in an object
8884 of type C<isl_union_access_info> can be obtained using
8886         #include <isl/flow.h>
8887         __isl_give isl_printer *
8888         isl_printer_print_union_access_info(
8889                 __isl_take isl_printer *p,
8890                 __isl_keep isl_union_access_info *access);
8891         __isl_give char *isl_union_access_info_to_str(
8892                 __isl_keep isl_union_access_info *access);
8894 C<isl_union_access_info_to_str> prints the information in flow format.
8896 The output of C<isl_union_access_info_compute_flow> can be examined,
8897 copied, and freed using the following functions.
8899         #include <isl/flow.h>
8900         __isl_give isl_union_map *isl_union_flow_get_must_dependence(
8901                 __isl_keep isl_union_flow *flow);
8902         __isl_give isl_union_map *isl_union_flow_get_may_dependence(
8903                 __isl_keep isl_union_flow *flow);
8904         __isl_give isl_union_map *
8905         isl_union_flow_get_full_must_dependence(
8906                 __isl_keep isl_union_flow *flow);
8907         __isl_give isl_union_map *
8908         isl_union_flow_get_full_may_dependence(
8909                 __isl_keep isl_union_flow *flow);
8910         __isl_give isl_union_map *isl_union_flow_get_must_no_source(
8911                 __isl_keep isl_union_flow *flow);
8912         __isl_give isl_union_map *isl_union_flow_get_may_no_source(
8913                 __isl_keep isl_union_flow *flow);
8914         __isl_give isl_union_flow *isl_union_flow_copy(
8915                 __isl_keep isl_union_flow *flow);
8916         __isl_null isl_union_flow *isl_union_flow_free(
8917                 __isl_take isl_union_flow *flow);
8919 The relation returned by C<isl_union_flow_get_must_dependence>
8920 relates domain elements of must sources to domain elements of the sink.
8921 The relation returned by C<isl_union_flow_get_may_dependence>
8922 relates domain elements of must or may sources to domain elements of the sink
8923 and includes the previous relation as a subset.
8924 The relation returned by C<isl_union_flow_get_full_must_dependence>
8925 relates domain elements of must sources to pairs of domain elements of the sink
8926 and accessed data elements.
8927 The relation returned by C<isl_union_flow_get_full_may_dependence>
8928 relates domain elements of must or may sources to pairs of
8929 domain elements of the sink and accessed data elements.
8930 This relation includes the previous relation as a subset.
8931 The relation returned by C<isl_union_flow_get_must_no_source> is the subset
8932 of the sink relation for which no dependences have been found.
8933 The relation returned by C<isl_union_flow_get_may_no_source> is the subset
8934 of the sink relation for which no definite dependences have been found.
8935 That is, it contains those sink access that do not contribute to any
8936 of the elements in the relation returned
8937 by C<isl_union_flow_get_must_dependence>.
8939 A representation of the information contained in an object
8940 of type C<isl_union_flow> can be obtained using
8942         #include <isl/flow.h>
8943         __isl_give isl_printer *isl_printer_print_union_flow(
8944                 __isl_take isl_printer *p,
8945                 __isl_keep isl_union_flow *flow);
8946         __isl_give char *isl_union_flow_to_str(
8947                 __isl_keep isl_union_flow *flow);
8949 C<isl_union_flow_to_str> prints the information in flow format.
8951 =head3 Low-level Interface
8953 A lower-level interface is provided by the following functions.
8955         #include <isl/flow.h>
8957         typedef int (*isl_access_level_before)(void *first, void *second);
8959         __isl_give isl_access_info *isl_access_info_alloc(
8960                 __isl_take isl_map *sink,
8961                 void *sink_user, isl_access_level_before fn,
8962                 int max_source);
8963         __isl_give isl_access_info *isl_access_info_add_source(
8964                 __isl_take isl_access_info *acc,
8965                 __isl_take isl_map *source, int must,
8966                 void *source_user);
8967         __isl_null isl_access_info *isl_access_info_free(
8968                 __isl_take isl_access_info *acc);
8970         __isl_give isl_flow *isl_access_info_compute_flow(
8971                 __isl_take isl_access_info *acc);
8973         isl_stat isl_flow_foreach(__isl_keep isl_flow *deps,
8974                 isl_stat (*fn)(__isl_take isl_map *dep, int must,
8975                           void *dep_user, void *user),
8976                 void *user);
8977         __isl_give isl_map *isl_flow_get_no_source(
8978                 __isl_keep isl_flow *deps, int must);
8979         void isl_flow_free(__isl_take isl_flow *deps);
8981 The function C<isl_access_info_compute_flow> performs the actual
8982 dependence analysis.  The other functions are used to construct
8983 the input for this function or to read off the output.
8985 The input is collected in an C<isl_access_info>, which can
8986 be created through a call to C<isl_access_info_alloc>.
8987 The arguments to this functions are the sink access relation
8988 C<sink>, a token C<sink_user> used to identify the sink
8989 access to the user, a callback function for specifying the
8990 relative order of source and sink accesses, and the number
8991 of source access relations that will be added.
8993 The callback function has type C<int (*)(void *first, void *second)>.
8994 The function is called with two user supplied tokens identifying
8995 either a source or the sink and it should return the shared nesting
8996 level and the relative order of the two accesses.
8997 In particular, let I<n> be the number of loops shared by
8998 the two accesses.  If C<first> precedes C<second> textually,
8999 then the function should return I<2 * n + 1>; otherwise,
9000 it should return I<2 * n>.
9001 The low-level interface assumes that no sources are coscheduled.
9002 If the information returned by the callback does not allow
9003 the relative order to be determined, then one of the sources
9004 is arbitrarily taken to be executed after the other(s).
9006 The sources can be added to the C<isl_access_info> object by performing
9007 (at most) C<max_source> calls to C<isl_access_info_add_source>.
9008 C<must> indicates whether the source is a I<must> access
9009 or a I<may> access.  Note that a multi-valued access relation
9010 should only be marked I<must> if every iteration in the domain
9011 of the relation accesses I<all> elements in its image.
9012 The C<source_user> token is again used to identify
9013 the source access.  The range of the source access relation
9014 C<source> should have the same dimension as the range
9015 of the sink access relation.
9016 The C<isl_access_info_free> function should usually not be
9017 called explicitly, because it is already called implicitly by
9018 C<isl_access_info_compute_flow>.
9020 The result of the dependence analysis is collected in an
9021 C<isl_flow>.  There may be elements of
9022 the sink access for which no preceding source access could be
9023 found or for which all preceding sources are I<may> accesses.
9024 The relations containing these elements can be obtained through
9025 calls to C<isl_flow_get_no_source>, the first with C<must> set
9026 and the second with C<must> unset.
9027 In the case of standard flow dependence analysis,
9028 with the sink a read and the sources I<must> writes,
9029 the first relation corresponds to the reads from uninitialized
9030 array elements and the second relation is empty.
9031 The actual flow dependences can be extracted using
9032 C<isl_flow_foreach>.  This function will call the user-specified
9033 callback function C<fn> for each B<non-empty> dependence between
9034 a source and the sink.  The callback function is called
9035 with four arguments, the actual flow dependence relation
9036 mapping source iterations to sink iterations, a boolean that
9037 indicates whether it is a I<must> or I<may> dependence, a token
9038 identifying the source and an additional C<void *> with value
9039 equal to the third argument of the C<isl_flow_foreach> call.
9040 A dependence is marked I<must> if it originates from a I<must>
9041 source and if it is not followed by any I<may> sources.
9043 After finishing with an C<isl_flow>, the user should call
9044 C<isl_flow_free> to free all associated memory.
9046 =head3 Interaction with the Low-level Interface
9048 During the dependence analysis, we frequently need to perform
9049 the following operation.  Given a relation between sink iterations
9050 and potential source iterations from a particular source domain,
9051 what is the last potential source iteration corresponding to each
9052 sink iteration.  It can sometimes be convenient to adjust
9053 the set of potential source iterations before or after each such operation.
9054 The prototypical example is fuzzy array dataflow analysis,
9055 where we need to analyze if, based on data-dependent constraints,
9056 the sink iteration can ever be executed without one or more of
9057 the corresponding potential source iterations being executed.
9058 If so, we can introduce extra parameters and select an unknown
9059 but fixed source iteration from the potential source iterations.
9060 To be able to perform such manipulations, C<isl> provides the following
9061 function.
9063         #include <isl/flow.h>
9065         typedef __isl_give isl_restriction *(*isl_access_restrict)(
9066                 __isl_keep isl_map *source_map,
9067                 __isl_keep isl_set *sink, void *source_user,
9068                 void *user);
9069         __isl_give isl_access_info *isl_access_info_set_restrict(
9070                 __isl_take isl_access_info *acc,
9071                 isl_access_restrict fn, void *user);
9073 The function C<isl_access_info_set_restrict> should be called
9074 before calling C<isl_access_info_compute_flow> and registers a callback function
9075 that will be called any time C<isl> is about to compute the last
9076 potential source.  The first argument is the (reverse) proto-dependence,
9077 mapping sink iterations to potential source iterations.
9078 The second argument represents the sink iterations for which
9079 we want to compute the last source iteration.
9080 The third argument is the token corresponding to the source
9081 and the final argument is the token passed to C<isl_access_info_set_restrict>.
9082 The callback is expected to return a restriction on either the input or
9083 the output of the operation computing the last potential source.
9084 If the input needs to be restricted then restrictions are needed
9085 for both the source and the sink iterations.  The sink iterations
9086 and the potential source iterations will be intersected with these sets.
9087 If the output needs to be restricted then only a restriction on the source
9088 iterations is required.
9089 If any error occurs, the callback should return C<NULL>.
9090 An C<isl_restriction> object can be created, freed and inspected
9091 using the following functions.
9093         #include <isl/flow.h>
9095         __isl_give isl_restriction *isl_restriction_input(
9096                 __isl_take isl_set *source_restr,
9097                 __isl_take isl_set *sink_restr);
9098         __isl_give isl_restriction *isl_restriction_output(
9099                 __isl_take isl_set *source_restr);
9100         __isl_give isl_restriction *isl_restriction_none(
9101                 __isl_take isl_map *source_map);
9102         __isl_give isl_restriction *isl_restriction_empty(
9103                 __isl_take isl_map *source_map);
9104         __isl_null isl_restriction *isl_restriction_free(
9105                 __isl_take isl_restriction *restr);
9107 C<isl_restriction_none> and C<isl_restriction_empty> are special
9108 cases of C<isl_restriction_input>.  C<isl_restriction_none>
9109 is essentially equivalent to
9111         isl_restriction_input(isl_set_universe(
9112             isl_space_range(isl_map_get_space(source_map))),
9113                             isl_set_universe(
9114             isl_space_domain(isl_map_get_space(source_map))));
9116 whereas C<isl_restriction_empty> is essentially equivalent to
9118         isl_restriction_input(isl_set_empty(
9119             isl_space_range(isl_map_get_space(source_map))),
9120                             isl_set_universe(
9121             isl_space_domain(isl_map_get_space(source_map))));
9123 =head2 Scheduling
9125         #include <isl/schedule.h>
9126         __isl_give isl_schedule *
9127         isl_schedule_constraints_compute_schedule(
9128                 __isl_take isl_schedule_constraints *sc);
9130 The function C<isl_schedule_constraints_compute_schedule> can be
9131 used to compute a schedule that satisfies the given schedule constraints.
9132 These schedule constraints include the iteration domain for which
9133 a schedule should be computed and dependences between pairs of
9134 iterations.  In particular, these dependences include
9135 I<validity> dependences and I<proximity> dependences.
9136 By default, the algorithm used to construct the schedule is similar
9137 to that of C<Pluto>.
9138 Alternatively, Feautrier's multi-dimensional scheduling algorithm can
9139 be selected.
9140 The generated schedule respects all validity dependences.
9141 That is, all dependence distances over these dependences in the
9142 scheduled space are lexicographically positive.
9144 The default algorithm tries to ensure that the dependence distances
9145 over coincidence constraints are zero and to minimize the
9146 dependence distances over proximity dependences.
9147 Moreover, it tries to obtain sequences (bands) of schedule dimensions
9148 for groups of domains where the dependence distances over validity
9149 dependences have only non-negative values.
9150 Note that when minimizing the maximal dependence distance
9151 over proximity dependences, a single affine expression in the parameters
9152 is constructed that bounds all dependence distances.  If no such expression
9153 exists, then the algorithm will fail and resort to an alternative
9154 scheduling algorithm.  In particular, this means that adding proximity
9155 dependences may eliminate valid solutions.  A typical example where this
9156 phenomenon may occur is when some subset of the proximity dependences
9157 has no restriction on some parameter, forcing the coefficient of that
9158 parameter to be zero, while some other subset forces the dependence
9159 distance to depend on that parameter, requiring the same coefficient
9160 to be non-zero.
9161 When using Feautrier's algorithm, the coincidence and proximity constraints
9162 are only taken into account during the extension to a
9163 full-dimensional schedule.
9165 An C<isl_schedule_constraints> object can be constructed
9166 and manipulated using the following functions.
9168         #include <isl/schedule.h>
9169         __isl_give isl_schedule_constraints *
9170         isl_schedule_constraints_copy(
9171                 __isl_keep isl_schedule_constraints *sc);
9172         __isl_give isl_schedule_constraints *
9173         isl_schedule_constraints_on_domain(
9174                 __isl_take isl_union_set *domain);
9175         __isl_give isl_schedule_constraints *
9176         isl_schedule_constraints_set_context(
9177                 __isl_take isl_schedule_constraints *sc,
9178                 __isl_take isl_set *context);
9179         __isl_give isl_schedule_constraints *
9180         isl_schedule_constraints_set_validity(
9181                 __isl_take isl_schedule_constraints *sc,
9182                 __isl_take isl_union_map *validity);
9183         __isl_give isl_schedule_constraints *
9184         isl_schedule_constraints_set_coincidence(
9185                 __isl_take isl_schedule_constraints *sc,
9186                 __isl_take isl_union_map *coincidence);
9187         __isl_give isl_schedule_constraints *
9188         isl_schedule_constraints_set_proximity(
9189                 __isl_take isl_schedule_constraints *sc,
9190                 __isl_take isl_union_map *proximity);
9191         __isl_give isl_schedule_constraints *
9192         isl_schedule_constraints_set_conditional_validity(
9193                 __isl_take isl_schedule_constraints *sc,
9194                 __isl_take isl_union_map *condition,
9195                 __isl_take isl_union_map *validity);
9196         __isl_give isl_schedule_constraints *
9197         isl_schedule_constraints_apply(
9198                 __isl_take isl_schedule_constraints *sc,
9199                 __isl_take isl_union_map *umap);
9200         __isl_null isl_schedule_constraints *
9201         isl_schedule_constraints_free(
9202                 __isl_take isl_schedule_constraints *sc);
9204 The initial C<isl_schedule_constraints> object created by
9205 C<isl_schedule_constraints_on_domain> does not impose any constraints.
9206 That is, it has an empty set of dependences.
9207 The function C<isl_schedule_constraints_set_context> allows the user
9208 to specify additional constraints on the parameters that may
9209 be assumed to hold during the construction of the schedule.
9210 The function C<isl_schedule_constraints_set_validity> replaces the
9211 validity dependences, mapping domain elements I<i> to domain
9212 elements that should be scheduled after I<i>.
9213 The function C<isl_schedule_constraints_set_coincidence> replaces the
9214 coincidence dependences, mapping domain elements I<i> to domain
9215 elements that should be scheduled together with I<I>, if possible.
9216 The function C<isl_schedule_constraints_set_proximity> replaces the
9217 proximity dependences, mapping domain elements I<i> to domain
9218 elements that should be scheduled either before I<I>
9219 or as early as possible after I<i>.
9221 The function C<isl_schedule_constraints_set_conditional_validity>
9222 replaces the conditional validity constraints.
9223 A conditional validity constraint is only imposed when any of the corresponding
9224 conditions is satisfied, i.e., when any of them is non-zero.
9225 That is, the scheduler ensures that within each band if the dependence
9226 distances over the condition constraints are not all zero
9227 then all corresponding conditional validity constraints are respected.
9228 A conditional validity constraint corresponds to a condition
9229 if the two are adjacent, i.e., if the domain of one relation intersect
9230 the range of the other relation.
9231 The typical use case of conditional validity constraints is
9232 to allow order constraints between live ranges to be violated
9233 as long as the live ranges themselves are local to the band.
9234 To allow more fine-grained control over which conditions correspond
9235 to which conditional validity constraints, the domains and ranges
9236 of these relations may include I<tags>.  That is, the domains and
9237 ranges of those relation may themselves be wrapped relations
9238 where the iteration domain appears in the domain of those wrapped relations
9239 and the range of the wrapped relations can be arbitrarily chosen
9240 by the user.  Conditions and conditional validity constraints are only
9241 considered adjacent to each other if the entire wrapped relation matches.
9242 In particular, a relation with a tag will never be considered adjacent
9243 to a relation without a tag.
9245 The function C<isl_schedule_constraints_compute_schedule> takes
9246 schedule constraints that are defined on some set of domain elements
9247 and transforms them to schedule constraints on the elements
9248 to which these domain elements are mapped by the given transformation.
9250 An C<isl_schedule_constraints> object can be inspected
9251 using the following functions.
9253         #include <isl/schedule.h>
9254         __isl_give isl_union_set *
9255         isl_schedule_constraints_get_domain(
9256                 __isl_keep isl_schedule_constraints *sc);
9257         __isl_give isl_set *isl_schedule_constraints_get_context(
9258                 __isl_keep isl_schedule_constraints *sc);
9259         __isl_give isl_union_map *
9260         isl_schedule_constraints_get_validity(
9261                 __isl_keep isl_schedule_constraints *sc);
9262         __isl_give isl_union_map *
9263         isl_schedule_constraints_get_coincidence(
9264                 __isl_keep isl_schedule_constraints *sc);
9265         __isl_give isl_union_map *
9266         isl_schedule_constraints_get_proximity(
9267                 __isl_keep isl_schedule_constraints *sc);
9268         __isl_give isl_union_map *
9269         isl_schedule_constraints_get_conditional_validity(
9270                 __isl_keep isl_schedule_constraints *sc);
9271         __isl_give isl_union_map *
9272         isl_schedule_constraints_get_conditional_validity_condition(
9273                 __isl_keep isl_schedule_constraints *sc);
9275 An C<isl_schedule_constraints> object can be read from input
9276 using the following functions.
9278         #include <isl/schedule.h>
9279         __isl_give isl_schedule_constraints *
9280         isl_schedule_constraints_read_from_str(isl_ctx *ctx,
9281                 const char *str);
9282         __isl_give isl_schedule_constraints *
9283         isl_schedule_constraints_read_from_file(isl_ctx *ctx,
9284                 FILE *input);
9286 The contents of an C<isl_schedule_constraints> object can be printed
9287 using the following functions.
9289         #include <isl/schedule.h>
9290         __isl_give isl_printer *
9291         isl_printer_print_schedule_constraints(
9292                 __isl_take isl_printer *p,
9293                 __isl_keep isl_schedule_constraints *sc);
9294         __isl_give char *isl_schedule_constraints_to_str(
9295                 __isl_keep isl_schedule_constraints *sc);
9297 The following function computes a schedule directly from
9298 an iteration domain and validity and proximity dependences
9299 and is implemented in terms of the functions described above.
9300 The use of C<isl_union_set_compute_schedule> is discouraged.
9302         #include <isl/schedule.h>
9303         __isl_give isl_schedule *isl_union_set_compute_schedule(
9304                 __isl_take isl_union_set *domain,
9305                 __isl_take isl_union_map *validity,
9306                 __isl_take isl_union_map *proximity);
9308 The generated schedule represents a schedule tree.
9309 For more information on schedule trees, see
9310 L</"Schedule Trees">.
9312 =head3 Options
9314         #include <isl/schedule.h>
9315         isl_stat isl_options_set_schedule_max_coefficient(
9316                 isl_ctx *ctx, int val);
9317         int isl_options_get_schedule_max_coefficient(
9318                 isl_ctx *ctx);
9319         isl_stat isl_options_set_schedule_max_constant_term(
9320                 isl_ctx *ctx, int val);
9321         int isl_options_get_schedule_max_constant_term(
9322                 isl_ctx *ctx);
9323         isl_stat isl_options_set_schedule_serialize_sccs(
9324                 isl_ctx *ctx, int val);
9325         int isl_options_get_schedule_serialize_sccs(isl_ctx *ctx);
9326         isl_stat isl_options_set_schedule_whole_component(
9327                 isl_ctx *ctx, int val);
9328         int isl_options_get_schedule_whole_component(
9329                 isl_ctx *ctx);
9330         isl_stat isl_options_set_schedule_maximize_band_depth(
9331                 isl_ctx *ctx, int val);
9332         int isl_options_get_schedule_maximize_band_depth(
9333                 isl_ctx *ctx);
9334         isl_stat isl_options_set_schedule_maximize_coincidence(
9335                 isl_ctx *ctx, int val);
9336         int isl_options_get_schedule_maximize_coincidence(
9337                 isl_ctx *ctx);
9338         isl_stat isl_options_set_schedule_outer_coincidence(
9339                 isl_ctx *ctx, int val);
9340         int isl_options_get_schedule_outer_coincidence(
9341                 isl_ctx *ctx);
9342         isl_stat isl_options_set_schedule_split_scaled(
9343                 isl_ctx *ctx, int val);
9344         int isl_options_get_schedule_split_scaled(
9345                 isl_ctx *ctx);
9346         isl_stat isl_options_set_schedule_treat_coalescing(
9347                 isl_ctx *ctx, int val);
9348         int isl_options_get_schedule_treat_coalescing(
9349                 isl_ctx *ctx);
9350         isl_stat isl_options_set_schedule_algorithm(
9351                 isl_ctx *ctx, int val);
9352         int isl_options_get_schedule_algorithm(
9353                 isl_ctx *ctx);
9354         isl_stat isl_options_set_schedule_carry_self_first(
9355                 isl_ctx *ctx, int val);
9356         int isl_options_get_schedule_carry_self_first(
9357                 isl_ctx *ctx);
9358         isl_stat isl_options_set_schedule_separate_components(
9359                 isl_ctx *ctx, int val);
9360         int isl_options_get_schedule_separate_components(
9361                 isl_ctx *ctx);
9363 =over
9365 =item * schedule_max_coefficient
9367 This option enforces that the coefficients for variable and parameter
9368 dimensions in the calculated schedule are not larger than the specified value.
9369 This option can significantly increase the speed of the scheduling calculation
9370 and may also prevent fusing of unrelated dimensions. A value of -1 means that
9371 this option does not introduce bounds on the variable or parameter
9372 coefficients.
9374 =item * schedule_max_constant_term
9376 This option enforces that the constant coefficients in the calculated schedule
9377 are not larger than the maximal constant term. This option can significantly
9378 increase the speed of the scheduling calculation and may also prevent fusing of
9379 unrelated dimensions. A value of -1 means that this option does not introduce
9380 bounds on the constant coefficients.
9382 =item * schedule_serialize_sccs
9384 If this option is set, then all strongly connected components
9385 in the dependence graph are serialized as soon as they are detected.
9386 This means in particular that instances of statements will only
9387 appear in the same band node if these statements belong
9388 to the same strongly connected component at the point where
9389 the band node is constructed.
9391 =item * schedule_whole_component
9393 If this option is set, then entire (weakly) connected
9394 components in the dependence graph are scheduled together
9395 as a whole.
9396 Otherwise, each strongly connected component within
9397 such a weakly connected component is first scheduled separately
9398 and then combined with other strongly connected components.
9399 This option has no effect if C<schedule_serialize_sccs> is set.
9401 =item * schedule_maximize_band_depth
9403 If this option is set, then the scheduler tries to maximize
9404 the width of the bands.  Wider bands give more possibilities for tiling.
9405 In particular, if the C<schedule_whole_component> option is set,
9406 then bands are split if this might result in wider bands.
9407 Otherwise, the effect of this option is to only allow
9408 strongly connected components to be combined if this does
9409 not reduce the width of the bands.
9410 Note that if the C<schedule_serialize_sccs> options is set, then
9411 the C<schedule_maximize_band_depth> option therefore has no effect.
9413 =item * schedule_maximize_coincidence
9415 This option is only effective if the C<schedule_whole_component>
9416 option is turned off.
9417 If the C<schedule_maximize_coincidence> option is set, then (clusters of)
9418 strongly connected components are only combined with each other
9419 if this does not reduce the number of coincident band members.
9421 =item * schedule_outer_coincidence
9423 If this option is set, then we try to construct schedules
9424 where the outermost scheduling dimension in each band
9425 satisfies the coincidence constraints.
9427 =item * schedule_algorithm
9429 Selects the scheduling algorithm to be used.
9430 Available scheduling algorithms are C<ISL_SCHEDULE_ALGORITHM_ISL>
9431 and C<ISL_SCHEDULE_ALGORITHM_FEAUTRIER>.
9433 =item * schedule_split_scaled
9435 If this option is set, then we try to construct schedules in which the
9436 constant term is split off from the linear part if the linear parts of
9437 the scheduling rows for all nodes in the graph have a common non-trivial
9438 divisor.
9439 The constant term is then dropped and the linear
9440 part is reduced.
9441 This option is only effective when the Feautrier style scheduler is
9442 being used, either as the main scheduler or as a fallback for the
9443 Pluto-like scheduler.
9445 =item * schedule_treat_coalescing
9447 If this option is set, then the scheduler will try and avoid
9448 producing schedules that perform loop coalescing.
9449 In particular, for the Pluto-like scheduler, this option places
9450 bounds on the schedule coefficients based on the sizes of the instance sets.
9451 For the Feautrier style scheduler, this option detects potentially
9452 coalescing schedules and then tries to adjust the schedule to avoid
9453 the coalescing.
9455 =item * schedule_carry_self_first
9457 If this option is set, then the Feautrier style scheduler
9458 (when used as a fallback for the Pluto-like scheduler) will
9459 first try to only carry self-dependences.
9461 =item * schedule_separate_components
9463 If this option is set then the function C<isl_schedule_get_map>
9464 will treat set nodes in the same way as sequence nodes.
9466 =back
9468 =head2 AST Generation
9470 This section describes the C<isl> functionality for generating
9471 ASTs that visit all the elements
9472 in a domain in an order specified by a schedule tree or
9473 a schedule map.
9474 In case the schedule given as a C<isl_union_map>, an AST is generated
9475 that visits all the elements in the domain of the C<isl_union_map>
9476 according to the lexicographic order of the corresponding image
9477 element(s).  If the range of the C<isl_union_map> consists of
9478 elements in more than one space, then each of these spaces is handled
9479 separately in an arbitrary order.
9480 It should be noted that the schedule tree or the image elements
9481 in a schedule map only specify the I<order>
9482 in which the corresponding domain elements should be visited.
9483 No direct relation between the partial schedule values
9484 or the image elements on the one hand and the loop iterators
9485 in the generated AST on the other hand should be assumed.
9487 Each AST is generated within a build.  The initial build
9488 simply specifies the constraints on the parameters (if any)
9489 and can be created, inspected, copied and freed using the following functions.
9491         #include <isl/ast_build.h>
9492         __isl_give isl_ast_build *isl_ast_build_alloc(
9493                 isl_ctx *ctx);
9494         __isl_give isl_ast_build *isl_ast_build_from_context(
9495                 __isl_take isl_set *set);
9496         __isl_give isl_ast_build *isl_ast_build_copy(
9497                 __isl_keep isl_ast_build *build);
9498         __isl_null isl_ast_build *isl_ast_build_free(
9499                 __isl_take isl_ast_build *build);
9501 The C<set> argument is usually a parameter set with zero or more parameters.
9502 In fact, when creating an AST using C<isl_ast_build_node_from_schedule>,
9503 this set is required to be a parameter set.
9504 An C<isl_ast_build> created using C<isl_ast_build_alloc> does not
9505 specify any parameter constraints.
9506 More C<isl_ast_build> functions are described in L</"Nested AST Generation">
9507 and L</"Fine-grained Control over AST Generation">.
9508 Finally, the AST itself can be constructed using one of the following
9509 functions.
9511         #include <isl/ast_build.h>
9512         __isl_give isl_ast_node *isl_ast_build_node_from_schedule(
9513                 __isl_keep isl_ast_build *build,
9514                 __isl_take isl_schedule *schedule);
9515         __isl_give isl_ast_node *
9516         isl_ast_build_node_from_schedule_map(
9517                 __isl_keep isl_ast_build *build,
9518                 __isl_take isl_union_map *schedule);
9520 =head3 Inspecting the AST
9522 The basic properties of an AST node can be obtained as follows.
9524         #include <isl/ast.h>
9525         enum isl_ast_node_type isl_ast_node_get_type(
9526                 __isl_keep isl_ast_node *node);
9528 The type of an AST node is one of
9529 C<isl_ast_node_for>,
9530 C<isl_ast_node_if>,
9531 C<isl_ast_node_block>,
9532 C<isl_ast_node_mark> or
9533 C<isl_ast_node_user>.
9534 An C<isl_ast_node_for> represents a for node.
9535 An C<isl_ast_node_if> represents an if node.
9536 An C<isl_ast_node_block> represents a compound node.
9537 An C<isl_ast_node_mark> introduces a mark in the AST.
9538 An C<isl_ast_node_user> represents an expression statement.
9539 An expression statement typically corresponds to a domain element, i.e.,
9540 one of the elements that is visited by the AST.
9542 Each type of node has its own additional properties.
9544         #include <isl/ast.h>
9545         __isl_give isl_ast_expr *isl_ast_node_for_get_iterator(
9546                 __isl_keep isl_ast_node *node);
9547         __isl_give isl_ast_expr *isl_ast_node_for_get_init(
9548                 __isl_keep isl_ast_node *node);
9549         __isl_give isl_ast_expr *isl_ast_node_for_get_cond(
9550                 __isl_keep isl_ast_node *node);
9551         __isl_give isl_ast_expr *isl_ast_node_for_get_inc(
9552                 __isl_keep isl_ast_node *node);
9553         __isl_give isl_ast_node *isl_ast_node_for_get_body(
9554                 __isl_keep isl_ast_node *node);
9555         isl_bool isl_ast_node_for_is_degenerate(
9556                 __isl_keep isl_ast_node *node);
9558 An C<isl_ast_for> is considered degenerate if it is known to execute
9559 exactly once.
9561         #include <isl/ast.h>
9562         __isl_give isl_ast_expr *isl_ast_node_if_get_cond(
9563                 __isl_keep isl_ast_node *node);
9564         __isl_give isl_ast_node *isl_ast_node_if_get_then(
9565                 __isl_keep isl_ast_node *node);
9566         isl_bool isl_ast_node_if_has_else(
9567                 __isl_keep isl_ast_node *node);
9568         __isl_give isl_ast_node *isl_ast_node_if_get_else(
9569                 __isl_keep isl_ast_node *node);
9571         __isl_give isl_ast_node_list *
9572         isl_ast_node_block_get_children(
9573                 __isl_keep isl_ast_node *node);
9575         __isl_give isl_id *isl_ast_node_mark_get_id(
9576                 __isl_keep isl_ast_node *node);
9577         __isl_give isl_ast_node *isl_ast_node_mark_get_node(
9578                 __isl_keep isl_ast_node *node);
9580 C<isl_ast_node_mark_get_id> returns the identifier of the mark.
9581 C<isl_ast_node_mark_get_node> returns the child node that is being marked.
9583         #include <isl/ast.h>
9584         __isl_give isl_ast_expr *isl_ast_node_user_get_expr(
9585                 __isl_keep isl_ast_node *node);
9587 All descendants of a specific node in the AST (including the node itself)
9588 can be visited
9589 in depth-first pre-order using the following function.
9591         #include <isl/ast.h>
9592         isl_stat isl_ast_node_foreach_descendant_top_down(
9593                 __isl_keep isl_ast_node *node,
9594                 isl_bool (*fn)(__isl_keep isl_ast_node *node,
9595                         void *user), void *user);
9597 The callback function should return C<isl_bool_true> if the children
9598 of the given node should be visited and C<isl_bool_false> if they should not.
9599 It should return C<isl_bool_error> in case of failure, in which case
9600 the entire traversal is aborted.
9602 Each of the returned C<isl_ast_expr>s can in turn be inspected using
9603 the following functions.
9605         #include <isl/ast.h>
9606         enum isl_ast_expr_type isl_ast_expr_get_type(
9607                 __isl_keep isl_ast_expr *expr);
9609 The type of an AST expression is one of
9610 C<isl_ast_expr_op>,
9611 C<isl_ast_expr_id> or
9612 C<isl_ast_expr_int>.
9613 An C<isl_ast_expr_op> represents the result of an operation.
9614 An C<isl_ast_expr_id> represents an identifier.
9615 An C<isl_ast_expr_int> represents an integer value.
9617 Each type of expression has its own additional properties.
9619         #include <isl/ast.h>
9620         enum isl_ast_op_type isl_ast_expr_get_op_type(
9621                 __isl_keep isl_ast_expr *expr);
9622         int isl_ast_expr_get_op_n_arg(__isl_keep isl_ast_expr *expr);
9623         __isl_give isl_ast_expr *isl_ast_expr_get_op_arg(
9624                 __isl_keep isl_ast_expr *expr, int pos);
9625         isl_stat isl_ast_expr_foreach_ast_op_type(
9626                 __isl_keep isl_ast_expr *expr,
9627                 isl_stat (*fn)(enum isl_ast_op_type type,
9628                         void *user), void *user);
9629         isl_stat isl_ast_node_foreach_ast_op_type(
9630                 __isl_keep isl_ast_node *node,
9631                 isl_stat (*fn)(enum isl_ast_op_type type,
9632                         void *user), void *user);
9634 C<isl_ast_expr_get_op_type> returns the type of the operation
9635 performed.  C<isl_ast_expr_get_op_n_arg> returns the number of
9636 arguments.  C<isl_ast_expr_get_op_arg> returns the specified
9637 argument.
9638 C<isl_ast_expr_foreach_ast_op_type> calls C<fn> for each distinct
9639 C<isl_ast_op_type> that appears in C<expr>.
9640 C<isl_ast_node_foreach_ast_op_type> does the same for each distinct
9641 C<isl_ast_op_type> that appears in C<node>.
9642 The operation type is one of the following.
9644 =over
9646 =item C<isl_ast_op_and>
9648 Logical I<and> of two arguments.
9649 Both arguments can be evaluated.
9651 =item C<isl_ast_op_and_then>
9653 Logical I<and> of two arguments.
9654 The second argument can only be evaluated if the first evaluates to true.
9656 =item C<isl_ast_op_or>
9658 Logical I<or> of two arguments.
9659 Both arguments can be evaluated.
9661 =item C<isl_ast_op_or_else>
9663 Logical I<or> of two arguments.
9664 The second argument can only be evaluated if the first evaluates to false.
9666 =item C<isl_ast_op_max>
9668 Maximum of two or more arguments.
9670 =item C<isl_ast_op_min>
9672 Minimum of two or more arguments.
9674 =item C<isl_ast_op_minus>
9676 Change sign.
9678 =item C<isl_ast_op_add>
9680 Sum of two arguments.
9682 =item C<isl_ast_op_sub>
9684 Difference of two arguments.
9686 =item C<isl_ast_op_mul>
9688 Product of two arguments.
9690 =item C<isl_ast_op_div>
9692 Exact division.  That is, the result is known to be an integer.
9694 =item C<isl_ast_op_fdiv_q>
9696 Result of integer division, rounded towards negative
9697 infinity.
9699 =item C<isl_ast_op_pdiv_q>
9701 Result of integer division, where dividend is known to be non-negative.
9703 =item C<isl_ast_op_pdiv_r>
9705 Remainder of integer division, where dividend is known to be non-negative.
9707 =item C<isl_ast_op_zdiv_r>
9709 Equal to zero iff the remainder on integer division is zero.
9711 =item C<isl_ast_op_cond>
9713 Conditional operator defined on three arguments.
9714 If the first argument evaluates to true, then the result
9715 is equal to the second argument.  Otherwise, the result
9716 is equal to the third argument.
9717 The second and third argument may only be evaluated if
9718 the first argument evaluates to true and false, respectively.
9719 Corresponds to C<a ? b : c> in C.
9721 =item C<isl_ast_op_select>
9723 Conditional operator defined on three arguments.
9724 If the first argument evaluates to true, then the result
9725 is equal to the second argument.  Otherwise, the result
9726 is equal to the third argument.
9727 The second and third argument may be evaluated independently
9728 of the value of the first argument.
9729 Corresponds to C<a * b + (1 - a) * c> in C.
9731 =item C<isl_ast_op_eq>
9733 Equality relation.
9735 =item C<isl_ast_op_le>
9737 Less than or equal relation.
9739 =item C<isl_ast_op_lt>
9741 Less than relation.
9743 =item C<isl_ast_op_ge>
9745 Greater than or equal relation.
9747 =item C<isl_ast_op_gt>
9749 Greater than relation.
9751 =item C<isl_ast_op_call>
9753 A function call.
9754 The number of arguments of the C<isl_ast_expr> is one more than
9755 the number of arguments in the function call, the first argument
9756 representing the function being called.
9758 =item C<isl_ast_op_access>
9760 An array access.
9761 The number of arguments of the C<isl_ast_expr> is one more than
9762 the number of index expressions in the array access, the first argument
9763 representing the array being accessed.
9765 =item C<isl_ast_op_member>
9767 A member access.
9768 This operation has two arguments, a structure and the name of
9769 the member of the structure being accessed.
9771 =back
9773         #include <isl/ast.h>
9774         __isl_give isl_id *isl_ast_expr_get_id(
9775                 __isl_keep isl_ast_expr *expr);
9777 Return the identifier represented by the AST expression.
9779         #include <isl/ast.h>
9780         __isl_give isl_val *isl_ast_expr_get_val(
9781                 __isl_keep isl_ast_expr *expr);
9783 Return the integer represented by the AST expression.
9785 =head3 Properties of ASTs
9787         #include <isl/ast.h>
9788         isl_bool isl_ast_expr_is_equal(
9789                 __isl_keep isl_ast_expr *expr1,
9790                 __isl_keep isl_ast_expr *expr2);
9792 Check if two C<isl_ast_expr>s are equal to each other.
9794 =head3 Manipulating and printing the AST
9796 AST nodes can be copied and freed using the following functions.
9798         #include <isl/ast.h>
9799         __isl_give isl_ast_node *isl_ast_node_copy(
9800                 __isl_keep isl_ast_node *node);
9801         __isl_null isl_ast_node *isl_ast_node_free(
9802                 __isl_take isl_ast_node *node);
9804 AST expressions can be copied and freed using the following functions.
9806         #include <isl/ast.h>
9807         __isl_give isl_ast_expr *isl_ast_expr_copy(
9808                 __isl_keep isl_ast_expr *expr);
9809         __isl_null isl_ast_expr *isl_ast_expr_free(
9810                 __isl_take isl_ast_expr *expr);
9812 New AST expressions can be created either directly or within
9813 the context of an C<isl_ast_build>.
9815         #include <isl/ast.h>
9816         __isl_give isl_ast_expr *isl_ast_expr_from_val(
9817                 __isl_take isl_val *v);
9818         __isl_give isl_ast_expr *isl_ast_expr_from_id(
9819                 __isl_take isl_id *id);
9820         __isl_give isl_ast_expr *isl_ast_expr_neg(
9821                 __isl_take isl_ast_expr *expr);
9822         __isl_give isl_ast_expr *isl_ast_expr_address_of(
9823                 __isl_take isl_ast_expr *expr);
9824         __isl_give isl_ast_expr *isl_ast_expr_add(
9825                 __isl_take isl_ast_expr *expr1,
9826                 __isl_take isl_ast_expr *expr2);
9827         __isl_give isl_ast_expr *isl_ast_expr_sub(
9828                 __isl_take isl_ast_expr *expr1,
9829                 __isl_take isl_ast_expr *expr2);
9830         __isl_give isl_ast_expr *isl_ast_expr_mul(
9831                 __isl_take isl_ast_expr *expr1,
9832                 __isl_take isl_ast_expr *expr2);
9833         __isl_give isl_ast_expr *isl_ast_expr_div(
9834                 __isl_take isl_ast_expr *expr1,
9835                 __isl_take isl_ast_expr *expr2);
9836         __isl_give isl_ast_expr *isl_ast_expr_pdiv_q(
9837                 __isl_take isl_ast_expr *expr1,
9838                 __isl_take isl_ast_expr *expr2);
9839         __isl_give isl_ast_expr *isl_ast_expr_pdiv_r(
9840                 __isl_take isl_ast_expr *expr1,
9841                 __isl_take isl_ast_expr *expr2);
9842         __isl_give isl_ast_expr *isl_ast_expr_and(
9843                 __isl_take isl_ast_expr *expr1,
9844                 __isl_take isl_ast_expr *expr2)
9845         __isl_give isl_ast_expr *isl_ast_expr_and_then(
9846                 __isl_take isl_ast_expr *expr1,
9847                 __isl_take isl_ast_expr *expr2)
9848         __isl_give isl_ast_expr *isl_ast_expr_or(
9849                 __isl_take isl_ast_expr *expr1,
9850                 __isl_take isl_ast_expr *expr2)
9851         __isl_give isl_ast_expr *isl_ast_expr_or_else(
9852                 __isl_take isl_ast_expr *expr1,
9853                 __isl_take isl_ast_expr *expr2)
9854         __isl_give isl_ast_expr *isl_ast_expr_eq(
9855                 __isl_take isl_ast_expr *expr1,
9856                 __isl_take isl_ast_expr *expr2);
9857         __isl_give isl_ast_expr *isl_ast_expr_le(
9858                 __isl_take isl_ast_expr *expr1,
9859                 __isl_take isl_ast_expr *expr2);
9860         __isl_give isl_ast_expr *isl_ast_expr_lt(
9861                 __isl_take isl_ast_expr *expr1,
9862                 __isl_take isl_ast_expr *expr2);
9863         __isl_give isl_ast_expr *isl_ast_expr_ge(
9864                 __isl_take isl_ast_expr *expr1,
9865                 __isl_take isl_ast_expr *expr2);
9866         __isl_give isl_ast_expr *isl_ast_expr_gt(
9867                 __isl_take isl_ast_expr *expr1,
9868                 __isl_take isl_ast_expr *expr2);
9869         __isl_give isl_ast_expr *isl_ast_expr_access(
9870                 __isl_take isl_ast_expr *array,
9871                 __isl_take isl_ast_expr_list *indices);
9872         __isl_give isl_ast_expr *isl_ast_expr_call(
9873                 __isl_take isl_ast_expr *function,
9874                 __isl_take isl_ast_expr_list *arguments);
9876 The function C<isl_ast_expr_address_of> can be applied to an
9877 C<isl_ast_expr> of type C<isl_ast_op_access> only. It is meant
9878 to represent the address of the C<isl_ast_expr_access>. The function
9879 C<isl_ast_expr_and_then> as well as C<isl_ast_expr_or_else> are short-circuit
9880 versions of C<isl_ast_expr_and> and C<isl_ast_expr_or>, respectively.
9882         #include <isl/ast_build.h>
9883         __isl_give isl_ast_expr *isl_ast_build_expr_from_set(
9884                 __isl_keep isl_ast_build *build,
9885                 __isl_take isl_set *set);
9886         __isl_give isl_ast_expr *isl_ast_build_expr_from_pw_aff(
9887                 __isl_keep isl_ast_build *build,
9888                 __isl_take isl_pw_aff *pa);
9889         __isl_give isl_ast_expr *
9890         isl_ast_build_access_from_pw_multi_aff(
9891                 __isl_keep isl_ast_build *build,
9892                 __isl_take isl_pw_multi_aff *pma);
9893         __isl_give isl_ast_expr *
9894         isl_ast_build_access_from_multi_pw_aff(
9895                 __isl_keep isl_ast_build *build,
9896                 __isl_take isl_multi_pw_aff *mpa);
9897         __isl_give isl_ast_expr *
9898         isl_ast_build_call_from_pw_multi_aff(
9899                 __isl_keep isl_ast_build *build,
9900                 __isl_take isl_pw_multi_aff *pma);
9901         __isl_give isl_ast_expr *
9902         isl_ast_build_call_from_multi_pw_aff(
9903                 __isl_keep isl_ast_build *build,
9904                 __isl_take isl_multi_pw_aff *mpa);
9906 The set <set> and
9907 the domains of C<pa>, C<mpa> and C<pma> should correspond
9908 to the schedule space of C<build>.
9909 The tuple id of C<mpa> or C<pma> is used as the array being accessed or
9910 the function being called.
9911 If the accessed space is a nested relation, then it is taken
9912 to represent an access of the member specified by the range
9913 of this nested relation of the structure specified by the domain
9914 of the nested relation.
9916 The following functions can be used to modify an C<isl_ast_expr>.
9918         #include <isl/ast.h>
9919         __isl_give isl_ast_expr *isl_ast_expr_set_op_arg(
9920                 __isl_take isl_ast_expr *expr, int pos,
9921                 __isl_take isl_ast_expr *arg);
9923 Replace the argument of C<expr> at position C<pos> by C<arg>.
9925         #include <isl/ast.h>
9926         __isl_give isl_ast_expr *isl_ast_expr_substitute_ids(
9927                 __isl_take isl_ast_expr *expr,
9928                 __isl_take isl_id_to_ast_expr *id2expr);
9930 The function C<isl_ast_expr_substitute_ids> replaces the
9931 subexpressions of C<expr> of type C<isl_ast_expr_id>
9932 by the corresponding expression in C<id2expr>, if there is any.
9935 User specified data can be attached to an C<isl_ast_node> and obtained
9936 from the same C<isl_ast_node> using the following functions.
9938         #include <isl/ast.h>
9939         __isl_give isl_ast_node *isl_ast_node_set_annotation(
9940                 __isl_take isl_ast_node *node,
9941                 __isl_take isl_id *annotation);
9942         __isl_give isl_id *isl_ast_node_get_annotation(
9943                 __isl_keep isl_ast_node *node);
9945 Basic printing can be performed using the following functions.
9947         #include <isl/ast.h>
9948         __isl_give isl_printer *isl_printer_print_ast_expr(
9949                 __isl_take isl_printer *p,
9950                 __isl_keep isl_ast_expr *expr);
9951         __isl_give isl_printer *isl_printer_print_ast_node(
9952                 __isl_take isl_printer *p,
9953                 __isl_keep isl_ast_node *node);
9954         __isl_give char *isl_ast_expr_to_str(
9955                 __isl_keep isl_ast_expr *expr);
9956         __isl_give char *isl_ast_node_to_str(
9957                 __isl_keep isl_ast_node *node);
9958         __isl_give char *isl_ast_expr_to_C_str(
9959                 __isl_keep isl_ast_expr *expr);
9960         __isl_give char *isl_ast_node_to_C_str(
9961                 __isl_keep isl_ast_node *node);
9963 The functions C<isl_ast_expr_to_C_str> and
9964 C<isl_ast_node_to_C_str> are convenience functions
9965 that return a string representation of the input in C format.
9967 More advanced printing can be performed using the following functions.
9969         #include <isl/ast.h>
9970         __isl_give isl_printer *isl_ast_op_type_set_print_name(
9971                 __isl_take isl_printer *p,
9972                 enum isl_ast_op_type type,
9973                 __isl_keep const char *name);
9974         isl_stat isl_options_set_ast_print_macro_once(
9975                 isl_ctx *ctx, int val);
9976         int isl_options_get_ast_print_macro_once(isl_ctx *ctx);
9977         __isl_give isl_printer *isl_ast_op_type_print_macro(
9978                 enum isl_ast_op_type type,
9979                 __isl_take isl_printer *p);
9980         __isl_give isl_printer *isl_ast_expr_print_macros(
9981                 __isl_keep isl_ast_expr *expr,
9982                 __isl_take isl_printer *p);
9983         __isl_give isl_printer *isl_ast_node_print_macros(
9984                 __isl_keep isl_ast_node *node,
9985                 __isl_take isl_printer *p);
9986         __isl_give isl_printer *isl_ast_node_print(
9987                 __isl_keep isl_ast_node *node,
9988                 __isl_take isl_printer *p,
9989                 __isl_take isl_ast_print_options *options);
9990         __isl_give isl_printer *isl_ast_node_for_print(
9991                 __isl_keep isl_ast_node *node,
9992                 __isl_take isl_printer *p,
9993                 __isl_take isl_ast_print_options *options);
9994         __isl_give isl_printer *isl_ast_node_if_print(
9995                 __isl_keep isl_ast_node *node,
9996                 __isl_take isl_printer *p,
9997                 __isl_take isl_ast_print_options *options);
9999 While printing an C<isl_ast_node> in C<ISL_FORMAT_C>,
10000 C<isl> may print out an AST that makes use of macros such
10001 as C<floord>, C<min> and C<max>.
10002 The names of these macros may be modified by a call
10003 to C<isl_ast_op_type_set_print_name>.  The user-specified
10004 names are associated to the printer object.
10005 C<isl_ast_op_type_print_macro> prints out the macro
10006 corresponding to a specific C<isl_ast_op_type>.
10007 If the print-macro-once option is set, then a given macro definition
10008 is only printed once to any given printer object.
10009 C<isl_ast_expr_print_macros> scans the C<isl_ast_expr>
10010 for subexpressions where these macros would be used and prints
10011 out the required macro definitions.
10012 Essentially, C<isl_ast_expr_print_macros> calls
10013 C<isl_ast_expr_foreach_ast_op_type> with C<isl_ast_op_type_print_macro>
10014 as function argument.
10015 C<isl_ast_node_print_macros> does the same
10016 for expressions in its C<isl_ast_node> argument.
10017 C<isl_ast_node_print>, C<isl_ast_node_for_print> and
10018 C<isl_ast_node_if_print> print an C<isl_ast_node>
10019 in C<ISL_FORMAT_C>, but allow for some extra control
10020 through an C<isl_ast_print_options> object.
10021 This object can be created using the following functions.
10023         #include <isl/ast.h>
10024         __isl_give isl_ast_print_options *
10025         isl_ast_print_options_alloc(isl_ctx *ctx);
10026         __isl_give isl_ast_print_options *
10027         isl_ast_print_options_copy(
10028                 __isl_keep isl_ast_print_options *options);
10029         __isl_null isl_ast_print_options *
10030         isl_ast_print_options_free(
10031                 __isl_take isl_ast_print_options *options);
10033         __isl_give isl_ast_print_options *
10034         isl_ast_print_options_set_print_user(
10035                 __isl_take isl_ast_print_options *options,
10036                 __isl_give isl_printer *(*print_user)(
10037                         __isl_take isl_printer *p,
10038                         __isl_take isl_ast_print_options *options,
10039                         __isl_keep isl_ast_node *node, void *user),
10040                 void *user);
10041         __isl_give isl_ast_print_options *
10042         isl_ast_print_options_set_print_for(
10043                 __isl_take isl_ast_print_options *options,
10044                 __isl_give isl_printer *(*print_for)(
10045                         __isl_take isl_printer *p,
10046                         __isl_take isl_ast_print_options *options,
10047                         __isl_keep isl_ast_node *node, void *user),
10048                 void *user);
10050 The callback set by C<isl_ast_print_options_set_print_user>
10051 is called whenever a node of type C<isl_ast_node_user> needs to
10052 be printed.
10053 The callback set by C<isl_ast_print_options_set_print_for>
10054 is called whenever a node of type C<isl_ast_node_for> needs to
10055 be printed.
10056 Note that C<isl_ast_node_for_print> will I<not> call the
10057 callback set by C<isl_ast_print_options_set_print_for> on the node
10058 on which C<isl_ast_node_for_print> is called, but only on nested
10059 nodes of type C<isl_ast_node_for>.  It is therefore safe to
10060 call C<isl_ast_node_for_print> from within the callback set by
10061 C<isl_ast_print_options_set_print_for>.
10063 The following option determines the type to be used for iterators
10064 while printing the AST.
10066         isl_stat isl_options_set_ast_iterator_type(
10067                 isl_ctx *ctx, const char *val);
10068         const char *isl_options_get_ast_iterator_type(
10069                 isl_ctx *ctx);
10071 The AST printer only prints body nodes as blocks if these
10072 blocks cannot be safely omitted.
10073 For example, a C<for> node with one body node will not be
10074 surrounded with braces in C<ISL_FORMAT_C>.
10075 A block will always be printed by setting the following option.
10077         isl_stat isl_options_set_ast_always_print_block(isl_ctx *ctx,
10078                 int val);
10079         int isl_options_get_ast_always_print_block(isl_ctx *ctx);
10081 =head3 Options
10083         #include <isl/ast_build.h>
10084         isl_stat isl_options_set_ast_build_atomic_upper_bound(
10085                 isl_ctx *ctx, int val);
10086         int isl_options_get_ast_build_atomic_upper_bound(
10087                 isl_ctx *ctx);
10088         isl_stat isl_options_set_ast_build_prefer_pdiv(isl_ctx *ctx,
10089                 int val);
10090         int isl_options_get_ast_build_prefer_pdiv(isl_ctx *ctx);
10091         isl_stat isl_options_set_ast_build_detect_min_max(
10092                 isl_ctx *ctx, int val);
10093         int isl_options_get_ast_build_detect_min_max(
10094                 isl_ctx *ctx);
10095         isl_stat isl_options_set_ast_build_exploit_nested_bounds(
10096                 isl_ctx *ctx, int val);
10097         int isl_options_get_ast_build_exploit_nested_bounds(
10098                 isl_ctx *ctx);
10099         isl_stat isl_options_set_ast_build_group_coscheduled(
10100                 isl_ctx *ctx, int val);
10101         int isl_options_get_ast_build_group_coscheduled(
10102                 isl_ctx *ctx);
10103         isl_stat isl_options_set_ast_build_scale_strides(
10104                 isl_ctx *ctx, int val);
10105         int isl_options_get_ast_build_scale_strides(
10106                 isl_ctx *ctx);
10107         isl_stat isl_options_set_ast_build_allow_else(isl_ctx *ctx,
10108                 int val);
10109         int isl_options_get_ast_build_allow_else(isl_ctx *ctx);
10110         isl_stat isl_options_set_ast_build_allow_or(isl_ctx *ctx,
10111                 int val);
10112         int isl_options_get_ast_build_allow_or(isl_ctx *ctx);
10114 =over
10116 =item * ast_build_atomic_upper_bound
10118 Generate loop upper bounds that consist of the current loop iterator,
10119 an operator and an expression not involving the iterator.
10120 If this option is not set, then the current loop iterator may appear
10121 several times in the upper bound.
10122 For example, when this option is turned off, AST generation
10123 for the schedule
10125         [n] -> { A[i] -> [i] : 0 <= i <= 100, n }
10127 produces
10129         for (int c0 = 0; c0 <= 100 && n >= c0; c0 += 1)
10130           A(c0);
10132 When the option is turned on, the following AST is generated
10134         for (int c0 = 0; c0 <= min(100, n); c0 += 1)
10135           A(c0);
10137 =item * ast_build_prefer_pdiv
10139 If this option is turned off, then the AST generation will
10140 produce ASTs that may only contain C<isl_ast_op_fdiv_q>
10141 operators, but no C<isl_ast_op_pdiv_q> or
10142 C<isl_ast_op_pdiv_r> operators.
10143 If this option is turned on, then C<isl> will try to convert
10144 some of the C<isl_ast_op_fdiv_q> operators to (expressions containing)
10145 C<isl_ast_op_pdiv_q> or C<isl_ast_op_pdiv_r> operators.
10147 =item * ast_build_detect_min_max
10149 If this option is turned on, then C<isl> will try and detect
10150 min or max-expressions when building AST expressions from
10151 piecewise affine expressions.
10153 =item * ast_build_exploit_nested_bounds
10155 Simplify conditions based on bounds of nested for loops.
10156 In particular, remove conditions that are implied by the fact
10157 that one or more nested loops have at least one iteration,
10158 meaning that the upper bound is at least as large as the lower bound.
10159 For example, when this option is turned off, AST generation
10160 for the schedule
10162         [N,M] -> { A[i,j] -> [i,j] : 0 <= i <= N and
10163                                         0 <= j <= M }
10165 produces
10167         if (M >= 0)
10168           for (int c0 = 0; c0 <= N; c0 += 1)
10169             for (int c1 = 0; c1 <= M; c1 += 1)
10170               A(c0, c1);
10172 When the option is turned on, the following AST is generated
10174         for (int c0 = 0; c0 <= N; c0 += 1)
10175           for (int c1 = 0; c1 <= M; c1 += 1)
10176             A(c0, c1);
10178 =item * ast_build_group_coscheduled
10180 If two domain elements are assigned the same schedule point, then
10181 they may be executed in any order and they may even appear in different
10182 loops.  If this options is set, then the AST generator will make
10183 sure that coscheduled domain elements do not appear in separate parts
10184 of the AST.  This is useful in case of nested AST generation
10185 if the outer AST generation is given only part of a schedule
10186 and the inner AST generation should handle the domains that are
10187 coscheduled by this initial part of the schedule together.
10188 For example if an AST is generated for a schedule
10190         { A[i] -> [0]; B[i] -> [0] }
10192 then the C<isl_ast_build_set_create_leaf> callback described
10193 below may get called twice, once for each domain.
10194 Setting this option ensures that the callback is only called once
10195 on both domains together.
10197 =item * ast_build_separation_bounds
10199 This option specifies which bounds to use during separation.
10200 If this option is set to C<ISL_AST_BUILD_SEPARATION_BOUNDS_IMPLICIT>
10201 then all (possibly implicit) bounds on the current dimension will
10202 be used during separation.
10203 If this option is set to C<ISL_AST_BUILD_SEPARATION_BOUNDS_EXPLICIT>
10204 then only those bounds that are explicitly available will
10205 be used during separation.
10207 =item * ast_build_scale_strides
10209 This option specifies whether the AST generator is allowed
10210 to scale down iterators of strided loops.
10212 =item * ast_build_allow_else
10214 This option specifies whether the AST generator is allowed
10215 to construct if statements with else branches.
10217 =item * ast_build_allow_or
10219 This option specifies whether the AST generator is allowed
10220 to construct if conditions with disjunctions.
10222 =back
10224 =head3 AST Generation Options (Schedule Tree)
10226 In case of AST construction from a schedule tree, the options
10227 that control how an AST is created from the individual schedule
10228 dimensions are stored in the band nodes of the tree
10229 (see L</"Schedule Trees">).
10231 In particular, a schedule dimension can be handled in four
10232 different ways, atomic, separate, unroll or the default.
10233 This loop AST generation type can be set using
10234 C<isl_schedule_node_band_member_set_ast_loop_type>.
10235 Alternatively,
10236 the first three can be selected by including a one-dimensional
10237 element with as value the position of the schedule dimension
10238 within the band and as name one of C<atomic>, C<separate>
10239 or C<unroll> in the options
10240 set by C<isl_schedule_node_band_set_ast_build_options>.
10241 Only one of these three may be specified for
10242 any given schedule dimension within a band node.
10243 If none of these is specified, then the default
10244 is used.  The meaning of the options is as follows.
10246 =over
10248 =item C<atomic>
10250 When this option is specified, the AST generator will make
10251 sure that a given domains space only appears in a single
10252 loop at the specified level.
10254 For example, for the schedule tree
10256         domain: "{ a[i] : 0 <= i < 10; b[i] : 0 <= i < 10 }"
10257         child:
10258           schedule: "[{ a[i] -> [i]; b[i] -> [i+1] }]"
10259           options: "{ atomic[x] }"
10261 the following AST will be generated
10263         for (int c0 = 0; c0 <= 10; c0 += 1) {
10264           if (c0 >= 1)
10265             b(c0 - 1);
10266           if (c0 <= 9)
10267             a(c0);
10268         }
10270 On the other hand, for the schedule tree
10272         domain: "{ a[i] : 0 <= i < 10; b[i] : 0 <= i < 10 }"
10273         child:
10274           schedule: "[{ a[i] -> [i]; b[i] -> [i+1] }]"
10275           options: "{ separate[x] }"
10277 the following AST will be generated
10279         {
10280           a(0);
10281           for (int c0 = 1; c0 <= 9; c0 += 1) {
10282             b(c0 - 1);
10283             a(c0);
10284           }
10285           b(9);
10286         }
10288 If neither C<atomic> nor C<separate> is specified, then the AST generator
10289 may produce either of these two results or some intermediate form.
10291 =item C<separate>
10293 When this option is specified, the AST generator will
10294 split the domain of the specified schedule dimension
10295 into pieces with a fixed set of statements for which
10296 instances need to be executed by the iterations in
10297 the schedule domain part.  This option tends to avoid
10298 the generation of guards inside the corresponding loops.
10299 See also the C<atomic> option.
10301 =item C<unroll>
10303 When this option is specified, the AST generator will
10304 I<completely> unroll the corresponding schedule dimension.
10305 It is the responsibility of the user to ensure that such
10306 unrolling is possible.
10307 To obtain a partial unrolling, the user should apply an additional
10308 strip-mining to the schedule and fully unroll the inner schedule
10309 dimension.
10311 =back
10313 The C<isolate> option is a bit more involved.  It allows the user
10314 to isolate a range of schedule dimension values from smaller and
10315 greater values.  Additionally, the user may specify a different
10316 atomic/separate/unroll choice for the isolated part and the remaining
10317 parts.  The typical use case of the C<isolate> option is to isolate
10318 full tiles from partial tiles.
10319 The part that needs to be isolated may depend on outer schedule dimensions.
10320 The option therefore needs to be able to reference those outer schedule
10321 dimensions.  In particular, the space of the C<isolate> option is that
10322 of a wrapped map with as domain the flat product of all outer band nodes
10323 and as range the space of the current band node.
10324 The atomic/separate/unroll choice for the isolated part is determined
10325 by an option that lives in an unnamed wrapped space with as domain
10326 a zero-dimensional C<isolate> space and as range the regular
10327 C<atomic>, C<separate> or C<unroll> space.
10328 This option may also be set directly using
10329 C<isl_schedule_node_band_member_set_isolate_ast_loop_type>.
10330 The atomic/separate/unroll choice for the remaining part is determined
10331 by the regular C<atomic>, C<separate> or C<unroll> option.
10332 Since the C<isolate> option references outer schedule dimensions,
10333 its use in a band node causes any tree containing the node
10334 to be considered anchored.
10336 As an example, consider the isolation of full tiles from partial tiles
10337 in a tiling of a triangular domain.  The original schedule is as follows.
10339         domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }"
10340         child:
10341           schedule: "[{ A[i,j] -> [floor(i/10)] }, \
10342                 { A[i,j] -> [floor(j/10)] }, \
10343                 { A[i,j] -> [i] }, { A[i,j] -> [j] }]"
10345 The output is
10347         for (int c0 = 0; c0 <= 10; c0 += 1)
10348           for (int c1 = 0; c1 <= -c0 + 10; c1 += 1)
10349             for (int c2 = 10 * c0;
10350                  c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1)
10351               for (int c3 = 10 * c1;
10352                    c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1)
10353                 A(c2, c3);
10355 Isolating the full tiles, we have the following input
10357         domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }"
10358         child:
10359           schedule: "[{ A[i,j] -> [floor(i/10)] }, \
10360                 { A[i,j] -> [floor(j/10)] }, \
10361                 { A[i,j] -> [i] }, { A[i,j] -> [j] }]"
10362           options: "{ isolate[[] -> [a,b,c,d]] : 0 <= 10a,10b and \
10363                 10a+9+10b+9 <= 100 }"
10365 and output
10367         {
10368           for (int c0 = 0; c0 <= 8; c0 += 1) {
10369             for (int c1 = 0; c1 <= -c0 + 8; c1 += 1)
10370               for (int c2 = 10 * c0;
10371                    c2 <= 10 * c0 + 9; c2 += 1)
10372                 for (int c3 = 10 * c1;
10373                      c3 <= 10 * c1 + 9; c3 += 1)
10374                   A(c2, c3);
10375             for (int c1 = -c0 + 9; c1 <= -c0 + 10; c1 += 1)
10376               for (int c2 = 10 * c0;
10377                    c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1)
10378                 for (int c3 = 10 * c1;
10379                      c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1)
10380                   A(c2, c3);
10381           }
10382           for (int c0 = 9; c0 <= 10; c0 += 1)
10383             for (int c1 = 0; c1 <= -c0 + 10; c1 += 1)
10384               for (int c2 = 10 * c0;
10385                    c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1)
10386                 for (int c3 = 10 * c1;
10387                      c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1)
10388                   A(c2, c3);
10389         }
10391 We may then additionally unroll the innermost loop of the isolated part
10393         domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }"
10394         child:
10395           schedule: "[{ A[i,j] -> [floor(i/10)] }, \
10396                 { A[i,j] -> [floor(j/10)] }, \
10397                 { A[i,j] -> [i] }, { A[i,j] -> [j] }]"
10398           options: "{ isolate[[] -> [a,b,c,d]] : 0 <= 10a,10b and \
10399                 10a+9+10b+9 <= 100; [isolate[] -> unroll[3]] }"
10401 to obtain
10403         {
10404           for (int c0 = 0; c0 <= 8; c0 += 1) {
10405             for (int c1 = 0; c1 <= -c0 + 8; c1 += 1)
10406               for (int c2 = 10 * c0; c2 <= 10 * c0 + 9; c2 += 1) {
10407                 A(c2, 10 * c1);
10408                 A(c2, 10 * c1 + 1);
10409                 A(c2, 10 * c1 + 2);
10410                 A(c2, 10 * c1 + 3);
10411                 A(c2, 10 * c1 + 4);
10412                 A(c2, 10 * c1 + 5);
10413                 A(c2, 10 * c1 + 6);
10414                 A(c2, 10 * c1 + 7);
10415                 A(c2, 10 * c1 + 8);
10416                 A(c2, 10 * c1 + 9);
10417               }
10418             for (int c1 = -c0 + 9; c1 <= -c0 + 10; c1 += 1)
10419               for (int c2 = 10 * c0;
10420                    c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1)
10421                 for (int c3 = 10 * c1;
10422                      c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1)
10423                   A(c2, c3);
10424           }
10425           for (int c0 = 9; c0 <= 10; c0 += 1)
10426             for (int c1 = 0; c1 <= -c0 + 10; c1 += 1)
10427               for (int c2 = 10 * c0;
10428                    c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1)
10429                 for (int c3 = 10 * c1;
10430                      c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1)
10431                   A(c2, c3);
10432         }
10435 =head3 AST Generation Options (Schedule Map)
10437 In case of AST construction using
10438 C<isl_ast_build_node_from_schedule_map>, the options
10439 that control how an AST is created from the individual schedule
10440 dimensions are stored in the C<isl_ast_build>.
10441 They can be set using the following function.
10443         #include <isl/ast_build.h>
10444         __isl_give isl_ast_build *
10445         isl_ast_build_set_options(
10446                 __isl_take isl_ast_build *control,
10447                 __isl_take isl_union_map *options);
10449 The options are encoded in an C<isl_union_map>.
10450 The domain of this union relation refers to the schedule domain,
10451 i.e., the range of the schedule passed
10452 to C<isl_ast_build_node_from_schedule_map>.
10453 In the case of nested AST generation (see L</"Nested AST Generation">),
10454 the domain of C<options> should refer to the extra piece of the schedule.
10455 That is, it should be equal to the range of the wrapped relation in the
10456 range of the schedule.
10457 The range of the options can consist of elements in one or more spaces,
10458 the names of which determine the effect of the option.
10459 The values of the range typically also refer to the schedule dimension
10460 to which the option applies.  In case of nested AST generation
10461 (see L</"Nested AST Generation">), these values refer to the position
10462 of the schedule dimension within the innermost AST generation.
10463 The constraints on the domain elements of
10464 the option should only refer to this dimension and earlier dimensions.
10465 We consider the following spaces.
10467 =over
10469 =item C<separation_class>
10471 B<This option has been deprecated.  Use the isolate option on
10472 schedule trees instead.>
10474 This space is a wrapped relation between two one dimensional spaces.
10475 The input space represents the schedule dimension to which the option
10476 applies and the output space represents the separation class.
10477 While constructing a loop corresponding to the specified schedule
10478 dimension(s), the AST generator will try to generate separate loops
10479 for domain elements that are assigned different classes.
10480 If only some of the elements are assigned a class, then those elements
10481 that are not assigned any class will be treated as belonging to a class
10482 that is separate from the explicitly assigned classes.
10483 The typical use case for this option is to separate full tiles from
10484 partial tiles.
10485 The other options, described below, are applied after the separation
10486 into classes.
10488 As an example, consider the separation into full and partial tiles
10489 of a tiling of a triangular domain.
10490 Take, for example, the domain
10492         { A[i,j] : 0 <= i,j and i + j <= 100 }
10494 and a tiling into tiles of 10 by 10.  The input to the AST generator
10495 is then the schedule
10497         { A[i,j] -> [([i/10]),[j/10],i,j] : 0 <= i,j and
10498                                                 i + j <= 100 }
10500 Without any options, the following AST is generated
10502         for (int c0 = 0; c0 <= 10; c0 += 1)
10503           for (int c1 = 0; c1 <= -c0 + 10; c1 += 1)
10504             for (int c2 = 10 * c0;
10505                  c2 <= min(-10 * c1 + 100, 10 * c0 + 9);
10506                  c2 += 1)
10507               for (int c3 = 10 * c1;
10508                    c3 <= min(10 * c1 + 9, -c2 + 100);
10509                    c3 += 1)
10510                 A(c2, c3);
10512 Separation into full and partial tiles can be obtained by assigning
10513 a class, say C<0>, to the full tiles.  The full tiles are represented by those
10514 values of the first and second schedule dimensions for which there are
10515 values of the third and fourth dimensions to cover an entire tile.
10516 That is, we need to specify the following option
10518         { [a,b,c,d] -> separation_class[[0]->[0]] :
10519                 exists b': 0 <= 10a,10b' and
10520                            10a+9+10b'+9 <= 100;
10521           [a,b,c,d] -> separation_class[[1]->[0]] :
10522                 0 <= 10a,10b and 10a+9+10b+9 <= 100 }
10524 which simplifies to
10526         { [a, b, c, d] -> separation_class[[1] -> [0]] :
10527                 a >= 0 and b >= 0 and b <= 8 - a;
10528           [a, b, c, d] -> separation_class[[0] -> [0]] :
10529                 a >= 0 and a <= 8 }
10531 With this option, the generated AST is as follows
10533         {
10534           for (int c0 = 0; c0 <= 8; c0 += 1) {
10535             for (int c1 = 0; c1 <= -c0 + 8; c1 += 1)
10536               for (int c2 = 10 * c0;
10537                    c2 <= 10 * c0 + 9; c2 += 1)
10538                 for (int c3 = 10 * c1;
10539                      c3 <= 10 * c1 + 9; c3 += 1)
10540                   A(c2, c3);
10541             for (int c1 = -c0 + 9; c1 <= -c0 + 10; c1 += 1)
10542               for (int c2 = 10 * c0;
10543                    c2 <= min(-10 * c1 + 100, 10 * c0 + 9);
10544                    c2 += 1)
10545                 for (int c3 = 10 * c1;
10546                      c3 <= min(-c2 + 100, 10 * c1 + 9);
10547                      c3 += 1)
10548                   A(c2, c3);
10549           }
10550           for (int c0 = 9; c0 <= 10; c0 += 1)
10551             for (int c1 = 0; c1 <= -c0 + 10; c1 += 1)
10552               for (int c2 = 10 * c0;
10553                    c2 <= min(-10 * c1 + 100, 10 * c0 + 9);
10554                    c2 += 1)
10555                 for (int c3 = 10 * c1;
10556                      c3 <= min(10 * c1 + 9, -c2 + 100);
10557                      c3 += 1)
10558                   A(c2, c3);
10559         }
10561 =item C<separate>
10563 This is a single-dimensional space representing the schedule dimension(s)
10564 to which ``separation'' should be applied.  Separation tries to split
10565 a loop into several pieces if this can avoid the generation of guards
10566 inside the loop.
10567 See also the C<atomic> option.
10569 =item C<atomic>
10571 This is a single-dimensional space representing the schedule dimension(s)
10572 for which the domains should be considered ``atomic''.  That is, the
10573 AST generator will make sure that any given domain space will only appear
10574 in a single loop at the specified level.
10576 Consider the following schedule
10578         { a[i] -> [i] : 0 <= i < 10;
10579           b[i] -> [i+1] : 0 <= i < 10 }
10581 If the following option is specified
10583         { [i] -> separate[x] }
10585 then the following AST will be generated
10587         {
10588           a(0);
10589           for (int c0 = 1; c0 <= 9; c0 += 1) {
10590             a(c0);
10591             b(c0 - 1);
10592           }
10593           b(9);
10594         }
10596 If, on the other hand, the following option is specified
10598         { [i] -> atomic[x] }
10600 then the following AST will be generated
10602         for (int c0 = 0; c0 <= 10; c0 += 1) {
10603           if (c0 <= 9)
10604             a(c0);
10605           if (c0 >= 1)
10606             b(c0 - 1);
10607         }
10609 If neither C<atomic> nor C<separate> is specified, then the AST generator
10610 may produce either of these two results or some intermediate form.
10612 =item C<unroll>
10614 This is a single-dimensional space representing the schedule dimension(s)
10615 that should be I<completely> unrolled.
10616 To obtain a partial unrolling, the user should apply an additional
10617 strip-mining to the schedule and fully unroll the inner loop.
10619 =back
10621 =head3 Fine-grained Control over AST Generation
10623 Besides specifying the constraints on the parameters,
10624 an C<isl_ast_build> object can be used to control
10625 various aspects of the AST generation process.
10626 In case of AST construction using
10627 C<isl_ast_build_node_from_schedule_map>,
10628 the most prominent way of control is through ``options'',
10629 as explained above.
10631 Additional control is available through the following functions.
10633         #include <isl/ast_build.h>
10634         __isl_give isl_ast_build *
10635         isl_ast_build_set_iterators(
10636                 __isl_take isl_ast_build *control,
10637                 __isl_take isl_id_list *iterators);
10639 The function C<isl_ast_build_set_iterators> allows the user to
10640 specify a list of iterator C<isl_id>s to be used as iterators.
10641 If the input schedule is injective, then
10642 the number of elements in this list should be as large as the dimension
10643 of the schedule space, but no direct correspondence should be assumed
10644 between dimensions and elements.
10645 If the input schedule is not injective, then an additional number
10646 of C<isl_id>s equal to the largest dimension of the input domains
10647 may be required.
10648 If the number of provided C<isl_id>s is insufficient, then additional
10649 names are automatically generated.
10651         #include <isl/ast_build.h>
10652         __isl_give isl_ast_build *
10653         isl_ast_build_set_create_leaf(
10654                 __isl_take isl_ast_build *control,
10655                 __isl_give isl_ast_node *(*fn)(
10656                         __isl_take isl_ast_build *build,
10657                         void *user), void *user);
10660 C<isl_ast_build_set_create_leaf> function allows for the
10661 specification of a callback that should be called whenever the AST
10662 generator arrives at an element of the schedule domain.
10663 The callback should return an AST node that should be inserted
10664 at the corresponding position of the AST.  The default action (when
10665 the callback is not set) is to continue generating parts of the AST to scan
10666 all the domain elements associated to the schedule domain element
10667 and to insert user nodes, ``calling'' the domain element, for each of them.
10668 The C<build> argument contains the current state of the C<isl_ast_build>.
10669 To ease nested AST generation (see L</"Nested AST Generation">),
10670 all control information that is
10671 specific to the current AST generation such as the options and
10672 the callbacks has been removed from this C<isl_ast_build>.
10673 The callback would typically return the result of a nested
10674 AST generation or a
10675 user defined node created using the following function.
10677         #include <isl/ast.h>
10678         __isl_give isl_ast_node *isl_ast_node_alloc_user(
10679                 __isl_take isl_ast_expr *expr);
10681         #include <isl/ast_build.h>
10682         __isl_give isl_ast_build *
10683         isl_ast_build_set_at_each_domain(
10684                 __isl_take isl_ast_build *build,
10685                 __isl_give isl_ast_node *(*fn)(
10686                         __isl_take isl_ast_node *node,
10687                         __isl_keep isl_ast_build *build,
10688                         void *user), void *user);
10689         __isl_give isl_ast_build *
10690         isl_ast_build_set_before_each_for(
10691                 __isl_take isl_ast_build *build,
10692                 __isl_give isl_id *(*fn)(
10693                         __isl_keep isl_ast_build *build,
10694                         void *user), void *user);
10695         __isl_give isl_ast_build *
10696         isl_ast_build_set_after_each_for(
10697                 __isl_take isl_ast_build *build,
10698                 __isl_give isl_ast_node *(*fn)(
10699                         __isl_take isl_ast_node *node,
10700                         __isl_keep isl_ast_build *build,
10701                         void *user), void *user);
10702         __isl_give isl_ast_build *
10703         isl_ast_build_set_before_each_mark(
10704                 __isl_take isl_ast_build *build,
10705                 isl_stat (*fn)(__isl_keep isl_id *mark,
10706                         __isl_keep isl_ast_build *build,
10707                         void *user), void *user);
10708         __isl_give isl_ast_build *
10709         isl_ast_build_set_after_each_mark(
10710                 __isl_take isl_ast_build *build,
10711                 __isl_give isl_ast_node *(*fn)(
10712                         __isl_take isl_ast_node *node,
10713                         __isl_keep isl_ast_build *build,
10714                         void *user), void *user);
10716 The callback set by C<isl_ast_build_set_at_each_domain> will
10717 be called for each domain AST node.
10718 The callbacks set by C<isl_ast_build_set_before_each_for>
10719 and C<isl_ast_build_set_after_each_for> will be called
10720 for each for AST node.  The first will be called in depth-first
10721 pre-order, while the second will be called in depth-first post-order.
10722 Since C<isl_ast_build_set_before_each_for> is called before the for
10723 node is actually constructed, it is only passed an C<isl_ast_build>.
10724 The returned C<isl_id> will be added as an annotation (using
10725 C<isl_ast_node_set_annotation>) to the constructed for node.
10726 In particular, if the user has also specified an C<after_each_for>
10727 callback, then the annotation can be retrieved from the node passed to
10728 that callback using C<isl_ast_node_get_annotation>.
10729 The callbacks set by C<isl_ast_build_set_before_each_mark>
10730 and C<isl_ast_build_set_after_each_mark> will be called for each
10731 mark AST node that is created, i.e., for each mark schedule node
10732 in the input schedule tree.  The first will be called in depth-first
10733 pre-order, while the second will be called in depth-first post-order.
10734 Since the callback set by C<isl_ast_build_set_before_each_mark>
10735 is called before the mark AST node is actually constructed, it is passed
10736 the identifier of the mark node.
10737 All callbacks should C<NULL> (or -1) on failure.
10738 The given C<isl_ast_build> can be used to create new
10739 C<isl_ast_expr> objects using C<isl_ast_build_expr_from_pw_aff>
10740 or C<isl_ast_build_call_from_pw_multi_aff>.
10742 =head3 Nested AST Generation
10744 C<isl> allows the user to create an AST within the context
10745 of another AST.  These nested ASTs are created using the
10746 same C<isl_ast_build_node_from_schedule_map> function that is used to create
10747 the outer AST.  The C<build> argument should be an C<isl_ast_build>
10748 passed to a callback set by
10749 C<isl_ast_build_set_create_leaf>.
10750 The space of the range of the C<schedule> argument should refer
10751 to this build.  In particular, the space should be a wrapped
10752 relation and the domain of this wrapped relation should be the
10753 same as that of the range of the schedule returned by
10754 C<isl_ast_build_get_schedule> below.
10755 In practice, the new schedule is typically
10756 created by calling C<isl_union_map_range_product> on the old schedule
10757 and some extra piece of the schedule.
10758 The space of the schedule domain is also available from
10759 the C<isl_ast_build>.
10761         #include <isl/ast_build.h>
10762         __isl_give isl_union_map *isl_ast_build_get_schedule(
10763                 __isl_keep isl_ast_build *build);
10764         __isl_give isl_space *isl_ast_build_get_schedule_space(
10765                 __isl_keep isl_ast_build *build);
10766         __isl_give isl_ast_build *isl_ast_build_restrict(
10767                 __isl_take isl_ast_build *build,
10768                 __isl_take isl_set *set);
10770 The C<isl_ast_build_get_schedule> function returns a (partial)
10771 schedule for the domains elements for which part of the AST still needs to
10772 be generated in the current build.
10773 In particular, the domain elements are mapped to those iterations of the loops
10774 enclosing the current point of the AST generation inside which
10775 the domain elements are executed.
10776 No direct correspondence between
10777 the input schedule and this schedule should be assumed.
10778 The space obtained from C<isl_ast_build_get_schedule_space> can be used
10779 to create a set for C<isl_ast_build_restrict> to intersect
10780 with the current build.  In particular, the set passed to
10781 C<isl_ast_build_restrict> can have additional parameters.
10782 The ids of the set dimensions in the space returned by
10783 C<isl_ast_build_get_schedule_space> correspond to the
10784 iterators of the already generated loops.
10785 The user should not rely on the ids of the output dimensions
10786 of the relations in the union relation returned by
10787 C<isl_ast_build_get_schedule> having any particular value.
10789 =head1 Applications
10791 Although C<isl> is mainly meant to be used as a library,
10792 it also contains some basic applications that use some
10793 of the functionality of C<isl>.
10794 For applications that take one or more polytopes or polyhedra
10795 as input, this input may be specified in either the L<isl format>
10796 or the L<PolyLib format>.
10798 =head2 C<isl_polyhedron_sample>
10800 C<isl_polyhedron_sample> takes a polyhedron as input and prints
10801 an integer element of the polyhedron, if there is any.
10802 The first column in the output is the denominator and is always
10803 equal to 1.  If the polyhedron contains no integer points,
10804 then a vector of length zero is printed.
10806 =head2 C<isl_pip>
10808 C<isl_pip> takes the same input as the C<example> program
10809 from the C<piplib> distribution, i.e., a set of constraints
10810 on the parameters, a line containing only -1 and finally a set
10811 of constraints on a parametric polyhedron.
10812 The coefficients of the parameters appear in the last columns
10813 (but before the final constant column).
10814 The output is the lexicographic minimum of the parametric polyhedron.
10815 As C<isl> currently does not have its own output format, the output
10816 is just a dump of the internal state.
10818 =head2 C<isl_polyhedron_minimize>
10820 C<isl_polyhedron_minimize> computes the minimum of some linear
10821 or affine objective function over the integer points in a polyhedron.
10822 If an affine objective function
10823 is given, then the constant should appear in the last column.
10825 =head2 C<isl_polytope_scan>
10827 Given a polytope, C<isl_polytope_scan> prints
10828 all integer points in the polytope.
10830 =head2 C<isl_flow>
10832 Given an C<isl_union_access_info> object as input,
10833 C<isl_flow> prints out the corresponding dependences,
10834 as computed by C<isl_union_access_info_compute_flow>.
10836 =head2 C<isl_codegen>
10838 Given either a schedule tree or a sequence consisting of
10839 a schedule map, a context set and an options relation,
10840 C<isl_codegen> prints out an AST that scans the domain elements
10841 of the schedule in the order of their image(s) taking into account
10842 the constraints in the context set.
10844 =head2 C<isl_schedule>
10846 Given an C<isl_schedule_constraints> object as input,
10847 C<isl_schedule> prints out a schedule that satisfies the given
10848 constraints.