PIPS
prettyprint.c
Go to the documentation of this file.
1 /*
2 
3  $Id: prettyprint.c 23065 2016-03-02 09:05:50Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 #ifdef HAVE_CONFIG_H
25  #include "pips_config.h"
26 #endif
27 /*
28  * This section has been revised and cleaned.
29  * The main change is to sort the arguments for
30  * the preconditions print.
31  *
32  * Modification : Arnauld LESERVOT
33  * Date : 92 08 27
34  * Old version : prettyprint.old.c
35  */
36 
37 #include <stdio.h>
38 #include <string.h>
39 
40 #include "genC.h"
41 #include "linear.h"
42 #include "ri.h"
43 #include "ri-util.h"
44 #include "workspace-util.h"
45 
46 #include "constants.h"
47 
48 #include "misc.h"
49 
50 #include "transformer.h"
51 
53 {
54  pips_internal_error("not implemenented anymore, tf=%p", tf);
55  return string_undefined;
56 }
57 
59 transformer pre;
60 {
61  pips_internal_error("not implemenented anymore, pre=%p", pre);
62  return string_undefined;
63 }
64 
65 string arguments_to_string(string s, list args)
66 {
67  pips_internal_error("not implemenented anymore, s=\"%s\", args=%p", s, args);
68  return string_undefined;
69 }
70 
71 string
73  string s,
74  Psysteme ps,
75  char * (*variable_name)(entity))
76 {
77  pips_internal_error("not implemenented anymore, s=\"%s\", ps=%p, variable_name=%p", s, ps, variable_name);
78  return string_undefined;
79 }
80 
81 const char * generic_value_name(entity e)
82 {
83  const char* n = string_undefined;
84 
85  if(e == (entity) TCST) {
86  n = "";
87  }
88  else {
89  (void) gen_check((gen_chunk *) e, entity_domain);
91  n = entity_minimal_name(e);
92  }
93  /* else if (entity_has_values_p(e)){ */
95  && value_entity_p(e)){
96  /* n = external_value_name(e); */
97  n = pips_user_value_name(e);
98  }
99  else {
100  n = entity_minimal_name(e);
101  }
102  }
103  return n;
104 }
gen_chunk * gen_check(gen_chunk *obj, int t)
GEN_CHECK checks that the gen_chunk received OBJ is of the appropriate TYPE.
Definition: genClib.c:2356
#define pips_internal_error
Definition: misc-local.h:149
const char * entity_minimal_name(entity e)
Do preserve scope informations.
Definition: naming.c:214
#define string_undefined
Definition: newgen_types.h:40
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410
char * variable_name(Variable v)
polynome_ri.c
Definition: polynome_ri.c:73
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
string transformer_to_string(transformer tf)
prettyprint.c
Definition: prettyprint.c:52
string relation_to_string(string s, Psysteme ps, char *(*variable_name)(entity))
Definition: prettyprint.c:72
string precondition_to_string(transformer pre)
Definition: prettyprint.c:58
string arguments_to_string(string s, list args)
Definition: prettyprint.c:65
const char * generic_value_name(entity e)
Definition: prettyprint.c:81
bool value_entity_p(entity)
Definition: value.c:976
const char * pips_user_value_name(entity)
This function is called many times when the constraints and the system of constraints are sorted usin...
Definition: value.c:815
bool local_temporary_value_entity_p(entity)
Definition: value.c:654
bool hash_value_to_name_undefined_p(void)
Definition: value.c:1199
A gen_chunk is used to store every object.
Definition: genC.h:58
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.