25 #include "pips_config.h"
82 entity package = FindEntity(TOP_LEVEL_MODULE_NAME,COMPLEXITY_PACKAGE_NAME);
140 keep_symbols, maximize);
157 fprintf(stderr,
"expr->pnome ");
180 precond, effects_list, keep_symbols, maximize);
184 precond, effects_list, keep_symbols, maximize);
188 precond, effects_list, keep_symbols, maximize);
192 precond, effects_list, keep_symbols, maximize);
246 bool we_must_evaluate;
249 trace_on(
"pvecteur -> pnome maximize is %d", maximize);
252 fprintf(stderr,
"expr->pnome: pvecteur = ");
298 fprintf(stderr,
"Pvecteur evaluation = ");
314 bool we_must_evaluate;
322 we_must_evaluate = (keep_symbols ?
383 trace_on(
"CALL '%s' -> pnome", name);
399 comp =
plus_op_handler(args, precond, effects_list, keep_symbols, maximize);
401 comp =
minus_op_handler(args, precond, effects_list, keep_symbols, maximize);
407 comp =
power_op_handler(args, precond, effects_list, keep_symbols, maximize);
411 comp =
field_op_handler(args, precond, effects_list, keep_symbols, maximize);
421 fprintf(stderr,
"call->pnome '%s': ", name);
441 keep_symbols, maximize);
444 fprintf(stderr,
"cast->pnome");
460 precond, effects_list, keep_symbols,
463 precond, effects_list, keep_symbols,
480 precond, effects_list, keep_symbols,
483 precond, effects_list, keep_symbols,
500 precond, effects_list, keep_symbols,
503 precond, effects_list, keep_symbols,
513 list effects_list,
bool keep_symbols,
int maximize) {
515 precond, effects_list, keep_symbols,
518 precond, effects_list, keep_symbols,
535 precond, effects_list, keep_symbols,
553 precond, effects_list, keep_symbols,
569 precond, effects_list, keep_symbols,
576 if (denominateur == 0)
577 user_error(
"divide_op_handler",
"division by zero\n");
598 precond, effects_list, keep_symbols,
607 if (power == (
int) power) {
655 #define maxint_p(i) ((i) == INT_MAX)
656 #define minint_p(i) ((i) == (INT_MIN))
664 !SC_UNDEFINED_P(psyst) ) {
680 fprintf(stderr,
"var_of is %s -- variable is %s --bool is %d\n",
689 ps = sc_projection(ps,
var_of(pv));
698 if ( !SC_UNDEFINED_P(ps) )
701 fprintf(stderr,
"ps is NULL\n");
717 fprintf(stderr,
" faisable is %d\n",faisable);
721 fprintf(stderr,
", maximize is %d\n", maximize);
773 else if ( faisable ) {
810 Pvecteur v = (ps->egalites)->vecteur;
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
language make_language_fortran(void)
basic make_basic_int(intptr_t _field_)
static reference ref
Current stmt (an integer)
#define value_notmin_p(val)
#define value_uminus(val)
unary operators on values
#define value_notmax_p(val)
#define VALUE_TO_FLOAT(val)
void fprint_Value(FILE *, Value)
void fprint_string_Value(FILE *, char *, Value)
complexity divide_op_handler(list args, transformer precond, list effects_list, bool keep_symbols, int maximize)
hash_table hash_complexity_parameters
complexity make_complexity_unknown(const char *name)
builds a new unknown complexity attached to a virtual package
complexity simplify_sc_to_complexity(Psysteme ps, Variable var)
This function is recently added by L.Zhou June 5, 91 simplify_sc_to_complexity(Psysteme ps,...
complexity plus_op_handler(list args, transformer precond, list effects_list, bool keep_symbols, int maximize)
hash_table hash_callee_to_complexity
comp_expr_to_pnome.c
complexity reference_to_polynome(reference ref, transformer precond, list effects_list, bool keep_symbols, int maximize)
First element of the "syntax" domain.
complexity call_to_polynome(call call_instr, transformer precond, list effects_list, bool keep_symbols, int maximize)
3rd element of syntax
complexity minus_op_handler(list args, transformer precond, list effects_list, bool keep_symbols, int maximize)
char * noms_var(entity e)
comp_expr_to_pnome.c
complexity pvecteur_to_polynome(Pvecteur pvect, transformer precond, list effects_list, bool keep_symbols, int maximize)
The only element available of normalized.
complexity multiply_op_handler(list args, transformer precond, list effects_list, bool keep_symbols, int maximize)
complexity normalized_to_polynome(normalized no, transformer precond, list effects_list, bool keep_symbols, int maximize)
2nd element of expression
complexity unary_minus_op_handler(list args, transformer precond, list effects_list, bool keep_symbols, int maximize)
complexity cast_to_polynome(cast cast_instr, transformer precond, list effects_list, bool keep_symbols, int maximize)
4th element of syntax : Molka Becher
complexity field_op_handler(list args, transformer precond, list effects_list, bool keep_symbols, int maximize)
complexity evaluate_var_to_complexity(entity var, transformer precond, list effects_list __attribute__((__unused__)), int maximize)
complexity evaluate_var_to_complexity(entity var, transformer precond, list effects_list,...
complexity unary_plus_op_handler(list args, transformer precond, list effects_list, bool keep_symbols, int maximize)
complexity syntax_to_polynome(syntax synt, transformer precond, list effects_list, bool keep_symbols, int maximize)
1st element of expression
complexity power_op_handler(list args, transformer precond, list effects_list, bool keep_symbols, int maximize)
complexity expression_to_complexity_polynome(expression expr, transformer precond, list effects_list, bool keep_symbols, int maximize)
Entry point routine of this file:
complexity range_to_polynome(range rg __attribute__((__unused__)), transformer precond __attribute__((__unused__)), list effects_list __attribute__((__unused__)), bool keep_symbols __attribute__((__unused__)), int maximize __attribute__((__unused__)))
2nd element of syntax
void complexity_add(complexity *pcomp1, complexity comp2)
void complexity_add(complexity *pcomp1, comp2) performs *pcomp1 = *pcomp1 + comp2; !...
void complexity_scalar_mult(complexity *pcomp, float f)
multiply a complexity by a floating-point number.
void complexity_polynome_add(complexity *pcomp, Ppolynome pp)
Ppolynome complexity_polynome(complexity comp)
Because complexity is composed of two elements, we use this function to get the first element : polyn...
float complexity_TCST(complexity comp)
return the constant term of comp.
void complexity_float_add(complexity *pcomp, float f)
Add a floating point digit to the complexity May 3, 91.
bool complexity_constant_p(complexity comp)
true if comp is constant.
complexity make_zero_complexity()
make a zero complexity "0.0000 * TCST" with null statistics
complexity make_constant_complexity(float f)
make a constant complexity "f * TCST" with null statistics
void complexity_mult(complexity *pcomp1, complexity comp2)
void complexity_mult(complexity *pcomp1, comp2) performs *pcomp1 = *pcomp1 * comp2; !...
bool complexity_zero_p(complexity comp)
zero complexity check.
void complexity_sub(complexity *pcomp1, complexity comp2)
void complexity_sub(complexity *pcomp1, comp2) performs *pcomp1 = *pcomp1 - comp2; !...
complexity polynome_to_new_complexity(Ppolynome pp)
Create a complexity equal to Ppolynome pp with null statistics.
bool complexity_unknown_p(complexity comp)
true if comp is unknown.
complexity make_single_var_complexity(float f, Variable var)
make a complexity "f * var" with null statistics
void complexity_rm(complexity *pcomp)
remove complexity comp
void trace_on(char *fmt,...)
void complexity_fprint(FILE *fd, complexity comp, bool print_stats_p, bool print_local_names_p)
float constant_entity_to_float(entity e)
Return if possible the value of e in a float.
void trace_off()
"trace off"
void prc(complexity comp)
#define DONT_KEEP_SYMBOLS
#define hash_contains_user_var_p(htp, key)
#define hash_contains_p(htp, key)
#define UNKNOWN_VARIABLE_NAME
pseudo-variable for unknown variables
#define COMPLEXITY_PACKAGE_NAME
#define complexity_eval(x)
#define varcount_guessed(x)
#define complexity_eval_(x)
#define newgen_Ppolynome(p)
#define complexity_undefined
#define complexity_varcount(x)
#define varcount_symbolic(x)
#define varcount_unknown(x)
#define varcount_bounded(x)
#define CONTRAINTE_UNDEFINED_P(c)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
static char * package
The package name in which functions will be defined.
#define NIL
The empty list (nil in Lisp)
#define CAR(pcons)
Get the value of the first element of a list.
#define CDR(pcons)
Get the list less its first element.
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...
#define pips_user_warning
#define pips_internal_error
#define user_error(fn,...)
#define same_string_p(s1, s2)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Ppolynome make_polynome(float coeff, Variable var, Value expo)
Ppolynome make_polynome(float coeff, Variable var, Value expo) PRIVATE allocates space for,...
void polynome_rm(Ppolynome *ppp)
void polynome_rm(Ppolynome* ppp) frees space occupied by polynomial *ppp returns *ppp pointing to POL...
Ppolynome polynome_power_n(Ppolynome pp, int n)
Ppolynome polynome_power_n(Ppolynome pp, int n) returns pp ^ n (n>=0)
Variable vect_first_var(Pvecteur pvec)
PRIVATE: marquage du couple var_val comme visite par remplacement de var par -var dans le couple (OBS...
#define POWER_OPERATOR_NAME
#define MINUS_OPERATOR_NAME
#define PLUS_OPERATOR_NAME
#define DEFAULT_INTEGER_TYPE_SIZE
#define NORMALIZE_EXPRESSION(e)
#define FIELD_OPERATOR_NAME
#define DIVIDE_OPERATOR_NAME
#define UNARY_MINUS_OPERATOR_NAME
#define MULTIPLY_OPERATOR_NAME
entity make_empty_program(const char *name, language l)
const char * module_local_name(entity e)
Returns the module local user name.
entity make_new_scalar_variable_with_prefix(const char *, entity, basic)
Create a new scalar variable of type b in the given module.
bool entity_integer_scalar_p(entity)
for variables (like I), not constants (like 1)! use integer_constant_p() for constants
#define type_functional_p(x)
#define transformer_undefined
#define syntax_reference(x)
#define normalized_linear_p(x)
#define reference_variable(x)
#define value_intrinsic_p(x)
@ is_syntax_sizeofexpression
#define value_constant_p(x)
#define EXPRESSION(x)
EXPRESSION.
#define cast_expression(x)
#define entity_undefined_p(x)
#define expression_undefined
#define transformer_relation(x)
#define predicate_undefined
#define reference_indices(x)
#define call_arguments(x)
#define normalized_linear(x)
#define expression_syntax(x)
#define predicate_system(x)
#define entity_initial(x)
struct Ssysteme * Psysteme
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
bool sc_minmax_of_variable(Psysteme ps, Variable var, Value *pmin, Value *pmax)
void sc_minmax_of_variable(Psysteme ps, Variable var, Value *pmin, *pmax): examine un systeme pour tr...
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...
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
char * variable_name(Variable v)
polynome_ri.c
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define exp
Avoid some warnings from "gcc -Wshadow".
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
char *(* get_variable_name_t)(Variable)
struct Svecteur * Pvecteur
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...