67 #define MALLOC(s,t,f) malloc((unsigned)(s))
68 #define FREE(s,t,f) free((char *)(s))
78 static void constraint_sort(inegs,v,prtri,nb_pos,nb_neg)
81 struct prtri_struct *prtri;
92 for(ineg=inegs,ineg1=ineg->
succ;ineg!=NULL;) {
95 ineg->
succ = prtri->pos;
101 ineg->
succ = prtri->neg;
106 ineg->
succ = prtri->cnul;
111 if (ineg1!=NULL) ineg1=ineg1->
succ;
124 sc_integer_fourier_motzkin_variable_elimination(
129 struct prtri_struct rtri;
136 bool non_equivalent_projections =
false;
142 ineg_stay = (
bool*)
malloc(
sizeof(
bool)*(dim+1));
144 for (i1 =1; i1<=dim; ineg_stay[i1]=
true, i1++);
145 if (!SC_UNDEFINED_P(sc)) {
155 constraint_sort(inegs,v,&rtri,&nb_pos,&nb_neg);
161 for( posit=rtri.pos; posit!=NULL; ) {
162 bool integer_comb_p =
true;
163 non_equivalent_projections =
false;
164 for( negat=rtri.neg, i1=1; negat!=NULL; i1++) {
166 ineg = sc_integer_inequalities_combination_ofl_ctrl
167 (sci, posit, negat, v, &integer_comb_p,
OFL_CTRL);
168 ineg_stay[i1] = ineg_stay[i1] && integer_comb_p;
169 if(!integer_comb_p) non_equivalent_projections =
true;
192 if(!integer_comb_p) {
197 ineg->
succ = rtri.cnul;
201 if (negat) negat = negat->
succ;
204 if (non_equivalent_projections) {
206 posit1->
succ=rtri.cnul;
210 if (posit) posit = posit->
succ;
213 for( negat=rtri.neg, i1=1; negat!=NULL; negat=negat->
succ, i1++) {
214 if (!ineg_stay[i1]) {
216 ineg->
succ = rtri.cnul;
243 Psysteme sc_integer_projection_along_variable(
260 sc = sc_variable_substitution_with_eq_ofl_ctrl(sc,
eq, v,
NO_OFL_CTRL);
268 if (!sc_integer_fourier_motzkin_variable_elimination(sci,sc,v) && sc) {
283 Psysteme sc_integer_projection_along_variables
296 sc = sc_integer_projection_along_variable(fsc,sc,
vecteur_var(pv1));
Pcontrainte contraintes_free(Pcontrainte pc)
Pcontrainte contraintes_free(Pcontrainte pc): desallocation de toutes les contraintes de la liste pc.
Pcontrainte contrainte_dup(Pcontrainte c_in)
Pcontrainte contrainte_dup(Pcontrainte c_in): allocation d'une contrainte c_out prenant la valeur de ...
Pcontrainte contrainte_var_min_coeff(Pcontrainte, Variable, Value *, bool)
Pcontrainte contrainte_var_min_coeff(Pcontrainte contraintes, Variable v, int *coeff) input : a list ...
bool egalite_normalize(Pcontrainte)
bool egalite_normalize(Pcontrainte eg): reduction d'une equation diophantienne par le pgcd de ses coe...
int nb_elems_list(Pcontrainte)
int nb_elems_list(Pcontrainte list): nombre de contraintes se trouvant dans une liste de contraintes
bool contrainte_constante_p(Pcontrainte)
bool contrainte_constante_p(Pcontrainte c): test de contrainte triviale sans variables (ie du type 0<...
bool contrainte_verifiee(Pcontrainte, bool)
bool contrainte_verifiee(Pcontrainte ineg, bool eq_p): test de faisabilite d'inegalite (eq_p == false...
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Psysteme build_integer_sc_nredund(volatile Psysteme ps, Pbase index_base, int tab_info[][4], int loop_level, int dim_h __attribute__((unused)), int n __attribute__((unused)))
Computation of a new system sc from the system ps, where each constraint of the system ps is added to...
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
void sc_integer_projection_information(Psysteme sc, Pbase index_base, int sc_info[][4], int dim_h, int n)
This function gives information about the variables and the constraints of the system.
Psysteme sc_normalize(Psysteme ps)
Psysteme sc_normalize(Psysteme ps): normalisation d'un systeme d'equation et d'inequations lineaires ...
Psysteme sc_elim_var(Psysteme sc, Variable v)
package sur les systemes de contraintes sc
struct Scontrainte * succ
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
#define OFL_CTRL
I do thing that overflows are managed in a very poor manner.
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...