1 /* $Id: pres_print.c,v 1.2 2006/05/04 08:59:31 boulet Exp $ */
3 #include <basic/bool.h>
4 #include <omega/pres_gen.h>
5 #include <omega/pres_var.h>
6 #include <omega/pres_tree.h>
7 #include <omega/pres_conj.h>
8 #include <omega/Relation.h>
10 #include <omega/omega_i.h>
11 #include <basic/Exit.h>
12 #include <omega/omega_core/oc.h>
16 ////////////////////////////////////////
18 // Print functions. //
20 ////////////////////////////////////////
22 void Conjunct::reorder_for_print(bool reverseOrder
,
24 int first_pass_output
,
28 Conjunct
*C2
= copy_conj_same_relation();
29 Variable_ID_Tuple
newpos(0),wcvars(0),gvars(0);
31 // We reorder the original Variable_ID's into the newpos list; later, we
32 // copy from their original column (using find_column) to the new one.
33 int n
= mappedVars
.size();
35 // there may be more inp/outp vars than maxVars; must do dynamically
37 Tuple
<bool> input_used(myRelation
->n_inp());
38 Tuple
<bool> output_used(myRelation
->n_out());
39 for(i
=1; i
<=myRelation
->n_inp();i
++) input_used
[i
] = false;
40 for(i
=1; i
<=myRelation
->n_out();i
++) output_used
[i
] = false;
42 if (mappedVars
[i
]->kind() == Input_Var
)
43 input_used
[mappedVars
[i
]->get_position()] = true;
44 else if (mappedVars
[i
]->kind() == Output_Var
)
45 output_used
[mappedVars
[i
]->get_position()] = true;
46 else if(mappedVars
[i
]->kind() == Global_Var
)
47 gvars
.append(mappedVars
[i
]);
52 for(i
=1; i
<=gvars
.size();i
++)
53 for(int j
=1; j
<= gvars
.size(); j
++)
54 if(gvars
[j
]->get_global_var()->base_name()
55 < gvars
[j
+1]->get_global_var()->base_name()) {
56 Variable_ID t
= gvars
[j
]; gvars
[j
] = gvars
[j
+1]; gvars
[j
+1] = t
;
62 for(i
=1; i
<=min(myRelation
->n_inp(),first_pass_input
);i
++)
63 if (input_used
[i
]) newpos
.append(input_vars
[i
]);
64 for(i
=1; i
<=min(myRelation
->n_out(),first_pass_output
);i
++)
65 if (output_used
[i
]) newpos
.append(output_vars
[i
]);
66 for(i
=max(1,first_pass_input
+1); i
<=myRelation
->n_inp();i
++)
67 if (input_used
[i
]) newpos
.append(input_vars
[i
]);
68 for(i
=max(1,first_pass_output
+1); i
<=myRelation
->n_out();i
++)
69 if (output_used
[i
]) newpos
.append(output_vars
[i
]);
72 for(i
=1; i
<=min(myRelation
->n_out(),first_pass_output
);i
++)
73 if (output_used
[i
]) newpos
.append(output_vars
[i
]);
74 for(i
=1; i
<=min(myRelation
->n_inp(),first_pass_input
);i
++)
75 if (input_used
[i
]) newpos
.append(input_vars
[i
]);
76 for(i
=max(1,first_pass_output
+1); i
<=myRelation
->n_out();i
++)
77 if (output_used
[i
]) newpos
.append(output_vars
[i
]);
78 for(i
=max(1,first_pass_input
+1); i
<=myRelation
->n_inp();i
++)
79 if (input_used
[i
]) newpos
.append(input_vars
[i
]);
84 if (mappedVars
[i
]->kind() == Wildcard_Var
)
85 wcvars
.append(mappedVars
[i
]);
88 for(i
=1; i
<=gvars
.size();i
++)
89 for(int j
=1; j
<= gvars
.size(); j
++)
90 if(gvars
[j
]->name() < gvars
[j
+1]->name()) {
91 Variable_ID t
= gvars
[j
]; gvars
[j
] = gvars
[j
+1]; gvars
[j
+1] = t
;
96 assert(problem
->nVars
== newpos
.size()); // i.e. no other variable types
98 // Copy coef columns into new order. Constant column is unchanged.
99 for(int e
=0; e
<problem
->nGEQs
; e
++) problem
->GEQs
[e
].touched
= 1;
101 for(i
=1; i
<=problem
->nVars
; i
++) {
102 int col
= find_column(newpos
[i
]); // Find column in original conj.
104 copy_column(problem
, i
, // Copy it from orig. column in the copy.
105 C2
->problem
, col
, 0, 0);
108 for(i
=1; i
<=problem
->nVars
; i
++)
109 problem
->forwardingAddress
[i
] = i
;
116 void Rel_Body::print_with_subs(FILE *output_file
, bool printSym
, bool newline
)
118 String s
= this->print_with_subs_to_string(printSym
, newline
);
119 fprintf(output_file
, (const char *) s
);
122 void Rel_Body::print_with_subs()
124 this->print_with_subs(stdout
, 0, 1);
128 String
tryToPrintVarToStringWithDiv(Conjunct
*C
, Variable_ID v
) {
131 // This assumes that there is one EQ involving v, that v cannot be
132 // substituted and hence has a non-unit coefficient.
133 for(EQ_Iterator
e(C
); e
; e
++) {
134 if ((*e
).get_coef(v
) != 0) {
135 assert(!seen
); // This asserts just one EQ with v
136 coef_t v_coef
= (*e
).get_coef(v
);
137 int v_sign
= v_coef
> 0 ? 1 : -1;
139 int sign_adj
= -v_sign
;
143 for(Constr_Vars_Iter
i(*e
,false); i
; i
++) {
144 if ((*i
).var
!= v
&& (*i
).coef
!= 0) {
145 coef_t this_coef
= sign_adj
*(*i
).coef
;
146 if(!first
&& this_coef
> 0)
149 s
+= (*i
).var
->name();
150 else if (this_coef
== -1)
152 s
+= "-"; s
+= (*i
).var
->name();
156 s
+= itoS(this_coef
) + "*" + (*i
).var
->name();
161 coef_t the_const
= (*e
).get_const()* sign_adj
;
162 if (the_const
> 0 && !first
)
165 s
+= itoS(the_const
);
166 s
+= "," + itoS(v_coef
) + ")";
174 // This function prints the output tuple of a relation with each one as a
175 // function of the input variables.
176 // This will fail or look goofy if the outputs are not affine functions of
178 // BIG WARNING: Call this only from the codegen stuff, since it assumes things
179 // about coefficients
180 String
Rel_Body::print_outputs_with_subs_to_string()
182 Rel_Body
S(this),Q(this);
184 Conjunct
*C
= S
.single_conjunct();
185 Conjunct
*D
= Q
.single_conjunct(); // ordered_elimination futzes with conj
187 C
->reorder_for_print();
188 C
->ordered_elimination(S
.global_decls()->length());
189 // Print output names with substitutions in them
190 for(int i
=1; i
<=S
.n_out(); i
++) {
192 int col
= C
->find_column(output_vars
[i
]);
194 t
= C
->print_sub_to_string(col
);
195 if (col
== 0 || t
== output_vars
[i
]->name()) // no sub found
196 // Assume you can't get a unit coefficient on v, must use div
197 t
= tryToPrintVarToStringWithDiv(D
,output_vars
[i
]);
199 if (i
< S
.n_out()) s
+= ",";
205 String
Rel_Body::print_outputs_with_subs_to_string(int i
)
207 Rel_Body
S(this),Q(this);
209 Conjunct
*C
= S
.single_conjunct();
210 Conjunct
*D
= Q
.single_conjunct(); // ordered_elimination futzes with conj
212 C
->reorder_for_print();
213 C
->ordered_elimination(S
.global_decls()->length());
214 // Print output names with substitutions in them
217 int col
= C
->find_column(output_vars
[i
]);
219 t
= C
->print_sub_to_string(col
);
220 if (col
== 0 || t
== output_vars
[i
]->name()) // no sub found?
221 t
= tryToPrintVarToStringWithDiv(D
,output_vars
[i
]);
222 // should check for failure
228 String
Rel_Body::print_with_subs_to_string(bool printSym
, bool newline
)
233 fprintf(DebugFile
,"print_with_subs_to_string:\n");
234 prefix_print(DebugFile
);
237 int anythingPrinted
= 0;
241 s
= "NULL Rel_Body\n";
246 bool firstRelation
= true;
248 for(DNF_Iterator
DI(R
.query_DNF()); DI
.live(); DI
.next()) {
250 Rel_Body
S(&R
, DI
.curr());
251 Conjunct
*C
= S
.single_conjunct();
252 if(!simplify_conj(C
, true, 4, black
)) continue;
259 if (newline
) s
+= "\n ";
262 firstRelation
= false;
266 C
->reorder_for_print(false,C
->max_ufs_arity_of_in(),
267 C
->max_ufs_arity_of_out());
268 C
->ordered_elimination(S
.Symbolic
.length()
269 +C
->max_ufs_arity_of_in()
270 +C
->max_ufs_arity_of_out());
271 // assert(C->problem->variablesInitialized);
273 if (pres_debug
) S
.prefix_print(DebugFile
);
275 /* Do actual printing of Conjunct C as a relation */
278 if (!Symbolic
.empty())
280 if (printSym
) s
+= "Sym=[";
281 for (Variable_ID_Iterator Sym_I
= S
.Symbolic
; Sym_I
;)
284 s
+= (*Sym_I
)->name();
286 if (printSym
&& Sym_I
) s
+= ",";
288 if (printSym
) s
+= "] ";
293 if (S
.number_input
!= 0) {
295 // Print input names with substitutions in them
296 for(i
=1; i
<=S
.number_input
; i
++) {
297 col
= C
->find_column(input_vars
[i
]);
299 s
+= C
->problem
->print_sub_to_string(col
);
301 s
+= input_vars
[i
]->name();
302 if (i
<S
.number_input
) s
+= ",";
310 if (S
.number_output
!= 0)
314 // Print output names with substitutions in them
315 for(i
=1; i
<=S
.number_output
; i
++) {
316 col
= C
->find_column(output_vars
[i
]);
318 s
+= C
->problem
->print_sub_to_string(col
);
320 s
+= output_vars
[i
]->name();
321 if (i
< S
.number_output
) s
+= ",";
328 if (S
.number_input
!= 0 || S
.number_output
!= 0)
335 // Empty conj means TRUE, so don't print colon
336 if (C
->problem
->nEQs
!= 0 || C
->problem
->nGEQs
!= 0) {
337 C
->problem
->clearSubs();
338 if (S
.number_input
!= 0 || S
.number_output
!= 0)
341 s
+= C
->print_to_string(false);
345 if (S
.number_input
== 0 && S
.number_output
== 0)
353 if (!anythingPrinted
)
357 s
+= R
.print_variables_to_string(printSym
);
358 if (R
.number_input
!= 0 || R
.number_output
!= 0)
361 if (newline
) s
+= "\n";
365 if (newline
) s
+= "\n";
370 void print_var_addrs(String
&s
, Variable_ID v
) {
373 sprintf(ss
, "(%p,%p)", v
, v
->remap
);
378 String
Rel_Body::print_variables_to_string(bool printSym
)
382 if (! Symbolic
.empty())
384 if (printSym
) s
+= " Sym=[";
385 for (Variable_ID_Iterator
Sym_I(Symbolic
); Sym_I
; )
387 if (printSym
) s
+= (*Sym_I
)->name();
388 print_var_addrs(s
, *Sym_I
);
390 if (printSym
&& Sym_I
) s
+= ",";
392 if (printSym
) s
+= "] ";
398 for (i
=1;i
<=number_input
;i
++) {
399 s
+= input_vars
[i
]->name();
400 print_var_addrs(s
, input_vars
[i
]);
401 if(i
< number_input
) s
+= ",";
409 for (i
=1;i
<=number_output
;i
++) {
410 s
+= output_vars
[i
]->name();
411 print_var_addrs(s
, output_vars
[i
]);
412 if(i
< number_output
) s
+= ",";
421 int F_Declaration::priority() {
424 int Formula::priority () {
428 int F_Or::priority() {
431 int F_And::priority() {
434 int Conjunct::priority() {
438 int F_Not::priority() {
446 void Formula::print(FILE *output_file
)
448 if(myChildren
.empty())
450 if(node_type()==Op_Relation
|| node_type()==Op_Or
)
451 fprintf(output_file
, "FALSE");
452 else if(node_type()==Op_And
)
453 fprintf(output_file
, "TRUE");
460 for(List_Iterator
<Formula
*> c(myChildren
); c
;)
462 if (node_type() == Op_Exists
|| node_type() == Op_Forall
463 || (*c
)->priority() < priority())
464 fprintf(output_file
, "( ");
465 (*c
)->print(output_file
);
466 if (node_type() == Op_Exists
|| node_type() == Op_Forall
467 || (*c
)->priority() < priority())
468 fprintf(output_file
, " )");
471 print_separator(output_file
);
475 String
Rel_Body::print_formula_to_string() {
478 for(DNF_Iterator
DI(query_DNF()); DI
.live();) {
480 s
+= (*DI
)->print_to_string(1);
482 if (DI
.live()) s
+= " && ";
483 if (pres_debug
) fprintf(DebugFile
,"Partial print to string: %s\n",
489 void Rel_Body::print(FILE *output_file
, bool printSym
) {
490 if (this->is_null()) {
491 fprintf(output_file
, "NULL Rel_Body\n");
497 fprintf(output_file
, "{");
499 String s
= print_variables_to_string(printSym
);
500 fprintf(output_file
, (const char *) s
);
502 if(simplified_DNF
==NULL
) {
503 Formula::print(output_file
);
505 assert(children().empty());
506 simplified_DNF
->print(output_file
);
509 fprintf(output_file
, " }\n");
512 void Rel_Body::print() {
516 void F_Not::print(FILE *output_file
) {
517 fprintf(output_file
, " not ");
518 Formula::print(output_file
);
521 void F_And::print_separator(FILE *output_file
) {
522 fprintf(output_file
, " and ");
525 void Conjunct::print(FILE *output_file
) {
526 String s
= print_to_string(true);
527 fprintf(output_file
, (const char *) s
);
530 String
Conjunct::print_to_string(int true_printed
) {
533 int num
= myLocals
.size();
537 for (i
= 1; i
<= num
; i
++) {
538 Variable_ID v
= myLocals
[i
];
540 if(i
< num
) s
+= ",";
542 if (true_printed
|| !(is_true())) s
+= " : ";
546 s
+= true_printed
? "TRUE" : "";
551 s
+= problem
->prettyPrintProblemToString();
562 void F_Or::print_separator(FILE *output_file
) {
563 fprintf(output_file
, " or ");
566 void F_Declaration::print(FILE *output_file
) {
568 for(Variable_ID_Iterator
VI(myLocals
); VI
; ) {
573 fprintf(output_file
, "( %s : ", (const char *) s
);
574 Formula::print(output_file
);
575 fprintf(output_file
, ")");
578 void F_Forall::print(FILE *output_file
) {
579 fprintf(output_file
, "forall ");
580 F_Declaration::print(output_file
);
583 void F_Exists::print(FILE *output_file
) {
584 fprintf(output_file
, "exists ");
585 F_Declaration::print(output_file
);
588 void Formula::print_separator(FILE *) {
589 assert(0); // should never be called, it's only for derived classes
593 // Setup names in formula.
596 typedef Set
<Global_Var_ID
> g_set
;
597 void Rel_Body::setup_names() {
601 if (use_ugly_names
) return;
604 fprintf(DebugFile
,"Setting up names for 0x%p\n", this);
606 for(i
=1; i
<=number_input
; i
++) {
607 input_vars
[i
]->base_name
= In_Names
[i
];
609 for(i
=1; i
<=number_output
; i
++) {
610 output_vars
[i
]->base_name
= Out_Names
[i
];
615 wildCardInstanceNumber
= 0;
617 for(i
=1; i
<= Symbolic
.size(); i
++) {
618 gbls
.insert(Symbolic
[i
]->get_global_var());
621 foreach(g
,Global_Var_ID
,gbls
,
622 g
->instance
= g
->base_name()++);
624 for(i
=1; i
<=number_input
; i
++) {
625 if (!input_vars
[i
]->base_name
.null())
626 input_vars
[i
]->instance
= input_vars
[i
]->base_name
++;
628 for(i
=1; i
<=number_output
; i
++) {
629 if (!output_vars
[i
]->base_name
.null())
630 output_vars
[i
]->instance
= output_vars
[i
]->base_name
++;
633 if (simplified_DNF
!= NULL
) // It is simplified
634 simplified_DNF
->setup_names();
635 else // not simplified
636 Formula::setup_names();
638 for(i
=1; i
<=number_output
; i
++) {
639 if (!output_vars
[i
]->base_name
.null())
640 output_vars
[i
]->base_name
--;
642 for(i
=1; i
<=number_input
; i
++) {
643 if (!input_vars
[i
]->base_name
.null())
644 input_vars
[i
]->base_name
--;
646 foreach(g
,Global_Var_ID
,gbls
, g
->base_name()--);
649 void Formula::setup_names()
652 fprintf(DebugFile
,"Setting up names for formula 0x%p\n", this);
654 for(List_Iterator
<Formula
*> c(myChildren
); c
; c
++)
658 void DNF::setup_names()
661 fprintf(DebugFile
,"Setting up names for DNF 0x%p\n", this);
663 for(DNF_Iterator
DI(this); DI
.live(); DI
.next())
664 DI
.curr()->setup_names();
668 void F_Declaration::setup_names() {
670 fprintf(DebugFile
,"Setting up names for Declaration 0x%p\n", this);
672 // Allow re-use of wc names in other scopes
673 int savedWildCardInstanceNumber
= wildCardInstanceNumber
;
675 for(Tuple_Iterator
<Variable_ID
> VI(myLocals
); VI
; VI
++) {
677 if (!v
->base_name
.null()) v
->instance
= v
->base_name
++;
678 else v
->instance
= wildCardInstanceNumber
++;
681 for(List_Iterator
<Formula
*> c(children()); c
; c
++)
684 for(Tuple_Iterator
<Variable_ID
> VI2(myLocals
); VI2
; VI2
++) {
685 Variable_ID v
= *VI2
;
686 if (!v
->base_name
.null()) v
->base_name
--;
688 wildCardInstanceNumber
= savedWildCardInstanceNumber
;
693 // Prefix_print functions.
694 // Print Formula Tree, used in debugging.
696 static int level
= 0;
698 void Formula::prefix_print(FILE *output_file
, int debug
)
700 for(List_Iterator
<Formula
*> c(children()); c
; c
++)
701 (*c
)->prefix_print(output_file
, debug
);
706 void Rel_Body::prefix_print() {
707 this->prefix_print(stdout
, 1);
710 void Rel_Body::prefix_print(FILE *output_file
, int debug
) {
711 int old_use_ugly_names
= use_ugly_names
;
717 if(pres_debug
>=2) fprintf(output_file
, "(@%p)", this);
718 fprintf(output_file
, is_set() ? "SET: " : "RELATION: ");
719 String s
= print_variables_to_string(true);
720 fprintf(output_file
, "%s\n", (const char *) s
);
722 if(simplified_DNF
==NULL
) {
723 Formula::prefix_print(output_file
, debug
);
725 assert(children().empty());
726 simplified_DNF
->prefix_print(output_file
, debug
,true);
728 fprintf(output_file
, "\n");
729 use_ugly_names
= old_use_ugly_names
;
733 void F_Forall::prefix_print(FILE *output_file
, int debug
) {
734 Formula::print_head(output_file
);
735 fprintf(output_file
, "FORALL [");
736 F_Declaration::prefix_print(output_file
, debug
);
737 for (Variable_ID_Iterator
VI(myLocals
); VI
; VI
++)
738 assert((*VI
)->kind() == Forall_Var
);
742 void F_Exists::prefix_print(FILE *output_file
, int debug
) {
743 Formula::print_head(output_file
);
744 if(pres_debug
>=2) fprintf(output_file
, "(@%p)", this);
745 fprintf(output_file
, "EXISTS [");
746 F_Declaration::prefix_print(output_file
, debug
);
747 for (Variable_ID_Iterator
VI(myLocals
); VI
; VI
++)
748 assert((*VI
)->kind() == Exists_Var
);
751 void F_Declaration::prefix_print(FILE *output_file
, int debug
) {
753 for (Variable_ID_Iterator
VI(myLocals
); VI
; ) {
755 print_var_addrs(s
, *VI
);
760 fprintf(output_file
, (const char *) s
);
761 Formula::prefix_print(output_file
, debug
);
764 void F_Or::prefix_print(FILE *output_file
, int debug
) {
765 Formula::print_head(output_file
);
766 fprintf(output_file
, "OR\n");
767 Formula::prefix_print(output_file
, debug
);
770 void F_And::prefix_print(FILE *output_file
, int debug
) {
771 Formula::print_head(output_file
);
772 fprintf(output_file
, "AND\n");
773 Formula::prefix_print(output_file
, debug
);
776 void F_Not::prefix_print(FILE *output_file
, int debug
) {
777 Formula::print_head(output_file
);
778 fprintf(output_file
, "NOT\n");
779 Formula::prefix_print(output_file
, debug
);
782 void Conjunct::prefix_print(FILE *output_file
, int debug
) {
783 static char dir_glyphs
[] = { '-', '?', '+' };
787 Formula::print_head(output_file
);
788 if(pres_debug
>=2) fprintf(output_file
, "(@%p)", this);
789 fprintf(output_file
, "%s CONJUNCT, ",
790 exact
? "EXACT" : "INEXACT");
791 if (simplified
) fprintf(output_file
, "simplified, ");
792 if (verified
) fprintf(output_file
, "verified, ");
793 if (possible_leading_0s
!= -1 && guaranteed_leading_0s
!= -1)
794 assert (guaranteed_leading_0s
<= possible_leading_0s
);
795 if (guaranteed_leading_0s
!= -1
796 && guaranteed_leading_0s
== possible_leading_0s
)
797 fprintf(output_file
,"# leading 0's = %d,", possible_leading_0s
);
798 else if (possible_leading_0s
!= -1 || guaranteed_leading_0s
!= -1) {
799 if (guaranteed_leading_0s
!= -1)
800 fprintf(output_file
,"%d <= ",guaranteed_leading_0s
);
801 fprintf(output_file
,"#O's");
802 if (possible_leading_0s
!= -1)
803 fprintf(output_file
," <= %d",possible_leading_0s
);
804 fprintf(output_file
,", ");
806 if (dir_glyphs
[leading_dir
+1] != '?')
807 fprintf(output_file
," first = %c, ", dir_glyphs
[leading_dir
+1]);
808 fprintf(output_file
,"myLocals=[");
810 for (Variable_ID_Iterator
VI(myLocals
); VI
; ) {
811 assert( (*VI
)->kind() == Wildcard_Var
);
813 print_var_addrs(s
, *VI
);
817 s
+= "] mappedVars=[";
818 for(Variable_ID_Iterator
MVI(mappedVars
); MVI
; ) {
820 print_var_addrs(s
, *MVI
);
824 fprintf(output_file
, "%s]\n", (const char *) s
);
829 setOutputFile(output_file
);
830 setPrintLevel(level
+1);
831 problem
->printProblem(debug
);
833 Formula::prefix_print(output_file
, debug
);
836 void Formula::print_head(FILE *output_file
) {
839 for(i
=0; i
<level
; i
++) {
840 fprintf(output_file
, ". ");
847 void DNF::print(FILE *out_file
) {
848 DNF_Iterator
p(this);
850 fprintf(out_file
, "FALSE");
853 p
.curr()->print(out_file
);
856 fprintf(out_file
, " OR ");
860 void DNF::prefix_print(FILE *out_file
, int debug
, bool parent_names_setup
) {
862 wildCardInstanceNumber
= 0;
863 Variable_ID_Tuple all_vars
;
864 if(!use_ugly_names
&& !parent_names_setup
) {
865 // We need to manually set up all of the input,output, and symbolic
866 // variables, since during simplification, a dnf's conjuncts may not
867 // be listed as part of a relation, or perhaps as part of different
868 // relations (?) (grr).
869 for(DNF_Iterator
p0(this); p0
.live(); p0
.next()) {
870 for(Variable_Iterator
vi((*p0
)->mappedVars
); vi
; vi
++)
871 if((*vi
)->kind() != Wildcard_Var
&& all_vars
.index(*vi
) == 0)
872 all_vars
.append(*vi
);
873 (*p0
)->setup_names();
875 foreach(v
,Variable_ID
,all_vars
,
876 if (!v
->base_name
.null()) v
->instance
= v
->base_name
++;
877 else v
->instance
= wildCardInstanceNumber
++;
883 for(DNF_Iterator
p(this); p
.live(); p
.next(), i
++) {
884 fprintf(out_file
, "#%d ", i
);
886 fprintf(out_file
, "(NULL)\n");
888 (*p
)->prefix_print(out_file
, debug
);
891 foreach(v
,Variable_ID
,all_vars
,if (!v
->base_name
.null()) v
->base_name
--);
893 fprintf(out_file
, "\n");
896 String
Constraint_Handle::print_to_string() const {
902 String
EQ_Handle::print_to_string() const {
903 relation()->setup_names();
904 String s
= c
->print_EQ_to_string(e
);
908 String
GEQ_Handle::print_to_string() const {
909 relation()->setup_names();
910 String s
= c
->print_GEQ_to_string(e
);
914 String
Constraint_Handle::print_term_to_string() const {
920 String
EQ_Handle::print_term_to_string() const {
921 relation()->setup_names();
922 String s
= c
->print_EQ_term_to_string(e
);
926 String
GEQ_Handle::print_term_to_string() const {
927 relation()->setup_names();
928 String s
= c
->print_GEQ_term_to_string(e
);