add isl_*_list_from_*
[platform/upstream/isl.git] / doc / user.pod
index 15bebe9..d500627 100644 (file)
@@ -87,6 +87,19 @@ is now expressed as the domain of the resulting relation.
 C<ISL_FORMAT_ISL> output has changed.
 Use C<ISL_FORMAT_C> to obtain the old output.
 
+=item * The C<*_fast_*> functions have been renamed to C<*_plain_*>.
+Some of the old names have been kept for backward compatibility,
+but they will be removed in the future.
+
+=back
+
+=head3 Changes since isl-0.07
+
+=over
+
+=item * The function C<isl_pw_aff_max> has been renamed to
+C<isl_pw_aff_union_max>.
+
 =back
 
 =head1 Installation
@@ -415,6 +428,32 @@ a C<NULL> value for an C<__isl_take> argument.
 
 =back
 
+=head2 Identifiers
+
+Identifiers are used to identify both individual dimensions
+and tuples of dimensions.  They consist of a name and an optional
+pointer.  Identifiers with the same name but different pointer values
+are considered to be distinct.
+Identifiers can be constructed, copied, freed, inspected and printed
+using the following functions.
+
+       #include <isl/id.h>
+       __isl_give isl_id *isl_id_alloc(isl_ctx *ctx,
+               __isl_keep const char *name, void *user);
+       __isl_give isl_id *isl_id_copy(isl_id *id);
+       void *isl_id_free(__isl_take isl_id *id);
+
+       isl_ctx *isl_id_get_ctx(__isl_keep isl_id *id);
+       void *isl_id_get_user(__isl_keep isl_id *id);
+       __isl_keep const char *isl_id_get_name(__isl_keep isl_id *id);
+
+       __isl_give isl_printer *isl_printer_print_id(
+               __isl_take isl_printer *p, __isl_keep isl_id *id);
+
+Note that C<isl_id_get_name> returns a pointer to some internal
+data structure, so the result can only be used while the
+corresponding C<isl_id> is alive.
+
 =head2 Dimension Specifications
 
 Whenever a new set or relation is created from scratch,
@@ -473,6 +512,8 @@ specification of the original object.
        #include <isl/polynomial.h>
        __isl_give isl_dim *isl_qpolynomial_get_dim(
                __isl_keep isl_qpolynomial *qp);
+       __isl_give isl_dim *isl_qpolynomial_fold_get_dim(
+               __isl_keep isl_qpolynomial_fold *fold);
        __isl_give isl_dim *isl_pw_qpolynomial_get_dim(
                __isl_keep isl_pw_qpolynomial *pwqp);
        __isl_give isl_dim *isl_union_pw_qpolynomial_get_dim(
@@ -483,11 +524,24 @@ specification of the original object.
        #include <isl/aff.h>
        __isl_give isl_dim *isl_aff_get_dim(
                __isl_keep isl_aff *aff);
+       __isl_give isl_dim *isl_pw_aff_get_dim(
+               __isl_keep isl_pw_aff *pwaff);
+
+       #include <isl/point.h>
+       __isl_give isl_dim *isl_point_get_dim(
+               __isl_keep isl_point *pnt);
 
-The names of the individual dimensions may be set or read off
+The identifiers or names of the individual dimensions may be set or read off
 using the following functions.
 
        #include <isl/dim.h>
+       __isl_give isl_dim *isl_dim_set_dim_id(
+               __isl_take isl_dim *dim,
+               enum isl_dim_type type, unsigned pos,
+               __isl_take isl_id *id);
+       __isl_give isl_id *isl_dim_get_dim_id(
+               __isl_keep isl_dim *dim,
+               enum isl_dim_type type, unsigned pos);
        __isl_give isl_dim *isl_dim_set_name(__isl_take isl_dim *dim,
                                 enum isl_dim_type type, unsigned pos,
                                 __isl_keep const char *name);
@@ -501,15 +555,29 @@ Also note that every function that operates on two sets or relations
 requires that both arguments have the same parameters.  This also
 means that if one of the arguments has named parameters, then the
 other needs to have named parameters too and the names need to match.
-Pairs of C<isl_union_set> and/or C<isl_union_map> arguments may
-have different parameters (as long as they are named), in which case
-the result will have as parameters the union of the parameters of
+Pairs of C<isl_set>, C<isl_map>, C<isl_union_set> and/or C<isl_union_map>
+arguments may have different parameters (as long as they are named),
+in which case the result will have as parameters the union of the parameters of
 the arguments.
 
-The names of entire spaces may be set or read off
+Given the identifier of a dimension (typically a parameter),
+its position can be obtained from the following function.
+
+       #include <isl/dim.h>
+       int isl_dim_find_dim_by_id(__isl_keep isl_dim *dim,
+               enum isl_dim_type type, __isl_keep isl_id *id);
+
+The identifiers or names of entire spaces may be set or read off
 using the following functions.
 
        #include <isl/dim.h>
+       __isl_give isl_dim *isl_dim_set_tuple_id(
+               __isl_take isl_dim *dim,
+               enum isl_dim_type type, __isl_take isl_id *id);
+       __isl_give isl_dim *isl_dim_reset_tuple_id(
+               __isl_take isl_dim *dim, enum isl_dim_type type);
+       __isl_give isl_id *isl_dim_get_tuple_id(
+               __isl_keep isl_dim *dim, enum isl_dim_type type);
        __isl_give isl_dim *isl_dim_set_tuple_name(
                __isl_take isl_dim *dim,
                enum isl_dim_type type, const char *s);
@@ -596,6 +664,9 @@ They can be inspected, copied and freed using the following functions.
        const char *isl_local_space_get_dim_name(
                __isl_keep isl_local_space *ls,
                enum isl_dim_type type, unsigned pos);
+       __isl_give isl_local_space *isl_local_space_set_dim_name(
+               __isl_take isl_local_space *ls,
+               enum isl_dim_type type, unsigned pos, const char *s);
        __isl_give isl_dim *isl_local_space_get_dim(
                __isl_keep isl_local_space *ls);
        __isl_give isl_div *isl_local_space_get_div(
@@ -604,6 +675,26 @@ They can be inspected, copied and freed using the following functions.
                __isl_keep isl_local_space *ls);
        void *isl_local_space_free(__isl_take isl_local_space *ls);
 
+Two local spaces can be compared using
+
+       int isl_local_space_is_equal(__isl_keep isl_local_space *ls1,
+               __isl_keep isl_local_space *ls2);
+
+Local spaces can be created from other local spaces
+using the following functions.
+
+       __isl_give isl_local_space *isl_local_space_from_domain(
+               __isl_take isl_local_space *ls);
+       __isl_give isl_local_space *isl_local_space_add_dims(
+               __isl_take isl_local_space *ls,
+               enum isl_dim_type type, unsigned n);
+       __isl_give isl_local_space *isl_local_space_insert_dims(
+               __isl_take isl_local_space *ls,
+               enum isl_dim_type type, unsigned first, unsigned n);
+       __isl_give isl_local_space *isl_local_space_drop_dims(
+               __isl_take isl_local_space *ls,
+               enum isl_dim_type type, unsigned first, unsigned n);
+
 =head2 Input and Output
 
 C<isl> supports its own input/output format, which is similar
@@ -890,6 +981,15 @@ using the following functions.
        __isl_give isl_union_set *isl_union_set_from_set(
                __isl_take isl_set *set);
 
+The inverse conversions below can only be used if the input
+union set or relation is known to contain elements in exactly one
+space.
+
+       __isl_give isl_set *isl_set_from_union_set(
+               __isl_take isl_union_set *uset);
+       __isl_give isl_map *isl_map_from_union_map(
+               __isl_take isl_union_map *umap);
+
 Sets and relations can be copied and freed again using the following
 functions.
 
@@ -905,28 +1005,34 @@ functions.
                __isl_keep isl_union_map *umap);
        void isl_basic_set_free(__isl_take isl_basic_set *bset);
        void isl_set_free(__isl_take isl_set *set);
-       void isl_union_set_free(__isl_take isl_union_set *uset);
+       void *isl_union_set_free(__isl_take isl_union_set *uset);
        void isl_basic_map_free(__isl_take isl_basic_map *bmap);
        void isl_map_free(__isl_take isl_map *map);
-       void isl_union_map_free(__isl_take isl_union_map *umap);
+       void *isl_union_map_free(__isl_take isl_union_map *umap);
 
 Other sets and relations can be constructed by starting
 from a universe set or relation, adding equality and/or
 inequality constraints and then projecting out the
 existentially quantified variables, if any.
 Constraints can be constructed, manipulated and
-added to (basic) sets and relations using the following functions.
+added to (or removed from) (basic) sets and relations
+using the following functions.
 
        #include <isl/constraint.h>
        __isl_give isl_constraint *isl_equality_alloc(
                __isl_take isl_dim *dim);
        __isl_give isl_constraint *isl_inequality_alloc(
                __isl_take isl_dim *dim);
-       void isl_constraint_set_constant(
-               __isl_keep isl_constraint *constraint, isl_int v);
-       void isl_constraint_set_coefficient(
-               __isl_keep isl_constraint *constraint,
+       __isl_give isl_constraint *isl_constraint_set_constant(
+               __isl_take isl_constraint *constraint, isl_int v);
+       __isl_give isl_constraint *isl_constraint_set_constant_si(
+               __isl_take isl_constraint *constraint, int v);
+       __isl_give isl_constraint *isl_constraint_set_coefficient(
+               __isl_take isl_constraint *constraint,
                enum isl_dim_type type, int pos, isl_int v);
+       __isl_give isl_constraint *isl_constraint_set_coefficient_si(
+               __isl_take isl_constraint *constraint,
+               enum isl_dim_type type, int pos, int v);
        __isl_give isl_basic_map *isl_basic_map_add_constraint(
                __isl_take isl_basic_map *bmap,
                __isl_take isl_constraint *constraint);
@@ -939,6 +1045,9 @@ added to (basic) sets and relations using the following functions.
        __isl_give isl_set *isl_set_add_constraint(
                __isl_take isl_set *set,
                __isl_take isl_constraint *constraint);
+       __isl_give isl_basic_set *isl_basic_set_drop_constraint(
+               __isl_take isl_basic_set *bset,
+               __isl_take isl_constraint *constraint);
 
 For example, to create a set containing the even integers
 between 10 and 42, you would use the following code.
@@ -1006,6 +1115,21 @@ C<isl_dim_set> and C<isl_dim_div> for sets and
 of C<isl_dim_cst>, C<isl_dim_param>,
 C<isl_dim_in>, C<isl_dim_out> and C<isl_dim_div> for relations.
 
+A (basic) relation can also be constructed from a (piecewise) affine expression
+or a list of affine expressions (See L<"Piecewise Quasi Affine Expressions">).
+
+       __isl_give isl_basic_map *isl_basic_map_from_aff(
+               __isl_take isl_aff *aff);
+       __isl_give isl_map *isl_map_from_pw_aff(
+               __isl_take isl_pw_aff *pwaff);
+       __isl_give isl_basic_map *isl_basic_map_from_aff_list(
+               __isl_take isl_dim *domain_dim,
+               __isl_take isl_aff_list *list);
+
+The C<domain_dim> argument describes the domain of the resulting
+basic relation.  It is required because the C<list> may consist
+of zero affine expressions.
+
 =head2 Inspecting Sets and Relations
 
 Usually, the user should not have to care about the actual constraints
@@ -1180,11 +1304,40 @@ different kinds of variables appear in the resulting matrix
 and should be a permutation of C<isl_dim_cst>, C<isl_dim_param>,
 C<isl_dim_in>, C<isl_dim_out> and C<isl_dim_div>.
 
-The names of the domain and range spaces of a set or relation can be
-read off using the following functions.
+To check whether the description of a set or relation depends
+on one or more given dimensions, it is not necessary to iterate over all
+constraints.  Instead the following functions can be used.
+
+       int isl_basic_set_involves_dims(
+               __isl_keep isl_basic_set *bset,
+               enum isl_dim_type type, unsigned first, unsigned n);
+       int isl_set_involves_dims(__isl_keep isl_set *set,
+               enum isl_dim_type type, unsigned first, unsigned n);
+       int isl_basic_map_involves_dims(
+               __isl_keep isl_basic_map *bmap,
+               enum isl_dim_type type, unsigned first, unsigned n);
+       int isl_map_involves_dims(__isl_keep isl_map *map,
+               enum isl_dim_type type, unsigned first, unsigned n);
+
+The identifiers or names of the domain and range spaces of a set
+or relation can be read off or set using the following functions.
+
+       __isl_give isl_set *isl_set_set_tuple_id(
+               __isl_take isl_set *set, __isl_take isl_id *id);
+       __isl_give isl_id *isl_set_get_tuple_id(
+               __isl_keep isl_set *set);
+       __isl_give isl_map *isl_map_set_tuple_id(
+               __isl_take isl_map *map, enum isl_dim_type type,
+               __isl_take isl_id *id);
+       __isl_give isl_map *isl_map_reset_tuple_id(
+               __isl_take isl_map *map, enum isl_dim_type type);
+       __isl_give isl_id *isl_map_get_tuple_id(
+               __isl_keep isl_map *map, enum isl_dim_type type);
 
        const char *isl_basic_set_get_tuple_name(
                __isl_keep isl_basic_set *bset);
+       __isl_give isl_basic_set *isl_basic_set_set_tuple_name(
+               __isl_take isl_basic_set *set, const char *s);
        const char *isl_set_get_tuple_name(
                __isl_keep isl_set *set);
        const char *isl_basic_map_get_tuple_name(
@@ -1196,8 +1349,26 @@ read off using the following functions.
 
 As with C<isl_dim_get_tuple_name>, the value returned points to
 an internal data structure.
-The names of individual dimensions can be read off using
-the following functions.
+The identifiers, positions or names of individual dimensions can be
+read off using the following functions.
+
+       __isl_give isl_set *isl_set_set_dim_id(
+               __isl_take isl_set *set, enum isl_dim_type type,
+               unsigned pos, __isl_take isl_id *id);
+       __isl_give isl_id *isl_set_get_dim_id(
+               __isl_keep isl_set *set, enum isl_dim_type type,
+               unsigned pos);
+       __isl_give isl_map *isl_map_set_dim_id(
+               __isl_take isl_map *map, enum isl_dim_type type,
+               unsigned pos, __isl_take isl_id *id);
+       __isl_give isl_id *isl_map_get_dim_id(
+               __isl_keep isl_map *map, enum isl_dim_type type,
+               unsigned pos);
+
+       int isl_set_find_dim_by_id(__isl_keep isl_set *set,
+               enum isl_dim_type type, __isl_keep isl_id *id);
+       int isl_map_find_dim_by_id(__isl_keep isl_map *map,
+               enum isl_dim_type type, __isl_keep isl_id *id);
 
        const char *isl_constraint_get_dim_name(
                __isl_keep isl_constraint *constraint,
@@ -1215,8 +1386,8 @@ the following functions.
                __isl_keep isl_map *map,
                enum isl_dim_type type, unsigned pos);
 
-These functions are mostly useful to obtain the names
-of the parameters.
+These functions are mostly useful to obtain the identifiers, positions
+or names of the parameters.
 
 =head2 Properties
 
@@ -1440,6 +1611,23 @@ without removing the dimensions.
 Intersect the set or relation with the hyperplane where the given
 dimension has the fixed given value.
 
+       __isl_give isl_set *isl_set_equate(__isl_take isl_set *set,
+               enum isl_dim_type type1, int pos1,
+               enum isl_dim_type type2, int pos2);
+       __isl_give isl_map *isl_map_equate(__isl_take isl_map *map,
+               enum isl_dim_type type1, int pos1,
+               enum isl_dim_type type2, int pos2);
+
+Intersect the set or relation with the hyperplane where the given
+dimensions are equal to each other.
+
+       __isl_give isl_map *isl_map_oppose(__isl_take isl_map *map,
+               enum isl_dim_type type1, int pos1,
+               enum isl_dim_type type2, int pos2);
+
+Intersect the relation with the hyperplane where the given
+dimensions have opposite values.
+
 =item * Identity
 
        __isl_give isl_map *isl_set_identity(
@@ -1505,8 +1693,12 @@ equalities.
 
        __isl_give isl_basic_set *isl_basic_set_remove_redundancies(
                __isl_take isl_basic_set *bset);
+       __isl_give isl_set *isl_set_remove_redundancies(
+               __isl_take isl_set *set);
        __isl_give isl_basic_map *isl_basic_map_remove_redundancies(
                __isl_take isl_basic_map *bmap);
+       __isl_give isl_map *isl_map_remove_redundancies(
+               __isl_take isl_map *map);
 
 =item * Convex hull
 
@@ -1579,14 +1771,25 @@ per space.
        enum isl_lp_result isl_basic_set_max(
                __isl_keep isl_basic_set *bset,
                __isl_keep isl_aff *obj, isl_int *opt)
+       enum isl_lp_result isl_set_min(__isl_keep isl_set *set,
+               __isl_keep isl_aff *obj, isl_int *opt);
        enum isl_lp_result isl_set_max(__isl_keep isl_set *set,
                __isl_keep isl_aff *obj, isl_int *opt);
 
-Compute the maximum of the integer affine expression C<obj>
+Compute the minimum or maximum of the integer affine expression C<obj>
 over the points in C<set>, returning the result in C<opt>.
 The return value may be one of C<isl_lp_error>,
 C<isl_lp_ok>, C<isl_lp_unbounded> or C<isl_lp_empty>.
 
+=item * Parametric optimization
+
+       __isl_give isl_pw_aff *isl_set_dim_max(
+               __isl_take isl_set *set, int pos);
+
+Compute the maximum of the given set dimension as a function of the
+parameters, but independently of the other set dimensions.
+For lexicographic optimization, see L<"Lexicographic Optimization">.
+
 =item * Dual
 
 The following functions compute either the set of (rational) coefficient
@@ -1770,6 +1973,9 @@ the same (number of) parameters.
        __isl_give isl_basic_set *isl_basic_set_intersect(
                __isl_take isl_basic_set *bset1,
                __isl_take isl_basic_set *bset2);
+       __isl_give isl_set *isl_set_intersect_params(
+               __isl_take isl_set *set,
+               __isl_take isl_set *params);
        __isl_give isl_set *isl_set_intersect(
                __isl_take isl_set *set1,
                __isl_take isl_set *set2);
@@ -1785,6 +1991,9 @@ the same (number of) parameters.
        __isl_give isl_basic_map *isl_basic_map_intersect(
                __isl_take isl_basic_map *bmap1,
                __isl_take isl_basic_map *bmap2);
+       __isl_give isl_map *isl_map_intersect_params(
+               __isl_take isl_map *map,
+               __isl_take isl_set *params);
        __isl_give isl_map *isl_map_intersect_domain(
                __isl_take isl_map *map,
                __isl_take isl_set *set);
@@ -2052,6 +2261,8 @@ Here we take lists of C<isl_set>s as an example.
 Lists can be created, copied and freed using the following functions.
 
        #include <isl/list.h>
+       __isl_give isl_set_list *isl_set_list_from_set(
+               __isl_take struct isl_set *el);
        __isl_give isl_set_list *isl_set_list_alloc(
                isl_ctx *ctx, int n);
        __isl_give isl_set_list *isl_set_list_copy(
@@ -2059,10 +2270,11 @@ Lists can be created, copied and freed using the following functions.
        __isl_give isl_set_list *isl_set_list_add(
                __isl_take isl_set_list *list,
                __isl_take isl_set *el);
-       void isl_set_list_free(__isl_take isl_set_list *list);
+       void *isl_set_list_free(__isl_take isl_set_list *list);
 
 C<isl_set_list_alloc> creates an empty list with a capacity for
-C<n> elements.
+C<n> elements.  C<isl_set_list_from_set> creates a list with a single
+element.
 
 Lists can be inspected using the following functions.
 
@@ -2121,19 +2333,40 @@ the original and the kernel (in that order) is the zero matrix.
 
        __isl_give isl_mat *isl_mat_right_kernel(__isl_take isl_mat *mat);
 
-=head2 Quasi Affine Expressions
+=head2 Piecewise Quasi Affine Expressions
 
 The zero quasi affine expression can be created using
 
        __isl_give isl_aff *isl_aff_zero(
                __isl_take isl_local_space *ls);
 
-Quasi affine expressions can be copied and free using
+A quasi affine expression can also be initialized from an C<isl_div>:
+
+       #include <isl/div.h>
+       __isl_give isl_aff *isl_aff_from_div(__isl_take isl_div *div);
+
+An empty piecewise quasi affine expression (one with no cells)
+or a piecewise quasi affine expression with a single cell can
+be created using the following functions.
+
+       #include <isl/aff.h>
+       __isl_give isl_pw_aff *isl_pw_aff_empty(
+               __isl_take isl_dim *dim);
+       __isl_give isl_pw_aff *isl_pw_aff_alloc(
+               __isl_take isl_set *set, __isl_take isl_aff *aff);
+       __isl_give isl_pw_aff *isl_pw_aff_from_aff(
+               __isl_take isl_aff *aff);
+
+Quasi affine expressions can be copied and freed using
 
        #include <isl/aff.h>
        __isl_give isl_aff *isl_aff_copy(__isl_keep isl_aff *aff);
        void *isl_aff_free(__isl_take isl_aff *aff);
 
+       __isl_give isl_pw_aff *isl_pw_aff_copy(
+               __isl_keep isl_pw_aff *pwaff);
+       void *isl_pw_aff_free(__isl_take isl_pw_aff *pwaff);
+
 A (rational) bound on a dimension can be extracted from an C<isl_constraint>
 using the following function.  The constraint is required to have
 a non-zero coefficient for the specified dimension.
@@ -2143,6 +2376,13 @@ a non-zero coefficient for the specified dimension.
                __isl_keep isl_constraint *constraint,
                enum isl_dim_type type, int pos);
 
+The entire affine expression of the constraint can also be extracted
+using the following function.
+
+       #include <isl/constraint.h>
+       __isl_give isl_aff *isl_constraint_get_aff(
+               __isl_keep isl_constraint *constraint);
+
 Conversely, an equality constraint equating
 the affine expression to zero or an inequality constraint enforcing
 the affine expression to be non-negative, can be constructed using
@@ -2171,9 +2411,28 @@ The expression can be inspected using
        __isl_give isl_div *isl_aff_get_div(
                __isl_keep isl_aff *aff, int pos);
 
+       int isl_aff_is_cst(__isl_keep isl_aff *aff);
+       int isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff);
+
+       int isl_aff_involves_dims(__isl_keep isl_aff *aff,
+               enum isl_dim_type type, unsigned first, unsigned n);
+       int isl_pw_aff_involves_dims(__isl_keep isl_pw_aff *pwaff,
+               enum isl_dim_type type, unsigned first, unsigned n);
+
+       isl_ctx *isl_pw_aff_get_ctx(__isl_keep isl_pw_aff *pwaff);
+       unsigned isl_pw_aff_dim(__isl_keep isl_pw_aff *pwaff,
+               enum isl_dim_type type);
+       int isl_pw_aff_is_empty(__isl_keep isl_pw_aff *pwaff);
+
 It can be modified using
 
        #include <isl/aff.h>
+       __isl_give isl_pw_aff *isl_pw_aff_set_tuple_id(
+               __isl_take isl_pw_aff *pwaff,
+               __isl_take isl_id *id);
+       __isl_give isl_aff *isl_aff_set_dim_name(
+               __isl_take isl_aff *aff, enum isl_dim_type type,
+               unsigned pos, const char *s);
        __isl_give isl_aff *isl_aff_set_constant(
                __isl_take isl_aff *aff, isl_int v);
        __isl_give isl_aff *isl_aff_set_constant_si(
@@ -2189,28 +2448,174 @@ It can be modified using
 
        __isl_give isl_aff *isl_aff_add_constant(
                __isl_take isl_aff *aff, isl_int v);
+       __isl_give isl_aff *isl_aff_add_constant_si(
+               __isl_take isl_aff *aff, int v);
+       __isl_give isl_aff *isl_aff_add_coefficient(
+               __isl_take isl_aff *aff,
+               enum isl_dim_type type, int pos, isl_int v);
        __isl_give isl_aff *isl_aff_add_coefficient_si(
                __isl_take isl_aff *aff,
                enum isl_dim_type type, int pos, int v);
 
+       __isl_give isl_aff *isl_aff_insert_dims(
+               __isl_take isl_aff *aff,
+               enum isl_dim_type type, unsigned first, unsigned n);
+       __isl_give isl_pw_aff *isl_pw_aff_insert_dims(
+               __isl_take isl_pw_aff *pwaff,
+               enum isl_dim_type type, unsigned first, unsigned n);
+       __isl_give isl_aff *isl_aff_add_dims(
+               __isl_take isl_aff *aff,
+               enum isl_dim_type type, unsigned n);
+       __isl_give isl_pw_aff *isl_pw_aff_add_dims(
+               __isl_take isl_pw_aff *pwaff,
+               enum isl_dim_type type, unsigned n);
+       __isl_give isl_aff *isl_aff_drop_dims(
+               __isl_take isl_aff *aff,
+               enum isl_dim_type type, unsigned first, unsigned n);
+       __isl_give isl_pw_aff *isl_pw_aff_drop_dims(
+               __isl_take isl_pw_aff *pwaff,
+               enum isl_dim_type type, unsigned first, unsigned n);
+
 Note that the C<set_constant> and C<set_coefficient> functions
 set the I<numerator> of the constant or coefficient, while
 C<add_constant> and C<add_coefficient> add an integer value to
 the possibly rational constant or coefficient.
 
+To check whether an affine expressions is obviously zero
+or obviously equal to some other affine expression, use
+
+       #include <isl/aff.h>
+       int isl_aff_plain_is_zero(__isl_keep isl_aff *aff);
+       int isl_aff_plain_is_equal(__isl_keep isl_aff *aff1,
+               __isl_keep isl_aff *aff2);
+
 Operations include
 
        #include <isl/aff.h>
        __isl_give isl_aff *isl_aff_add(__isl_take isl_aff *aff1,
                __isl_take isl_aff *aff2);
+       __isl_give isl_pw_aff *isl_pw_aff_add(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
+       __isl_give isl_pw_aff *isl_pw_aff_min(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
+       __isl_give isl_pw_aff *isl_pw_aff_max(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
        __isl_give isl_aff *isl_aff_sub(__isl_take isl_aff *aff1,
                __isl_take isl_aff *aff2);
+       __isl_give isl_pw_aff *isl_pw_aff_sub(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
        __isl_give isl_aff *isl_aff_neg(__isl_take isl_aff *aff);
+       __isl_give isl_pw_aff *isl_pw_aff_neg(
+               __isl_take isl_pw_aff *pwaff);
        __isl_give isl_aff *isl_aff_ceil(__isl_take isl_aff *aff);
+       __isl_give isl_pw_aff *isl_pw_aff_ceil(
+               __isl_take isl_pw_aff *pwaff);
+       __isl_give isl_aff *isl_aff_floor(__isl_take isl_aff *aff);
+       __isl_give isl_pw_aff *isl_pw_aff_floor(
+               __isl_take isl_pw_aff *pwaff);
        __isl_give isl_aff *isl_aff_scale(__isl_take isl_aff *aff,
                isl_int f);
+       __isl_give isl_pw_aff *isl_pw_aff_scale(
+               __isl_take isl_pw_aff *pwaff, isl_int f);
        __isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff,
                isl_int f);
+       __isl_give isl_aff *isl_aff_scale_down_ui(
+               __isl_take isl_aff *aff, unsigned f);
+       __isl_give isl_pw_aff *isl_pw_aff_scale_down(
+               __isl_take isl_pw_aff *pwaff, isl_int f);
+
+       __isl_give isl_pw_aff *isl_pw_aff_coalesce(
+               __isl_take isl_pw_aff *pwqp);
+
+       __isl_give isl_pw_aff *isl_pw_aff_align_params(
+               __isl_take isl_pw_aff *pwaff,
+               __isl_take isl_dim *model);
+
+       __isl_give isl_aff *isl_aff_gist(__isl_take isl_aff *aff,
+               __isl_take isl_set *context);
+       __isl_give isl_pw_aff *isl_pw_aff_gist(
+               __isl_take isl_pw_aff *pwaff,
+               __isl_take isl_set *context);
+
+       __isl_give isl_set *isl_pw_aff_domain(
+               __isl_take isl_pw_aff *pwaff);
+
+       __isl_give isl_aff *isl_aff_mul(__isl_take isl_aff *aff1,
+               __isl_take isl_aff *aff2);
+       __isl_give isl_pw_aff *isl_pw_aff_mul(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
+
+When multiplying two affine expressions, at least one of the two needs
+to be a constant.
+
+       #include <isl/aff.h>
+       __isl_give isl_basic_set *isl_aff_ge_basic_set(
+               __isl_take isl_aff *aff1, __isl_take isl_aff *aff2);
+       __isl_give isl_set *isl_pw_aff_eq_set(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
+       __isl_give isl_set *isl_pw_aff_ne_set(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
+       __isl_give isl_set *isl_pw_aff_le_set(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
+       __isl_give isl_set *isl_pw_aff_lt_set(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
+       __isl_give isl_set *isl_pw_aff_ge_set(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
+       __isl_give isl_set *isl_pw_aff_gt_set(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
+
+The function C<isl_aff_ge_basic_set> returns a basic set
+containing those elements in the shared space
+of C<aff1> and C<aff2> where C<aff1> is greater than or equal to C<aff2>.
+The function C<isl_aff_ge_set> returns a set
+containing those elements in the shared domain
+of C<pwaff1> and C<pwaff2> where C<pwaff1> is greater than or equal to C<pwaff2>.
+
+       #include <isl/aff.h>
+       __isl_give isl_set *isl_pw_aff_nonneg_set(
+               __isl_take isl_pw_aff *pwaff);
+       __isl_give isl_set *isl_pw_aff_zero_set(
+               __isl_take isl_pw_aff *pwaff);
+       __isl_give isl_set *isl_pw_aff_non_zero_set(
+               __isl_take isl_pw_aff *pwaff);
+
+The function C<isl_pw_aff_nonneg_set> returns a set
+containing those elements in the domain
+of C<pwaff> where C<pwaff> is non-negative.
+
+       #include <isl/aff.h>
+       __isl_give isl_pw_aff *isl_pw_aff_cond(
+               __isl_take isl_set *cond,
+               __isl_take isl_pw_aff *pwaff_true,
+               __isl_take isl_pw_aff *pwaff_false);
+
+The function C<isl_pw_aff_cond> performs a conditional operator
+and returns an expression that is equal to C<pwaff_true>
+for elements in C<cond> and equal to C<pwaff_false> for elements
+not in C<cond>.
+
+       #include <isl/aff.h>
+       __isl_give isl_pw_aff *isl_pw_aff_union_max(
+               __isl_take isl_pw_aff *pwaff1,
+               __isl_take isl_pw_aff *pwaff2);
+
+The function C<isl_pw_aff_union_max> computes a piecewise quasi-affine
+expression with a domain that is the union of those of C<pwaff1> and
+C<pwaff2> and such that on each cell, the quasi-affine expression is
+the maximum of those of C<pwaff1> and C<pwaff2>.  If only one of
+C<pwaff1> or C<pwaff2> is defined on a given cell, then the
+associated expression is the defined one.
 
 An expression can be printed using
 
@@ -2218,6 +2623,10 @@ An expression can be printed using
        __isl_give isl_printer *isl_printer_print_aff(
                __isl_take isl_printer *p, __isl_keep isl_aff *aff);
 
+       __isl_give isl_printer *isl_printer_print_pw_aff(
+               __isl_take isl_printer *p,
+               __isl_keep isl_pw_aff *pwaff);
+
 =head2 Points
 
 Points are elements of a set.  They can be used to construct
@@ -2243,6 +2652,10 @@ using
                __isl_take isl_point *pnt,
                enum isl_dim_type type, int pos, unsigned val);
 
+Other properties can be obtained using
+
+       isl_ctx *isl_point_get_ctx(__isl_keep isl_point *pnt);
+
 Points can be copied or freed using
 
        __isl_give isl_point *isl_point_copy(
@@ -2414,7 +2827,7 @@ functions.
 
        __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_copy(
                __isl_keep isl_pw_qpolynomial *pwqp);
-       void isl_pw_qpolynomial_free(
+       void *isl_pw_qpolynomial_free(
                __isl_take isl_pw_qpolynomial *pwqp);
 
        __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_copy(
@@ -2511,6 +2924,8 @@ are returned in C<*n> and C<*d>, respectively.
 
 =head3 Operations on (Piecewise) Quasipolynomials
 
+       __isl_give isl_qpolynomial *isl_qpolynomial_scale(
+               __isl_take isl_qpolynomial *qp, isl_int v);
        __isl_give isl_qpolynomial *isl_qpolynomial_neg(
                __isl_take isl_qpolynomial *qp);
        __isl_give isl_qpolynomial *isl_qpolynomial_add(
@@ -2644,7 +3059,7 @@ following functions.
                __isl_keep isl_union_pw_qpolynomial_fold *upwf);
        void isl_qpolynomial_fold_free(
                __isl_take isl_qpolynomial_fold *fold);
-       void isl_pw_qpolynomial_fold_free(
+       void *isl_pw_qpolynomial_fold_free(
                __isl_take isl_pw_qpolynomial_fold *pwf);
        void isl_union_pw_qpolynomial_fold_free(
                __isl_take isl_union_pw_qpolynomial_fold *upwf);
@@ -2712,6 +3127,9 @@ To iterate over all quasipolynomials in a reduction, use
 
 =head3 Operations on Piecewise Quasipolynomial Reductions
 
+       __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale(
+               __isl_take isl_qpolynomial_fold *fold, isl_int v);
+
        __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add(
                __isl_take isl_pw_qpolynomial_fold *pwf1,
                __isl_take isl_pw_qpolynomial_fold *pwf2);
@@ -2996,11 +3414,15 @@ The properties of a band can be inspected using the following functions.
                __isl_keep isl_band *band);
 
        int isl_band_n_member(__isl_keep isl_band *band);
-       int isl_band_member_is_parallel(__isl_keep isl_band *band,
-               int pos);
+       int isl_band_member_is_zero_distance(
+               __isl_keep isl_band *band, int pos);
 
-Note that a scheduling dimension is considered parallel if it
-does not carry any proximity dependences.
+Note that a scheduling dimension is considered to be ``zero
+distance'' if it does not carry any proximity dependences
+within its band.
+That is, if the dependence distances of the proximity
+dependences are all zero in that direction (for fixed
+iterations of outer bands).
 
 A representation of the band can be printed using
 
@@ -3009,22 +3431,6 @@ A representation of the band can be printed using
                __isl_take isl_printer *p,
                __isl_keep isl_band *band);
 
-Alternatively, the schedule mapping
-can also be obtained in pieces using the following functions.
-
-       int isl_schedule_n_band(__isl_keep isl_schedule *sched);
-       __isl_give isl_union_map *isl_schedule_get_band(
-               __isl_keep isl_schedule *sched, unsigned band);
-
-C<isl_schedule_n_band> returns the maximal number of bands.
-C<isl_schedule_get_band> returns a union of mappings from a domain to
-the band of consecutive schedule dimensions with the given sequence
-number for that domain.  Bands with the same sequence number but for
-different domains may be completely unrelated.
-Within a band, the corresponding coordinates of the distance vectors
-are all non-negative, assuming that the coordinates for all previous
-bands are all zero.
-
 =head2 Parametric Vertex Enumeration
 
 The parametric vertex enumeration described in this section