* inequality adjacent to an equality.
* We call the basic map that has the inequality "i" and the basic
* map that has the equality "j".
- * If "i" has any "cut" inequality, then relaxing the inequality
+ * If "i" has any "cut" (in)equality, then relaxing the inequality
* by one would not result in a basic map that contains the other
* basic map.
*/
/* j has an equality adjacent to an inequality in i */
+ if (any(eq_i, 2 * map->p[i]->n_eq, STATUS_CUT))
+ return 0;
if (any(ineq_i, map->p[i]->n_ineq, STATUS_CUT))
/* ADJ EQ CUT */
return 0;
all(ineq_j, map->p[j]->n_ineq, STATUS_VALID)) {
drop(map, i, tabs);
changed = 1;
- } else if (any(eq_i, 2 * map->p[i]->n_eq, STATUS_CUT) ||
- any(eq_j, 2 * map->p[j]->n_eq, STATUS_CUT)) {
- /* BAD CUT */
} else if (any(eq_i, 2 * map->p[i]->n_eq, STATUS_ADJ_EQ) ||
any(eq_j, 2 * map->p[j]->n_eq, STATUS_ADJ_EQ)) {
/* ADJ EQ PAIR */
any(eq_j, 2 * map->p[j]->n_eq, STATUS_ADJ_INEQ)) {
changed = check_adj_eq(map, i, j, tabs,
eq_i, ineq_i, eq_j, ineq_j);
+ } else if (any(eq_i, 2 * map->p[i]->n_eq, STATUS_CUT) ||
+ any(eq_j, 2 * map->p[j]->n_eq, STATUS_CUT)) {
+ /* BAD CUT */
} else if (any(ineq_i, map->p[i]->n_ineq, STATUS_ADJ_EQ) ||
any(ineq_j, map->p[j]->n_ineq, STATUS_ADJ_EQ)) {
/* Can't happen */
"(i1 = M and M >= 1) }", 0);
test_coalesce_set(ctx,
"{[x,y] : x,y >= 0; [x,y] : 10 <= x <= 20 and y >= -1 }", 0);
+ test_coalesce_set(ctx,
+ "{ [x, y] : (x >= 1 and y >= 1 and x <= 2 and y <= 2) or "
+ "(y = 3 and x = 1) }", 1);
}
void test_closure(struct isl_ctx *ctx)