PIPS
sc_list.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "linear_assert.h"
#include <time.h>
#include <sys/time.h>
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
#include "sc.h"
#include "sommet.h"
#include "polyedre.h"
#include "union.h"
+ Include dependency graph for sc_list.c:

Go to the source code of this file.

Functions

Psysteme sc_full ()
 Psysteme sc_full() similar to sc_new. More...
 
bool sc_full_p (Psysteme in_ps)
 Psysteme sc_full_p( in_ps ) similar to sc_new. More...
 
Psysteme sc_dup1 (Psysteme in_ps)
 Psysteme sc_dup1( in_ps ) AL 30/05/94 1 depth copy of in_ps: no duplication of vectors (except for the base). More...
 
Psysteme sc_free (Psysteme in_ps)
 Psysteme sc_free( in_ps ) AL 30/05/94 Free of in_ps. More...
 
Psysteme sc_free1 (Psysteme in_ps)
 Psysteme sc_free1( in_ps ) AL 30/05/94 Only pcontrainte of in_ps are freed. More...
 
Psysteme sc_concatenate (Psysteme in_s1, Psysteme in_s2)
 Psysteme sc_concatenate( in_s1, in_s2 ) AL 30/05/94 Append in_s2 to the end of in_s1 and returns in_s1. More...
 
bool sl_length (Psyslist in_sl)
 int sl_length( (Psyslist) in_sl ) AL 26/04/95 Returns length of in_sl. More...
 
int sl_max_constraints_nb (Psyslist in_sl)
 int sl_max_constraints_nb( (Psyslist) in_sl ) Give the maximum constraints nb among systems of in_sl. More...
 
bool sl_is_system_p (Psyslist in_sl)
 bool sl_is_system_p( (Psyslist) in_sl ) AL 16/11/93 Returns True if syslist in_sl has only one Psysteme in it. More...
 
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_ps will be added. More...
 
Psyslist sl_append_system_first (Psyslist in_sl, Psysteme in_ps)
 Psyslist sl_append_system_first( in_sl, in_ps ) AL 23/03/95 A new Psyslist with in_ps at the end of in_sl (sharing). More...
 
Psyslist sl_new ()
 Psyslist sl_new() AL 26/10/93 Input : Nothing. More...
 
Psyslist sl_dup (Psyslist in_sl)
 Psyslist sl_dup( (Psyslist) in_sl ) AL 15/11/93 w - 1 duplication : everything is duplicated, except entities. More...
 
Psyslist sl_dup1 (Psyslist in_sl)
 Psyslist sl_dup1( (Psyslist) in_sl ) AL 15/11/93 Duplicates input syslist. More...
 
Psyslist sl_free (Psyslist psl)
 Psyslist sl_free(Psyslist psl) BA, AL 30/05/94 w - 1 depth free. More...
 
Psyslist sl_free1 (Psyslist psl)
 Psyslist sl_free1(Psyslist psl) AL 30/05/94 1 depth free. More...
 
void sl_set_variable_name (char *(*in_fu)())
 char* sl_set_variable_name( in_fu ) give the function to read variables More...
 
char * sl_get_tab_string (int in_tab)
 char* sl_get_tab_string( in_tab ) returns a string of in_tab \t More...
 
void sl_fprint_tab (FILE *in_fi, Psyslist in_sl, char *(*in_fu)(), int in_tab)
 
void sl_fprint (in_fi, in_sl, char *(*in_fu)())
 
int slx_parse (void)
 fichier lu par sl_lex.l
More...
 
void sl_init_lex (void)
 
Psyslist sl_read (char *nomfic)
 void sl_read(FILE*) reads a Psyslist More...
 
void un_fprint_tab (FILE *in_fi, char *in_un, char *(*in_fu)(), int in_ty, int in_tab)
 void un_fprint_tab(FILE*, Pdisjunct, function, type, tab) prints a union More...
 

Variables

char *(* union_variable_name )(Variable) = variable_default_name
 Package : C3/union Author : Arnauld LESERVOT (leservot(a)limeil.cea.fr) Date :
Modified : 04 04 95 Documents: UNION.tex : `‘Extension de C3 aux unions de polyedres’' Comments : More...
 
Psyslist sl_yacc
 
FILE * slx_in
 Psysteme construit par sl_gram.y. More...
 

Function Documentation

◆ sc_concatenate()

Psysteme sc_concatenate ( Psysteme  in_s1,
Psysteme  in_s2 
)

Psysteme sc_concatenate( in_s1, in_s2 ) AL 30/05/94 Append in_s2 to the end of in_s1 and returns in_s1.

Freeable with sc_free1(). Sharing.

Memory management and returns

Parameters
in_s1n_s1
in_s2n_s2

Definition at line 157 of file sc_list.c.

159 {
160  Pcontrainte eq;
161  Psysteme s1, s2;
162 
163  s1 = sc_dup1( in_s1 ); s2 = sc_dup1( in_s2 );
164  if (SC_UNDEFINED_P(in_s1)) {s1 = sc_free1(s1); return(s2);}
165  if (SC_UNDEFINED_P(in_s2)) {s2 = sc_free1(s2); return(s1);}
166 
167  if (s1->nb_eq != 0) {
168  for (eq = s1->egalites; eq->succ != (Pcontrainte)NULL; eq = eq->succ) ;
169  eq->succ = s2->egalites; s1->nb_eq += s2->nb_eq;
170  }
171  else { s1->egalites = s2->egalites; s1->nb_eq = s2->nb_eq; }
172 
173  if (s1->nb_ineq != 0) {
174  for (eq = s1->inegalites;eq->succ != (Pcontrainte)NULL;eq = eq->succ) ;
175  eq->succ = s2->inegalites; s1->nb_ineq += s2->nb_ineq;
176  }
177  else { s1->inegalites = s2->inegalites; s1->nb_ineq = s2->nb_ineq; }
178 
179  /* Memory management and returns */
180  vect_rm( s1->base ); vect_rm( s2->base ); free( s2 ); s2 = NULL;
181  s1->base = NULL; sc_creer_base( s1 );
182  return(s1);
183 }
void free(void *)
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
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
Definition: sc_gram.c:108
Psysteme sc_dup1(Psysteme in_ps)
Psysteme sc_dup1( in_ps ) AL 30/05/94 1 depth copy of in_ps: no duplication of vectors (except for th...
Definition: sc_list.c:72
Psysteme sc_free1(Psysteme in_ps)
Psysteme sc_free1( in_ps ) AL 30/05/94 Only pcontrainte of in_ps are freed.
Definition: sc_list.c:121
s1
Definition: set.c:247
struct Scontrainte * succ
Pcontrainte inegalites
Definition: sc-local.h:71
Pcontrainte egalites
Definition: sc-local.h:70
Pbase base
Definition: sc-local.h:75
int nb_ineq
Definition: sc-local.h:73
int nb_eq
Definition: sc-local.h:72
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Definition: alloc.c:78

References Ssysteme::base, Ssysteme::egalites, eq, free(), Ssysteme::inegalites, Ssysteme::nb_eq, Ssysteme::nb_ineq, s1, sc_creer_base(), sc_dup1(), sc_free1(), Scontrainte::succ, and vect_rm().

+ Here is the call graph for this function:

◆ sc_dup1()

Psysteme sc_dup1 ( Psysteme  in_ps)

Psysteme sc_dup1( in_ps ) AL 30/05/94 1 depth copy of in_ps: no duplication of vectors (except for the base).

Sharing !

Parameters
in_psn_ps

Definition at line 72 of file sc_list.c.

74 {
75  Psysteme cp = SC_UNDEFINED;
76  Pcontrainte eq, eq_cp;
77 
78  if (!SC_UNDEFINED_P(in_ps)) {
79  cp = sc_new();
80 
81  for (eq = in_ps->egalites; eq != NULL; eq = eq->succ) {
82  eq_cp = contrainte_new();
84  sc_add_egalite(cp, eq_cp);
85  }
86 
87  for(eq=in_ps->inegalites;eq!=NULL;eq=eq->succ) {
88  eq_cp = contrainte_new();
90  sc_add_inegalite(cp, eq_cp);
91  }
92 
93  if(in_ps->dimension==0) {
95  cp->dimension = 0;
96  cp->base = VECTEUR_UNDEFINED;
97  }
98  else {
99  assert(in_ps->dimension==vect_size(in_ps->base));
100  cp->dimension = in_ps->dimension;
101  cp->base = vect_dup(in_ps->base);
102  }
103  }
104  return(cp);
105 }
#define contrainte_vecteur(c)
passage au champ vecteur d'une contrainte "a la Newgen"
Pcontrainte contrainte_new(void)
package contrainte - allocations et desallocations
Definition: alloc.c:47
int vect_size(Pvecteur v)
package vecteur - reductions
Definition: reductions.c:47
#define assert(ex)
Definition: newgen_assert.h:41
void sc_add_egalite(Psysteme p, Pcontrainte e)
void sc_add_egalite(Psysteme p, Pcontrainte e): macro ajoutant une egalite e a un systeme p; la base ...
Definition: sc_alloc.c:389
Psysteme sc_new(void)
Psysteme sc_new(): alloue un systeme vide, initialise tous les champs avec des valeurs nulles,...
Definition: sc_alloc.c:55
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
Pvecteur cp
pointeur sur l'egalite ou l'inegalite courante
Definition: sc_read.c:87
int dimension
Definition: sc-local.h:74
#define VECTEUR_UNDEFINED
#define VECTEUR_UNDEFINED_P(v)
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

References assert, contrainte_new(), contrainte_vecteur, cp, eq, sc_add_egalite(), sc_add_inegalite(), sc_new(), Scontrainte::succ, vect_dup(), vect_size(), VECTEUR_UNDEFINED, and VECTEUR_UNDEFINED_P.

Referenced by sc_concatenate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sc_free()

Psysteme sc_free ( Psysteme  in_ps)

Psysteme sc_free( in_ps ) AL 30/05/94 Free of in_ps.

Returns NULL to be used as in_ps = sc_free( in_ps );

Parameters
in_psn_ps

Definition at line 112 of file sc_list.c.

114 { sc_rm( in_ps ); return( (Psysteme) NULL ); }
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

References sc_rm().

Referenced by c_convex_effects_on_actual_parameter_forward_translation(), dj_intersection_ofl_ctrl(), effects_to_dma(), new_system_with_only_live_variable(), pa_free(), pa_intersect_system(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), region_to_minimal_dimensions(), sc_elim_redund_with_first_ofl_ctrl(), sc_supress_parallel_redund_constraints(), sl_free(), transformer_list_generic_transitive_closure(), xml_Application(), xml_Boxes(), xml_Call(), xml_Loop(), and xml_Pattern_Paving().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sc_free1()

Psysteme sc_free1 ( Psysteme  in_ps)

Psysteme sc_free1( in_ps ) AL 30/05/94 Only pcontrainte of in_ps are freed.

Parameters
in_psn_ps

Definition at line 121 of file sc_list.c.

123 {
124  Pcontrainte pc, pc2;
125 
126  if (in_ps != NULL) {
127  for(pc = in_ps->inegalites; pc != NULL; ) {
128  pc2 = pc;
129  pc = pc->succ;
130  free(pc2);
131  pc2 = NULL;
132  }
133  for(pc = in_ps->egalites; pc != NULL; ) {
134  pc2 = pc;
135  pc = pc->succ;
136  free(pc2);
137  pc2 = NULL;
138  }
139  in_ps->nb_eq = 0;
140  in_ps->nb_ineq = 0;
141  in_ps->dimension = 0;
142  vect_rm( in_ps->base );
143  in_ps->base = NULL;
144 
145  free((char *) in_ps);
146  in_ps = (Psysteme) NULL;
147  }
148  return( (Psysteme) NULL );
149 }
struct Ssysteme * Psysteme

References free(), Scontrainte::succ, and vect_rm().

Referenced by sc_concatenate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sc_full()

Psysteme sc_full ( void  )

Psysteme sc_full() similar to sc_new.

Definition at line 58 of file sc_list.c.

58 { return sc_new(); }

References sc_new().

Referenced by pa_intersect_complement(), and sc_elim_redund_with_first_ofl_ctrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sc_full_p()

bool sc_full_p ( Psysteme  in_ps)

Psysteme sc_full_p( in_ps ) similar to sc_new.

Parameters
in_psn_ps

Definition at line 61 of file sc_list.c.

63 { return( (in_ps->nb_eq == 0) && (in_ps->nb_ineq == 0) &&
64  (in_ps->egalites == NULL) && (in_ps->inegalites == NULL) ); }

Referenced by dj_simple_inegs_to_eg(), pa_path_to_disjunct_rule4_ofl_ctrl(), sc_elim_redund_with_first_ofl_ctrl(), and sl_fprint_tab().

+ Here is the caller graph for this function:

◆ sl_append_system()

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_ps will be added.


Output : Disjunct in_sl with in_ps. => ! Sharing. Comment: Nothing is checked on result in_sl. AL 10/11/93

Parameters
in_sln_sl
in_psn_ps

Definition at line 240 of file sc_list.c.

243 {
244  Psyslist ret_sl;
245 
246  if (in_ps == NULL) return( in_sl );
247  ret_sl = sl_new(); ret_sl->psys = in_ps; ret_sl->succ = in_sl;
248  return( ret_sl );
249 }
Psyslist sl_new()
Psyslist sl_new() AL 26/10/93 Input : Nothing.
Definition: sc_list.c:277
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

References Ssyslist::psys, sl_new(), and Ssyslist::succ.

Referenced by dj_append_system(), dj_empty(), dj_intersect_system_ofl_ctrl(), dj_intersection_ofl_ctrl(), dj_simple_inegs_to_eg(), dj_system_complement(), pa_convex_hull_equals_union_p_ofl_ctrl(), pa_inclusion_p_ofl_ctrl(), pa_intersect_complement(), pa_path_to_disjunct_ofl_ctrl(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), pa_supress_same_constraints(), pa_system_difference_ofl_ctrl(), sl_append_system_first(), sl_dup(), and sl_dup1().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sl_append_system_first()

Psyslist sl_append_system_first ( Psyslist  in_sl,
Psysteme  in_ps 
)

Psyslist sl_append_system_first( in_sl, in_ps ) AL 23/03/95 A new Psyslist with in_ps at the end of in_sl (sharing).

Parameters
in_sln_sl
in_psn_ps

Definition at line 256 of file sc_list.c.

259 {
260  Psyslist new_sl = SL_NULL, sl = SL_NULL;
261 
262  if (in_ps == NULL) return( in_sl );
263  new_sl = sl_append_system(NULL, in_ps);
264  if (in_sl == SL_NULL) return new_sl;
265  if (in_sl->succ == NULL) { in_sl->succ = new_sl ; return in_sl; }
266  for(sl = in_sl; (sl->succ != NULL); sl = sl->succ) {}
267  sl->succ = new_sl;
268  return( in_sl );
269 }
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
#define SL_NULL
Definition: union-local.h:8

References sl_append_system(), SL_NULL, and Ssyslist::succ.

+ Here is the call graph for this function:

◆ sl_dup()

Psyslist sl_dup ( Psyslist  in_sl)

Psyslist sl_dup( (Psyslist) in_sl ) AL 15/11/93 w - 1 duplication : everything is duplicated, except entities.

Duplicates input syslist.

Parameters
in_sln_sl

Definition at line 296 of file sc_list.c.

298 {
299  Psyslist sl, ret_sl = SL_NULL;
300  for( sl = in_sl; sl != NULL; sl = sl->succ ) {
301  ret_sl = sl_append_system( ret_sl, sc_dup( sl->psys ) );
302  }
303  return ret_sl;
304 }
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Definition: sc_alloc.c:176

References Ssyslist::psys, sc_dup(), sl_append_system(), SL_NULL, and Ssyslist::succ.

Referenced by dj_dup(), pa_dup(), pa_intersect_complement(), pa_intersect_system(), and pa_path_to_few_disjunct_ofl_ctrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sl_dup1()

Psyslist sl_dup1 ( Psyslist  in_sl)

Psyslist sl_dup1( (Psyslist) in_sl ) AL 15/11/93 Duplicates input syslist.

Sharing.

Parameters
in_sln_sl

Definition at line 311 of file sc_list.c.

313 {
314  Psyslist sl, ret_sl = NULL;
315  for( sl = in_sl; sl != NULL; sl = sl->succ ) {
316  if ( sl->psys == SC_UNDEFINED ) continue;
317  ret_sl = sl_append_system( ret_sl, sl->psys );
318  }
319  return ret_sl;
320 }

References Ssyslist::psys, sl_append_system(), and Ssyslist::succ.

Referenced by dj_dup1(), and pa_dup1().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sl_fprint()

void sl_fprint ( in_fi  ,
in_sl  ,
char *(*)()  in_fu 
)

Definition at line 447 of file sc_list.c.

451 { sl_fprint_tab( in_fi, in_sl, in_fu, 0 ); }
void sl_fprint_tab(FILE *in_fi, Psyslist in_sl, char *(*in_fu)(), int in_tab)
Definition: sc_list.c:383

References sl_fprint_tab().

Referenced by build_list_of_min(), prepare_reindexing(), separate_variables(), and separate_variables_2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sl_fprint_tab()

void sl_fprint_tab ( FILE*  in_fi,
Psyslist  in_sl,
char *(*)()  in_fu,
int  in_tab 
)

Prints the VAR part

Prints Psysteme list

Special cases

General Cases

Definition at line 383 of file sc_list.c.

388 {
389  Pcontrainte peq = NULL;
390  Psyslist sl = NULL;
391  Pbase b = NULL, b1;
392  char* tabs = sl_get_tab_string( in_tab );
393 
394  if (in_sl == SL_NULL) {
395  fprintf( in_fi, "\n%sSL_NULL\n", tabs );
396  free(tabs); return;
397  }
398 
399  /* Prints the VAR part */
400  for(sl = in_sl; sl != NULL; sl = sl->succ) {
401  if (sl->psys == NULL) continue;
402  b1 = b;
403  b = base_union( b, (sl->psys)->base );
404  if ( b != b1 ) { vect_rm( b1 ); b1 = (Pvecteur) NULL; }
405  }
406 
407  if (vect_size( b ) >= 1 ) {
408  fprintf( in_fi,"%s", tabs);
409  fprintf( in_fi,"VAR %s", (*in_fu)(vecteur_var(b)));
410  for (b1=b->succ; !VECTEUR_NUL_P(b1); b1 = b1->succ)
411  fprintf(in_fi,", %s",(*in_fu)(vecteur_var(b1)));
412  }
413 
414  vect_rm( (Pvecteur) b ); b = (Pvecteur) NULL;
415 
416  /* Prints Psysteme list */
417  for(sl = in_sl ; sl != NULL; sl = sl->succ) {
418  Psysteme ps = NULL;
419 
420  ps = sl->psys;
421 
422  /* Special cases */
423  if ( SC_UNDEFINED_P(ps) )
424  {fprintf( in_fi, "\n%sSC_UNDEFINED\n", tabs); continue; }
425  if ( sc_full_p(ps) )
426  {fprintf( in_fi, "\n%sSC_FULL\n", tabs); continue; }
427  if ( sc_empty_p(ps) )
428  {fprintf( in_fi, "\n%sSC_EMPTY\n", tabs); continue; }
429 
430 
431  /* General Cases */
432  fprintf(in_fi,"\n%s { \n", tabs);
433 
434  for (peq = ps->inegalites;peq!=NULL;
435  fprintf(in_fi,"%s", tabs),
436  inegalite_fprint(in_fi,peq,in_fu),peq=peq->succ);
437 
438  for (peq = ps->egalites;peq!=NULL;
439  fprintf(in_fi,"%s", tabs),
440  egalite_fprint(in_fi,peq,in_fu),peq=peq->succ);
441 
442  fprintf(in_fi,"%s } \n", tabs);
443  }
444  free( tabs );
445 }
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
void egalite_fprint(FILE *, Pcontrainte, char *(*)(Variable))
void inegalite_fprint(FILE *, Pcontrainte, char *(*)(Variable))
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
Value b1
booleen indiquant quel membre est en cours d'analyse
Definition: sc_gram.c:105
char * sl_get_tab_string(int in_tab)
char* sl_get_tab_string( in_tab ) returns a string of in_tab \t
Definition: sc_list.c:366
bool sc_full_p(Psysteme in_ps)
Psysteme sc_full_p( in_ps ) similar to sc_new.
Definition: sc_list.c:61
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
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
#define vecteur_var(v)
struct Svecteur * Pvecteur
#define VECTEUR_NUL_P(v)

References b1, base_union(), egalite_fprint(), Ssysteme::egalites, fprintf(), free(), inegalite_fprint(), Ssysteme::inegalites, Ssyslist::psys, sc_empty_p(), sc_full_p(), sl_get_tab_string(), SL_NULL, Scontrainte::succ, Ssyslist::succ, Svecteur::succ, vect_rm(), vect_size(), VECTEUR_NUL_P, and vecteur_var.

Referenced by dj_fprint_tab(), pa_fprint_tab(), sl_fprint(), and un_fprint_tab().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sl_free()

Psyslist sl_free ( Psyslist  psl)

Psyslist sl_free(Psyslist psl) BA, AL 30/05/94 w - 1 depth free.

Parameters
pslsl

Definition at line 327 of file sc_list.c.

329 {
330  if( psl != SL_NULL ) {
331  psl->psys = sc_free( psl->psys );
332  psl->succ = sl_free(psl->succ);
333  free( psl ); psl = NULL;
334  }
335  return SL_NULL;
336 }
Psysteme sc_free(Psysteme in_ps)
Psysteme sc_free( in_ps ) AL 30/05/94 Free of in_ps.
Definition: sc_list.c:112
Psyslist sl_free(Psyslist psl)
Psyslist sl_free(Psyslist psl) BA, AL 30/05/94 w - 1 depth free.
Definition: sc_list.c:327

References free(), Ssyslist::psys, sc_free(), and SL_NULL.

Referenced by dj_free(), pa_free(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_reduce_simple_complement(), and pa_supress_same_constraints().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sl_free1()

Psyslist sl_free1 ( Psyslist  psl)

Psyslist sl_free1(Psyslist psl) AL 30/05/94 1 depth free.

Parameters
pslsl

Definition at line 343 of file sc_list.c.

345 {
346  if( psl != SL_NULL ) {
347  psl->psys = (Psysteme) NULL;
348  psl->succ = sl_free1(psl->succ);
349  free( psl );
350  }
351  return SL_NULL;
352 }
Psyslist sl_free1(Psyslist psl)
Psyslist sl_free1(Psyslist psl) AL 30/05/94 1 depth free.
Definition: sc_list.c:343

References free(), Ssyslist::psys, and SL_NULL.

Referenced by dj_free1(), pa_free1(), and pa_reduce_simple_complement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sl_get_tab_string()

char* sl_get_tab_string ( int  in_tab)

char* sl_get_tab_string( in_tab ) returns a string of in_tab \t

Parameters
in_tabn_tab

Definition at line 366 of file sc_list.c.

368 {
369  int d;
370  static char name[20];
371 #ifndef strdup
372  extern char* strdup();
373 #endif
374 
375  if (in_tab == 0) return strdup("");
376  assert( (in_tab > 0) && (in_tab < 20) );
377  for(d = 0; d < in_tab; d++){ sprintf(&name[d],"\t"); }
378  return strdup(name);
379 }
char * strdup()

References assert, and strdup().

Referenced by dj_fprint_tab(), pa_fprint_tab(), sl_fprint_tab(), and un_fprint_tab().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sl_init_lex()

void sl_init_lex ( void  )

Referenced by sl_read().

+ Here is the caller graph for this function:

◆ sl_is_system_p()

bool sl_is_system_p ( Psyslist  in_sl)

bool sl_is_system_p( (Psyslist) in_sl ) AL 16/11/93 Returns True if syslist in_sl has only one Psysteme in it.

Parameters
in_sln_sl

Definition at line 230 of file sc_list.c.

232 { return ( sl_length(in_sl) == 1 ); }
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

References sl_length().

Referenced by dj_is_system_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sl_length()

bool sl_length ( Psyslist  in_sl)

int sl_length( (Psyslist) in_sl ) AL 26/04/95 Returns length of in_sl.

Parameters
in_sln_sl

Definition at line 193 of file sc_list.c.

195 {
196  int length; Psyslist sl = in_sl;
197  if (in_sl == NULL) return 0;
198  for(length = 0; sl != NULL; sl = sl->succ, length++);
199  return length;
200 }

References Ssyslist::succ.

Referenced by pa_feasibility_ofl_ctrl(), pa_path_to_disjunct_ofl_ctrl(), pa_path_to_disjunct_rule4_ofl_ctrl(), and sl_is_system_p().

+ Here is the caller graph for this function:

◆ sl_max_constraints_nb()

int sl_max_constraints_nb ( Psyslist  in_sl)

int sl_max_constraints_nb( (Psyslist) in_sl ) Give the maximum constraints nb among systems of in_sl.

Parameters
in_sln_sl

Definition at line 207 of file sc_list.c.

209 {
210  Psysteme ps;
211  int ret_int = 0;
212 
213  if (in_sl == NULL) return 0;
214 
215  for(; in_sl != NULL; in_sl = in_sl->succ) {
216  int loc;
217  ps = in_sl->psys;
218  if (sc_empty_p(ps)) continue;
219  loc = 2*(ps->nb_eq) + ps->nb_ineq;
220  if (loc > ret_int) ret_int = loc;
221  }
222  return ret_int;
223 }
if(!(yy_init))
Definition: genread_lex.c:1029

References if(), Ssysteme::nb_eq, Ssysteme::nb_ineq, and sc_empty_p().

Referenced by pa_feasibility_ofl_ctrl(), and pa_max_constraints_nb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sl_new()

Psyslist sl_new ( void  )

Psyslist sl_new() AL 26/10/93 Input : Nothing.

Output : An empty syslist.

Definition at line 277 of file sc_list.c.

278 {
279  Psyslist p;
280 
281  p = (Psyslist) malloc(sizeof(Ssyslist));
282  if (p == NULL) {
283  (void) fprintf(stderr,"sl_new: Out of memory space\n");
284  exit(-1);
285  }
286  p->psys = (Psysteme ) NULL; p->succ = (Psyslist) NULL;
287  return(p);
288 }
void * malloc(YYSIZE_T)
#define exit(code)
Definition: misc-local.h:54
struct Ssyslist * Psyslist

References exit, fprintf(), malloc(), Ssyslist::psys, and Ssyslist::succ.

Referenced by build_third_comb(), dj_new(), pa_fprint_tab(), prepare_array_bounds(), and sl_append_system().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sl_read()

Psyslist sl_read ( char*  nomfic)

void sl_read(FILE*) reads a Psyslist

Parameters
nomficomfic

Definition at line 461 of file sc_list.c.

463 {
464  if ((slx_in = fopen(nomfic, "r")) == NULL) {
465  (void) fprintf(stderr, "Ouverture du fichier %s impossible\n",nomfic);
466  exit(4);
467  }
468  sl_init_lex(); slx_parse(); fclose( slx_in );
469  return( sl_yacc );
470 }
Psyslist sl_yacc
Definition: sl_gram.c:113
void sl_init_lex(void)
FILE * slx_in
Psysteme construit par sl_gram.y.
int slx_parse(void)
fichier lu par sl_lex.l

References exit, fprintf(), sl_init_lex(), sl_yacc, slx_in, and slx_parse().

Referenced by dj_read(), and pa_read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sl_set_variable_name()

void sl_set_variable_name ( char* (*)()  in_fu)

char* sl_set_variable_name( in_fu ) give the function to read variables

Definition at line 357 of file sc_list.c.

359 {
360  union_variable_name = in_fu;
361 }
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

References union_variable_name.

◆ slx_parse()

int slx_parse ( void  )

fichier lu par sl_lex.l

Referenced by sl_read().

+ Here is the caller graph for this function:

◆ un_fprint_tab()

void un_fprint_tab ( FILE*  in_fi,
char*  in_un,
char *(*)()  in_fu,
int  in_ty,
int  in_tab 
)

void un_fprint_tab(FILE*, Pdisjunct, function, type, tab) prints a union

Definition at line 475 of file sc_list.c.

481 {
482  switch( in_ty ) {
483 
484  case IS_SC:
485  fprintf ( in_fi, "Systeme:\n");
486  sc_fprint( in_fi, (Psysteme) in_un, in_fu );
487  break;
488 
489  case IS_SL:
490  fprintf ( in_fi, "%sSyslist:\n", sl_get_tab_string( in_tab ));
491  sl_fprint_tab( in_fi, (Psyslist) in_un, in_fu, in_tab );
492  break;
493 
494  case IS_DJ:
495  dj_fprint( in_fi, (Pdisjunct) in_un, in_fu );
496  break;
497 
498  case IS_PA:
499  pa_fprint( in_fi, (Ppath) in_un, in_fu );
500  break;
501 
502  default: {}
503  }
504 }
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
#define pa_fprint(fi, pa, fu)
Definition: union-local.h:109
#define dj_fprint(fi, dj, fu)
Definition: union-local.h:96
#define IS_DJ
Definition: union-local.h:135
#define IS_SC
Definition: union-local.h:133
#define IS_PA
Definition: union-local.h:136
#define IS_SL
Definition: union-local.h:134

References dj_fprint, fprintf(), IS_DJ, IS_PA, IS_SC, IS_SL, pa_fprint, sc_fprint(), sl_fprint_tab(), and sl_get_tab_string().

+ Here is the call graph for this function:

Variable Documentation

◆ sl_yacc

Psyslist sl_yacc
extern

Definition at line 113 of file sl_gram.c.

Referenced by sl_read().

◆ slx_in

FILE* slx_in
extern

Psysteme construit par sl_gram.y.

Referenced by sl_read().

◆ union_variable_name

char *(* union_variable_name)(Variable) ( Variable  ) = variable_default_name

Package : C3/union Author : Arnauld LESERVOT (leservot(a)limeil.cea.fr) Date :
Modified : 04 04 95 Documents: UNION.tex : `‘Extension de C3 aux unions de polyedres’' Comments :

sc_list.c

           WARNING

THOSE FUNCTIONS ARE AUTOMATICALLY DERIVED

    FROM THE WEB SOURCES !

Ansi includes
Linear includes

Definition at line 51 of file sc_list.c.

Referenced by dj_disjunct_complement(), dj_intersect_djcomp_ofl_ctrl(), dj_system_complement(), dj_variable_substitution_with_eqs_ofl_ctrl(), pa_feasibility_ofl_ctrl(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), pa_supress_same_constraints(), sc_elim_redund_with_first_ofl_ctrl(), sc_supress_parallel_redund_constraints(), sc_supress_same_constraints(), and sl_set_variable_name().