PIPS
reduc.c
Go to the documentation of this file.
1 
2 #line 1366 "reduc.w"
3 
4 
5 #line 335 "UNION.w"
6 
7 /* Package : C3/union
8  * Author : Arnauld LESERVOT (leservot(a)limeil.cea.fr)
9  * Date :
10  * Modified : 04 04 95
11  * Documents: UNION.tex : ``Extension de C3 aux unions de polyedres''
12  * Comments :
13  */
14 /*
15  * WARNING
16  *
17  * THOSE FUNCTIONS ARE AUTOMATICALLY DERIVED
18  *
19  * FROM THE WEB SOURCES !
20  */
21 
22 /* Ansi includes */
23 #ifdef HAVE_CONFIG_H
24  #include "config.h"
25 #endif
26 #include <stdlib.h>
27 #include <stdio.h>
28 #include <string.h>
29 #include "linear_assert.h"
30 #include <time.h>
31 #include <sys/time.h>
32 
33 /* Linear includes */
34 #include "boolean.h"
35 #include "arithmetique.h"
36 #include "vecteur.h"
37 #include "contrainte.h"
38 #include "sc.h"
39 #include "sommet.h"
40 #include "polyedre.h"
41 #include "union.h"
42 
43 
44 #line 1367 "reduc.w"
45 
46 
47 #line 148 "reduc.w"
48 
49 static char* hspara_string[10] __attribute__ ((unused)) =
50 {
51  "unpara",
52  /**/
53  "sszero",
54  "ssplus",
55  /**/
56  /**/
57  /**/
58  "ssminus",
59  /**/
60  "opzero",
61  "opplus",
62  "keep",
63  /**/
64  "opminus",
65  "empty",
66  "full"
67 };
68 
69 static enum hspara_elem
70  hspara_jm[10][10] = { /* Lower left is join, upper right is meet */
71 
72  /*join\meet unpara sszero ssplus ssminus opzero opplus keep opminus empty full */
73  /* unpara */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
74  /* sszero */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 1 },
75  /* ssplus */ { 2, 2, 2, 0, 0, 0, 0, 0, 0, 2 },
76  /* ssminus */ { 3, 9, 9, 3, 0, 0, 3, 0, 3, 3 },
77  /* opzero */ { 4, 9, 9, 6, 4, 4, 4, 0, 4, 4 },
78  /* opplus */ { 5, 9, 9, 6, 5, 5, 5, 0, 5, 5 },
79  /* keep */ { 6, 9, 9, 6, 6, 6, 6, 0, 6, 6 },
80  /* opminus */ { 7, 9, 9, 8, 8, 8, 8, 7, 7, 7 },
81  /* empty */ { 8, 9, 9, 8, 8, 8, 8, 8, 8, 8 },
82  /* full */ { 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 }};
83 
84 
85 #define hspara_join(se1, se2) (((se1) >= (se2))?hspara_jm[(se1)][(se2)]:hspara_jm[(se2)][(se1)])
86 #define hspara_meet(se1, se2) (((se1) <= (se2))?hspara_jm[(se1)][(se2)]:hspara_jm[(se2)][(se1)])
87 #define hspara_to_string(se) (char*) hspara_string[(int) (se)]
88 
89 #line 1368 "reduc.w"
90 
91 
92 #line 208 "reduc.w"
93 
94 /* enum hspara_elem vect_parallel(Pvecteur in_v1, Pvecteur in_v2) AL950711
95  * input: 2 Pvecteur in_v1 and in_v2
96  * output: hspara_elem (element of the parallel half space lattice)
97  * memory: Inspector (nothing is shared, nor modified, output allocated).
98  * complexity: length(in_v1) * length(in_v2)
99  * comment: in_v1 = a1 X + b1 represents a1 X+b1 <= 0 and in_v2 a2 X + b2 <=0.
100  * if (a1!=a2) || (a1!=-a2), returns unpara
101  * else if (a1==a2), return sign(b2-b1) in ss part of hspara
102  * else if (a1==-a2), return sign(-b2-b1) in op part of hspara.
103  */
104 enum hspara_elem vect_parallel( in_v1, in_v2 )
105 Pvecteur in_v1, in_v2;
106 {
107  Pvecteur v1, v2;
108  enum hspara_elem ret_sle = unpara;
109  bool first = true;
110  bool same_sign = false;
111  Value gcd1, gcd2; /* gcd of each vector */
112  int l1, l2; /* length of each vector without TCST */
113  Value b1, b2, diff; /* value of TCST and their diff */
114 
115  if (!in_v1 || !in_v2) return unpara;
116 
117  /* debuging */
118  /*
119  C3_DEBUG("vect_parallel", {
120  fprintf(stderr, "Input vectors, in_v1, then in_v2:\n");
121  vect_fprint( stderr, in_v1, union_variable_name );
122  vect_fprint( stderr, in_v2, union_variable_name );
123  });
124  */
125 
126 
127  /* get gcd of each vector and constant linked to TCST */
128 
129  l1 = 0; b1 = 0; gcd1 = value_abs(val_of(in_v1));
130  for (v1 = in_v1; v1 != NULL; v1 = v1->succ) {
131  gcd1 = pgcd( gcd1, value_abs(val_of(v1)) );
132  if(var_of(v1)==TCST) b1 = val_of(v1);
133  else l1++;
134  }
135 
136  l2 = 0; b2 = 0; gcd2 = value_abs(val_of(in_v2));
137  for (v2 = in_v2; v2 != NULL; v2 = v2->succ) {
138  gcd2 = pgcd( gcd2, value_abs(val_of(v2)) );
139  if(var_of(v2)==TCST) b2 = val_of(v2);
140  else l2++;
141  }
142 
143  if (l1 != l2) return unpara ;
144 
145 
146  /* Determine what kind of parallel hyperplane we are in */
147  for (v2 = in_v2; v2 != NULL; v2 = v2->succ) {
148  Variable var2 = var_of(v2);
149  Value val2 = val_of(v2);
150  bool found = false;
151 
152  if (var2 == TCST) continue;
153 
154  for (v1 = in_v1; v1 != NULL; v1 = v1->succ) {
155  if (var_of(v1) == var2) {
156  Value i1 = value_mult(gcd2,val_of(v1));
157  Value i2 = value_mult(gcd1,val2);
158  bool ss = value_eq(i1,i2);
159  bool op = value_eq(i1,value_uminus(i2));
160 
161  if (!ss && !op) return unpara;
162  if (first) {first = false; same_sign = (ss)?ss:op ;}
163  if ((same_sign && op)||(!same_sign && ss)) return unpara;
164  found = true;
165  }
166  }
167 
168  /* coefficient value was 0 and was not represented */
169  if(!found) return unpara;
170  }
171 
172 
173  /* compute return value */
174  {
175  Value p1 = value_mult(gcd1,b2),
176  p2 = value_uminus(value_mult(gcd2,b1));
177  diff = (same_sign)? value_plus(p1,p2): value_minus(p2,p1);
178  }
179  if (value_zero_p(diff)) ret_sle = (same_sign) ? sszero : opzero ;
180  else if (value_pos_p(diff)) ret_sle = (same_sign) ? ssplus : opplus ;
181  else if (value_neg_p(diff)) ret_sle = (same_sign) ? ssminus : opminus ;
182  else ret_sle = unpara;
183 
184  /* debuging */
185  /*
186  C3_DEBUG("vect_parallel",
187  { fprintf(stderr, "Output hspara: %s\n", hspara_to_string(ret_sle)); });
188  */
189 
190  return ret_sle;
191 }
192 
193 #line 320 "reduc.w"
194 
195 /* enum enum hspara_elem contrainte_parallel_in_liste( in_co, in_lc ) AL950711
196  * input: 1 constraint in_co and a list of constraints in_lc
197  * output: hspara_elem (element of the parallel half space lattice)
198  * memory: Inspector (nothing is shared, nor modified, output allocated).
199  * complexity: length(in_lc) * comp(vect_parallel())
200  * comment: in_co represents a1 X+b1 <= 0 and in_lc aj X + bj <=0.
201  * Returns in_co/in_lc = join_j( vect_parallel( in_co, in_lc_j ) )
202  * between keep, empty and full.
203  */
204 enum hspara_elem contrainte_parallel_in_liste( in_co, in_lc )
205 Pcontrainte in_co, in_lc;
206 {
207  Pcontrainte c;
208  Pvecteur vpos;
209  enum hspara_elem ret_sle = keep;
210 
212  if (CONTRAINTE_NULLE_P(in_co)) return keep;
213 
214  /* debuging */
215  C3_DEBUG("contrainte_parallel_in_list", {
216  fprintf(stderr, "Input in_co:");
217  inegalite_fprint( stderr, in_co, union_variable_name );
218  fprintf(stderr, "Input in_lc:\n");
219  inegalites_fprint( stderr, in_lc, union_variable_name );
220  });
221 
222  vpos = in_co->vecteur;
223 
224  for (c = in_lc; !CONTRAINTE_UNDEFINED_P(c) && (ret_sle != full); c=c->succ) {
225  Pvecteur cv = c->vecteur;
226  enum hspara_elem hs = vect_parallel(vpos, cv);
227 
228  C3_DEBUG("contrainte_parallel_in_list", {
229  fprintf(stderr, "ret_sle: %s , hs: %s\n",
230  hspara_to_string(ret_sle),
231  hspara_to_string( hs ) );
232  });
233 
234  ret_sle = hspara_join( ret_sle, hs);
235  }
236 
237 
238  /* debuging */
239  C3_DEBUG("contrainte_parallel_in_list",
240  { fprintf(stderr, "Output hspara: %s\n", hspara_to_string(ret_sle)); });
241 
242  return ret_sle;
243 }
244 
245 #line 387 "reduc.w"
246 
247 /* Psysteme sc_supress_parallel_redund_constraints( in_ps1, in_ps2 )
248  * input: 2 Psystemes in_ps1 and in_ps2
249  * output: in_ps1 / in_ps2 (cut operation on polyhedrons)
250  * memory: Inspector (nothing is shared, nor modified, output allocated).
251  * comment: Supress in dup(in_ps2) parallel constraints that are redundant
252  * relatively to in_ps1.
253  * Returned Psysteme have only inequalities.
254  */
256 Psysteme in_ps1, in_ps2;
257 {
258  Psysteme ps1, ps2, ret_ps = NULL;
259  Pcontrainte ineq1, ineqs2;
260  bool stop = false, dup1 = false, dup2 = false;
261 
262  if ( in_ps1 == SC_RN ) return sc_dup(in_ps2);
263 
264  /* debuging */
265  C3_DEBUG("sc_supress_parallel_constraints", {
266  fprintf(stderr, "Input systems, in_ps1, then in_ps2:\n");
267  sc_fprint( stderr, in_ps1, union_variable_name );
268  sc_fprint( stderr, in_ps2, union_variable_name );
269  });
270 
271 
272  /* Transforms equalities in inequalities if necessary */
273  if (in_ps1->nb_eq != 0)
274  { ps1 = sc_dup( in_ps1 ); sc_transform_eg_in_ineg( ps1 ); dup1 = true; }
275  else ps1 = in_ps1;
276 
277  if (in_ps2->nb_eq != 0)
278  { ps2 = sc_dup( in_ps2 ); sc_transform_eg_in_ineg( ps2 ); dup2 = true; }
279  else ps2 = in_ps2;
280 
281 
282  /* Compare with inequalities */
283  ineqs2 = ps2->inegalites;
284 
285  for (ineq1 = ps1->inegalites; ineq1 != NULL && !stop; ineq1 = ineq1->succ) {
286  enum hspara_elem sk = contrainte_parallel_in_liste( ineq1, ineqs2 );
287  switch (sk)
288  {
289  case keep:
290  if (ret_ps != NULL){ sc_add_inegalite( ret_ps, contrainte_dup(ineq1) ); }
291  else ret_ps = sc_make( NULL, contrainte_dup(ineq1) );
292  break;
293  case empty:
294  ret_ps = sc_free(ret_ps);
295  ret_ps = sc_empty(NULL);
296  stop = true;
297  break;
298  case full: continue; break;
299  default:
300  {
301  fprintf(stderr, "%s supress_kind == %d should not appear !",
302  "[sc_supress_parallel_redund_constraints]", (int) sk );
303  abort();
304  }
305  }
306 
307  }
308 
309  /* update base and normalize */
310  if ((ret_ps != NULL) && !sc_empty_p(ret_ps)) {
311  vect_rm(ret_ps->base);
312  ret_ps->base = NULL; sc_creer_base( ret_ps );
313  ret_ps = sc_normalize( ret_ps );
314  }
315 
316  /* Manage memory and return */
317  ps1 = (dup1)? sc_free(ps1) : ps1;
318  ps2 = (dup2)? sc_free(ps2) : ps2;
319  C3_RETURN( IS_SC, ret_ps );
320 }
321 
322 #line 470 "reduc.w"
323 
324 /* Psysteme sc_supress_same_constraints( in_ps1, in_ps2 ) supress in
325  * in_ps2 constraints that are in in_ps1. Nothing is shared, nor modified.
326  * Returned Psysteme have only inequalities.
327  * This function should be superseded by sc_supress_parallel_redund_contraints
328  */
330 Psysteme in_ps1, in_ps2;
331 {
332  Psysteme ret_ps = NULL;
333  Pcontrainte eq, ineq;
334 
335  if ( in_ps1 == SC_RN ) return sc_dup(in_ps2);
336 
337  C3_DEBUG("sc_supress_same_constraints", {
338  fprintf(stderr, "\nInput systems, in_ps1, then in_ps2:\n");
339  sc_fprint( stderr, in_ps1, union_variable_name );
340  sc_fprint( stderr, in_ps2, union_variable_name );
341  });
342 
343  /* Compare with equalities a == 0 <=> a <= 0 and -a <= 0 */
344  for (eq = in_ps2->egalites; eq != NULL; eq = eq->succ) {
345  Pcontrainte co, eq2;
346  Pvecteur pv;
347  bool eq_in_ineq, co_in_ineq;
348 
349  if (contrainte_in_liste(eq, in_ps1->egalites)) continue;
350 
351  pv = vect_dup(eq->vecteur);
352  vect_chg_sgn ( pv );
353  co = contrainte_make( pv );
354  if (contrainte_in_liste(co, in_ps1->egalites ))
355  { co = contrainte_free( co ); continue; }
356 
357 
358  eq_in_ineq = contrainte_in_liste(eq, in_ps1->inegalites);
359  co_in_ineq = contrainte_in_liste(co, in_ps1->inegalites);
360 
361  if (eq_in_ineq && co_in_ineq) {
362  co = contrainte_free( co );
363  }
364  else if (eq_in_ineq) { /* add co to returned inegs */
365  if (ret_ps != NULL){ sc_add_inegalite( ret_ps, co ); }
366  else ret_ps = sc_make( NULL, co );
367  }
368  else if (co_in_ineq) { /* add eq to returned inegs */
369  eq2 = contrainte_dup(eq);
370  if (ret_ps != NULL){ sc_add_inegalite( ret_ps, eq2 ); }
371  else ret_ps = sc_make( NULL, eq2 );
372  co = contrainte_free( co );
373  }
374  else { /* add co and eq to returned inegs */
375  eq2 = contrainte_dup(eq);
376  if (ret_ps != NULL){ sc_add_inegalite( ret_ps, eq2 ); }
377  else ret_ps = sc_make( NULL, eq2 );
378  sc_add_inegalite( ret_ps, co );
379  }
380  }
381 
382  /* Compare with inequalities */
383  for (ineq = in_ps2->inegalites; ineq != NULL; ineq = ineq->succ) {
384  Pcontrainte io;
385  if (contrainte_in_liste(ineq, in_ps1->inegalites)) continue;
386  if (contrainte_in_liste(ineq, in_ps1->egalites)) continue;
387  io = contrainte_dup( ineq ); contrainte_chg_sgn( io );
388  if (contrainte_in_liste(io, in_ps1->egalites)) {
389  io = contrainte_free(io);
390  continue;
391  }
392 
393  if (ret_ps != NULL){ sc_add_inegalite( ret_ps, contrainte_dup(ineq) ); }
394  else ret_ps = sc_make( NULL, contrainte_dup(ineq) );
395  io = contrainte_free(io);
396  }
397 
398  if (ret_ps != NULL)
399  { vect_rm(ret_ps->base); ret_ps->base = NULL; sc_creer_base( ret_ps );}
400 
401  ret_ps = sc_normalize( ret_ps );
402  C3_RETURN( IS_SC, ret_ps );
403 }
404 
405 #line 570 "reduc.w"
406 
407 /* Psysteme sc_elim_redund_with_first_ofl_ctrl( in_ps1, in_ps2, ofl_ctrl )
408  * Returns constraints of in_ps2 which cut in_ps1. AL 06 04 95
409  * It is assumed that in_ps1 and in_ps2 are feasible !
410  * in_ps1 is not modified, in_ps2 is modified.
411  */
413 Psysteme in_ps1, in_ps2;
414 int ofl_ctrl;
415 {
416  Psysteme ps1;
417  Pcontrainte prev_eq = NULL, eq, tail = NULL;
418  Pbase pb;
419 
420  /* Return on special cases */
421  if ( sc_full_p(in_ps1) ) return in_ps2;
422  if ( in_ps1->nb_ineq == 0 ) return in_ps2;
423 
424  /* debuging */
425  C3_DEBUG("sc_elim_redund_with_first", {
426  fprintf(stderr, "\nInput systems, in_ps1, then in_ps2:\n");
427  sc_fprint( stderr, in_ps1, union_variable_name );
428  sc_fprint( stderr, in_ps2, union_variable_name );
429  });
430 
431 
432  /* build in_ps1.and.in_ps2 with sharing on in_ps2
433  * This also works if in_ps1 is full space */
434  if ( in_ps2->nb_eq != 0 ) sc_transform_eg_in_ineg( in_ps2 );
435  ps1 = sc_dup( in_ps1 );
436  for (eq = ps1->inegalites; eq != NULL; tail = eq, eq = eq->succ) {}
437  tail->succ = in_ps2->inegalites;
438 
439  /* debuging */
440  C3_DEBUG("sc_elim_redund_with_first", {
441  fprintf(stderr, "ps1 old: nb_eq= %d, nb_ineq= %d, dimension= %d, base= \n",
442  ps1->nb_eq, ps1->nb_ineq, ps1->dimension);
443  vect_fprint(stderr, ps1->base, union_variable_name);
444  fprintf(stderr, "in_ps2: nb_eq= %d, nb_ineq= %d, dimension= %d, base= \n",
445  in_ps2->nb_eq, in_ps2->nb_ineq, in_ps2->dimension);
446  vect_fprint(stderr, in_ps2->base, union_variable_name);
447  });
448 
449  /* update information on ps1 */
450  ps1->nb_eq = ps1->nb_eq + in_ps2->nb_eq;
451  ps1->nb_ineq = ps1->nb_ineq + in_ps2->nb_ineq;
452  pb = ps1->base;
453  ps1->base = base_union( ps1->base, in_ps2->base );
454  ps1->dimension = vect_size ( ps1->base );
455  vect_rm( pb );
456 
457  /* debuging */
458  C3_DEBUG("sc_elim_redund_with_first", {
459  fprintf(stderr, "ps1: nb_eq= %d, nb_ineq= %d, dimension= %d, base= \n",
460  ps1->nb_eq, ps1->nb_ineq, ps1->dimension);
461  vect_fprint(stderr, ps1->base, union_variable_name);
462  });
463 
464  /* Normalize 2 inputs systems */
465  for (eq = ps1->inegalites; eq != NULL; eq=eq->succ)
466  {
468  }
469  /* returns if there is no intersection */
470  if (!sc_rational_feasibility_ofl_ctrl(ps1, ofl_ctrl, true)) {
471  tail->succ = NULL; ps1 = sc_free(ps1);
472  in_ps2 = sc_free(in_ps2); in_ps2 = sc_empty(NULL);
473  C3_RETURN( IS_SC, in_ps2 );
474  }
475 
476 
477  /* We run over in_ps2 constraints (shared by ps1)
478  * and detect redundance */
479  assert(sc_weak_consistent_p(in_ps2));
481  for (eq = tail->succ, prev_eq = tail; eq != NULL; eq = eq->succ)
482  {
485  C3_DEBUG("sc_elim_redund_with_first", {
486  fprintf(stderr, "\nps1:\n");
487  fprintf(stderr, "nb_eq= %d, nb_ineq= %d, dimension= %d\n",
488  ps1->nb_eq, ps1->nb_ineq, ps1->dimension);
489  sc_fprint( stderr, ps1, union_variable_name );
490  });
491 
492  if (sc_rational_feasibility_ofl_ctrl(ps1, ofl_ctrl, true))
493  {
495  prev_eq = prev_eq->succ;
496  }
497  else{
498  /* eliminate the constraint from in_ps2, and thus from ps1 */
500  if (in_ps2->inegalites == eq)
501  in_ps2->inegalites = eq->succ;
502  prev_eq->succ = eq->succ;
504  eq = contrainte_free(eq);
505  eq = prev_eq;
506  in_ps2->nb_ineq--;
507  ps1->nb_ineq--;
509  assert(sc_weak_consistent_p(in_ps2));
510  }
511  }
512 
513 
514  if ( in_ps2->inegalites == NULL )
515  { in_ps2 = sc_free(in_ps2); in_ps2 = sc_full(); }
516 
517  tail->succ = NULL; ps1 = sc_free( ps1 );
518  C3_RETURN( IS_SC, in_ps2 );
519 }
520 
521 #line 832 "reduc.w"
522 
523 /* Ppath pa_supress_same_constraints( (Ppath) in_pa )
524  * Supress from complements of in_pa same constraints than those in
525  * positif Psystem in_pa->psys. Returned path have no more equalities. AL050795
526  * No sharing, no modification of inputs.
527  */
529 Ppath in_pa;
530 {
531  Ppath ret_pa = PA_UNDEFINED;
532  Pcomplist comp;
533  Psysteme positif;
534  Psyslist psl = NULL;
535 
536  /* Special cases */
537  if ( PA_UNDEFINED_P( in_pa )) return PA_UNDEFINED;
538  if ( pa_empty_p ( in_pa )) return pa_empty();
539  if ( pa_full_p ( in_pa )) return pa_full ();
540 
541  /* debuging */
542  C3_DEBUG( "pa_supress_same_constraints", {
543  fprintf(stderr, "Input path:\n");
544  pa_fprint_tab(stderr, in_pa, union_variable_name, 1);
545  });
546 
547  /* General case */
548  positif = in_pa->psys;
549  if (!sc_faisabilite_ofl(positif)) return pa_empty();
550 
551  for( comp = in_pa->pcomp; comp != NULL; comp = comp->succ) {
552  /* Psysteme ps = sc_supress_same_constraints( positif, comp->psys ); */
554  if (ps == NULL)
555  {psl = sl_free(psl); ret_pa = pa_empty(); C3_RETURN(IS_PA, ret_pa);}
556  else psl = sl_append_system( psl, ps );
557  }
558 
559  positif = sc_dup(positif); sc_transform_eg_in_ineg( positif );
560  ret_pa = pa_make( positif, (Pcomplist) psl );
561  C3_RETURN(IS_PA, ret_pa);
562 }
563 
564 #line 884 "reduc.w"
565 
566 /* Pdisjunct pa_path_to_disjunct_rule4_ofl_ctrl( (Ppath) in_pa, int ofl_ctrl)
567  * Returns the corresponding disjunction according rule 4. AL 05/16/95
568  * No sharing.
569  */
571 Ppath in_pa;
572 int ofl_ctrl;
573 {
574  Pcomplist comp, lcomp = NULL;
575  Pdisjunct ret_dj ;
576  Psysteme systeme ;
577  Ppath pa ;
578  int pa_clength1, pa_clength2;
579 
580  if (in_pa == PA_UNDEFINED) return DJ_UNDEFINED;
581  if (pa_empty_p(in_pa)) return dj_empty();
582 
583  C3_DEBUG( "pa_path_to_disjunct_rule4_ofl_ctrl", {
584  fprintf(stderr, "\n\n Input path:\n\n");
585  pa_fprint(stderr, in_pa, union_variable_name );
586  });
587 
588 
590  C3_RETURN(IS_DJ, pa_path_to_disjunct_ofl_ctrl( in_pa, ofl_ctrl));
591 
592  systeme = in_pa->psys;
593  if (in_pa->pcomp == NULL)
594  C3_RETURN(IS_DJ, sl_append_system(NULL,sc_dup(systeme)));
595 
596  for( comp = in_pa->pcomp; comp != NULL; comp = comp->succ ) {
597  Psysteme ps;
598  if (comp->psys == SC_UNDEFINED)
599  { sl_free(lcomp); C3_RETURN( IS_DJ, DJ_UNDEFINED ); }
600 
601  ps = sc_dup(comp->psys);
602 
603  ps = sc_elim_redund_with_first_ofl_ctrl( systeme, ps, ofl_ctrl );
604 
605  if (sc_empty_p( ps )) { ps = sc_free(ps); continue; }
606  if (sc_full_p ( ps ))
607  { ps = sc_free(ps); C3_RETURN( IS_DJ, dj_empty() ); }
608 
609  lcomp = sl_append_system( lcomp, ps );
610  }
611 
612  pa = pa_make(sc_dup(in_pa->psys), lcomp);
613  pa_clength1 = sl_length( pa->pcomp );
614  pa = pa_reduce_simple_complement( pa );
615  pa_clength2 = sl_length( pa->pcomp );
616  systeme = pa->psys;
617 
618 
619  /* Returns according to different cases */
620  if (pa_empty_p(pa))
621  { ret_dj = dj_empty(); }
622  else if (pa_clength2 == 0)
623  { ret_dj = dj_append_system(NULL,sc_dup(systeme)); }
624  else if (pa_clength1 != pa_clength2) /* we've modified P0 systeme */
625  { ret_dj = pa_path_to_disjunct_rule4_ofl_ctrl( pa, ofl_ctrl); }
626  else { ret_dj = pa_path_to_disjunct_ofl_ctrl( pa, ofl_ctrl); }
627 
628  pa = pa_free( pa );
629 
630  C3_RETURN( IS_DJ, ret_dj );
631 }
632 
633 #line 1207 "reduc.w"
634 
635 /*
636 #line 1197 "reduc.w"
637 
638  Pdisjunct pa_path_to_few_disjunct_ofl_ctrl( (Ppath) in_pa, (int) ofl_ctrl )
639  Produces a Pdisjunct corresponding to the path Ppath and
640  reduces the number of disjunctions.
641  See "Extension de C3 aux Unions de Polyedres" Version 2,
642  for a complete explanation about this function.
643  in_pa is modified. AL 23/03/95
644 
645 #line 1208 "reduc.w"
646 
647 */
649 Ppath in_pa;
650 int ofl_ctrl;
651 {
652 
653 #line 980 "reduc.w"
654  Psysteme systeme; Pdisjunct ret_dj = DJ_UNDEFINED;
655 #line 1001 "reduc.w"
656  Ppath pa; Pcomplist lcomp;
657 #line 1040 "reduc.w"
658 
659  Pcontrainte common_cons = NULL, cons, cons_oppose = NULL;
660  Pvecteur vect_1, cons_pv = NULL;
661  Pcomplist comp;
662 
663 #line 1111 "reduc.w"
664 
665  Pcontrainte common_cons_oppose;
666  Psysteme common_ps, common_ps_oppose;
667  Ppath pa1, pa2;
668  bool pa1_empty = false, pa2_empty = false;
669  bool pa1_filled = false, pa2_filled = false;
670 
671 #line 1144 "reduc.w"
672  Pdisjunct dj1 = dj_empty(), dj2 = dj_empty();
673 #line 1214 "reduc.w"
674 
675 
676 
677 #line 981 "reduc.w"
678 
679  C3_DEBUG( "pa_path_to_few_disjunct_ofl_ctrl", {
680  fprintf(stderr, "\n\n Input path:\n\n");
681  pa_fprint(stderr, in_pa, union_variable_name );
682  });
683 
684  if (PA_UNDEFINED_P( in_pa )) C3_RETURN(IS_DJ, DJ_UNDEFINED);
685  if (pa_full_p ( in_pa )) C3_RETURN(IS_DJ, dj_full());
686  if (pa_empty_p ( in_pa )) C3_RETURN(IS_DJ, dj_empty());
687 
688  /* If it's an empty path or if it has no complements : return */
689  systeme = in_pa->psys ;
690  if (!sc_faisabilite_ofl( systeme )) C3_RETURN(IS_DJ,dj_empty());
691  if (in_pa->pcomp == NULL) C3_RETURN(IS_DJ,(Pdisjunct) sl_append_system(NULL,sc_dup(systeme)));
692 
693 #line 1216 "reduc.w"
694 
695 
696 #line 1002 "reduc.w"
697 
698  pa = pa_make(sc_dup(systeme), sl_dup(in_pa->pcomp));
699  pa = pa_reduce_simple_complement( pa );
700 
701  if (pa_empty_p(pa)) {pa = pa_free(pa); C3_RETURN(IS_DJ,dj_empty());}
702 
703  pa = pa_transform_eg_in_ineg ( pa );
704  lcomp = pa->pcomp ;
705  systeme = pa->psys ;
706 
707  C3_DEBUG( "pa_path_to_few_disjunct_ofl_ctrl", {
708  fprintf(stderr, "pa:\n");
709  pa_fprint_tab(stderr, pa, union_variable_name, 1 );
710  });
711 
712  if ( pa->pcomp == NULL ) {
713  pa = pa_free1(pa);
714  ret_dj = (Pdisjunct) sl_append_system(NULL, systeme);
715 
716  C3_DEBUG( "pa_path_to_few_disjunct_ofl_ctrl", {
717  fprintf(stderr, "No complement, returning:\n");
718  dj_fprint_tab(stderr, ret_dj, union_variable_name, 1 );
719  });
720 
721  return ret_dj;
722  }
723 
724 #line 1217 "reduc.w"
725 
726 
727 #line 1045 "reduc.w"
728 
729  /* We are looking for a common hyperplan */
730  vect_1 = vect_new(TCST, VALUE_ONE); common_cons = NULL;
731 
732  for(cons = (lcomp->psys)->inegalites;
733  (cons != NULL)&&(lcomp->succ != NULL);cons = cons->succ){
734  bool is_common = true;
735  cons_pv = vect_dup( cons->vecteur ); vect_chg_sgn( cons_pv );
736  cons_oppose = contrainte_make(vect_add( cons_pv, vect_1 ));
737 
738  for(comp = lcomp->succ;(comp != NULL) && is_common; comp = comp->succ){
739  Pcontrainte ineg = (comp->psys)->inegalites;
740  bool is_common1, is_common2;
741 
742  is_common1 = contrainte_in_liste( cons, ineg );
743  is_common2 = contrainte_in_liste( cons_oppose, ineg );
744  is_common = is_common1 || is_common2;
745  }
746  if (!is_common) {
747  /* removes cons_pv and vect_dup(vect_1) */
748  cons_oppose = contrainte_free(cons_oppose);
749  vect_rm( cons_pv ); cons_pv = (Pvecteur) NULL;
750  continue;
751  }
752  common_cons = cons;
753  vect_chg_sgn( cons_pv );
754  break;
755  }
756 
757  C3_DEBUG( "pa_path_to_few_disjunct_ofl_ctrl", {
758  fprintf(stderr, "cons_pv: ");
759  if (common_cons == NULL) fprintf(stderr, "NULL\n");
760  else vect_fprint(stderr, cons_pv, union_variable_name);
761  });
762 
763 #line 1218 "reduc.w"
764 
765 
766 #line 1086 "reduc.w"
767 
768  if( common_cons != NULL ) {
769 
770 #line 1118 "reduc.w"
771 
772  common_ps = sc_make( CONTRAINTE_UNDEFINED, contrainte_make(cons_pv) );
773  cons_pv = vect_dup( common_cons->vecteur ); vect_chg_sgn( cons_pv );
774  common_cons_oppose = contrainte_make(vect_add(cons_pv,vect_1));
775  common_ps_oppose = sc_make( CONTRAINTE_UNDEFINED, common_cons_oppose );
776  pa1 = pa_new(); pa2= pa_new();
777 
778  for(comp = lcomp; comp != NULL; comp = comp->succ){
779  Psysteme local_ps;
780  Pcontrainte co = comp->psys->inegalites;
781 
782  if (!pa1_empty && contrainte_in_liste(common_cons, co)) {
783  local_ps = sc_supress_same_constraints( common_ps, comp->psys );
784  if (local_ps == SC_EMPTY) { pa1 = pa_empty(); pa1_empty = true; continue;}
785  pa1->pcomp = sl_append_system( pa1->pcomp, local_ps ); pa1_filled = true;
786  }
787  else if(!pa2_empty && contrainte_in_liste(common_cons_oppose, co)) {
788  local_ps = sc_supress_same_constraints( common_ps_oppose, comp->psys );
789  if (local_ps == SC_EMPTY) {pa2 = pa_empty(); pa2_empty = true; continue;}
790  pa2->pcomp = sl_append_system( pa2->pcomp, local_ps ); pa2_filled = true;
791  }
792  }
793 
794 #line 1088 "reduc.w"
795 
796 
797 #line 1145 "reduc.w"
798 
799  if (pa1_filled) {
800  /* take care of rule 2 */
801  if (pa_full_p( pa2 )) pa1->psys = sc_dup( systeme );
802  else pa1->psys = sc_safe_append( sc_dup(common_ps), systeme );
803 
804  C3_DEBUG("pa_path_to_few_disjunct", {
805  fprintf(stderr, "pa1:\n");
806  pa_fprint_tab( stderr, pa1, union_variable_name, 1 );
807  });
808 
809  if (pa_full_p(pa2)||sc_faisabilite_ofl(pa1->psys))
810  {dj_free(dj1);dj1 = pa_path_to_few_disjunct_ofl_ctrl(pa1, ofl_ctrl);}
811 
812  }
813 
814  if (pa2_filled) {
815  /* take care of rule 2 */
816  if (pa_full_p( pa1 )) pa2->psys = sc_dup( systeme );
817  else pa2->psys = sc_safe_append( sc_dup(common_ps_oppose), systeme );
818 
819  C3_DEBUG("pa_path_to_few_disjunct", {
820  fprintf(stderr, "pa2:\n");
821  pa_fprint_tab( stderr, pa2, union_variable_name, 1 );
822  });
823  if (pa_full_p(pa1)||sc_faisabilite_ofl(pa2->psys))
824  {dj_free(dj2);dj2 = pa_path_to_few_disjunct_ofl_ctrl(pa2, ofl_ctrl);}
825 
826 
827  }
828 
829  ret_dj = dj_union( dj1, dj2 );
830 
831  /* Manage memory, free:
832  * cons_oppose, common_ps, common_ps_oppose,
833  * cons_pv, vect_1, pa1, pa2
834  */
835  cons_oppose = contrainte_free( cons_oppose );
836  common_ps = sc_free( common_ps );
837  common_ps_oppose = sc_free( common_ps_oppose );
838  vect_rm(cons_pv); cons_pv = NULL;
839  pa1 = pa_free(pa1); pa2 = pa_free(pa2);
840 
841 #line 1089 "reduc.w"
842 
843  }
844  else {
845 
846 #line 1191 "reduc.w"
847  ret_dj = pa_path_to_disjunct_rule4_ofl_ctrl( pa, ofl_ctrl );
848 
849 #line 1092 "reduc.w"
850 
851  }
852 
853  /* Manage memory */
854  pa = pa_free(pa); vect_rm(vect_1); vect_1 = NULL;
855 
856  C3_RETURN(IS_DJ, ret_dj);
857 
858 #line 1219 "reduc.w"
859 
860 }
861 
862 #line 1249 "reduc.w"
863 
864 /* bool pa_inclusion_p(Psysteme ps1, Psysteme ps2) BA, AL 31/05/94
865  * returns true if ps1 represents a subset of ps2, false otherwise
866  * Inspector (no sharing on memory).
867  */
868 bool pa_inclusion_p_ofl_ctrl(ps1, ps2, ofl_ctrl)
869 Psysteme ps1, ps2;
870 int ofl_ctrl;
871 {
872  bool result;
873  Ppath chemin = pa_make(ps1, sl_append_system(NULL, ps2));
874 
876  result = false;
877  }
878  TRY {
879  result = ! (pa_feasibility_ofl_ctrl(chemin, ofl_ctrl));
881  }
882  chemin = pa_free1(chemin);
883  return(result);
884 }
885 
886 #line 1275 "reduc.w"
887 
888 /* bool pa_system_equal_p(Psysteme ps1, Psysteme ps2) BA
889  */
890 bool pa_system_equal_p_ofl_ctrl(ps1,ps2, ofl_ctrl)
891 Psysteme ps1, ps2;
892 int ofl_ctrl;
893 {
894  return ( pa_inclusion_p_ofl_ctrl(ps1,ps2, ofl_ctrl) &&
895  pa_inclusion_p_ofl_ctrl(ps2,ps1, ofl_ctrl) );
896 }
897 
898 #line 1290 "reduc.w"
899 
900 /* Pdisjunct pa_system_difference_ofl_ctrl(ps1, ps2)
901  * input : two Psystemes
902  * output : a disjunction representing ps1 - ps2
903  * modifies : nothing
904  * comment : algorihtm :
905  * chemin = ps1 inter complement of (ps2)
906  * ret_dj = dj_simple_inegs_to_eg( pa_path_to_few_disjunct(chemin) )
907  */
909 Psysteme ps1,ps2;
910 int ofl_ctrl;
911 {
912  Ppath chemin;
913  Pdisjunct dj, ret_dj;
914 
915  if ((ps1 == SC_UNDEFINED)||(ps2 == SC_UNDEFINED)) return DJ_UNDEFINED;
916  if (sc_empty_p(ps2)) return sl_append_system(NULL,sc_dup(ps1));
917  if (sc_empty_p(ps1)) return dj_empty();
918 
919  chemin = pa_make(ps1, sl_append_system(NULL,ps2));
920  dj = pa_path_to_few_disjunct_ofl_ctrl(chemin, ofl_ctrl);
921  chemin = pa_free1( chemin );
922  ret_dj = dj_simple_inegs_to_eg( dj );
923  dj = dj_free( dj );
924  return ret_dj;
925 }
926 
927 #line 1323 "reduc.w"
928 
929 /* bool pa_convex_hull_equals_union_p(conv_hull, ps1, ps2)
930  * input : two Psystems and their convex hull AL,BC 23/03/95
931  * output : true if ps1 U ps2 = convex_hull, false otherwise
932  * modifies : nothing
933  * comment : complexity = nb_constraints(ps1) * nb_constraints(ps2)
934  * if ofl_ctrl = OFL_CTRL, conservatively returns ofl_ctrl
935  * when an overflow error occurs
936  */
938  (conv_hull, ps1, ps2, ofl_ctrl, ofl_res)
939 Psysteme conv_hull, ps1, ps2;
940 int ofl_ctrl;
941 volatile bool ofl_res;
942 {
943  volatile Ppath chemin;
944  bool result;
945  int local_ofl_ctrl = (ofl_ctrl == OFL_CTRL)?FWD_OFL_CTRL:ofl_ctrl;
946 
947  chemin = pa_make(conv_hull,sl_append_system(sl_append_system(NULL,ps1),ps2));
948 
949  if (ofl_ctrl==OFL_CTRL) {
951  result = ofl_res;
952  }
953  TRY {
954  result = !(pa_feasibility_ofl_ctrl(chemin, local_ofl_ctrl));
956  }
957  }
958  else
959  result = !(pa_feasibility_ofl_ctrl(chemin, local_ofl_ctrl));
960 
961  chemin = pa_free1(chemin);
962  return(result);
963 }
964 
965 #line 1369 "reduc.w"
966 
#define CATCH(what)
@ overflow_error
#define UNCATCH(what)
#define TRY
#define value_pos_p(val)
#define value_minus(v1, v2)
#define pgcd(a, b)
Pour la recherche de performance, selection d'une implementation particuliere des fonctions.
#define value_uminus(val)
unary operators on values
#define value_zero_p(val)
int Value
#define value_eq(v1, v2)
bool operators on values
#define value_plus(v1, v2)
binary operators on values
#define VALUE_ONE
#define value_abs(val)
#define value_mult(v, w)
whether the default is protected or not this define makes no sense any more...
#define value_neg_p(val)
Pbase base_union(Pbase b1, Pbase b2)
Pbase base_union(Pbase b1, Pbase b2): compute a new basis containing all elements of b1 and all eleme...
Definition: base.c:428
#define CONTRAINTE_UNDEFINED_P(c)
#define CONTRAINTE_NULLE_P(c)
contrainte nulle (non contrainte 0 == 0 ou 0 <= 0)
#define CONTRAINTE_UNDEFINED
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
void eq_set_vect_nul(Pcontrainte)
void_eq_set_vect_nul(Pcontrainte c): transformation d'une contrainte en une contrainte triviale 0 == ...
Definition: unaires.c:84
void inegalites_fprint(FILE *, Pcontrainte, char *(*)(Variable))
void contrainte_reverse(Pcontrainte)
void contrainte_reverse(Pcontrainte eq): changement de signe d'une contrainte, i.e.
Definition: unaires.c:67
void contrainte_chg_sgn(Pcontrainte)
void contrainte_chg_sgn(Pcontrainte eq): changement de signe d'une contrainte, i.e.
Definition: unaires.c:56
bool contrainte_in_liste(Pcontrainte, Pcontrainte)
listes.c
Definition: listes.c:52
void inegalite_fprint(FILE *, Pcontrainte, char *(*)(Variable))
Pdisjunct dj_free(Pdisjunct in_dj)
Pdisjunct dj_free( (Pdisjunct) in_dj ) AL 31/05/94 w - 1 depth free of input disjunction.
Definition: disjunct.c:69
Pdisjunct dj_append_system(Pdisjunct in_dj, Psysteme in_ps)
Pdisjunct dj_append_system( (Pdisjunct) in_dj, (Psysteme) in_ps ) Input : A disjunct in_dj to wich in...
Definition: disjunct.c:403
Pdisjunct dj_simple_inegs_to_eg(Pdisjunct in_dj)
Pdisjunct dj_simple_inegs_to_eg( in_dj ) transforms two opposite inequalities in a simple equality in...
Definition: disjunct.c:339
Pdisjunct dj_union(Pdisjunct in_dj1, Pdisjunct in_dj2)
Pdisjunct dj_union( (Pdisjunct) in_dj1, (Pdisjunct) in_dj2 ) Give the union of the two disjunctions.
Definition: disjunct.c:211
Pdisjunct dj_full()
Pdisjunct dj_full() AL 18/11/93 Return full space disjunction = dj_new()
Definition: disjunct.c:92
void dj_fprint_tab(FILE *in_fi, Pdisjunct in_dj, char *(*in_fu)(), int in_tab)
void dj_fprint_tab(FILE*, Pdisjunct, function, int) prints a Pdisjunct
Definition: disjunct.c:492
Pdisjunct dj_empty()
Pdisjunct dj_empty() AL 18/11/93 Returns a disjunction with sc_empty() element.
Definition: disjunct.c:111
struct cons cons
The structure used to build lists in NewGen.
void vect_fprint(FILE *f, Pvecteur v, get_variable_name_t variable_name)
void vect_fprint(FILE * f, Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v su...
Definition: io.c:124
int vect_size(Pvecteur v)
package vecteur - reductions
Definition: reductions.c:47
#define abort()
Definition: misc-local.h:53
#define assert(ex)
Definition: newgen_assert.h:41
int pa_max_constraints_nb(Ppath in_pa)
int pa_max_constraints_nb( (Ppath) in_pa ) Give the maximum constraints nb among systems of in_pa.
Definition: path.c:155
Ppath pa_full()
Ppath pa_full() AL 18/11/93 Returns full space path : pa_full = pa_new()
Definition: path.c:117
Ppath pa_empty()
Ppath pa_empty() AL 18/11/93 Returns empty path : pa_empty = sc_empty(NULL) ^ (NIL)
Definition: path.c:135
void pa_fprint_tab(FILE *in_fi, Ppath in_pa, char *(*in_fu)(), int in_tab)
void pa_fprint_tab(FILE*, Pdisjunct, function, tab) prints a Ppath
Definition: path.c:412
Ppath pa_transform_eg_in_ineg(Ppath in_pa)
Ppath pa_transform_eg_in_ineg( in_pa ) Transforms all equalities of all systems composing in_pa in in...
Definition: path.c:284
Ppath pa_free(Ppath in_pa)
Ppath pa_free(Ppath pa) BA, AL 30/05/94.
Definition: path.c:76
Pdisjunct pa_path_to_disjunct_ofl_ctrl(Ppath in_pa, int ofl_ctrl)
Pdisjunct pa_path_to_disjunct_ofl_ctrl ( (Ppath) in_pa, (int) ofl_ctrl) Produces a Pdisjunct corres...
Definition: path.c:374
Ppath pa_make(Psysteme in_ps, Pcomplist in_pcomp)
Package : C3/union Author : Arnauld LESERVOT (leservot(a)limeil.cea.fr) Date : Modified : 04 04 95 ...
Definition: path.c:53
bool pa_feasibility_ofl_ctrl(Ppath in_pa, int ofl_ctrl)
bool pa_feasibility_ofl_ctrl( (Ppath) in_pa, int ofl_ctrl) Returns true if the input path is possib...
Definition: path.c:309
bool pa_full_p(Ppath in_pa)
pa_full_p( (Ppath) in_pa ) AL 18/11/93 Returns True if in_pa = (NIL) ^ (NIL)
Definition: path.c:123
Ppath pa_free1(Ppath in_pa)
Ppath pa_free1(Ppath pa) BA, AL 30/05/94 1 depth free.
Definition: path.c:102
bool pa_empty_p(Ppath in_pa)
pa_empty_p( (Ppath) in_pa ) AL 18/11/93 Returns True if in_pa = (1*TCST = 0) ^ (NIL)
Definition: path.c:141
Ppath pa_reduce_simple_complement(Ppath in_pa)
Ppath pa_reduce_simple_complement( (Ppath) in_pa ) AL 16/11/93 Scan all the complement.
Definition: path.c:222
Psommet eq_in_ineq(Psommet *sys, int *nb_som, Pvecteur *lvbase)
Psommet eq_in_ineq(Psommet * sys, int * nb_som, Pvecteur * lvbase): Transformation des egalites du sy...
Definition: plvar-ecart.c:68
enum hspara_elem contrainte_parallel_in_liste(Pcontrainte in_co, Pcontrainte in_lc)
enum enum hspara_elem contrainte_parallel_in_liste( in_co, in_lc ) AL950711 input: 1 constraint in_co...
Definition: reduc.c:204
#define hspara_to_string(se)
Definition: reduc.c:87
#define hspara_join(se1, se2)
Definition: reduc.c:85
Psysteme sc_supress_same_constraints(Psysteme in_ps1, Psysteme in_ps2)
Psysteme sc_supress_same_constraints( in_ps1, in_ps2 ) supress in in_ps2 constraints that are in in_p...
Definition: reduc.c:329
Psysteme sc_supress_parallel_redund_constraints(Psysteme in_ps1, Psysteme in_ps2)
Psysteme sc_supress_parallel_redund_constraints( in_ps1, in_ps2 ) input: 2 Psystemes in_ps1 and in_ps...
Definition: reduc.c:255
static enum hspara_elem hspara_jm[10][10]
Definition: reduc.c:70
Ppath pa_supress_same_constraints(Ppath in_pa)
Ppath pa_supress_same_constraints( (Ppath) in_pa ) Supress from complements of in_pa same constrain...
Definition: reduc.c:528
bool pa_convex_hull_equals_union_p_ofl_ctrl(Psysteme conv_hull, Psysteme ps1, Psysteme ps2, int ofl_ctrl, volatile bool ofl_res)
bool pa_convex_hull_equals_union_p(conv_hull, ps1, ps2) input : two Psystems and their convex hull AL...
Definition: reduc.c:938
bool pa_inclusion_p_ofl_ctrl(Psysteme ps1, Psysteme ps2, int ofl_ctrl)
bool pa_inclusion_p(Psysteme ps1, Psysteme ps2) BA, AL 31/05/94 returns true if ps1 represents a subs...
Definition: reduc.c:868
Pdisjunct pa_path_to_disjunct_rule4_ofl_ctrl(Ppath in_pa, int ofl_ctrl)
Pdisjunct pa_path_to_disjunct_rule4_ofl_ctrl( (Ppath) in_pa, int ofl_ctrl) Returns the correspondin...
Definition: reduc.c:570
Pdisjunct pa_path_to_few_disjunct_ofl_ctrl(Ppath in_pa, int ofl_ctrl)
line 1197 "reduc.w"
Definition: reduc.c:648
Pdisjunct pa_system_difference_ofl_ctrl(Psysteme ps1, Psysteme ps2, int ofl_ctrl)
Pdisjunct pa_system_difference_ofl_ctrl(ps1, ps2) input : two Psystemes output : a disjunction repres...
Definition: reduc.c:908
static char *hspara_string[10] __attribute__((unused))
Package : C3/union Author : Arnauld LESERVOT (leservot(a)limeil.cea.fr) Date : Modified : 04 04 95 ...
Definition: bootstrap.c:4277
Psysteme sc_elim_redund_with_first_ofl_ctrl(Psysteme in_ps1, Psysteme in_ps2, int ofl_ctrl)
Psysteme sc_elim_redund_with_first_ofl_ctrl( in_ps1, in_ps2, ofl_ctrl ) Returns constraints of in_ps2...
Definition: reduc.c:412
enum hspara_elem vect_parallel(Pvecteur in_v1, Pvecteur in_v2)
enum hspara_elem vect_parallel(Pvecteur in_v1, Pvecteur in_v2) AL950711 input: 2 Pvecteur in_v1 and i...
Definition: reduc.c:104
bool pa_system_equal_p_ofl_ctrl(Psysteme ps1, Psysteme ps2, int ofl_ctrl)
bool pa_system_equal_p(Psysteme ps1, Psysteme ps2) BA
Definition: reduc.c:890
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg)
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg): allocation et initialisation d'un systeme d'equ...
Definition: sc.c:78
bool sc_weak_consistent_p(Psysteme sc)
check that sc is well defined, that the numbers of equalities and inequalities are consistent with th...
Definition: sc.c:362
Psysteme sc_empty(Pbase b)
Psysteme sc_empty(Pbase b): build a Psysteme with one unfeasible constraint to define the empty subsp...
Definition: sc_alloc.c:319
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
bool sc_empty_p(Psysteme sc)
bool sc_empty_p(Psysteme sc): check if the set associated to sc is the constant sc_empty or not.
Definition: sc_alloc.c:350
void sc_add_inegalite(Psysteme p, Pcontrainte i)
void sc_add_inegalite(Psysteme p, Pcontrainte i): macro ajoutant une inegalite i a un systeme p; la b...
Definition: sc_alloc.c:406
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Definition: sc_alloc.c:176
bool sc_rational_feasibility_ofl_ctrl(Psysteme sc, int ofl_ctrl, bool ofl_res)
Value b2
Definition: sc_gram.c:105
Value b1
booleen indiquant quel membre est en cours d'analyse
Definition: sc_gram.c:105
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
Definition: sc_gram.c:108
Psysteme sc_safe_append(Psysteme s1, Psysteme s2)
Psysteme sc_safe_append(Psysteme s1, Psysteme s2) input : output : calcul de l'intersection des polye...
void sc_fprint(FILE *fp, Psysteme ps, get_variable_name_t nom_var)
void sc_fprint(FILE * f, Psysteme ps, char * (*nom_var)()): cette fonction imprime dans le fichier po...
Definition: sc_io.c:220
Psysteme sc_free(Psysteme in_ps)
Psysteme sc_free( in_ps ) AL 30/05/94 Free of in_ps.
Definition: sc_list.c:112
Psysteme sc_full()
Psysteme sc_full() similar to sc_new.
Definition: sc_list.c:58
Psyslist sl_free(Psyslist psl)
Psyslist sl_free(Psyslist psl) BA, AL 30/05/94 w - 1 depth free.
Definition: sc_list.c:327
char *(* union_variable_name)(Variable)
Package : C3/union Author : Arnauld LESERVOT (leservot(a)limeil.cea.fr) Date : Modified : 04 04 95 ...
Definition: sc_list.c:51
Psyslist sl_append_system(Psyslist in_sl, Psysteme in_ps)
Psyslist sl_append_system( (Psyslist) in_sl, (Psysteme) in_ps ) Input : A disjunct in_sl to wich in_p...
Definition: sc_list.c:240
bool sc_full_p(Psysteme in_ps)
Psysteme sc_full_p( in_ps ) similar to sc_new.
Definition: sc_list.c:61
Psyslist sl_dup(Psyslist in_sl)
Psyslist sl_dup( (Psyslist) in_sl ) AL 15/11/93 w - 1 duplication : everything is duplicated,...
Definition: sc_list.c:296
bool sl_length(Psyslist in_sl)
int sl_length( (Psyslist) in_sl ) AL 26/04/95 Returns length of in_sl.
Definition: sc_list.c:193
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 ...
void sc_transform_eg_in_ineg(Psysteme sc)
Package sc.
void vect_chg_sgn(Pvecteur v)
void vect_chg_sgn(Pvecteur v): multiplie v par -1
Definition: scalaires.c:151
Pvecteur vecteur
struct Scontrainte * succ
Pcomplist pcomp
Definition: union-local.h:20
Psysteme psys
Definition: union-local.h:19
Warning! Do not modify this file that is automatically generated!
Definition: union-local.h:3
Psysteme psys
Definition: union-local.h:4
struct Ssyslist * succ
Definition: union-local.h:5
Pcontrainte inegalites
Definition: sc-local.h:71
Pbase base
Definition: sc-local.h:75
int dimension
Definition: sc-local.h:74
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
struct Svecteur * succ
Definition: vecteur-local.h:92
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
#define pa_fprint(fi, pa, fu)
Definition: union-local.h:109
#define PA_UNDEFINED_P(pa)
Definition: union-local.h:110
#define PA_UNDEFINED
Definition: union-local.h:23
#define IS_DJ
Definition: union-local.h:135
Ssyslist * Pdisjunct
Definition: union-local.h:10
#define IS_SC
Definition: union-local.h:133
#define C3_DEBUG(fun, code)
Definition: union-local.h:150
#define C3_RETURN(type, val)
Definition: union-local.h:151
#define IS_PA
Definition: union-local.h:136
hspara_elem
Implementation of the finite parallel half space lattice hspara.
Definition: union-local.h:49
@ full
Definition: union-local.h:65
@ keep
bj > b1 -> h1/hj = h1
Definition: union-local.h:61
@ ssplus
b1 == bj -> h1/hj = full
Definition: union-local.h:53
@ opzero
bj < b1 -> h1/hj = h1
Definition: union-local.h:59
@ opplus
b1 == bj -> h1/hj = h1
Definition: union-local.h:60
@ ssminus
bj > b1 -> h1/hj = full
Definition: union-local.h:57
@ unpara
compare {h1: a1 X + b1 <= 0} with {hj: aj X + bj <= 0}
Definition: union-local.h:50
@ sszero
unparallel -> h1/hj = h1
Definition: union-local.h:52
@ opminus
empty part
Definition: union-local.h:63
@ empty
b1 < bj -> h1/hj = empty
Definition: union-local.h:64
#define pa_new()
Definition: union-local.h:111
#define PATH_MAX_CONSTRAINTS
Misceleanous (debuging...)
Definition: union-local.h:131
#define DJ_UNDEFINED
Definition: union-local.h:12
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define val_of(varval)
struct Svecteur * Pvecteur
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 FWD_OFL_CTRL
#define var_of(varval)
#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;.
Definition: alloc.c:51
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
Definition: alloc.c:110
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Definition: alloc.c:78
Pvecteur vect_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
Definition: binaires.c:53
void vect_normalize(Pvecteur v)
void vect_normalize(Pvecteur v): division de tous les coefficients de v par leur pgcd; "normalisation...
Definition: unaires.c:59