PIPS
print.c File Reference
#include <stdio.h>
#include "genC.h"
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
#include "ray_dte.h"
#include "sommet.h"
#include "sg.h"
#include "sc.h"
#include "polyedre.h"
#include "matrice.h"
#include "matrix.h"
#include "linear.h"
#include "ri.h"
#include "ri-util.h"
#include "workspace-util.h"
#include "prettyprint.h"
#include "constants.h"
#include "misc.h"
#include "paf_ri.h"
#include "graph.h"
#include "text.h"
#include "text-util.h"
#include "paf-util.h"
+ Include dependency graph for print.c:

Go to the source code of this file.

Macros

#define IS_INEG   0
 Macro functions. More...
 
#define IS_EG   1
 
#define IS_VEC   2
 
#define INDENT_FACTOR   2
 

Typedefs

typedef dfg_arc_label arc_label
 Name : print.c Package : paf-util Author : Alexis Platonoff Date : july 1993. More...
 
typedef dfg_vertex_label vertex_label
 

Functions

static void pu_contrainte_fprint (FILE *fp, Pcontrainte c, int is_what, const char *(*variable_name)(entity))
 Used in imprime_quast() for correct indentation. More...
 
void pu_inegalite_fprint (FILE *fp, Pcontrainte ineg, const char *(*variable_name)(entity))
 =========================================================================== More...
 
void pu_egalite_fprint (FILE *fp, Pcontrainte eg, const char *(*variable_name)(entity))
 =========================================================================== More...
 
void vecteur_fprint (FILE *fp, Pcontrainte vec, const char *(*variable_name)(entity))
 =========================================================================== More...
 
void fprint_dataflow (FILE *fp, int stmt, dataflow df)
 =========================================================================== More...
 
void fprint_pred (FILE *fp, predicate pred)
 =========================================================================== More...
 
void fprint_psysteme (FILE *fp, Psysteme ps)
 =========================================================================== More...
 
void fprint_sc_pvecteur (FILE *fp, Psysteme ps)
 =========================================================================== More...
 
void fprint_bdt (FILE *fp, bdt obj)
 =========================================================================== More...
 
const char * pu_variable_name (Variable v)
 package mapping : Alexis Platonoff, april 1993 More...
 
bool pu_is_inferior_var (Variable v1 __attribute__((unused)), Variable v2 __attribute__((unused)))
 =========================================================================== More...
 
void pu_vect_fprint (FILE *fp, Pvecteur v)
 =========================================================================== More...
 
void fprint_indent (FILE *fp, int indent)
 =========================================================================== More...
 
void imprime_quast (FILE *fp, quast qu)
 =========================================================================== More...
 

Variables

static int quast_depth = 0
 Global variables
More...
 

Macro Definition Documentation

◆ INDENT_FACTOR

#define INDENT_FACTOR   2

Definition at line 499 of file print.c.

◆ IS_EG

#define IS_EG   1

Definition at line 81 of file print.c.

◆ IS_INEG

#define IS_INEG   0

Macro functions.

Definition at line 80 of file print.c.

◆ IS_VEC

#define IS_VEC   2

Definition at line 82 of file print.c.

Typedef Documentation

◆ arc_label

Name : print.c Package : paf-util Author : Alexis Platonoff Date : july 1993.

Historic :

  • 16 july 93, changes in paf_ri, AP
  • 23 sept 93, change the name of this file, AP
  • 17 nov 93, add of fprintf_indent() for a prettier imprime_quast(). AP

Documents: Comments : This file contains the functions used for printing the data structures of paf_ri. Ansi includes
Newgen includes C3 includes
Pips includes

Definition at line 71 of file print.c.

◆ vertex_label

Definition at line 72 of file print.c.

Function Documentation

◆ fprint_bdt()

void fprint_bdt ( FILE *  fp,
bdt  obj 
)

===========================================================================

PRINT

Mod by AP, oct 6th 199595: the number of the instruction is the vertex number minus BASE_NODE_NUMBER.

Parameters
fpp
objbj

Definition at line 352 of file print.c.

355 {
356  list sched_l;
357 
358  fprintf(fp,"\n Scheduling:\n");
359  fprintf(fp,"============\n");
360 
361  if(obj == bdt_undefined) {
362  fprintf(fp, "\tNot computed\n\n");
363  return;
364  }
365 
366  sched_l = bdt_schedules(obj);
367 
368  for(; sched_l != NIL; sched_l = CDR(sched_l)) {
369  schedule crt_sched;
370  int crt_stmt;
371  list dim_l;
372  predicate crt_pred;
373 
374  crt_sched = SCHEDULE(CAR(sched_l));
375  crt_stmt = schedule_statement(crt_sched);
376  dim_l = schedule_dims(crt_sched);
377  crt_pred = schedule_predicate(crt_sched);
378 
379  /* PRINT */
380  /* Mod by AP, oct 6th 199595: the number of the instruction is the
381  vertex number minus BASE_NODE_NUMBER. */
382  fprintf(fp,"ins_%d:\n", crt_stmt-BASE_NODE_NUMBER);
383 
384  if(crt_pred != predicate_undefined) {
385  Psysteme ps = (Psysteme) predicate_system(crt_pred);
386  Pcontrainte peq;
387 
388  if (ps != NULL) {
389  fprintf(fp,"\t pred: ");
390 
391  for (peq = ps->inegalites; peq!=NULL;
392  pu_inegalite_fprint(fp,peq,entity_local_name),peq=peq->succ);
393 
394  for (peq = ps->egalites; peq!=NULL;
395  pu_egalite_fprint(fp,peq,entity_local_name),peq=peq->succ);
396 
397  fprintf(fp,"\n");
398  }
399  else
400  fprintf(fp, "\t pred: TRUE\n");
401  }
402  else
403  fprintf(fp, "\t pred: TRUE\n");
404 
405  fprintf(fp, "\t dims: ");
406  for(; dim_l != NIL; dim_l = CDR(dim_l)) {
407  expression exp = EXPRESSION(CAR(dim_l));
408  fprintf(fp,"%s", expression_to_string(exp));
409  if(CDR(dim_l) != NIL)
410  fprintf(fp," , ");
411  }
412  fprintf(fp,"\n");
413  }
414 }
static int crt_stmt
Current source statement.
Definition: adg_read_paf.c:162
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
#define BASE_NODE_NUMBER
void pu_egalite_fprint(FILE *fp, Pcontrainte eg, const char *(*variable_name)(entity))
===========================================================================
Definition: print.c:205
void pu_inegalite_fprint(FILE *fp, Pcontrainte ineg, const char *(*variable_name)(entity))
===========================================================================
Definition: print.c:194
#define SCHEDULE(x)
SCHEDULE.
Definition: paf_ri.h:682
#define schedule_predicate(x)
Definition: paf_ri.h:715
#define bdt_schedules(x)
Definition: paf_ri.h:226
#define schedule_dims(x)
Definition: paf_ri.h:717
#define schedule_statement(x)
Definition: paf_ri.h:713
#define bdt_undefined
Definition: paf_ri.h:204
string expression_to_string(expression e)
Definition: expression.c:77
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
Definition: entity.c:453
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define predicate_undefined
Definition: ri.h:2046
#define predicate_system(x)
Definition: ri.h:2069
struct Ssysteme * Psysteme
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
struct Scontrainte * succ
Pcontrainte inegalites
Definition: sc-local.h:71
Pcontrainte egalites
Definition: sc-local.h:70
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207

References BASE_NODE_NUMBER, bdt_schedules, bdt_undefined, CAR, CDR, crt_stmt, Ssysteme::egalites, entity_local_name(), exp, EXPRESSION, expression_to_string(), fprintf(), Ssysteme::inegalites, NIL, predicate_system, predicate_undefined, pu_egalite_fprint(), pu_inegalite_fprint(), SCHEDULE, schedule_dims, schedule_predicate, schedule_statement, and Scontrainte::succ.

Referenced by analyze_quast(), build_bdt_null(), prgm_mapping(), print_bdt(), print_parallelizedCMF_code(), print_parallelizedCRAFT_code(), reindexing(), and search_scc_bdt().

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

◆ fprint_dataflow()

void fprint_dataflow ( FILE *  fp,
int  stmt,
dataflow  df 
)

===========================================================================

void fprint_dataflow(FILE *fp, int stmt, dataflow df)

Prints in the file "fp" the dataflow "df" with a sink statement "stmt".

printf(fp, "\t\t Communication general \n");

Parameters
fpp
stmttmt
dff

Definition at line 229 of file print.c.

233 {
238 
239  fprintf(fp,
240  " ---Def-Use---> ins_%d:\n Reference: %s\n Transformation: [",
242 
244  fprintf(fp,"]\n");
245  fprintf(fp," Governing predicate:\n");
247  fprint_pred(fp, gov_pred);
248  else
249  fprintf(fp, " {nil} \n");
250 
251  if(comm == communication_undefined)
252  {
253  /*fprintf(fp, "\t\t Communication general \n");*/
254  }
255  else
256  {
257  predicate pred;
258 
259  pred = communication_broadcast(comm);
260  if(pred != predicate_undefined)
261  {
262  fprintf(fp,"\t\t Broadcast vector(s):");
264  }
265 
266  pred = communication_reduction(comm);
267  if(pred != predicate_undefined)
268  {
269  fprintf(fp,"\t\t Reduction vector(s):");
271  }
272 
273  pred = communication_shift(comm);
274  if(pred != predicate_undefined)
275  {
276  fprintf(fp,"\t\t Shift vector(s):");
278  }
279  }
280 }
static list trans_l
Current list of nodes.
Definition: adg_read_paf.c:168
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
static predicate gov_pred
Current expression.
Definition: adg_read_paf.c:165
void fprint_sc_pvecteur(FILE *fp, Psysteme ps)
===========================================================================
Definition: print.c:329
void fprint_pred(FILE *fp, predicate pred)
===========================================================================
Definition: print.c:287
#define communication_shift(x)
Definition: paf_ri.h:265
#define dataflow_communication(x)
Definition: paf_ri.h:346
#define dataflow_transformation(x)
Definition: paf_ri.h:342
#define communication_undefined
Definition: paf_ri.h:236
#define dataflow_governing_pred(x)
Definition: paf_ri.h:344
#define communication_reduction(x)
Definition: paf_ri.h:263
#define dataflow_reference(x)
Definition: paf_ri.h:340
#define communication_broadcast(x)
Definition: paf_ri.h:261
void fprint_list_of_exp(FILE *fp, list exp_l)
void fprint_list_of_exp(FILE *fp, list exp_l): prints in the file "fp" the list of expression "exp_l"...
Definition: expression.c:229
string reference_to_string(reference r)
Definition: expression.c:87
Definition: statement.c:54

References communication_broadcast, communication_reduction, communication_shift, communication_undefined, dataflow_communication, dataflow_governing_pred, dataflow_reference, dataflow_transformation, fprint_list_of_exp(), fprint_pred(), fprint_sc_pvecteur(), fprintf(), gov_pred, predicate_system, predicate_undefined, ref, reference_to_string(), and trans_l.

Referenced by broadcast_conditions(), build_third_comb(), compatible_pc_p(), count_dataflows_on_ref(), edge_weight(), fprint_dfg(), fprint_sccs(), plc_fprint_dfs(), plc_fprint_distance(), plc_make_distance(), and prgm_mapping().

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

◆ fprint_indent()

void fprint_indent ( FILE *  fp,
int  indent 
)

===========================================================================

Parameters
fpp
indentndent

Definition at line 502 of file print.c.

505 {
506  int i;
507 
508  fprintf(fp, "\n");
509  for(i = 0; i < (indent * INDENT_FACTOR); i++) fprintf(fp, " ");
510 }
#define INDENT_FACTOR
Definition: print.c:499

References fprintf(), and INDENT_FACTOR.

Referenced by imprime_quast().

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

◆ fprint_pred()

void fprint_pred ( FILE *  fp,
predicate  pred 
)

===========================================================================

void fprint_pred(FILE *fp, predicate pred): prints in the file "fp" the predicate "pred".

Parameters
fpp
predred

Definition at line 287 of file print.c.

290 {
291  Psysteme ps = (Psysteme) predicate_system(pred);
292 
293  fprint_psysteme(fp, ps);
294 }
void fprint_psysteme(FILE *fp, Psysteme ps)
===========================================================================
Definition: print.c:302

References fprint_psysteme(), and predicate_system.

Referenced by broadcast_conditions(), fprint_dataflow(), fprint_dfg(), and predicate_to_expression().

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

◆ fprint_psysteme()

void fprint_psysteme ( FILE *  fp,
Psysteme  ps 
)

===========================================================================

void fprint_psysteme(FILE *fp, Psysteme ps): prints in the file "fp" the Psysteme "ps". Each constraint is printed either with pu_inegalite_fprint() or pu_egalite_fprint(), both redefined above. See pu_contrainte_fprint() for details.

Parameters
fpp
pss

Definition at line 302 of file print.c.

305 {
306  Pcontrainte peq;
307 
308  if (ps != NULL) {
309  fprintf(fp,"{\n");
310  for (peq = ps->inegalites; peq!=NULL; peq=peq->succ) {
312  fprintf(fp, "\n");
313  }
314  for (peq = ps->egalites; peq!=NULL; peq=peq->succ) {
316  fprintf(fp, "\n");
317  }
318  fprintf(fp,"} \n");
319  }
320  else
321  fprintf(fp," { nil }\n");
322 }

References Ssysteme::egalites, entity_local_name(), fprintf(), Ssysteme::inegalites, pu_egalite_fprint(), pu_inegalite_fprint(), and Scontrainte::succ.

Referenced by adg_dataflowgraph(), adg_dataflowgraph_with_extremities(), analyze_quast(), better_elim_var_with_eg(), broadcast_conditions(), build_list_of_min(), build_third_comb(), compatible_pc_p(), constraint_to_bound(), cutting_conditions(), dataflows_on_reference(), edge_weight(), fprint_l_psysteme(), fprint_mytest(), fprint_pred(), fprint_sys_list(), get_bounds_expression(), imprime_quast(), imprime_special_quast(), include_trans_on_LC_in_ref(), make_bounds(), make_causal_external(), make_primal(), make_reindex(), mapping_on_broadcast(), matrix_to_system(), my_substitute_var_with_vec(), new_elim_var_with_eg(), nullify_factors(), partial_broadcast_coefficients(), pip_solve(), pip_solve_min_with_big(), plc_elim_var_with_eg(), plc_make_distance(), prepare_reindexing(), prgm_mapping(), prototype_dimension(), sc_to_tableau(), search_scc_bdt(), simplify_bdt(), substitute_var_with_vec(), and valuer().

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

◆ fprint_sc_pvecteur()

void fprint_sc_pvecteur ( FILE *  fp,
Psysteme  ps 
)

===========================================================================

void fprint_sc_pvecteur(FILE *fp, Psysteme ps): prints in the file "fp" the Psysteme "ps" as a list of vectors. Each constraint is printed with vecteur_fprint() defined above. See pu_contrainte_fprint() for details.

Parameters
fpp
pss

Definition at line 329 of file print.c.

332 {
333  Pcontrainte peq;
334 
335  if (ps != NULL) {
336  fprintf(fp,"{ ");
337 
338  for (peq = ps->inegalites; peq!=NULL;
339  vecteur_fprint(fp,peq,entity_local_name),peq=peq->succ);
340 
341  for (peq = ps->egalites; peq!=NULL;
342  vecteur_fprint(fp,peq,entity_local_name),peq=peq->succ);
343 
344  fprintf(fp," } \n");
345  }
346  else
347  fprintf(fp,"(nil)\n");
348 }
void vecteur_fprint(FILE *fp, Pcontrainte vec, const char *(*variable_name)(entity))
===========================================================================
Definition: print.c:216

References Ssysteme::egalites, entity_local_name(), fprintf(), Ssysteme::inegalites, Scontrainte::succ, and vecteur_fprint().

Referenced by fprint_dataflow().

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

◆ imprime_quast()

void imprime_quast ( FILE *  fp,
quast  qu 
)

===========================================================================

Parameters
fpp
quu

Definition at line 514 of file print.c.

517 {
518  Psysteme paux = SC_UNDEFINED;
519  predicate pred_aux = predicate_undefined;
520  conditional cond_aux;
521  quast_value quv;
522  quast_leaf qul;
523  leaf_label ll;
524  list sol;
525 
526  if( (qu == quast_undefined) || (qu == NULL) ) {
528  fprintf(fp, "Empty Quast ");
529  return;
530  }
531  quv = quast_quast_value(qu);
532  if( quv == quast_value_undefined ) {
534  fprintf(fp, "Empty Quast ");
535  return;
536  }
537  quv = quast_quast_value(qu);
538 
539  switch( quast_value_tag(quv)) {
541  cond_aux = quast_value_conditional(quv);
542  pred_aux = conditional_predicate(cond_aux);
543  if (pred_aux != predicate_undefined)
544  paux = (Psysteme) predicate_system(pred_aux);
545 
547  fprintf(fp, "IF ");
548  fprint_psysteme(fp, paux);
549 
551  fprintf(fp, "THEN");
552  quast_depth++;
553  imprime_quast(fp, conditional_true_quast (cond_aux) );
554  quast_depth--;
555 
557  fprintf(fp, "ELSE");
558  quast_depth++;
559  imprime_quast(fp, conditional_false_quast (cond_aux) );
560  quast_depth--;
561 
563  fprintf(fp, "FI");
564  break;
565 
567  qul = quast_value_quast_leaf( quv );
568  if (qul == quast_leaf_undefined) {fprintf(fp,"Empty Quast Leaf\n");break;}
569  sol = quast_leaf_solution( qul );
570  ll = quast_leaf_leaf_label( qul );
571  if (ll != leaf_label_undefined) {
573  fprintf(fp, "Statement source number : %"PRIdPTR,
575 
577  fprintf(fp, "Depth : %"PRIdPTR, leaf_label_depth(ll));
578  }
580  while (sol != NIL) {
581  fprintf(fp, "%s, ", expression_to_string(EXPRESSION(CAR(sol))));
582  sol = CDR(sol);
583  }
584  break;
585  }
586 }
statement ordering_to_statement(int o)
Get the statement associated to a given ordering.
Definition: ordering.c:111
void fprint_indent(FILE *fp, int indent)
===========================================================================
Definition: print.c:502
static int quast_depth
Global variables
Definition: print.c:87
void imprime_quast(FILE *fp, quast qu)
===========================================================================
Definition: print.c:514
#define conditional_true_quast(x)
Definition: paf_ri.h:302
#define quast_undefined
Definition: paf_ri.h:603
#define quast_value_undefined
Definition: paf_ri.h:639
#define leaf_label_statement(x)
Definition: paf_ri.h:451
@ is_quast_value_quast_leaf
Definition: paf_ri.h:654
@ is_quast_value_conditional
Definition: paf_ri.h:655
#define conditional_false_quast(x)
Definition: paf_ri.h:304
#define quast_leaf_solution(x)
Definition: paf_ri.h:591
#define quast_value_tag(x)
Definition: paf_ri.h:672
#define quast_leaf_undefined
Definition: paf_ri.h:567
#define leaf_label_undefined
Definition: paf_ri.h:427
#define leaf_label_depth(x)
Definition: paf_ri.h:453
#define quast_value_quast_leaf(x)
Definition: paf_ri.h:675
#define quast_leaf_leaf_label(x)
Definition: paf_ri.h:593
#define quast_quast_value(x)
Definition: paf_ri.h:627
#define conditional_predicate(x)
Definition: paf_ri.h:300
#define quast_value_conditional(x)
Definition: paf_ri.h:678
#define statement_number(x)
Definition: ri.h:2452

References CAR, CDR, conditional_false_quast, conditional_predicate, conditional_true_quast, EXPRESSION, expression_to_string(), fprint_indent(), fprint_psysteme(), fprintf(), imprime_quast(), is_quast_value_conditional, is_quast_value_quast_leaf, leaf_label_depth, leaf_label_statement, leaf_label_undefined, NIL, ordering_to_statement(), predicate_system, predicate_undefined, quast_depth, quast_leaf_leaf_label, quast_leaf_solution, quast_leaf_undefined, quast_quast_value, quast_undefined, quast_value_conditional, quast_value_quast_leaf, quast_value_tag, quast_value_undefined, and statement_number.

Referenced by analyze_quast(), imprime_quast(), pip_solve(), pip_solve_min_with_big(), search_scc_bdt(), and valuer().

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

◆ pu_contrainte_fprint()

static void pu_contrainte_fprint ( FILE *  fp,
Pcontrainte  c,
int  is_what,
const char *(*)(entity variable_name 
)
static

Used in imprime_quast() for correct indentation.

Local defines Moved higher because of Newgen's static typing =========================================================================== static void pu_contrainte_fprint(FILE *fp, Pcontrainte c, int is_what, char *(*variable_name)()):

prints in the file "fp" the constraint "c", of type equality, inequality or vector according to the value of the integer argument "is_what", using the function "variable_name" for the name of the variables.

The function contrainte_fprint() exists, it is defined in contrainte.c (C3 library). We redefine this function because:

    1. we want the constant term in the left hand side
    2. we want a third type of contrainte (vector) which does not print the
    inequality or equality symbol.
 3. we do not want a line feed at the end of the constraint

We consider that CONTRAINTE_UNDEFINED => CONTRAINTE_NULLE

Results for a constraint containing the following Pvecteur (2*I) (-J) (-4):

equality: 2 * I - J - 4 = 0 inequality: 2 * I - J - 4 <= 0 vector: 2 * I - J - 4 GRRRR this function is already/also in array_dfg... FC

on admet plusieurs occurences du terme constant!?!

sign

value

trail

IS_VEC

Definition at line 123 of file print.c.

128 {
129  Pvecteur v;
130  short int debut = 1;
131  Value constante = VALUE_ZERO;
132 
133  if (!CONTRAINTE_UNDEFINED_P(c))
134  v = contrainte_vecteur(c);
135  else
136  v = VECTEUR_NUL;
137 
138  if(!vect_check(v))
139  pips_internal_error("Non coherent vector");
140 
141  while (!VECTEUR_NUL_P(v)) {
142  if (v->var!=TCST) {
143  char signe;
144  Value coeff = v->val;
145 
146  if (value_notzero_p(coeff)) {
147  if (value_pos_p(coeff))
148  signe = (debut) ? ' ' : '+';
149  else {
150  signe = '-';
151  value_oppose(coeff);
152  };
153  debut = 0;
154  if (value_one_p(coeff))
155  (void) fprintf(fp,"%c %s ", signe, variable_name(v->var));
156  else
157  {
158  (void) fprintf(fp,"%c ", signe);
159  fprint_Value(fp, coeff);
160  fprintf(fp, " %s ", variable_name(v->var));
161  }
162  }
163  }
164  else /* on admet plusieurs occurences du terme constant!?! */
165  value_addto(constante, v->val);
166 
167  v = v->succ;
168  }
169 
170  /* sign */
171  if (value_pos_p(constante))
172  fprintf(fp, "+ ");
173  else if (value_neg_p(constante))
174  value_oppose(constante), fprintf(fp, "- ");
175 
176  /* value */
177  if (value_notzero_p(constante))
178  fprint_Value(fp, constante), fprintf(fp, " ");
179 
180  /* trail */
181  if (is_what == IS_INEG)
182  fprintf (fp,"<= 0 ,");
183  else if(is_what == IS_EG)
184  fprintf (fp,"== 0 ,");
185  else /* IS_VEC */
186  fprintf (fp," ,");
187 }
#define value_pos_p(val)
#define VALUE_ZERO
#define value_oppose(ref)
#define value_notzero_p(val)
#define value_one_p(val)
int Value
#define value_addto(ref, val)
#define value_neg_p(val)
void fprint_Value(FILE *, Value)
Definition: io.c:42
#define CONTRAINTE_UNDEFINED_P(c)
#define contrainte_vecteur(c)
passage au champ vecteur d'une contrainte "a la Newgen"
bool vect_check(Pvecteur cv)
bool vect_check(Pvecteur v): renvoie true si le vecteur v est coherent avec les specifications du pac...
Definition: reductions.c:529
#define pips_internal_error
Definition: misc-local.h:149
#define IS_EG
Definition: print.c:81
#define IS_INEG
Macro functions.
Definition: print.c:80
char * variable_name(Variable v)
polynome_ri.c
Definition: polynome_ri.c:73
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
Value val
Definition: vecteur-local.h:91
Variable var
Definition: vecteur-local.h:90
struct Svecteur * succ
Definition: vecteur-local.h:92
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
#define VECTEUR_NUL_P(v)

References CONTRAINTE_UNDEFINED_P, contrainte_vecteur, fprint_Value(), fprintf(), IS_EG, IS_INEG, pips_internal_error, Svecteur::succ, TCST, Svecteur::val, value_addto, value_neg_p, value_notzero_p, value_one_p, value_oppose, value_pos_p, VALUE_ZERO, Svecteur::var, variable_name(), vect_check(), VECTEUR_NUL, and VECTEUR_NUL_P.

Referenced by pu_egalite_fprint(), pu_inegalite_fprint(), and vecteur_fprint().

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

◆ pu_egalite_fprint()

void pu_egalite_fprint ( FILE *  fp,
Pcontrainte  eg,
const char *(*)(entity variable_name 
)

===========================================================================

void pu_egalite_fprint(FILE *fp, Pcontraint eg, char *(*variable_name)()): Redefinition of egalite_fprint(). See pu_contrainte_fprint() for details.

Definition at line 205 of file print.c.

208 {
210 }
static void pu_contrainte_fprint(FILE *fp, Pcontrainte c, int is_what, const char *(*variable_name)(entity))
Used in imprime_quast() for correct indentation.
Definition: print.c:123

References IS_EG, pu_contrainte_fprint(), and variable_name().

Referenced by fprint_bdt(), and fprint_psysteme().

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

◆ pu_inegalite_fprint()

void pu_inegalite_fprint ( FILE *  fp,
Pcontrainte  ineg,
const char *(*)(entity variable_name 
)

===========================================================================

void pu_inegalite_fprint(FILE *fp, Pcontraint ineg, char *(*variable_name)()): Redefinition of inegalite_fprint(). See pu_contrainte_fprint() for details.

Definition at line 194 of file print.c.

197 {
199 }

References IS_INEG, pu_contrainte_fprint(), and variable_name().

Referenced by fprint_bdt(), and fprint_psysteme().

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

◆ pu_is_inferior_var()

bool pu_is_inferior_var ( Variable v1   __attribute__(unused),
Variable v2   __attribute__(unused) 
)

===========================================================================

Definition at line 432 of file print.c.

434 {
435  return(false);
436 }

Referenced by fprint_pla_pp_dims(), plc_fprint_distance(), and plc_fprint_proto().

+ Here is the caller graph for this function:

◆ pu_variable_name()

const char* pu_variable_name ( Variable  v)

package mapping : Alexis Platonoff, april 1993

===========================================================================

Definition at line 421 of file print.c.

423 {
424  if(v == TCST)
425  return("TCST");
426  else
427  return(entity_local_name((entity) v));
428 }

References entity_local_name(), and TCST.

Referenced by calculate_delay(), constraint_to_bound(), fprint_pla_pp_dims(), is_not_trivial_p(), make_reindex(), mapping_on_broadcast(), nullify_factors(), partition_unknowns(), plc_fprint_distance(), plc_make_distance(), prgm_mapping(), prototype_dimension(), solve_system_by_succ_elim(), and valuer().

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

◆ pu_vect_fprint()

void pu_vect_fprint ( FILE *  fp,
Pvecteur  v 
)

===========================================================================

void pu_vect_fprint(FILE *fp, Pvecteur v): impression d'un vecteur creux v sur le fichier fp.

There exist a function "vect_fprint" in C3 which takes a third argument. arg, also in array_dfg.

on admet plusieurs occurences du terme constant!?!

Parameters
fpp

Definition at line 446 of file print.c.

447 {
448  short int debut = 1;
449  Value constante = VALUE_ZERO;
450  char signe;
451  while (!VECTEUR_NUL_P(v)) {
452  if (v->var!=TCST) {
453  Value coeff = v->val;
454 
455  if (value_notzero_p(coeff)) {
456  if (value_pos_p(coeff))
457  signe = (debut) ? ' ' : '+';
458  else {
459  signe = '-';
460  value_oppose(coeff);
461  }
462  debut = 0;
463  if (value_one_p(coeff))
464  fprintf(fp,"%c %s ", signe,
466  else
467  {
468  fprintf(fp,"%c ", signe);
469  fprint_Value(fp, coeff);
470  fprintf(fp, " %s ", entity_local_name((entity) v->var));
471  }
472  }
473  }
474  else
475  /* on admet plusieurs occurences du terme constant!?! */
476  value_addto(constante, v->val);
477  v = v->succ;
478  }
479  if(debut)
480  fprint_Value(fp, constante);
481  else if(value_notzero_p(constante)) {
482  if(value_pos_p(constante))
483  signe = (debut) ? ' ' : '+';
484  else {
485  signe = '-';
486  value_oppose(constante);
487  }
488  (void) fprintf(fp,"%c ", signe);
489  fprint_Value(fp, constante);
490  fprintf(fp, "\n");
491  }
492  else
493  (void) fprintf(fp, "\n");
494 }

References entity_local_name(), fprint_Value(), fprintf(), Svecteur::succ, TCST, Svecteur::val, value_addto, value_notzero_p, value_one_p, value_oppose, value_pos_p, VALUE_ZERO, Svecteur::var, and VECTEUR_NUL_P.

Referenced by adg_dataflowgraph(), adg_dataflowgraph_with_extremities(), analyze_quast(), better_elim_var_with_eg(), build_third_comb(), calculate_delay(), constraint_to_bound(), fprint_coef_list(), fprint_vv(), make_reindex(), mapping_on_broadcast(), new_elim_var_with_eg(), nullify_factors(), plc_elim_var_with_eg(), predicate_to_expression(), prepare_reindexing(), prototype_dimension(), search_scc_bdt(), simplify_dimension(), and solve_system_by_succ_elim().

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

◆ vecteur_fprint()

void vecteur_fprint ( FILE *  fp,
Pcontrainte  vec,
const char *(*)(entity variable_name 
)

===========================================================================

void vecteur_fprint(FILE *fp, Pcontraint vec char *(*variable_name)()): See pu_contrainte_fprint() for details.

Definition at line 216 of file print.c.

219 {
221 }
#define IS_VEC
Definition: print.c:82

References IS_VEC, pu_contrainte_fprint(), and variable_name().

Referenced by fprint_sc_pvecteur().

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

Variable Documentation

◆ quast_depth

int quast_depth = 0
static

Global variables

Internal variables

Definition at line 87 of file print.c.

Referenced by imprime_quast().