2 * Copyright 2008-2009 Katholieke Universiteit Leuven
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege, K.U.Leuven, Departement
7 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
10 #include <isl_map_private.h>
15 #include <isl_point_private.h>
16 #include <isl_vec_private.h>
18 /* Expand the constraint "c" into "v". The initial "dim" dimensions
19 * are the same, but "v" may have more divs than "c" and the divs of "c"
20 * may appear in different positions in "v".
21 * The number of divs in "c" is given by "n_div" and the mapping
22 * of divs in "c" to divs in "v" is given by "div_map".
24 * Although it shouldn't happen in practice, it is theoretically
25 * possible that two or more divs in "c" are mapped to the same div in "v".
26 * These divs are then necessarily the same, so we simply add their
29 static void expand_constraint(isl_vec
*v
, unsigned dim
,
30 isl_int
*c
, int *div_map
, unsigned n_div
)
34 isl_seq_cpy(v
->el
, c
, 1 + dim
);
35 isl_seq_clr(v
->el
+ 1 + dim
, v
->size
- (1 + dim
));
37 for (i
= 0; i
< n_div
; ++i
) {
38 int pos
= 1 + dim
+ div_map
[i
];
39 isl_int_add(v
->el
[pos
], v
->el
[pos
], c
[1 + dim
+ i
]);
43 /* Add all constraints of bmap to tab. The equalities of bmap
44 * are added as a pair of inequalities.
46 static int tab_add_constraints(struct isl_tab
*tab
,
47 __isl_keep isl_basic_map
*bmap
, int *div_map
)
58 tab_total
= isl_basic_map_total_dim(tab
->bmap
);
59 bmap_total
= isl_basic_map_total_dim(bmap
);
60 dim
= isl_space_dim(tab
->bmap
->dim
, isl_dim_all
);
62 if (isl_tab_extend_cons(tab
, 2 * bmap
->n_eq
+ bmap
->n_ineq
) < 0)
65 v
= isl_vec_alloc(bmap
->ctx
, 1 + tab_total
);
69 for (i
= 0; i
< bmap
->n_eq
; ++i
) {
70 expand_constraint(v
, dim
, bmap
->eq
[i
], div_map
, bmap
->n_div
);
71 if (isl_tab_add_ineq(tab
, v
->el
) < 0)
73 isl_seq_neg(bmap
->eq
[i
], bmap
->eq
[i
], 1 + bmap_total
);
74 expand_constraint(v
, dim
, bmap
->eq
[i
], div_map
, bmap
->n_div
);
75 if (isl_tab_add_ineq(tab
, v
->el
) < 0)
77 isl_seq_neg(bmap
->eq
[i
], bmap
->eq
[i
], 1 + bmap_total
);
82 for (i
= 0; i
< bmap
->n_ineq
; ++i
) {
83 expand_constraint(v
, dim
, bmap
->ineq
[i
], div_map
, bmap
->n_div
);
84 if (isl_tab_add_ineq(tab
, v
->el
) < 0)
97 /* Add a specific constraint of bmap (or its opposite) to tab.
98 * The position of the constraint is specified by "c", where
99 * the equalities of bmap are counted twice, once for the inequality
100 * that is equal to the equality, and once for its negation.
102 * Each of these constraints has been added to "tab" before by
103 * tab_add_constraints (and later removed again), so there should
104 * already be a row available for the constraint.
106 static int tab_add_constraint(struct isl_tab
*tab
,
107 __isl_keep isl_basic_map
*bmap
, int *div_map
, int c
, int oppose
)
118 tab_total
= isl_basic_map_total_dim(tab
->bmap
);
119 bmap_total
= isl_basic_map_total_dim(bmap
);
120 dim
= isl_space_dim(tab
->bmap
->dim
, isl_dim_all
);
122 v
= isl_vec_alloc(bmap
->ctx
, 1 + tab_total
);
126 if (c
< 2 * bmap
->n_eq
) {
127 if ((c
% 2) != oppose
)
128 isl_seq_neg(bmap
->eq
[c
/2], bmap
->eq
[c
/2],
131 isl_int_sub_ui(bmap
->eq
[c
/2][0], bmap
->eq
[c
/2][0], 1);
132 expand_constraint(v
, dim
, bmap
->eq
[c
/2], div_map
, bmap
->n_div
);
133 r
= isl_tab_add_ineq(tab
, v
->el
);
135 isl_int_add_ui(bmap
->eq
[c
/2][0], bmap
->eq
[c
/2][0], 1);
136 if ((c
% 2) != oppose
)
137 isl_seq_neg(bmap
->eq
[c
/2], bmap
->eq
[c
/2],
142 isl_seq_neg(bmap
->ineq
[c
], bmap
->ineq
[c
],
144 isl_int_sub_ui(bmap
->ineq
[c
][0], bmap
->ineq
[c
][0], 1);
146 expand_constraint(v
, dim
, bmap
->ineq
[c
], div_map
, bmap
->n_div
);
147 r
= isl_tab_add_ineq(tab
, v
->el
);
149 isl_int_add_ui(bmap
->ineq
[c
][0], bmap
->ineq
[c
][0], 1);
150 isl_seq_neg(bmap
->ineq
[c
], bmap
->ineq
[c
],
159 static int tab_add_divs(struct isl_tab
*tab
, __isl_keep isl_basic_map
*bmap
,
173 *div_map
= isl_alloc_array(bmap
->ctx
, int, bmap
->n_div
);
177 total
= isl_basic_map_total_dim(tab
->bmap
);
178 dim
= total
- tab
->bmap
->n_div
;
179 vec
= isl_vec_alloc(bmap
->ctx
, 2 + total
+ bmap
->n_div
);
183 for (i
= 0; i
< bmap
->n_div
; ++i
) {
184 isl_seq_cpy(vec
->el
, bmap
->div
[i
], 2 + dim
);
185 isl_seq_clr(vec
->el
+ 2 + dim
, tab
->bmap
->n_div
);
186 for (j
= 0; j
< i
; ++j
)
187 isl_int_set(vec
->el
[2 + dim
+ (*div_map
)[j
]],
188 bmap
->div
[i
][2 + dim
+ j
]);
189 for (j
= 0; j
< tab
->bmap
->n_div
; ++j
)
190 if (isl_seq_eq(tab
->bmap
->div
[j
],
191 vec
->el
, 2 + dim
+ tab
->bmap
->n_div
))
194 if (j
== tab
->bmap
->n_div
) {
195 vec
->size
= 2 + dim
+ tab
->bmap
->n_div
;
196 if (isl_tab_add_div(tab
, vec
, NULL
, NULL
) < 0)
210 /* Freeze all constraints of tableau tab.
212 static int tab_freeze_constraints(struct isl_tab
*tab
)
216 for (i
= 0; i
< tab
->n_con
; ++i
)
217 if (isl_tab_freeze_constraint(tab
, i
) < 0)
223 /* Check for redundant constraints starting at offset.
224 * Put the indices of the redundant constraints in index
225 * and return the number of redundant constraints.
227 static int n_non_redundant(isl_ctx
*ctx
, struct isl_tab
*tab
,
228 int offset
, int **index
)
231 int n_test
= tab
->n_con
- offset
;
233 if (isl_tab_detect_redundant(tab
) < 0)
239 *index
= isl_alloc_array(ctx
, int, n_test
);
243 for (n
= 0, i
= 0; i
< n_test
; ++i
) {
245 r
= isl_tab_is_redundant(tab
, offset
+ i
);
256 /* basic_map_collect_diff calls add on each of the pieces of
257 * the set difference between bmap and map until the add method
258 * return a negative value.
260 struct isl_diff_collector
{
261 int (*add
)(struct isl_diff_collector
*dc
,
262 __isl_take isl_basic_map
*bmap
);
265 /* Compute the set difference between bmap and map and call
266 * dc->add on each of the piece until this function returns
268 * Return 0 on success and -1 on error. dc->add returning
269 * a negative value is treated as an error, but the calling
270 * function can interpret the results based on the state of dc.
272 * Assumes that map has known divs.
274 * The difference is computed by a backtracking algorithm.
275 * Each level corresponds to a basic map in "map".
276 * When a node in entered for the first time, we check
277 * if the corresonding basic map intersects the current piece
278 * of "bmap". If not, we move to the next level.
279 * Otherwise, we split the current piece into as many
280 * pieces as there are non-redundant constraints of the current
281 * basic map in the intersection. Each of these pieces is
282 * handled by a child of the current node.
283 * In particular, if there are n non-redundant constraints,
284 * then for each 0 <= i < n, a piece is cut off by adding
285 * constraints 0 <= j < i and adding the opposite of constraint i.
286 * If there are no non-redundant constraints, meaning that the current
287 * piece is a subset of the current basic map, then we simply backtrack.
289 * In the leaves, we check if the remaining piece has any integer points
290 * and if so, pass it along to dc->add. As a special case, if nothing
291 * has been removed when we end up in a leaf, we simply pass along
292 * the original basic map.
294 static isl_stat
basic_map_collect_diff(__isl_take isl_basic_map
*bmap
,
295 __isl_take isl_map
*map
, struct isl_diff_collector
*dc
)
303 struct isl_tab
*tab
= NULL
;
304 struct isl_tab_undo
**snap
= NULL
;
308 int **div_map
= NULL
;
310 empty
= isl_basic_map_is_empty(bmap
);
312 isl_basic_map_free(bmap
);
314 return empty
< 0 ? isl_stat_error
: isl_stat_ok
;
317 bmap
= isl_basic_map_cow(bmap
);
318 map
= isl_map_cow(map
);
324 snap
= isl_alloc_array(map
->ctx
, struct isl_tab_undo
*, map
->n
);
325 k
= isl_alloc_array(map
->ctx
, int, map
->n
);
326 n
= isl_alloc_array(map
->ctx
, int, map
->n
);
327 index
= isl_calloc_array(map
->ctx
, int *, map
->n
);
328 div_map
= isl_calloc_array(map
->ctx
, int *, map
->n
);
329 if (!snap
|| !k
|| !n
|| !index
|| !div_map
)
332 bmap
= isl_basic_map_order_divs(bmap
);
333 map
= isl_map_order_divs(map
);
335 tab
= isl_tab_from_basic_map(bmap
, 1);
344 if (level
>= map
->n
) {
346 struct isl_basic_map
*bm
;
348 if (dc
->add(dc
, isl_basic_map_copy(bmap
)) < 0)
352 bm
= isl_basic_map_copy(tab
->bmap
);
353 bm
= isl_basic_map_cow(bm
);
354 bm
= isl_basic_map_update_from_tab(bm
, tab
);
355 bm
= isl_basic_map_simplify(bm
);
356 bm
= isl_basic_map_finalize(bm
);
357 empty
= isl_basic_map_is_empty(bm
);
359 isl_basic_map_free(bm
);
360 else if (dc
->add(dc
, bm
) < 0)
370 struct isl_tab_undo
*snap2
;
371 snap2
= isl_tab_snap(tab
);
372 if (tab_add_divs(tab
, map
->p
[level
],
373 &div_map
[level
]) < 0)
376 snap
[level
] = isl_tab_snap(tab
);
377 if (tab_freeze_constraints(tab
) < 0)
379 if (tab_add_constraints(tab
, map
->p
[level
],
385 if (isl_tab_rollback(tab
, snap2
) < 0)
391 n
[level
] = n_non_redundant(ctx
, tab
, offset
,
400 if (isl_tab_rollback(tab
, snap
[level
]) < 0)
402 if (tab_add_constraint(tab
, map
->p
[level
],
403 div_map
[level
], index
[level
][0], 1) < 0)
408 if (k
[level
] + 1 >= n
[level
]) {
412 if (isl_tab_rollback(tab
, snap
[level
]) < 0)
414 if (tab_add_constraint(tab
, map
->p
[level
],
416 index
[level
][k
[level
]], 0) < 0)
418 snap
[level
] = isl_tab_snap(tab
);
420 if (tab_add_constraint(tab
, map
->p
[level
],
422 index
[level
][k
[level
]], 1) < 0)
434 for (i
= 0; index
&& i
< map
->n
; ++i
)
437 for (i
= 0; div_map
&& i
< map
->n
; ++i
)
441 isl_basic_map_free(bmap
);
450 for (i
= 0; index
&& i
< map
->n
; ++i
)
453 for (i
= 0; div_map
&& i
< map
->n
; ++i
)
456 isl_basic_map_free(bmap
);
458 return isl_stat_error
;
461 /* A diff collector that actually collects all parts of the
462 * set difference in the field diff.
464 struct isl_subtract_diff_collector
{
465 struct isl_diff_collector dc
;
466 struct isl_map
*diff
;
469 /* isl_subtract_diff_collector callback.
471 static int basic_map_subtract_add(struct isl_diff_collector
*dc
,
472 __isl_take isl_basic_map
*bmap
)
474 struct isl_subtract_diff_collector
*sdc
;
475 sdc
= (struct isl_subtract_diff_collector
*)dc
;
477 sdc
->diff
= isl_map_union_disjoint(sdc
->diff
,
478 isl_map_from_basic_map(bmap
));
480 return sdc
->diff
? 0 : -1;
483 /* Return the set difference between bmap and map.
485 static __isl_give isl_map
*basic_map_subtract(__isl_take isl_basic_map
*bmap
,
486 __isl_take isl_map
*map
)
488 struct isl_subtract_diff_collector sdc
;
489 sdc
.dc
.add
= &basic_map_subtract_add
;
490 sdc
.diff
= isl_map_empty(isl_basic_map_get_space(bmap
));
491 if (basic_map_collect_diff(bmap
, map
, &sdc
.dc
) < 0) {
492 isl_map_free(sdc
.diff
);
498 /* Return an empty map living in the same space as "map1" and "map2".
500 static __isl_give isl_map
*replace_pair_by_empty( __isl_take isl_map
*map1
,
501 __isl_take isl_map
*map2
)
505 space
= isl_map_get_space(map1
);
508 return isl_map_empty(space
);
511 /* Return the set difference between map1 and map2.
512 * (U_i A_i) \ (U_j B_j) is computed as U_i (A_i \ (U_j B_j))
514 * If "map1" and "map2" are obviously equal to each other,
515 * then return an empty map in the same space.
517 * If "map1" and "map2" are disjoint, then simply return "map1".
519 static __isl_give isl_map
*map_subtract( __isl_take isl_map
*map1
,
520 __isl_take isl_map
*map2
)
524 struct isl_map
*diff
;
529 isl_assert(map1
->ctx
, isl_space_is_equal(map1
->dim
, map2
->dim
), goto error
);
531 equal
= isl_map_plain_is_equal(map1
, map2
);
535 return replace_pair_by_empty(map1
, map2
);
537 disjoint
= isl_map_is_disjoint(map1
, map2
);
545 map1
= isl_map_compute_divs(map1
);
546 map2
= isl_map_compute_divs(map2
);
550 map1
= isl_map_remove_empty_parts(map1
);
551 map2
= isl_map_remove_empty_parts(map2
);
553 diff
= isl_map_empty(isl_map_get_space(map1
));
554 for (i
= 0; i
< map1
->n
; ++i
) {
556 d
= basic_map_subtract(isl_basic_map_copy(map1
->p
[i
]),
558 if (ISL_F_ISSET(map1
, ISL_MAP_DISJOINT
))
559 diff
= isl_map_union_disjoint(diff
, d
);
561 diff
= isl_map_union(diff
, d
);
574 __isl_give isl_map
*isl_map_subtract( __isl_take isl_map
*map1
,
575 __isl_take isl_map
*map2
)
577 return isl_map_align_params_map_map_and(map1
, map2
, &map_subtract
);
580 struct isl_set
*isl_set_subtract(struct isl_set
*set1
, struct isl_set
*set2
)
582 return (struct isl_set
*)
584 (struct isl_map
*)set1
, (struct isl_map
*)set2
);
587 /* Remove the elements of "dom" from the domain of "map".
589 static __isl_give isl_map
*map_subtract_domain(__isl_take isl_map
*map
,
590 __isl_take isl_set
*dom
)
594 if (!isl_map_compatible_domain(map
, dom
))
595 isl_die(isl_set_get_ctx(dom
), isl_error_invalid
,
596 "incompatible spaces", goto error
);
598 ext_dom
= isl_map_universe(isl_map_get_space(map
));
599 ext_dom
= isl_map_intersect_domain(ext_dom
, dom
);
600 return isl_map_subtract(map
, ext_dom
);
607 __isl_give isl_map
*isl_map_subtract_domain(__isl_take isl_map
*map
,
608 __isl_take isl_set
*dom
)
610 return isl_map_align_params_map_map_and(map
, dom
, &map_subtract_domain
);
613 /* Remove the elements of "dom" from the range of "map".
615 static __isl_give isl_map
*map_subtract_range(__isl_take isl_map
*map
,
616 __isl_take isl_set
*dom
)
620 if (!isl_map_compatible_range(map
, dom
))
621 isl_die(isl_set_get_ctx(dom
), isl_error_invalid
,
622 "incompatible spaces", goto error
);
624 ext_dom
= isl_map_universe(isl_map_get_space(map
));
625 ext_dom
= isl_map_intersect_range(ext_dom
, dom
);
626 return isl_map_subtract(map
, ext_dom
);
633 __isl_give isl_map
*isl_map_subtract_range(__isl_take isl_map
*map
,
634 __isl_take isl_set
*dom
)
636 return isl_map_align_params_map_map_and(map
, dom
, &map_subtract_range
);
639 /* A diff collector that aborts as soon as its add function is called,
640 * setting empty to 0.
642 struct isl_is_empty_diff_collector
{
643 struct isl_diff_collector dc
;
647 /* isl_is_empty_diff_collector callback.
649 static int basic_map_is_empty_add(struct isl_diff_collector
*dc
,
650 __isl_take isl_basic_map
*bmap
)
652 struct isl_is_empty_diff_collector
*edc
;
653 edc
= (struct isl_is_empty_diff_collector
*)dc
;
657 isl_basic_map_free(bmap
);
661 /* Check if bmap \ map is empty by computing this set difference
662 * and breaking off as soon as the difference is known to be non-empty.
664 static isl_bool
basic_map_diff_is_empty(__isl_keep isl_basic_map
*bmap
,
665 __isl_keep isl_map
*map
)
669 struct isl_is_empty_diff_collector edc
;
671 empty
= isl_basic_map_plain_is_empty(bmap
);
675 edc
.dc
.add
= &basic_map_is_empty_add
;
676 edc
.empty
= isl_bool_true
;
677 r
= basic_map_collect_diff(isl_basic_map_copy(bmap
),
678 isl_map_copy(map
), &edc
.dc
);
680 return isl_bool_false
;
682 return r
< 0 ? isl_bool_error
: isl_bool_true
;
685 /* Check if map1 \ map2 is empty by checking if the set difference is empty
686 * for each of the basic maps in map1.
688 static isl_bool
map_diff_is_empty(__isl_keep isl_map
*map1
,
689 __isl_keep isl_map
*map2
)
692 isl_bool is_empty
= isl_bool_true
;
695 return isl_bool_error
;
697 for (i
= 0; i
< map1
->n
; ++i
) {
698 is_empty
= basic_map_diff_is_empty(map1
->p
[i
], map2
);
699 if (is_empty
< 0 || !is_empty
)
706 /* Return 1 if "bmap" contains a single element.
708 int isl_basic_map_plain_is_singleton(__isl_keep isl_basic_map
*bmap
)
716 return bmap
->n_eq
== isl_basic_map_total_dim(bmap
);
719 /* Return 1 if "map" contains a single element.
721 int isl_map_plain_is_singleton(__isl_keep isl_map
*map
)
728 return isl_basic_map_plain_is_singleton(map
->p
[0]);
731 /* Given a singleton basic map, extract the single element
734 static __isl_give isl_point
*singleton_extract_point(
735 __isl_keep isl_basic_map
*bmap
)
739 struct isl_vec
*point
;
745 dim
= isl_basic_map_total_dim(bmap
);
746 isl_assert(bmap
->ctx
, bmap
->n_eq
== dim
, return NULL
);
747 point
= isl_vec_alloc(bmap
->ctx
, 1 + dim
);
753 isl_int_set_si(point
->el
[0], 1);
754 for (j
= 0; j
< bmap
->n_eq
; ++j
) {
756 isl_assert(bmap
->ctx
,
757 isl_seq_first_non_zero(bmap
->eq
[j
] + 1, i
) == -1,
759 isl_assert(bmap
->ctx
,
760 isl_int_is_one(bmap
->eq
[j
][1 + i
]) ||
761 isl_int_is_negone(bmap
->eq
[j
][1 + i
]),
763 isl_assert(bmap
->ctx
,
764 isl_seq_first_non_zero(bmap
->eq
[j
]+1+i
+1, dim
-i
-1) == -1,
767 isl_int_gcd(m
, point
->el
[0], bmap
->eq
[j
][1 + i
]);
768 isl_int_divexact(m
, bmap
->eq
[j
][1 + i
], m
);
770 isl_seq_scale(point
->el
, point
->el
, m
, 1 + i
);
771 isl_int_divexact(m
, point
->el
[0], bmap
->eq
[j
][1 + i
]);
773 isl_int_mul(point
->el
[1 + i
], m
, bmap
->eq
[j
][0]);
777 return isl_point_alloc(isl_basic_map_get_space(bmap
), point
);
784 /* Return isl_bool_true if the singleton map "map1" is a subset of "map2",
785 * i.e., if the single element of "map1" is also an element of "map2".
786 * Assumes "map2" has known divs.
788 static isl_bool
map_is_singleton_subset(__isl_keep isl_map
*map1
,
789 __isl_keep isl_map
*map2
)
792 isl_bool is_subset
= isl_bool_false
;
793 struct isl_point
*point
;
796 return isl_bool_error
;
798 isl_die(isl_map_get_ctx(map1
), isl_error_invalid
,
799 "expecting single-disjunct input",
800 return isl_bool_error
);
802 point
= singleton_extract_point(map1
->p
[0]);
804 return isl_bool_error
;
806 for (i
= 0; i
< map2
->n
; ++i
) {
807 is_subset
= isl_basic_map_contains_point(map2
->p
[i
], point
);
812 isl_point_free(point
);
816 static isl_bool
map_is_subset(__isl_keep isl_map
*map1
,
817 __isl_keep isl_map
*map2
)
819 isl_bool is_subset
= isl_bool_false
;
824 return isl_bool_error
;
826 if (!isl_map_has_equal_space(map1
, map2
))
827 return isl_bool_false
;
829 empty
= isl_map_is_empty(map1
);
831 return isl_bool_error
;
833 return isl_bool_true
;
835 empty
= isl_map_is_empty(map2
);
837 return isl_bool_error
;
839 return isl_bool_false
;
841 rat1
= isl_map_has_rational(map1
);
842 rat2
= isl_map_has_rational(map2
);
843 if (rat1
< 0 || rat2
< 0)
844 return isl_bool_error
;
846 return isl_bool_false
;
848 if (isl_map_plain_is_universe(map2
))
849 return isl_bool_true
;
851 map2
= isl_map_compute_divs(isl_map_copy(map2
));
852 if (isl_map_plain_is_singleton(map1
)) {
853 is_subset
= map_is_singleton_subset(map1
, map2
);
857 is_subset
= map_diff_is_empty(map1
, map2
);
863 isl_bool
isl_map_is_subset(__isl_keep isl_map
*map1
, __isl_keep isl_map
*map2
)
865 return isl_map_align_params_map_map_and_test(map1
, map2
,
869 isl_bool
isl_set_is_subset(__isl_keep isl_set
*set1
, __isl_keep isl_set
*set2
)
871 return isl_map_is_subset(
872 (struct isl_map
*)set1
, (struct isl_map
*)set2
);
875 __isl_give isl_map
*isl_map_make_disjoint(__isl_take isl_map
*map
)
878 struct isl_subtract_diff_collector sdc
;
879 sdc
.dc
.add
= &basic_map_subtract_add
;
883 if (ISL_F_ISSET(map
, ISL_MAP_DISJOINT
))
888 map
= isl_map_compute_divs(map
);
889 map
= isl_map_remove_empty_parts(map
);
891 if (!map
|| map
->n
<= 1)
894 sdc
.diff
= isl_map_from_basic_map(isl_basic_map_copy(map
->p
[0]));
896 for (i
= 1; i
< map
->n
; ++i
) {
897 struct isl_basic_map
*bmap
= isl_basic_map_copy(map
->p
[i
]);
898 struct isl_map
*copy
= isl_map_copy(sdc
.diff
);
899 if (basic_map_collect_diff(bmap
, copy
, &sdc
.dc
) < 0) {
900 isl_map_free(sdc
.diff
);
911 __isl_give isl_set
*isl_set_make_disjoint(__isl_take isl_set
*set
)
913 return (struct isl_set
*)isl_map_make_disjoint((struct isl_map
*)set
);
916 __isl_give isl_map
*isl_map_complement(__isl_take isl_map
*map
)
923 universe
= isl_map_universe(isl_map_get_space(map
));
925 return isl_map_subtract(universe
, map
);
928 __isl_give isl_set
*isl_set_complement(__isl_take isl_set
*set
)
930 return isl_map_complement(set
);