add generic isl_obj
[isl.git] / isl_output.c
blob4a3d8387360f1bde4cf50c9f3fe9f17e6c5eed27
1 /*
2 * Copyright 2008-2009 Katholieke Universiteit Leuven
3 * Copyright 2010 INRIA Saclay
5 * Use of this software is governed by the GNU LGPLv2.1 license
7 * Written by Sven Verdoolaege, K.U.Leuven, Departement
8 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
9 * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite,
10 * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France
13 #include <string.h>
14 #include <isl_set.h>
15 #include <isl_seq.h>
16 #include <isl_polynomial_private.h>
18 static void print_constraint_polylib(struct isl_basic_map *bmap,
19 int ineq, int n,
20 FILE *out, int indent, const char *prefix, const char *suffix)
22 int i;
23 unsigned n_in = isl_basic_map_dim(bmap, isl_dim_in);
24 unsigned n_out = isl_basic_map_dim(bmap, isl_dim_out);
25 unsigned nparam = isl_basic_map_dim(bmap, isl_dim_param);
26 isl_int *c = ineq ? bmap->ineq[n] : bmap->eq[n];
28 fprintf(out, "%*s%s", indent, "", prefix ? prefix : "");
29 fprintf(out, "%d", ineq);
30 for (i = 0; i < n_out; ++i) {
31 fprintf(out, " ");
32 isl_int_print(out, c[1+nparam+n_in+i], 5);
34 for (i = 0; i < n_in; ++i) {
35 fprintf(out, " ");
36 isl_int_print(out, c[1+nparam+i], 5);
38 for (i = 0; i < bmap->n_div; ++i) {
39 fprintf(out, " ");
40 isl_int_print(out, c[1+nparam+n_in+n_out+i], 5);
42 for (i = 0; i < nparam; ++i) {
43 fprintf(out, " ");
44 isl_int_print(out, c[1+i], 5);
46 fprintf(out, " ");
47 isl_int_print(out, c[0], 5);
48 fprintf(out, "%s\n", suffix ? suffix : "");
51 static void print_constraints_polylib(struct isl_basic_map *bmap,
52 FILE *out, int indent, const char *prefix, const char *suffix)
54 int i;
56 for (i = 0; i < bmap->n_eq; ++i)
57 print_constraint_polylib(bmap, 0, i, out,
58 indent, prefix, suffix);
59 for (i = 0; i < bmap->n_ineq; ++i)
60 print_constraint_polylib(bmap, 1, i, out,
61 indent, prefix, suffix);
64 static void bset_print_constraints_polylib(struct isl_basic_set *bset,
65 FILE *out, int indent, const char *prefix, const char *suffix)
67 print_constraints_polylib((struct isl_basic_map *)bset,
68 out, indent, prefix, suffix);
71 static void isl_basic_map_print_polylib(struct isl_basic_map *bmap, FILE *out,
72 int indent, const char *prefix, const char *suffix)
74 unsigned total = isl_basic_map_total_dim(bmap);
75 fprintf(out, "%*s%s", indent, "", prefix ? prefix : "");
76 fprintf(out, "%d %d", bmap->n_eq + bmap->n_ineq, 1 + total + 1);
77 fprintf(out, "%s\n", suffix ? suffix : "");
78 print_constraints_polylib(bmap, out, indent, prefix, suffix);
81 static void isl_basic_set_print_polylib(struct isl_basic_set *bset, FILE *out,
82 int indent, const char *prefix, const char *suffix)
84 isl_basic_map_print_polylib((struct isl_basic_map *)bset, out,
85 indent, prefix, suffix);
88 static void isl_map_print_polylib(struct isl_map *map, FILE *out, int indent)
90 int i;
92 fprintf(out, "%*s", indent, "");
93 fprintf(out, "%d\n", map->n);
94 for (i = 0; i < map->n; ++i) {
95 fprintf(out, "\n");
96 isl_basic_map_print_polylib(map->p[i], out, indent, NULL, NULL);
100 static void isl_set_print_polylib(struct isl_set *set, FILE *out, int indent)
102 isl_map_print_polylib((struct isl_map *)set, out, indent);
105 static int count_same_name(__isl_keep isl_dim *dim,
106 enum isl_dim_type type, unsigned pos, const char *name)
108 enum isl_dim_type t;
109 unsigned p, s;
110 int count = 0;
112 for (t = isl_dim_param; t <= type && t <= isl_dim_out; ++t) {
113 s = t == type ? pos : isl_dim_size(dim, t);
114 for (p = 0; p < s; ++p) {
115 const char *n = isl_dim_get_name(dim, t, p);
116 if (n && !strcmp(n, name))
117 count++;
120 return count;
123 static void print_name(struct isl_dim *dim, FILE *out,
124 enum isl_dim_type type, unsigned pos, int set)
126 const char *name;
127 char buffer[20];
128 int primes;
130 name = type == isl_dim_div ? NULL : isl_dim_get_name(dim, type, pos);
132 if (!name) {
133 const char *prefix;
134 if (type == isl_dim_param)
135 prefix = "p";
136 else if (type == isl_dim_div)
137 prefix = "e";
138 else if (set || type == isl_dim_in)
139 prefix = "i";
140 else
141 prefix = "o";
142 snprintf(buffer, sizeof(buffer), "%s%d", prefix, pos);
143 name = buffer;
145 primes = count_same_name(dim, name == buffer ? isl_dim_div : type,
146 pos, name);
147 fprintf(out, "%s", name);
148 while (primes-- > 0)
149 fputc('\'', out);
152 static void print_var_list(struct isl_dim *dim, FILE *out,
153 enum isl_dim_type type, int set)
155 int i;
157 for (i = 0; i < isl_dim_size(dim, type); ++i) {
158 if (i)
159 fprintf(out, ", ");
160 print_name(dim, out, type, i, set);
164 static void print_tuple(__isl_keep isl_dim *dim, FILE *out,
165 enum isl_dim_type type, int set)
167 fprintf(out, "[");
168 print_var_list(dim, out, type, set);
169 fprintf(out, "]");
172 static void print_omega_parameters(struct isl_dim *dim, FILE *out,
173 int indent, const char *prefix, const char *suffix)
175 if (isl_dim_size(dim, isl_dim_param) == 0)
176 return;
178 fprintf(out, "%*s%ssymbolic ", indent, "", prefix ? prefix : "");
179 print_var_list(dim, out, isl_dim_param, 0);
180 fprintf(out, ";%s\n", suffix ? suffix : "");
183 static void print_term(__isl_keep isl_dim *dim,
184 isl_int c, int pos, FILE *out, int set)
186 enum isl_dim_type type;
187 unsigned n_in = isl_dim_size(dim, isl_dim_in);
188 unsigned n_out = isl_dim_size(dim, isl_dim_out);
189 unsigned nparam = isl_dim_size(dim, isl_dim_param);
191 if (pos == 0) {
192 isl_int_print(out, c, 0);
193 return;
196 if (isl_int_is_one(c))
198 else if (isl_int_is_negone(c))
199 fprintf(out, "-");
200 else
201 isl_int_print(out, c, 0);
202 if (pos < 1 + nparam) {
203 type = isl_dim_param;
204 pos -= 1;
205 } else if (pos < 1 + nparam + n_in) {
206 type = isl_dim_in;
207 pos -= 1 + nparam;
208 } else if (pos < 1 + nparam + n_in + n_out) {
209 type = isl_dim_out;
210 pos -= 1 + nparam + n_in;
211 } else {
212 type = isl_dim_div;
213 pos -= 1 + nparam + n_in + n_out;
215 print_name(dim, out, type, pos, set);
218 static void print_affine_of_len(__isl_keep isl_dim *dim, FILE *out,
219 isl_int *c, int len, int set)
221 int i;
222 int first;
224 for (i = 0, first = 1; i < len; ++i) {
225 int flip = 0;
226 if (isl_int_is_zero(c[i]))
227 continue;
228 if (!first) {
229 if (isl_int_is_neg(c[i])) {
230 flip = 1;
231 isl_int_neg(c[i], c[i]);
232 fprintf(out, " - ");
233 } else
234 fprintf(out, " + ");
236 first = 0;
237 print_term(dim, c[i], i, out, set);
238 if (flip)
239 isl_int_neg(c[i], c[i]);
241 if (first)
242 fprintf(out, "0");
245 static void print_affine(__isl_keep isl_basic_map *bmap,
246 __isl_keep isl_dim *dim, FILE *out, isl_int *c, int set)
248 unsigned len = 1 + isl_basic_map_total_dim(bmap);
249 print_affine_of_len(dim, out, c, len, set);
252 static void print_constraint(struct isl_basic_map *bmap,
253 __isl_keep isl_dim *dim, FILE *out,
254 isl_int *c, int last, const char *op, int first_constraint, int set)
256 if (!first_constraint)
257 fprintf(out, " and ");
259 isl_int_abs(c[last], c[last]);
261 print_term(dim, c[last], last, out, set);
263 fprintf(out, " %s ", op);
265 isl_int_set_si(c[last], 0);
266 print_affine(bmap, dim, out, c, set);
269 static void print_constraints(__isl_keep isl_basic_map *bmap,
270 __isl_keep isl_dim *dim, FILE *out, int set)
272 int i;
273 struct isl_vec *c;
274 unsigned total = isl_basic_map_total_dim(bmap);
276 c = isl_vec_alloc(bmap->ctx, 1 + total);
277 if (!c)
278 return;
280 for (i = bmap->n_eq - 1; i >= 0; --i) {
281 int l = isl_seq_last_non_zero(bmap->eq[i], 1 + total);
282 isl_assert(bmap->ctx, l >= 0, return);
283 if (isl_int_is_neg(bmap->eq[i][l]))
284 isl_seq_cpy(c->el, bmap->eq[i], 1 + total);
285 else
286 isl_seq_neg(c->el, bmap->eq[i], 1 + total);
287 print_constraint(bmap, dim, out, c->el, l,
288 "=", i == bmap->n_eq - 1, set);
290 for (i = 0; i < bmap->n_ineq; ++i) {
291 int l = isl_seq_last_non_zero(bmap->ineq[i], 1 + total);
292 int s;
293 isl_assert(bmap->ctx, l >= 0, return);
294 s = isl_int_sgn(bmap->ineq[i][l]);
295 if (s < 0)
296 isl_seq_cpy(c->el, bmap->ineq[i], 1 + total);
297 else
298 isl_seq_neg(c->el, bmap->ineq[i], 1 + total);
299 print_constraint(bmap, dim, out, c->el, l,
300 s < 0 ? "<=" : ">=", !bmap->n_eq && !i, set);
303 isl_vec_free(c);
306 static void print_omega_constraints(__isl_keep isl_basic_map *bmap, FILE *out,
307 int set)
309 if (bmap->n_eq + bmap->n_ineq == 0)
310 return;
312 fprintf(out, ": ");
313 if (bmap->n_div > 0) {
314 int i;
315 fprintf(out, "exists (");
316 for (i = 0; i < bmap->n_div; ++i) {
317 if (i)
318 fprintf(out, ", ");
319 print_name(bmap->dim, out, isl_dim_div, i, 0);
321 fprintf(out, ": ");
323 print_constraints(bmap, bmap->dim, out, set);
324 if (bmap->n_div > 0)
325 fprintf(out, ")");
328 static void basic_map_print_omega(struct isl_basic_map *bmap, FILE *out)
330 fprintf(out, "{ [");
331 print_var_list(bmap->dim, out, isl_dim_in, 0);
332 fprintf(out, "] -> [");
333 print_var_list(bmap->dim, out, isl_dim_out, 0);
334 fprintf(out, "] ");
335 print_omega_constraints(bmap, out, 0);
336 fprintf(out, " }");
339 static void isl_basic_map_print_omega(struct isl_basic_map *bmap, FILE *out,
340 int indent, const char *prefix, const char *suffix)
342 print_omega_parameters(bmap->dim, out, indent, prefix, suffix);
344 fprintf(out, "%*s%s", indent, "", prefix ? prefix : "");
345 basic_map_print_omega(bmap, out);
346 fprintf(out, "%s\n", suffix ? suffix : "");
349 static void basic_set_print_omega(struct isl_basic_set *bset, FILE *out)
351 fprintf(out, "{ [");
352 print_var_list(bset->dim, out, isl_dim_set, 1);
353 fprintf(out, "] ");
354 print_omega_constraints((isl_basic_map *)bset, out, 1);
355 fprintf(out, " }");
358 static void isl_basic_set_print_omega(struct isl_basic_set *bset, FILE *out,
359 int indent, const char *prefix, const char *suffix)
361 print_omega_parameters(bset->dim, out, indent, prefix, suffix);
363 fprintf(out, "%*s%s", indent, "", prefix ? prefix : "");
364 basic_set_print_omega(bset, out);
365 fprintf(out, "%s\n", suffix ? suffix : "");
368 static void isl_map_print_omega(struct isl_map *map, FILE *out, int indent)
370 int i;
372 print_omega_parameters(map->dim, out, indent, "", "");
374 fprintf(out, "%*s", indent, "");
375 for (i = 0; i < map->n; ++i) {
376 if (i)
377 fprintf(out, " union ");
378 basic_map_print_omega(map->p[i], out);
380 fprintf(out, "\n");
383 static void isl_set_print_omega(struct isl_set *set, FILE *out, int indent)
385 int i;
387 print_omega_parameters(set->dim, out, indent, "", "");
389 fprintf(out, "%*s", indent, "");
390 for (i = 0; i < set->n; ++i) {
391 if (i)
392 fprintf(out, " union ");
393 basic_set_print_omega(set->p[i], out);
395 fprintf(out, "\n");
398 static void print_disjunct(__isl_keep isl_basic_map *bmap,
399 __isl_keep isl_dim *dim, FILE *out, int set)
401 if (bmap->n_div > 0) {
402 int i;
403 fprintf(out, "exists (");
404 for (i = 0; i < bmap->n_div; ++i) {
405 if (i)
406 fprintf(out, ", ");
407 print_name(dim, out, isl_dim_div, i, 0);
408 if (isl_int_is_zero(bmap->div[i][0]))
409 continue;
410 fprintf(out, " = [(");
411 print_affine(bmap, dim, out, bmap->div[i] + 1, set);
412 fprintf(out, ")/");
413 isl_int_print(out, bmap->div[i][0], 0);
414 fprintf(out, "]");
416 fprintf(out, ": ");
419 print_constraints(bmap, dim, out, set);
421 if (bmap->n_div > 0)
422 fprintf(out, ")");
425 static void isl_basic_map_print_isl(__isl_keep isl_basic_map *bmap, FILE *out,
426 int indent, const char *prefix, const char *suffix)
428 int i;
430 fprintf(out, "%*s%s", indent, "", prefix ? prefix : "");
431 if (isl_basic_map_dim(bmap, isl_dim_param) > 0) {
432 print_tuple(bmap->dim, out, isl_dim_param, 0);
433 fprintf(out, " -> ");
435 fprintf(out, "{ ");
436 print_tuple(bmap->dim, out, isl_dim_in, 0);
437 fprintf(out, " -> ");
438 print_tuple(bmap->dim, out, isl_dim_out, 0);
439 fprintf(out, " : ");
440 print_disjunct(bmap, bmap->dim, out, 0);
441 fprintf(out, " }%s\n", suffix ? suffix : "");
444 static void isl_basic_set_print_isl(__isl_keep isl_basic_set *bset, FILE *out,
445 int indent, const char *prefix, const char *suffix)
447 int i;
449 fprintf(out, "%*s%s", indent, "", prefix ? prefix : "");
450 if (isl_basic_set_dim(bset, isl_dim_param) > 0) {
451 print_tuple(bset->dim, out, isl_dim_param, 0);
452 fprintf(out, " -> ");
454 fprintf(out, "{ ");
455 print_tuple(bset->dim, out, isl_dim_set, 1);
456 fprintf(out, " : ");
457 print_disjunct((isl_basic_map *)bset, bset->dim, out, 1);
458 fprintf(out, " }%s\n", suffix ? suffix : "");
461 static void print_disjuncts(__isl_keep isl_map *map, FILE *out, int set)
463 int i;
465 if (isl_map_fast_is_universe(map))
466 return;
468 fprintf(out, " : ");
469 if (map->n == 0)
470 fprintf(out, "1 = 0");
471 for (i = 0; i < map->n; ++i) {
472 if (i)
473 fprintf(out, " or ");
474 if (map->n > 1 && map->p[i]->n_eq + map->p[i]->n_ineq > 1)
475 fprintf(out, "(");
476 print_disjunct(map->p[i], map->dim, out, set);
477 if (map->n > 1 && map->p[i]->n_eq + map->p[i]->n_ineq > 1)
478 fprintf(out, ")");
482 static void isl_map_print_isl(__isl_keep isl_map *map, FILE *out, int indent)
484 fprintf(out, "%*s", indent, "");
485 if (isl_map_dim(map, isl_dim_param) > 0) {
486 print_tuple(map->dim, out, isl_dim_param, 0);
487 fprintf(out, " -> ");
489 fprintf(out, "{ ");
490 print_tuple(map->dim, out, isl_dim_in, 0);
491 fprintf(out, " -> ");
492 print_tuple(map->dim, out, isl_dim_out, 0);
493 print_disjuncts(map, out, 0);
494 fprintf(out, " }\n");
497 static void isl_set_print_isl(__isl_keep isl_set *set, FILE *out, int indent)
499 int i;
501 fprintf(out, "%*s", indent, "");
502 if (isl_set_dim(set, isl_dim_param) > 0) {
503 print_tuple(set->dim, out, isl_dim_param, 0);
504 fprintf(out, " -> ");
506 fprintf(out, "{ ");
507 print_tuple(set->dim, out, isl_dim_set, 1);
508 print_disjuncts((isl_map *)set, out, 1);
509 fprintf(out, " }\n");
512 void isl_basic_map_print(__isl_keep isl_basic_map *bmap, FILE *out, int indent,
513 const char *prefix, const char *suffix, unsigned output_format)
515 if (!bmap)
516 return;
517 if (output_format == ISL_FORMAT_ISL)
518 isl_basic_map_print_isl(bmap, out, indent, prefix, suffix);
519 else if (output_format == ISL_FORMAT_OMEGA)
520 isl_basic_map_print_omega(bmap, out, indent, prefix, suffix);
521 else
522 isl_assert(bmap->ctx, 0, return);
525 void isl_basic_set_print(struct isl_basic_set *bset, FILE *out, int indent,
526 const char *prefix, const char *suffix, unsigned output_format)
528 if (!bset)
529 return;
530 if (output_format == ISL_FORMAT_ISL)
531 isl_basic_set_print_isl(bset, out, indent, prefix, suffix);
532 else if (output_format == ISL_FORMAT_POLYLIB)
533 isl_basic_set_print_polylib(bset, out, indent, prefix, suffix);
534 else if (output_format == ISL_FORMAT_POLYLIB_CONSTRAINTS)
535 bset_print_constraints_polylib(bset, out, indent, prefix, suffix);
536 else if (output_format == ISL_FORMAT_OMEGA)
537 isl_basic_set_print_omega(bset, out, indent, prefix, suffix);
538 else
539 isl_assert(bset->ctx, 0, return);
542 void isl_set_print(struct isl_set *set, FILE *out, int indent,
543 unsigned output_format)
545 if (!set)
546 return;
547 if (output_format == ISL_FORMAT_ISL)
548 isl_set_print_isl(set, out, indent);
549 else if (output_format == ISL_FORMAT_POLYLIB)
550 isl_set_print_polylib(set, out, indent);
551 else if (output_format == ISL_FORMAT_OMEGA)
552 isl_set_print_omega(set, out, indent);
553 else
554 isl_assert(set->ctx, 0, return);
557 void isl_map_print(__isl_keep isl_map *map, FILE *out, int indent,
558 unsigned output_format)
560 if (!map)
561 return;
562 if (output_format == ISL_FORMAT_ISL)
563 isl_map_print_isl(map, out, indent);
564 else if (output_format == ISL_FORMAT_POLYLIB)
565 isl_map_print_polylib(map, out, indent);
566 else if (output_format == ISL_FORMAT_OMEGA)
567 isl_map_print_omega(map, out, indent);
568 else
569 isl_assert(map->ctx, 0, return);
572 static int upoly_rec_n_non_zero(__isl_keep struct isl_upoly_rec *rec)
574 int i;
575 int n;
577 for (i = 0, n = 0; i < rec->n; ++i)
578 if (!isl_upoly_is_zero(rec->p[i]))
579 ++n;
581 return n;
584 static void print_div(__isl_keep isl_dim *dim, __isl_keep isl_mat *div,
585 int pos, FILE *out)
587 fprintf(out, "[(");
588 print_affine_of_len(dim, out, div->row[pos] + 1, div->n_col - 1, 1);
589 fprintf(out, ")/");
590 isl_int_print(out, div->row[pos][0], 0);
591 fprintf(out, "]");
594 static void upoly_print_cst(__isl_keep struct isl_upoly *up, FILE *out, int first)
596 struct isl_upoly_cst *cst;
597 int neg;
599 cst = isl_upoly_as_cst(up);
600 if (!cst)
601 return;
602 neg = !first && isl_int_is_neg(cst->n);
603 if (!first)
604 fprintf(out, neg ? " - " : " + ");
605 if (neg)
606 isl_int_neg(cst->n, cst->n);
607 if (isl_int_is_zero(cst->d)) {
608 int sgn = isl_int_sgn(cst->n);
609 fprintf(out, sgn < 0 ? "-infty" : sgn == 0 ? "NaN" : "infty");
610 } else
611 isl_int_print(out, cst->n, 0);
612 if (neg)
613 isl_int_neg(cst->n, cst->n);
614 if (!isl_int_is_zero(cst->d) && !isl_int_is_one(cst->d)) {
615 fprintf(out, "/");
616 isl_int_print(out, cst->d, 0);
620 static void upoly_print(__isl_keep struct isl_upoly *up,
621 __isl_keep isl_dim *dim, __isl_keep isl_mat *div, FILE *out)
623 unsigned total;
624 int i, n, first;
625 struct isl_upoly_rec *rec;
627 if (!up || !dim || !div)
628 return;
630 if (isl_upoly_is_cst(up)) {
631 upoly_print_cst(up, out, 1);
632 return;
635 total = isl_dim_total(dim);
636 rec = isl_upoly_as_rec(up);
637 if (!rec)
638 return;
639 n = upoly_rec_n_non_zero(rec);
640 if (n > 1)
641 fprintf(out, "(");
642 for (i = 0, first = 1; i < rec->n; ++i) {
643 if (isl_upoly_is_zero(rec->p[i]))
644 continue;
645 if (isl_upoly_is_negone(rec->p[i])) {
646 if (!i)
647 fprintf(out, "-1");
648 else if (first)
649 fprintf(out, "-");
650 else
651 fprintf(out, " - ");
652 } else if (isl_upoly_is_cst(rec->p[i]) &&
653 !isl_upoly_is_one(rec->p[i]))
654 upoly_print_cst(rec->p[i], out, first);
655 else {
656 if (!first)
657 fprintf(out, " + ");
658 if (i == 0 || !isl_upoly_is_one(rec->p[i]))
659 upoly_print(rec->p[i], dim, div, out);
661 first = 0;
662 if (i == 0)
663 continue;
664 if (!isl_upoly_is_one(rec->p[i]) &&
665 !isl_upoly_is_negone(rec->p[i]))
666 fprintf(out, " * ");
667 if (rec->up.var < total)
668 print_term(dim, up->ctx->one, 1 + rec->up.var, out, 1);
669 else
670 print_div(dim, div, rec->up.var - total, out);
671 if (i == 1)
672 continue;
673 fprintf(out, "^%d", i);
675 if (n > 1)
676 fprintf(out, ")");
679 static void qpolynomial_print(__isl_keep isl_qpolynomial *qp, FILE *out)
681 if (!qp)
682 return;
683 upoly_print(qp->upoly, qp->dim, qp->div, out);
686 void isl_qpolynomial_print(__isl_keep isl_qpolynomial *qp, FILE *out,
687 unsigned output_format)
689 if (!qp)
690 return;
691 isl_assert(qp->dim->ctx, output_format == ISL_FORMAT_ISL, return);
692 qpolynomial_print(qp, out);
693 fprintf(out, "\n");
696 void isl_pw_qpolynomial_print(__isl_keep isl_pw_qpolynomial *pwqp, FILE *out,
697 unsigned output_format)
699 int i = 0;
701 if (!pwqp)
702 return;
703 isl_assert(pwqp->dim->ctx, output_format == ISL_FORMAT_ISL, return);
704 if (isl_dim_size(pwqp->dim, isl_dim_param) > 0) {
705 print_tuple(pwqp->dim, out, isl_dim_param, 0);
706 fprintf(out, " -> ");
708 fprintf(out, "{ ");
709 if (pwqp->n == 0) {
710 if (isl_dim_size(pwqp->dim, isl_dim_set) > 0) {
711 print_tuple(pwqp->dim, out, isl_dim_set, 0);
712 fprintf(out, " -> ");
714 fprintf(out, "0");
716 for (i = 0; i < pwqp->n; ++i) {
717 if (i)
718 fprintf(out, "; ");
719 if (isl_dim_size(pwqp->p[i].set->dim, isl_dim_set) > 0) {
720 print_tuple(pwqp->p[i].set->dim, out, isl_dim_set, 0);
721 fprintf(out, " -> ");
723 qpolynomial_print(pwqp->p[i].qp, out);
724 print_disjuncts((isl_map *)pwqp->p[i].set, out, 1);
726 fprintf(out, " }\n");