PIPS
sc_eval.c
Go to the documentation of this file.
1 /*
2 
3  $Id: sc_eval.c 1669 2019-06-26 17:24:57Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of Linear/C3 Library.
8 
9  Linear/C3 Library is free software: you can redistribute it and/or modify it
10  under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  Linear/C3 Library is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with Linear/C3 Library. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 
25 /* package sc
26  */
27 
28 #ifdef HAVE_CONFIG_H
29  #include "config.h"
30 #endif
31 
32 #include <string.h>
33 #include <stdio.h>
34 #include <limits.h>
35 #include <stdlib.h>
36 
37 #include "linear_assert.h"
38 #include "boolean.h"
39 #include "arithmetique.h"
40 #include "vecteur.h"
41 #include "contrainte.h"
42 #include "sc.h"
43 
44 
45 #define HUGE 250
46 static bool huge_system(Psysteme ps)
47 {
48  return(ps->nb_eq>HUGE || ps->nb_ineq>HUGE);
49 }
50 
51 
52 /* bool sc_value_for_variable(Psysteme ps, Variable var, Value *pval):
53  * examine les egalites du systeme ps pour recherche une egalite de la forme:
54  *
55  * coeff*var - cste == 0
56  *
57  * Si une telle equation est trouvee et si elle est faisable,
58  * sc_value_for_variable calcule la valeur de var pour ce systeme et
59  * la retourne par pval. Sinon, la procedure renvoie la valeur false.
60  *
61  * Notes:
62  * - le vecteur representant l'equation est suppose correct: une variable
63  * dont le coefficient est nul ne doit pas etre materialisee
64  * - ce n'est pas une fonction sur les systemes mais sur les listes d'egalites
65  * - la valeur false peut signifer que le systeme d'egalites de ps n'est pas
66  * faisable ou qu'il n'y a pas d'equation satisfaisante; l'arret par
67  * sc_error() en cas de non-faisabilite n'etait pas satisfaisant pour les
68  * procedures appelantes
69  */
70 bool sc_value_of_variable(ps, var, pval)
71 Psysteme ps;
72 Variable var;
73 Value *pval;
74 {
75  Pcontrainte pc;
76 
77  if (SC_UNDEFINED_P(ps))
78  return(false);
79 
80  for (pc = ps->egalites; pc != NULL; pc = pc->succ)
81  {
82  Pvecteur pv = pc->vecteur;
83 
84  if (! VECTEUR_NUL_P(pv))
85  {
86  if (pv->succ == NULL)
87  {
88  if (pv->var == var)
89  {
90  /* equation de la forme: k*var == 0 */
91  *pval = 0;
92  return(true);
93  }
94  }
95  else if (pv->succ->succ == NULL)
96  {
97  if ((pv->var == var) && (pv->succ->var == TCST))
98  {
99  Value vs = val_of(pv->succ), v = val_of(pv);
100  /* equation de la forme: k*var - c == 0 */
101  if(value_zero_p(value_mod(vs,v)))
102  {
103  *pval = value_uminus(value_div(vs,v));
104  return(true);
105  }
106  else
107  {
108  return(false);
109  }
110  }
111  else
112  {
113  if ((pv->var == TCST) && (pv->succ->var == var))
114  {
115  Value vs = val_of(pv->succ), v = val_of(pv);
116  /* equation de la forme: c - k*var == 0 */
117  if(value_zero_p(value_mod(v,vs))) {
118  *pval = value_uminus(value_div(v,vs));
119  return(true);
120  }
121  else
122  {
123  return(false);
124  }
125  }
126  }
127  }
128  }
129  }
130 
131  return(false);
132 }
133 
134 /* void sc_minmax_of_variable(Psysteme ps, Variable var, Value *pmin, *pmax):
135  * examine un systeme pour trouver le minimum et le maximum d'une variable
136  * apparaissant dans ce systeme par projection a la Fourier-Motzkin.
137  * la procedure retourne la valeur false si le systeme est infaisable et
138  * true sinon
139  *
140  * le systeme ps est detruit.
141  *
142  */
143 bool sc_minmax_of_variable(ps, var, pmin, pmax)
144 Psysteme ps;
145 Variable var;
146 Value *pmin, *pmax;
147 {
148  Value val;
149  Pcontrainte pc;
150  Pbase b=VECTEUR_NUL;
151 
152  assert(var!=TCST);
153 
154  *pmax = VALUE_MAX;
155  *pmin = VALUE_MIN;
156  if (SC_EMPTY_P(ps)) return false;
157  if (sc_rn_p(ps)) return true;
158 
159  if (sc_value_of_variable(ps, var, &val) == true) {
160  *pmin = val;
161  *pmax = val;
162  return true;
163  }
164 
165  /* projection sur toutes les variables sauf var */
166  for (b = vect_copy(ps->base); !sc_rn_p(ps) && !SC_EMPTY_P(ps) && !VECTEUR_NUL_P(b) ; b = b->succ) {
167  Variable v = vecteur_var(b);
168  if (!sc_rn_p(ps) && !SC_EMPTY_P(ps) && v != var) {
169  ps = sc_projection(ps, v);
170  // if (!sc_rn_p(ps) && !SC_EMPTY_P(ps) && !huge_system(ps))
172  if (!sc_rn_p(ps) && !SC_EMPTY_P(ps) && !huge_system(ps))
173  ps = sc_normalize(ps);
174  }
175  }
176  vect_rm(b);
177  if (SC_EMPTY_P(ps)) return false;
178  if (sc_value_of_variable(ps, var, &val) == true) {
179  *pmin = val;
180  *pmax = val;
181  return true;
182  }
183 
184  for (pc = ps->inegalites; pc != NULL; pc = pc->succ) {
185  Value cv = vect_coeff(var, pc->vecteur);
187 
188  if (value_pos_p(cv)) {
189  /* cette contrainte nous donne une borne max */
190  Value bs = value_pdiv(cc,cv);
191  if (value_lt(bs,*pmax))
192  *pmax = bs;
193  }
194  else if (value_neg_p(cv)) {
195  /* cette contrainte nous donne une borne min */
196  Value bi = value_pdiv(cc,cv);
197  if (value_gt(bi,*pmin))
198  *pmin = bi;
199  }
200  }
201  if (value_lt(*pmax,*pmin))
202  return false;
203 
204  return true;
205 }
206 
207 /* This function uses sc_minmax_of_variable to compute the min and max
208  * of each variable belonging to base b.
209  * If constraints on the variable are found, they are added to the systeme
210  * ps2.
211  */
212 void sc_minmax_of_variables(ps1,ps2,b)
213 Psysteme ps1,ps2;
214 Pbase b;
215 {
216  Pvecteur pv;
217  assert(ps2);
218 
219  for (pv = b; !VECTEUR_NUL_P(pv); pv = pv->succ) {
220  Variable var1 = vecteur_var(pv);
221  Psysteme sc = sc_dup(ps1);
222  Value min, max;
223  bool faisable = sc_minmax_of_variable(sc, var1, &min, &max);
224  Pcontrainte pc;
225 
226  if (faisable) {
227  if (value_ne(min,VALUE_MIN))
228  {
230  VECTEUR_NUL, var1, VALUE_MONE, TCST, min));
231  sc_add_ineg(ps2, pc);
232  }
233  if (value_ne(max,VALUE_MAX))
234  {
237  sc_add_ineg(ps2, pc);
238  }
239  }
240  }
241 }
242 
243 /* void sc_force_variable_to_zero(Psysteme ps, Variable var): force la
244  * variable var a prendre la valeur 0, i.e. intersection du polyedre defini
245  * par ps avec l'hyperplan var=0; on suppose que cette intersection est
246  * non vide (la faisabilite n'est pas testee).
247  *
248  * le systeme initial ps est transforme par effet de bord.
249  *
250  */
252 Psysteme ps;
253 Variable var;
254 {
255  Pcontrainte pc, pcs, pcp;
256 
257  pc = ps->egalites;
258  pcp = (Pcontrainte) NULL;
259  while (pc != (Pcontrainte) NULL) {
260  vect_erase_var(&(pc->vecteur), var);
261  pcs = pc->succ;
262  if (contrainte_constante_p(pc)) {
263  if (pcp == (Pcontrainte) NULL) {
264  ps->egalites = pcs;
265  }
266  else {
267  pcp->succ = pcs;
268  }
269  ps->nb_eq -= 1;
270  contrainte_free(pc);
271  }
272  else {
273  pcp = pc;
274  }
275  pc = pcs;
276  }
277 
278  pc = ps->inegalites;
279  pcp = (Pcontrainte) NULL;
280  while (pc != (Pcontrainte) NULL) {
281  vect_erase_var(&(pc->vecteur), var);
282  pcs = pc->succ;
283  if (contrainte_constante_p(pc)) {
284  if (pcp == (Pcontrainte) NULL) {
285  ps->inegalites = pcs;
286  }
287  else {
288  pcp->succ = pcs;
289  }
290  ps->nb_ineq -= 1;
291  contrainte_free(pc);
292  }
293  else {
294  pcp = pc;
295  }
296  pc = pcs;
297  }
298 }
299 
300 
301 /* void sc_minmax_of_variable2(Psysteme ps, Variable var, Value *pmin, *pmax):
302  * examine un systeme pour trouver le minimum et le maximum d'une variable
303  * apparaissant dans ce systeme par projection a la Fourier-Motzkin.
304  * la procedure retourne la valeur false si le systeme est infaisable et
305  * true sinon
306  *
307  * Le systeme ps est detruit et desalloue..
308  *
309  * L'algorithme utilise est different de celui de sc_minmax_of_variable().
310  * Les equations sont tout d'abord utilisees pour decomposer le systeme
311  * en un hyper-espace caracterise par un sous-ensemble des equations
312  * (par exemple les equations ayant moins de 2 variables) et un polyedre
313  * de cet hyperespace caracterise par les inegalites de ps et les egalites
314  * qui n'ont pas ete utilisees lors de la projection.
315  *
316  * Note:
317  * - comme on ne teste pas la faisabilite en entiers, il se peut que
318  * cette fonction renvoie true et que les deux valeurs min et max
319  * n'existent pas vraiment; il faut donc etre sur de la maniere dont
320  * on utilise cette fonction; dans le cas de l'evaluation de la valeur
321  * d'une variable en un point d'un programme, cela n'a pas d'importance
322  * puisque la non-faisabilite (connue ou non) implique que le code est
323  * mort. La substitution d'une variable par une valeur n'a donc pas
324  * d'importance.
325  * - on pourrait verifier que var appartient a la base de ps; comme il est
326  * trivial mais pas forcement justifie, ce test est laisse a la charge
327  * de l'appelant.
328  */
329 bool
331  Variable var, Value *pmin, Value *pmax)
332 {
333 /* Maximum number of variables in an equation used for the projection */
334 #define level (2)
335 
336 #define if_debug_sc_minmax_of_variable2 if(false)
337 
338  volatile bool feasible_p = true;
339 
341  fprintf(stderr, "[sc_minmax_of_variable2]: Begin\n");
342  }
343 
344  if(SC_UNDEFINED_P(ps)) {
346  fprintf(stderr,
347  "[sc_minmax_of_variable2]: Empty system as input\n");
348  }
349  feasible_p = false;
350  }
351  else if(SC_EMPTY_P(ps = sc_normalize(ps))) {
353  fprintf(stderr,
354  "[sc_minmax_of_variable2]:"
355  " Non-feasibility detected by first call to sc_normalize\n");
356  }
357  feasible_p = false;
358  }
359  else { /* no obvious non-feasibility */
363  volatile int nvar;
364  volatile int neq = sc_nbre_egalites(ps);
365 
367  fprintf(stderr,
368  "[sc_minmax_of_variable2]: After call to sc_normalize\n");
369  fprintf(stderr, "[sc_minmax_of_variable2]: Input system %p\n",
370  ps);
371  sc_dump(ps);
372  }
373 
374  /*
375  * Solve the equalities (if any)
376  *
377  * Start with equalities with the smallest number of variables
378  * and stop when all equalities have been used and or when
379  * all equalities left have too many variables.
380  *
381  * Equalities with no variable are checked although nvar starts
382  * with 1.
383  */
384  for(nvar = 1;
385  feasible_p && neq > 0 && nvar <= level /* && sc_nbre_egalites(ps) != 0 */;
386  nvar++) {
387  for(eq = sc_egalites(ps);
388  feasible_p && !CONTRAINTE_UNDEFINED_P(eq);
389  eq = next_eq) {
390 
391  /* eq might suffer in the substitution... */
392  next_eq = contrainte_succ(eq);
393 
394  if(egalite_normalize(eq)) {
395  if(CONTRAINTE_NULLE_P(eq)) {
396  /* eq is redundant */
397  ;
398  }
399  else {
400  /* Equalities change because of substitutions.
401  * Their dimensions may go under the present
402  * required dimension, nvar. Hence the non-equality
403  * test between d and nvar.
404  */
406 
407  if(d<=nvar) {
409  /* Automatic variables read in a CATCH block need
410  * to be declared volatile as
411  * specified by the documentation*/
412  Variable volatile v = TCST;
413  Variable v1 = TCST;
414  Variable v2 = TCST;
415  Variable nv = TCST;
417  bool value_found_p = false;
418 
419  /* Does eq define var's value (and min==max)?
420  * Let's keep track of this but go on to check
421  * feasibility
422  */
423  if(d==1) {
424  if(!VECTEUR_UNDEFINED_P(pv->succ)) {
425  /* remember eq was normalized... */
426  if ((pv->var == var) &&
427  (pv->succ->var == TCST)) {
428  *pmin = value_uminus
430  val_of(pv)));
431  *pmax = *pmin;
432  value_found_p = true;
433  }
434  else if ((pv->succ->var == var) &&
435  (pv->var == TCST)) {
436  *pmin = value_uminus
437  (value_div(val_of(pv),
438  val_of(vecteur_succ(pv))));
439  *pmax = *pmin;
440  value_found_p = true;
441  }
442  else {
443  value_found_p = false;
444  }
445  }
446  else {
447  if (pv->var == var) {
448  *pmin = VALUE_ZERO;
449  *pmax = *pmin;
450  value_found_p = true;
451  }
452  else {
453  value_found_p = false;
454  }
455  }
456  }
457  /* Although the value might have been found, go on to
458  * check feasibility. This could be optional because
459  * it should not matter for any safe use of this
460  * function. See Note in function's header.
461  */
462  if(value_found_p) {
463  /* do not touch ps any more */
464  /* sc_rm(new_ps); */
465  return true;
466  }
467 
468  /* keep eq */
469  /* In fact, new_ps is not needed. we simply modify ps */
470  /*
471  new_eq = contrainte_dup(eq);
472  sc_add_egalite(new_ps, new_eq);
473  */
474 
475  /* use eq to eliminate a variable except if var value
476  * is still unknown. We then do need this equation in ps.
477  */
478 
479  /* Let's use a variable with coefficient 1 if
480  * possible.
481  */
482  v1 = TCST;
483  v2 = TCST;
484  for( pv = contrainte_vecteur(eq);
485  !VECTEUR_NUL_P(pv);
486  pv = vecteur_succ(pv)) {
487  nv = vecteur_var(pv);
488  /* This test is not fully used in the curent
489  * version since value_found_p==false here.
490  * That would change if feasibility had to
491  * be checked better.
492  */
493  if(nv!=TCST && (nv!=var||value_found_p)) {
494  v2 = (v2==TCST)? nv : v2;
495  if(value_one_p(vecteur_val(pv))) {
496  if(v1==TCST) {
497  v1 = nv;
498  break;
499  }
500  }
501  }
502  }
503  v = (v1==TCST)? v2 : v1;
504  /* because of the !CONTRAINTE_NULLE_P() test and because
505  * of value_found_p */
506  assert(v!=TCST);
507  assert(v!=var||value_found_p);
508 
509  /* eq itself is going to be modified in ps.
510  * use a copy!
511  */
512  def = contrainte_dup(eq);
514  ps=sc_elim_var(ps,v);
515  }
516  TRY {
517  ps =
518  sc_simple_variable_substitution_with_eq_ofl_ctrl
519  (ps, def, v, NO_OFL_CTRL);
520  contrainte_rm(def);
522  }
523  /* Print ps after projection.
524  * This really generates a lot of output on real life systems!
525  * But less than the next debug statement...
526  */
527  /*
528  if_debug_sc_minmax_of_variable2 {
529  fprintf(stderr,
530  "Print the two systems at each elimination step:\n");
531  fprintf(stderr, "[sc_minmax_of_variable2]: Input system %x\n",
532  (unsigned int) ps);
533  sc_dump(ps);
534  }
535  */
536  }
537  else {
538  /* too early to use this equation eq */
539  /* If there any hope to use it in the future?
540  * Yes, if its dimension is no more than nvar+1
541  * because one of its variable might be substituted.
542  * If more variable are substituted, it's dimension
543  * is going to go down and it will be counted later...
544  * Well this is not true, it will be lost:-(
545  */
546  if(d<=nvar+1) {
547  neq++;
548  }
549  else {
550  /* to be on the safe side till I find a better idea... */
551  neq++;
552  }
553  }
554  }
555  }
556  else {
557  /* The system is not feasible. Stop */
558  feasible_p = false;
559  break;
560  }
561 
562  /* This really generates a lot of output on real life system!
563  * This is useless. Use previous debugging statement */
564  /*
565  if_debug_sc_minmax_of_variable2 {
566  fprintf(stderr,
567  "Print the two systems at each equation check:\n");
568  fprintf(stderr, "[sc_minmax_of_variable2]: Input system %x\n",
569  (unsigned int) ps);
570  sc_dump(ps);
571  }
572  */
573  }
574 
576  fprintf(stderr,
577  "Print the two systems at each nvar=%d step:\n", nvar);
578  fprintf(stderr, "[sc_minmax_of_variable2]: Input system %p\n",
579  ps);
580  sc_dump(ps);
581  }
582  }
583 
584  assert(!feasible_p ||
586 
587  feasible_p = feasible_p && !SC_EMPTY_P(ps = sc_normalize(ps));
588 
589  if(feasible_p) {
590  /* Try to exploit the inequalities and the equalities left in ps */
591 
592  /* Exploit the reduction in size */
593  base_rm(sc_base(ps));
594  sc_base(ps) = BASE_UNDEFINED;
595  sc_creer_base(ps);
596 
598  fprintf(stderr,
599  "Print System ps after projection and normalization:\n");
600  fprintf(stderr, "[sc_minmax_of_variable2]: Input system ps %p\n",
601  ps);
602  sc_dump(ps);
603  }
604 
605  if(base_contains_variable_p(sc_base(ps), var)) {
606  feasible_p = sc_minmax_of_variable(ps, var, pmin, pmax);
607  ps = SC_UNDEFINED;
608  }
609  else {
610  *pmin = VALUE_MIN;
611  *pmax = VALUE_MAX;
612  }
613  }
614  }
615 
616  if(!feasible_p) {
617  *pmin = VALUE_MIN;
618  *pmax = VALUE_MAX;
619  }
620  else {
621  /* I'm afraid of sc_minmax_of_variable() behavior...
622  * The guard should be useless
623  */
624  if(!SC_UNDEFINED_P(ps)) {
625  sc_rm(ps);
626  }
627  }
628 
630  fprintf(stderr,
631  "[sc_minmax_of_variable2]: feasible=%d, min=", feasible_p);
632  fprint_Value(stderr, *pmin);
633  fprintf(stderr, ", max=");
634  fprint_Value(stderr, *pmax);
635  fprintf(stderr, "\n[sc_minmax_of_variable2]: End\n");
636  }
637 
638  return feasible_p;
639 }
640 
641 /*
642  * That's all folks!
643  */
#define CATCH(what)
@ overflow_error
#define UNCATCH(what)
#define TRY
#define value_pos_p(val)
#define VALUE_ZERO
#define value_gt(v1, v2)
#define value_pdiv(v1, v2)
#define value_uminus(val)
unary operators on values
#define value_one_p(val)
#define VALUE_MIN
#define VALUE_MONE
#define value_ne(v1, v2)
#define value_zero_p(val)
int Value
#define VALUE_MAX
#define VALUE_ONE
#define value_mod(v1, v2)
#define value_lt(v1, v2)
#define value_neg_p(val)
#define value_div(v1, v2)
void fprint_Value(FILE *, Value)
Definition: io.c:42
bool base_contains_variable_p(Pbase b, Variable v)
bool base_contains_variable_p(Pbase b, Variable v): returns true if variable v is one of b's elements...
Definition: base.c:136
#define CONTRAINTE_UNDEFINED_P(c)
#define CONTRAINTE_NULLE_P(c)
contrainte nulle (non contrainte 0 == 0 ou 0 <= 0)
#define contrainte_succ(c)
#define contrainte_vecteur(c)
passage au champ vecteur d'une contrainte "a la Newgen"
#define CONTRAINTE_UNDEFINED
struct Scontrainte * Pcontrainte
#define contrainte_rm(c)
the standard xxx_rm does not return a value
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Definition: alloc.c:73
Pcontrainte contrainte_free(Pcontrainte c)
Pcontrainte contrainte_free(Pcontrainte c): liberation de l'espace memoire alloue a la contrainte c a...
Definition: alloc.c:184
Pcontrainte contrainte_dup(Pcontrainte c_in)
Pcontrainte contrainte_dup(Pcontrainte c_in): allocation d'une contrainte c_out prenant la valeur de ...
Definition: alloc.c:132
bool egalite_normalize(Pcontrainte)
bool egalite_normalize(Pcontrainte eg): reduction d'une equation diophantienne par le pgcd de ses coe...
Definition: normalize.c:136
bool contrainte_constante_p(Pcontrainte)
bool contrainte_constante_p(Pcontrainte c): test de contrainte triviale sans variables (ie du type 0<...
Definition: predicats.c:192
#define min(a, b)
#define max(a, b)
int vect_dimension(Pvecteur v)
int vect_dimension(Pvecteur v): calcul du nombre de composantes non nulles et non constantes d'un vec...
Definition: reductions.c:64
#define assert(ex)
Definition: newgen_assert.h:41
bool sc_rn_p(Psysteme sc)
bool sc_rn_p(Psysteme sc): check if the set associated to sc is the whole space, rn
Definition: sc_alloc.c:369
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
Definition: sc_alloc.c:129
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
Definition: sc_alloc.c:277
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Definition: sc_alloc.c:176
Psysteme sc_elim_double_constraints(Psysteme ps)
Psysteme sc_elim_double_constraints(Psysteme ps): elimination des egalites et des inegalites identiqu...
static bool huge_system(Psysteme ps)
Definition: sc_eval.c:46
#define if_debug_sc_minmax_of_variable2
void sc_force_variable_to_zero(Psysteme ps, Variable var)
void sc_force_variable_to_zero(Psysteme ps, Variable var): force la variable var a prendre la valeur ...
Definition: sc_eval.c:251
#define HUGE
package sc
Definition: sc_eval.c:45
bool sc_minmax_of_variable(Psysteme ps, Variable var, Value *pmin, Value *pmax)
void sc_minmax_of_variable(Psysteme ps, Variable var, Value *pmin, *pmax): examine un systeme pour tr...
Definition: sc_eval.c:143
bool sc_value_of_variable(Psysteme ps, Variable var, Value *pval)
bool sc_value_for_variable(Psysteme ps, Variable var, Value *pval): examine les egalites du systeme p...
Definition: sc_eval.c:70
void sc_minmax_of_variables(Psysteme ps1, Psysteme ps2, Pbase b)
This function uses sc_minmax_of_variable to compute the min and max of each variable belonging to bas...
Definition: sc_eval.c:212
#define level
bool sc_minmax_of_variable2(volatile Psysteme ps, Variable var, Value *pmin, Value *pmax)
void sc_minmax_of_variable2(Psysteme ps, Variable var, Value *pmin, *pmax): examine un systeme pour t...
Definition: sc_eval.c:330
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
Definition: sc_gram.c:108
void sc_dump(Psysteme sc)
void sc_dump(Psysteme sc): dump to stderr
Definition: sc_io.c:142
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
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
Definition: sc_unaires.c:49
Pvecteur vecteur
struct Scontrainte * succ
int nb_ineq
Definition: sc-local.h:73
int nb_eq
Definition: sc-local.h:72
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
Variable var
Definition: vecteur-local.h:90
struct Svecteur * succ
Definition: vecteur-local.h:92
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define vecteur_val(v)
#define vecteur_var(v)
#define val_of(varval)
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
#define NO_OFL_CTRL
#define vecteur_succ(v)
#define VECTEUR_NUL_P(v)
#define base_rm(b)
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Definition: vecteur-local.h:60
#define BASE_UNDEFINED
#define VECTEUR_UNDEFINED_P(v)
Pvecteur vect_make(Pvecteur v, Variable var, Value val,...)
Pvecteur vect_make(v, [var, val,]* 0, val) Pvecteur v; // may be NULL, use assigne anyway Variable va...
Definition: alloc.c:165
Pbase vect_copy(Pvecteur b)
direct duplication.
Definition: alloc.c:240
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Definition: alloc.c:78
void vect_erase_var(Pvecteur *ppv, Variable v)
void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i....
Definition: unaires.c:106
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
Definition: unaires.c:228