PIPS
|
#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 "union.h"
#include "matrice.h"
#include "matrix.h"
#include "ri.h"
#include "constants.h"
#include "ri-util.h"
#include "misc.h"
#include "graph.h"
#include "paf_ri.h"
#include "text.h"
#include "text-util.h"
#include "paf-util.h"
#include "prgm_mapping.h"
Go to the source code of this file.
Macros | |
#define | VV_VAR(x) var_val_variable(x) |
Name : substitution.c Package : prgm_mapping Author : Platonoff Alexis Date : 4 october 1993 Historic : Documents: Comments : This file contains the functions for manipulating substitutions. More... | |
#define | VV_COEFF(x) expression_to_int(var_val_value(x)) |
#define | VV_VAL_(x) normalized_linear_(expression_normalized(var_val_value(x))) |
#define | VV_VAL(x) normalized_linear(expression_normalized(var_val_value(x))) |
#define | MAKE_VV(var, coeff, val) |
Typedefs | |
typedef bool(* | argh) (Pvecteur *, Pvecteur *) |
Functions | |
Ppolynome | my_vecteur_to_polynome (Pvecteur pv) |
Global variables More... | |
list | make_vvs (entity var, int coeff, Pvecteur val) |
======================================================================== More... | |
var_val | dup_vv (var_val vv) |
======================================================================== More... | |
list | dup_vvs (list vvs) |
======================================================================== More... | |
void | fprint_vvs (FILE *fp, list vvs) |
======================================================================== More... | |
void | fprint_vv (FILE *fp, var_val vv) |
======================================================================== More... | |
list | vvs_on_vvs (list vv1, list vv2) |
======================================================================== More... | |
list | compose_vvs (list vv1, list vv2) |
======================================================================== More... | |
list | sc_to_vvs (Psysteme sc, list var_l) |
======================================================================== More... | |
Psysteme | vvs_to_sc (list vvs) |
======================================================================== More... | |
bool | vvs_faisabilite (list vvs) |
======================================================================== More... | |
Ppolynome | vvs_on_polynome (list vvs, Ppolynome pp) |
======================================================================== More... | |
Pvecteur | vvs_on_vecteur (list vvs, Pvecteur pv) |
======================================================================== More... | |
Psysteme | vvs_on_systeme (list vvs, Psysteme ps) |
======================================================================== More... | |
list | make_vvs_from_sc (Psysteme ps_aux, list var_l) |
======================================================================== More... | |
list | plc_make_vvs_with_vector (Pvecteur v) |
======================================================================== More... | |
#define MAKE_VV | ( | var, | |
coeff, | |||
val | |||
) |
#define VV_COEFF | ( | x | ) | expression_to_int(var_val_value(x)) |
#define VV_VAL | ( | x | ) | normalized_linear(expression_normalized(var_val_value(x))) |
#define VV_VAL_ | ( | x | ) | normalized_linear_(expression_normalized(var_val_value(x))) |
#define VV_VAR | ( | x | ) | var_val_variable(x) |
========================================================================
If "pv" is not NULL and "aux_vvs" is NULL, it means that elim_var_with_eg() did not work.
"v1 == v2", so "v2" is remove from "cvv2"
Definition at line 274 of file vvs.c.
References CAR, CDR, contrainte_make(), dup_vvs(), elim_var_with_eg(), ENDP, gen_nconc(), newgen_Pvecteur, NIL, NO_OFL_CTRL, pgcd, POP, ppcm(), same_entity_p(), sc_add_egalite(), sc_new(), sc_to_vvs(), user_error, VAR_VAL, vect_cl2_ofl_ctrl(), vect_coeff(), vect_erase_var(), vecteur_to_list(), VV_COEFF, VV_VAL, VV_VAL_, and VV_VAR.
Referenced by partial_broadcast_coefficients(), sc_to_vvs(), solve_system_by_succ_elim(), and valuer().
========================================================================
Definition at line 123 of file vvs.c.
References MAKE_VV, vect_dup(), VV_COEFF, VV_VAL, and VV_VAR.
Referenced by dup_vvs().
========================================================================
Definition at line 131 of file vvs.c.
References CAR, CONS, dup_vv(), ENDP, gen_nconc(), NIL, POP, and VAR_VAL.
Referenced by compose_vvs().
void fprint_vv | ( | FILE * | fp, |
var_val | vv | ||
) |
========================================================================
Definition at line 158 of file vvs.c.
References entity_local_name(), expression_syntax, fprintf(), pu_vect_fprint(), syntax_undefined, var_val_value, VV_COEFF, VV_VAL, and VV_VAR.
Referenced by fprint_vvs().
void fprint_vvs | ( | FILE * | fp, |
list | vvs | ||
) |
========================================================================
Definition at line 146 of file vvs.c.
References CAR, ENDP, fprint_vv(), fprintf(), POP, and VAR_VAL.
Referenced by broadcast_conditions(), is_not_trivial_p(), partial_broadcast_coefficients(), plc_make_distance(), plc_make_vvs_with_vector(), prgm_mapping(), solve_system_by_succ_elim(), and valuer().
========================================================================
We remove "var" from "vec"
We have: val.var + new_vec == 0. So: abs(val).var = -sign(val).new_vec
Definition at line 610 of file vvs.c.
References CAR, CONS, ENDP, ENTITY, gen_nconc(), MAKE_VV, NIL, POP, Scontrainte::succ, user_error, VAR_VAL, vect_chg_sgn(), vect_coeff(), vect_del_var(), and Scontrainte::vecteur.
Referenced by partial_broadcast_coefficients(), plc_make_distance(), valuer(), and vvs_on_vvs().
Global variables
Internal variables
========================================================================
Definition at line 86 of file vvs.c.
References make_polynome(), POLYNOME_NUL, polynome_succ, Svecteur::succ, VECTEUR_NUL_P, vecteur_val, and vecteur_var.
========================================================================
list plc_make_vvs_with_vector(Pvecteur v): computes a substitution from a vector representing the following equality: v = 0
We do a Gauss-Jordan elimination on "v", the equation is transformed into a substitution.
For example, with the equation: C1 - C2 = 0
we can eliminate one of the two variables C1 or C2), the substitution may be: C2 <– C1
we sort the variables of this vector in order to try the elimination in the following order: first the CONST_COEFF, second the PARAM_COEFF, third the INDEX_COEFF, last the MU_COEFF.
We look, in lc, for a variable that we can eliminate in v, i.e. with a coefficient equal to 1 or -1.
Definition at line 668 of file vvs.c.
References CAR, CDR, compare_coeff(), ENTITY, entity_undefined, fprint_vvs(), fprintf(), general_merge_sort(), get_debug_level(), int, make_vvs(), NIL, NO_OFL_CTRL, vect_cl2_ofl_ctrl(), vect_coeff(), vect_new(), and vecteur_to_list().
Referenced by solve_system_by_succ_elim().
========================================================================
list sc_to_vvs(sc, var_l): returns the substitution equivalent to the system given in argument knowing that the substituted variables are contained in "var_l", in the same order. Then, their must be as many var in "var_l" as there are equalities in "sc".
We have: val.var + v = 0 => var = -val.v, with val in {1, -1} however: V = val.var + v => v = V - val.var so: var = -val(V - val.var) => var = -val.V + (val)^2.var => var = -val.V + var
Definition at line 382 of file vvs.c.
References CAR, CDR, compose_vvs(), CONS, ENTITY, MAKE_VV, NIL, NO_OFL_CTRL, same_entity_p(), Scontrainte::succ, Svecteur::succ, TCST, user_error, Svecteur::val, Svecteur::var, VAR_VAL, vect_cl2_ofl_ctrl(), vect_new(), Scontrainte::vecteur, and VECTEUR_NUL_P.
Referenced by compose_vvs().
========================================================================
Definition at line 449 of file vvs.c.
References NO_OFL_CTRL, sc_rational_feasibility_ofl_ctrl(), and vvs_to_sc().
========================================================================
Special treatment if there is only one sub
Definition at line 465 of file vvs.c.
References base_to_list(), CAR, CDR, ENDP, ENTITY, NIL, polynome_used_var(), POP, prototype_var_subst(), pu_is_inferior_var(), same_entity_p(), user_error, VAR_VAL, var_val_variable, vecteur_to_polynome(), VV_COEFF, VV_VAL, and VV_VAR.
Referenced by is_not_trivial_p(), plc_make_distance(), prgm_mapping(), valuer(), and vvs_on_prototypes().
========================================================================
Psysteme vvs_on_systeme(list vvs, Psysteme ps): applies the substitution "s" on the system "ps". The substitution is done directly on "ps" ; so, it is modified and is the returned value.
We substitute "pv" to "c.e" in ps.
Definition at line 567 of file vvs.c.
References CAR, ENDP, POP, substitute_var_with_vec(), VAR_VAL, VV_COEFF, VV_VAL, and VV_VAR.
Referenced by valuer().
========================================================================
Pvecteur vvs_on_vecteur(list vvs, Pvecteur pv): applies the substitution "s" on the vecteur "pv". The substitution is done directly on "pv" ; so, it is modified and is the returned value.
We substitute "vvpv" to "vve" in "pv".
We delete the occurence of "vve"...
... and we add "val*vvpv" to "pv".
Definition at line 530 of file vvs.c.
References CAR, ENDP, NO_OFL_CTRL, POP, user_error, VAR_VAL, vect_cl_ofl_ctrl(), vect_coeff(), vect_erase_var(), VV_COEFF, VV_VAL, and VV_VAR.
Referenced by solve_system_by_succ_elim().
========================================================================
Definition at line 198 of file vvs.c.
References CAR, CDR, contrainte_make(), elim_var_with_eg(), ENDP, gen_concatenate(), make_vvs_from_sc(), newgen_Pvecteur, NIL, NO_OFL_CTRL, pgcd, POP, ppcm(), same_entity_p(), sc_add_egalite(), sc_new(), user_error, VAR_VAL, vect_cl2_ofl_ctrl(), vect_coeff(), vect_erase_var(), vecteur_to_list(), VV_COEFF, VV_VAL, VV_VAL_, and VV_VAR.
Referenced by valuer().
========================================================================
Definition at line 429 of file vvs.c.
References CAR, contrainte_make(), ENDP, POP, sc_add_egalite(), sc_creer_base(), sc_new(), VAR_VAL, vect_add_elem(), VV_COEFF, VV_VAL, and VV_VAR.
Referenced by vvs_faisabilite().