initilize the complexity as zero complexity
variables in final complexity result
get reverse order, because we want to go over the complexity bottom-up
Get the must_be_written variables from the block effects, which means that these variables should NOT be contained in the block complexity results
begining of trace
find each stmt of the block
Get the un-evaluated complexity for the stmt
Get the precondition for the stmt
Get the cumulated effects of the stmt
Obtain all the eventual variables from the complexity result
Find from effects that which variable is must be written
if var is in var_comp and is must_be_written variable
Evaluate that variable to complexity
add the complexity togather
verification of the final complexity
end of trace
Definition at line 27 of file newblockalgo.c.
42 Pbase block_var_must = var_in_must_be_written(effects_list);
58 list cumu_list = load_statement_cumulated_effects(stat);
61 Pbase var_comp = var_in_comp(ctemp);
64 Pbase var_must = var_in_must_be_written(cumu_list);
67 for ( var in (var_comp and var_must) ) {
73 if ( csubst is not unknown )
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,...
void complexity_add(complexity *pcomp1, complexity comp2)
void complexity_add(complexity *pcomp1, comp2) performs *pcomp1 = *pcomp1 + comp2; !...
complexity make_zero_complexity()
make a zero complexity "0.0000 * TCST" with null statistics
complexity complexity_var_subst(complexity comp, Variable var, complexity compsubst)
complexity complexity_var_subst(comp, var, compsubst) replaces every occurrence of variable var in co...
complexity statement_to_complexity(statement stat, transformer precon __attribute__((__unused__)), list eff_list __attribute__((__unused__)))
starting point of Abstract Syntax Tree
void trace_on(char *fmt,...)
void complexity_check_and_warn(char *s, complexity comp) const
void trace_off()
"trace off"
list gen_nreverse(list cp)
reverse a list in place
#define NIL
The empty list (nil in Lisp)
#define CAR(pcons)
Get the value of the first element of a list.
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
#define STATEMENT(x)
STATEMENT.
transformer load_statement_precondition(statement)
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
References CAR, complexity_add(), complexity_check_and_warn(), complexity_var_subst(), evaluate_var_to_complexity(), gen_nreverse(), load_statement_precondition(), make_zero_complexity(), MAPL, NIL, STATEMENT, statement_to_complexity(), trace_off(), and trace_on().