union.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Ssyslist
 Warning! Do not modify this file that is automatically generated! More...
struct  Spath
struct  Sunion

Defines

#define SL_NULL   (Psyslist) NULL
#define DJ_UNDEFINED   (Pdisjunct) NULL
#define CO_UNDEFINED   (Pcomplement) NULL
#define PA_UNDEFINED   (Ppath) NULL
#define UN_UNDEFINED   (Punion) NULL
#define UN_FULL_SPACE   (Punion) NULL
#define UN_EMPTY_SPACE   (Punion) NULL
#define my_sc_full()   sc_full()
#define my_sc_empty()   sc_empty((Pbase) NULL)
#define is_sc_my_empty_p(ps)   sc_empty_p((ps))
#define is_dj_full_p(dj)   dj_full_p((dj))
#define is_dj_empty_p(dj)   dj_empty_p((dj))
#define is_pa_full_p(pa)   pa_full_p((pa))
#define is_pa_empty_p(pa)   pa_empty_p((pa))
#define sc_difference(ps1, ps2)   pa_system_difference_ofl_ctrl((ps1),(ps2),FWD_OFL_CTRL)
#define sc_inclusion_p(ps1, ps2)   pa_inclusion_p_ofl_ctrl((ps1), (ps2), NO_OFL_CTRL)
#define sc_inclusion_p_ofl(ps1, ps2)   pa_inclusion_p_ofl_ctrl((ps1), (ps2), FWD_OFL_CTRL)
#define sc_inclusion_p_ofl_ctrl(ps1, ps2, ofl)   pa_inclusion_p_ofl_ctrl((ps1), (ps2), (ofl))
#define sc_equal_p(ps1, ps2)   pa_system_equal_p_ofl_ctrl((ps1), (ps2), NO_OFL_CTRL)
#define sc_equal_p_ofl(ps1, ps2)   pa_system_equal_p_ofl_ctrl((ps1), (ps2), FWD_OFL_CTRL)
#define sc_equal_p_ofl_ctrl(ps1, ps2, ofl)   pa_system_equal_p_ofl_ctrl((ps1), (ps2), (ofl))
#define sc_convex_hull_equals_union_p(conv_hull, ps1, ps2)   pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2),NO_OFL_CTRL, FALSE)
#define sc_convex_hull_equals_union_p_ofl(conv_hull, ps1, ps2)   pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2), OFL_CTRL, FALSE)
#define sc_convex_hull_equals_union_p_ofl_ctrl(conv_hull, ps1, ps2, ofl, bo)   pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2), (ofl), (bo))
#define sc_elim_redund_with_first(ps1, ps2)   sc_elim_redund_with_first_ofl_ctrl((ps1), (ps2), NO_OFL_CTRL)
#define dj_fprint(fi, dj, fu)   dj_fprint_tab((fi), (dj), (fu), 0)
#define DJ_UNDEFINED_P(dj)   ((dj) == DJ_UNDEFINED)
#define dj_faisabilite(dj)   dj_feasibility_ofl_ctrl((dj), NO_OFL_CTRL)
#define dj_feasibility(dj)   dj_feasibility_ofl_ctrl((dj), NO_OFL_CTRL)
#define dj_faisabilite_ofl(dj)   dj_feasibility_ofl_ctrl((dj), FWD_OFL_CTRL)
#define dj_intersection(dj1, dj2)   dj_intersection_ofl_ctrl((dj1), (dj2), NO_OFL_CTRL)
#define dj_intersect_system(dj, ps)   dj_intersect_system_ofl_ctrl((dj), (ps), NO_OFL_CTRL )
#define dj_intersect_djcomp(dj1, dj2)   dj_intersect_djcomp_ofl_ctrl( (dj1), (dj2), NO_OFL_CTRL )
#define dj_projection_along_variables(dj, pv)   dj_projection_along_variables_ofl_ctrl((dj),(pv),NO_OFL_CTRL)
#define dj_variable_substitution_with_eqs(dj, co, pv)   dj_variable_substitution_with_eqs_ofl_ctrl( (dj), (co), (pv), NO_OFL_CTRL )
#define pa_fprint(fi, pa, fu)   pa_fprint_tab((fi), (pa), (fu), 0)
#define PA_UNDEFINED_P(pa)   ((pa) == PA_UNDEFINED)
#define pa_new()   pa_make(NULL, NULL)
#define pa_faisabilite(pa)   pa_feasibility_ofl_ctrl((pa), NO_OFL_CTRL)
#define pa_feasibility(pa)   pa_feasibility_ofl_ctrl((pa), NO_OFL_CTRL)
#define pa_faisabilite_ofl(pa)   pa_feasibility_ofl_ctrl((pa), FWD_OFL_CTRL)
#define pa_path_to_disjunct(pa)   pa_path_to_disjunct_ofl_ctrl((pa), NO_OFL_CTRL )
#define pa_path_dup_to_disjunct(pa)   pa_path_to_disjunct_ofl_ctrl((pa), NO_OFL_CTRL )
#define pa_system_difference(ps1, ps2)   pa_system_difference_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)
#define pa_system_equal_p(ps1, ps2)   pa_system_equal_p_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)
#define pa_inclusion_p(ps1, ps2)   pa_inclusion_p_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)
#define pa_path_to_disjunct_ofl(pa)   pa_path_to_disjunct_ofl_ctrl((pa), FWD_OFL_CTRL )
#define pa_path_to_disjunct_rule4(pa)   pa_path_to_disjunct_rule4_ofl_ctrl((pa), FWD_OFL_CTRL )
#define pa_path_to_few_disjunct(pa)   pa_path_to_few_disjunct_ofl_ctrl((pa), NO_OFL_CTRL)
#define pa_system_difference(ps1, ps2)   pa_system_difference_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)
#define pa_convex_hull_equals_union_p(conv_hull, ps1, ps2)   pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2), NO_OFL_CTRL, FALSE)
#define un_fprint(fi, un, fu, ty)   un_fprint_tab((fi), (un), (fu), (ty), 0)
#define PATH_MAX_CONSTRAINTS   12
#define IS_SC   1
#define IS_SL   2
#define IS_DJ   3
#define IS_PA   4
#define C3_DEBUG(fun, code)
#define C3_RETURN(type, val)   {return val;}
#define SL_NULL   (Psyslist) NULL
#define DJ_UNDEFINED   (Pdisjunct) NULL
#define CO_UNDEFINED   (Pcomplement) NULL
#define PA_UNDEFINED   (Ppath) NULL
#define UN_UNDEFINED   (Punion) NULL
#define UN_FULL_SPACE   (Punion) NULL
#define UN_EMPTY_SPACE   (Punion) NULL
#define my_sc_full()   sc_full()
 FOR BACKWARD COMPATIBILITY.
#define my_sc_empty()   sc_empty((Pbase) NULL)
#define is_sc_my_empty_p(ps)   sc_empty_p((ps))
#define is_dj_full_p(dj)   dj_full_p((dj))
#define is_dj_empty_p(dj)   dj_empty_p((dj))
#define is_pa_full_p(pa)   pa_full_p((pa))
#define is_pa_empty_p(pa)   pa_empty_p((pa))
#define sc_difference(ps1, ps2)   pa_system_difference_ofl_ctrl((ps1),(ps2),FWD_OFL_CTRL)
 FOR BACKWARD COMPATIBILITY.
#define sc_inclusion_p(ps1, ps2)   pa_inclusion_p_ofl_ctrl((ps1), (ps2), NO_OFL_CTRL)
#define sc_inclusion_p_ofl(ps1, ps2)   pa_inclusion_p_ofl_ctrl((ps1), (ps2), FWD_OFL_CTRL)
#define sc_inclusion_p_ofl_ctrl(ps1, ps2, ofl)   pa_inclusion_p_ofl_ctrl((ps1), (ps2), (ofl))
#define sc_equal_p(ps1, ps2)   pa_system_equal_p_ofl_ctrl((ps1), (ps2), NO_OFL_CTRL)
#define sc_equal_p_ofl(ps1, ps2)   pa_system_equal_p_ofl_ctrl((ps1), (ps2), FWD_OFL_CTRL)
#define sc_equal_p_ofl_ctrl(ps1, ps2, ofl)   pa_system_equal_p_ofl_ctrl((ps1), (ps2), (ofl))
#define sc_convex_hull_equals_union_p(conv_hull, ps1, ps2)   pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2),NO_OFL_CTRL, FALSE)
#define sc_convex_hull_equals_union_p_ofl(conv_hull, ps1, ps2)   pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2), OFL_CTRL, FALSE)
#define sc_convex_hull_equals_union_p_ofl_ctrl(conv_hull, ps1, ps2, ofl, bo)   pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2), (ofl), (bo))
#define sc_elim_redund_with_first(ps1, ps2)   sc_elim_redund_with_first_ofl_ctrl((ps1), (ps2), NO_OFL_CTRL)
 OTHERS.
#define dj_fprint(fi, dj, fu)   dj_fprint_tab((fi), (dj), (fu), 0)
#define DJ_UNDEFINED_P(dj)   ((dj) == DJ_UNDEFINED)
#define dj_faisabilite(dj)   dj_feasibility_ofl_ctrl((dj), NO_OFL_CTRL)
#define dj_feasibility(dj)   dj_feasibility_ofl_ctrl((dj), NO_OFL_CTRL)
#define dj_faisabilite_ofl(dj)   dj_feasibility_ofl_ctrl((dj), FWD_OFL_CTRL)
#define dj_intersection(dj1, dj2)   dj_intersection_ofl_ctrl((dj1), (dj2), NO_OFL_CTRL)
#define dj_intersect_system(dj, ps)   dj_intersect_system_ofl_ctrl((dj), (ps), NO_OFL_CTRL )
#define dj_intersect_djcomp(dj1, dj2)   dj_intersect_djcomp_ofl_ctrl( (dj1), (dj2), NO_OFL_CTRL )
#define dj_projection_along_variables(dj, pv)   dj_projection_along_variables_ofl_ctrl((dj),(pv),NO_OFL_CTRL)
#define dj_variable_substitution_with_eqs(dj, co, pv)   dj_variable_substitution_with_eqs_ofl_ctrl( (dj), (co), (pv), NO_OFL_CTRL )
#define pa_fprint(fi, pa, fu)   pa_fprint_tab((fi), (pa), (fu), 0)
#define PA_UNDEFINED_P(pa)   ((pa) == PA_UNDEFINED)
#define pa_new()   pa_make(NULL, NULL)
#define pa_faisabilite(pa)   pa_feasibility_ofl_ctrl((pa), NO_OFL_CTRL)
#define pa_feasibility(pa)   pa_feasibility_ofl_ctrl((pa), NO_OFL_CTRL)
#define pa_faisabilite_ofl(pa)   pa_feasibility_ofl_ctrl((pa), FWD_OFL_CTRL)
#define pa_path_to_disjunct(pa)   pa_path_to_disjunct_ofl_ctrl((pa), NO_OFL_CTRL )
#define pa_path_dup_to_disjunct(pa)   pa_path_to_disjunct_ofl_ctrl((pa), NO_OFL_CTRL )
#define pa_system_difference(ps1, ps2)   pa_system_difference_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)
#define pa_system_equal_p(ps1, ps2)   pa_system_equal_p_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)
#define pa_inclusion_p(ps1, ps2)   pa_inclusion_p_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)
#define pa_path_to_disjunct_ofl(pa)   pa_path_to_disjunct_ofl_ctrl((pa), FWD_OFL_CTRL )
#define pa_path_to_disjunct_rule4(pa)   pa_path_to_disjunct_rule4_ofl_ctrl((pa), FWD_OFL_CTRL )
#define pa_path_to_few_disjunct(pa)   pa_path_to_few_disjunct_ofl_ctrl((pa), NO_OFL_CTRL)
#define pa_system_difference(ps1, ps2)   pa_system_difference_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)
#define pa_convex_hull_equals_union_p(conv_hull, ps1, ps2)   pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2), NO_OFL_CTRL, FALSE)
#define un_fprint(fi, un, fu, ty)   un_fprint_tab((fi), (un), (fu), (ty), 0)
#define PATH_MAX_CONSTRAINTS   12
 Misceleanous (debuging.
#define IS_SC   1
#define IS_SL   2
#define IS_DJ   3
#define IS_PA   4
#define C3_DEBUG(fun, code)
#define C3_RETURN(type, val)   {return val;}

Typedefs

typedef struct SsyslistPsyslist
 Warning! Do not modify this file that is automatically generated!
typedef struct Ssyslist Ssyslist
typedef SsyslistPdisjunct
typedef Ssyslist Sdisjunct
typedef SsystemePcomplement
typedef Ssysteme Scomplement
typedef SsyslistPcomplist
typedef Ssyslist Scomplist
typedef struct SpathPpath
typedef struct Spath Spath
typedef struct SunionPunion
typedef struct Sunion Sunion

Enumerations

enum  hspara_elem {
  unpara = 0, sszero = 1, ssplus = 2, ssminus = 3,
  opzero = 4, opplus = 5, keep = 6, opminus = 7,
  empty = 8, full = 9, unpara = 0, sszero = 1,
  ssplus = 2, ssminus = 3, opzero = 4, opplus = 5,
  keep = 6, opminus = 7, empty = 8, full = 9
}
 

Implementation of the finite parallel half space lattice hspara.

More...

Functions

Pdisjunct dj_new (void)
 disjunct.c
Pdisjunct dj_dup (Pdisjunct)
 Pdisjunct dj_dup( (Pdisjunct) in_dj ) AL 15/11/93 Duplicates input disjunction.
Pdisjunct dj_free (Pdisjunct)
 Pdisjunct dj_free( (Pdisjunct) in_dj ) AL 31/05/94 w - 1 depth free of input disjunction.
Pdisjunct dj_dup1 (Pdisjunct)
 Pdisjunct dj_dup1( (Pdisjunct) in_dj ) AL 31/05/94 1st depth duplication of input disjunction.
Pdisjunct dj_free1 (Pdisjunct)
 Pdisjunct dj_free1( (Pdisjunct) in_dj ) AL 31/05/94 1st depth free of input disjunction.
Pdisjunct dj_full (void)
 Pdisjunct dj_full() AL 18/11/93 Return full space disjunction = dj_new().
boolean dj_full_p (Pdisjunct)
 dj_full_p( (Pdisjunct) in_dj ) AL 30/05/94 Returns True if in_dj = (NIL) ^ (NIL)
Pdisjunct dj_empty (void)
 Pdisjunct dj_empty() AL 18/11/93 Returns a disjunction with sc_empty() element.
boolean dj_empty_p (Pdisjunct)
 dj_empty_p( (Ppath) in_pa ) AL 30/05/94 Returns True if in_dj = (1*TCST = 0) ^ (NIL)
Pdisjunct dj_intersection_ofl_ctrl (Pdisjunct, Pdisjunct, int)
 Pdisjunct dj_intersection_ofl_ctrl( in_dj1, in_dj2, ofl_ctrl ) Computes intersection of two disjunctions.
Pdisjunct dj_intersect_system_ofl_ctrl (Pdisjunct, Psysteme, int)
Pdisjunct dj_intersect_djcomp_ofl_ctrl (Pdisjunct, Pdisjunct, int)
 Pdisjunct dj_intersect_djcomp_ofl_ctrl( ) No sharing.
Pdisjunct dj_union (Pdisjunct, Pdisjunct)
 Pdisjunct dj_union( (Pdisjunct) in_dj1, (Pdisjunct) in_dj2 ) Give the union of the two disjunctions.
boolean dj_feasibility_ofl_ctrl (Pdisjunct, int)
 boolean dj_feasibility_ofl_ctrl( (Pdisjunct) in_dj, (int) ofl_ctrl ) Returns true if in_dj is a feasible disjunction.
Pdisjunct dj_system_complement (Psysteme)
 Pdisjunct dj_system_complement( (Psystem) in_ps ) AL 26/10/93 Input : A Psysteme.
Pdisjunct dj_disjunct_complement (Pdisjunct)
 Returns complement of in_dj.
Pdisjunct dj_projection_along_variables_ofl_ctrl (Pdisjunct, Pvecteur, int)
 Returns projection of in_dj along vars of in_pv.
Pdisjunct dj_simple_inegs_to_eg (Pdisjunct)
 Pdisjunct dj_simple_inegs_to_eg( in_dj ) transforms two opposite inequalities in a simple equality in each system of the input disjunction.
boolean dj_is_system_p (Pdisjunct)
 boolean dj_is_system_p( (Pdisjunct) in_dj ) AL 16/11/93 Returns True if disjunction in_dj has only one Psysteme in it.
Pdisjunct dj_append_system (Pdisjunct, Psysteme)
 Pdisjunct dj_append_system( (Pdisjunct) in_dj, (Psysteme) in_ps ) Input : A disjunct in_dj to wich in_ps will be added.
Pdisjunct dj_variable_rename (Pdisjunct, Variable, Variable)
 dj_variable_rename replaces in_vold with in_vnew : in_dj is modified
Pdisjunct dj_variable_substitution_with_eqs_ofl_ctrl (Pdisjunct, Pcontrainte, Pvecteur, int)
void dj_fprint_tab (FILE *, Pdisjunct, char *(*)(void), int)
Pdisjunct dj_read (char *)
 void dj_read(FILE*) reads a Pdisjunct
Ppath pa_make (Psysteme, Pcomplist)
 path.c
Ppath pa_dup (Ppath)
 void pa_dup(Ppath pa) AL 30/05/94
Ppath pa_free (Ppath)
 Ppath pa_free(Ppath pa) BA, AL 30/05/94.
Ppath pa_dup1 (Ppath)
 void pa_dup1(Ppath pa) AL 30/05/94 1 depth duplication: system and complements are shared.
Ppath pa_free1 (Ppath)
 Ppath pa_free1(Ppath pa) BA, AL 30/05/94 1 depth free.
Ppath pa_full (void)
 Ppath pa_full() AL 18/11/93 Returns full space path : pa_full = pa_new().
boolean pa_full_p (Ppath)
 pa_full_p( (Ppath) in_pa ) AL 18/11/93 Returns True if in_pa = (NIL) ^ (NIL)
Ppath pa_empty (void)
 Ppath pa_empty() AL 18/11/93 Returns empty path : pa_empty = sc_empty(NULL) ^ (NIL).
boolean pa_empty_p (Ppath)
 pa_empty_p( (Ppath) in_pa ) AL 18/11/93 Returns True if in_pa = (1*TCST = 0) ^ (NIL)
int pa_max_constraints_nb (Ppath)
 int pa_max_constraints_nb( (Ppath) in_pa ) Give the maximum constraints nb among systems of in_pa.
Ppath pa_intersect_system (Ppath, Psysteme)
 Ppath pa_intersect_system( (Ppath) in_pa, (Psysteme) in_ps ) Computes the intersection between in_pa and in_ps.
Ppath pa_intersect_complement (Ppath, Pcomplement)
 Ppath pa_intersect_complement( (Ppath) in_pa, (Pcomplement) in_pc ) Computes the intersection between in_pa and in_ps.
Ppath pa_reduce_simple_complement (Ppath)
 Ppath pa_reduce_simple_complement( (Ppath) in_pa ) AL 16/11/93 Scan all the complement.
Ppath pa_transform_eg_in_ineg (Ppath)
 Ppath pa_transform_eg_in_ineg( in_pa ) Transforms all equalities of all systems composing in_pa in inequalities and returns in_pa.
boolean pa_feasibility_ofl_ctrl (Ppath, int)
 boolean pa_feasibility_ofl_ctrl( (Ppath) in_pa, int ofl_ctrl) Returns true if the input path is possible and FALSE if it is not possible or undefined.
Pdisjunct pa_path_to_disjunct_ofl_ctrl (Ppath, int)
 Pdisjunct pa_path_to_disjunct_ofl_ctrl ( (Ppath) in_pa, (int) ofl_ctrl) Produces a Pdisjunct corresponding to the path Ppath.
void pa_fprint_tab (FILE *, Ppath, char *(*)(void), int)
Ppath pa_read (char *)
 void pa_read(FILE*) reads a Ppath
enum hspara_elem vect_parallel (Pvecteur, Pvecteur)
 reduc.c
enum hspara_elem contrainte_parallel_in_liste (Pcontrainte, Pcontrainte)
 enum enum hspara_elem contrainte_parallel_in_liste( in_co, in_lc ) AL950711 input: 1 constraint in_co and a list of constraints in_lc output: hspara_elem (element of the parallel half space lattice) memory: Inspector (nothing is shared, nor modified, output allocated).
Psysteme sc_supress_parallel_redund_constraints (Psysteme, Psysteme)
 Psysteme sc_supress_parallel_redund_constraints( in_ps1, in_ps2 ) input: 2 Psystemes in_ps1 and in_ps2 output: in_ps1 / in_ps2 (cut operation on polyhedrons) memory: Inspector (nothing is shared, nor modified, output allocated).
Psysteme sc_supress_same_constraints (Psysteme, Psysteme)
 Psysteme sc_supress_same_constraints( in_ps1, in_ps2 ) supress in in_ps2 constraints that are in in_ps1.
Psysteme sc_elim_redund_with_first_ofl_ctrl (Psysteme, Psysteme, int)
 Psysteme sc_elim_redund_with_first_ofl_ctrl( in_ps1, in_ps2, ofl_ctrl ) Returns constraints of in_ps2 which cut in_ps1.
Ppath pa_supress_same_constraints (Ppath)
 Ppath pa_supress_same_constraints( (Ppath) in_pa ) Supress from complements of in_pa same constraints than those in positif Psystem in_pa->psys.
Pdisjunct pa_path_to_disjunct_rule4_ofl_ctrl (Ppath, int)
 Pdisjunct pa_path_to_disjunct_rule4_ofl_ctrl( (Ppath) in_pa, int ofl_ctrl) Returns the corresponding disjunction according rule 4.
Pdisjunct pa_path_to_few_disjunct_ofl_ctrl (Ppath, int)
 line 1197 "reduc.w"
boolean pa_inclusion_p_ofl_ctrl (Psysteme, Psysteme, int)
 boolean pa_inclusion_p(Psysteme ps1, Psysteme ps2) BA, AL 31/05/94 returns TRUE if ps1 represents a subset of ps2, false otherwise Inspector (no sharing on memory).
boolean pa_system_equal_p_ofl_ctrl (Psysteme, Psysteme, int)
 boolean pa_system_equal_p(Psysteme ps1, Psysteme ps2) BA
Pdisjunct pa_system_difference_ofl_ctrl (Psysteme, Psysteme, int)
 Pdisjunct pa_system_difference_ofl_ctrl(ps1, ps2) input : two Psystemes output : a disjunction representing ps1 - ps2 modifies : nothing comment : algorihtm : chemin = ps1 inter complement of (ps2) ret_dj = dj_simple_inegs_to_eg( pa_path_to_few_disjunct(chemin) ).
boolean pa_convex_hull_equals_union_p_ofl_ctrl (Psysteme, Psysteme, Psysteme, int, boolean)
 boolean pa_convex_hull_equals_union_p(conv_hull, ps1, ps2) input : two Psystems and their convex hull AL,BC 23/03/95 output : TRUE if ps1 U ps2 = convex_hull, FALSE otherwise modifies : nothing comment : complexity = nb_constraints(ps1) * nb_constraints(ps2) if ofl_ctrl = OFL_CTRL, conservatively returns ofl_ctrl when an overflow error occurs
char *(*) union_variable_name (Variable)
 sc_list.c
Psysteme sc_full (void)
 Psysteme sc_full() similar to sc_new.
boolean sc_full_p (Psysteme)
 Psysteme sc_full_p( in_ps ) similar to sc_new.
Psysteme sc_dup1 (Psysteme)
 Psysteme sc_dup1( in_ps ) AL 30/05/94 1 depth copy of in_ps: no duplication of vectors (except for the base).
Psysteme sc_free (Psysteme)
 Psysteme sc_free( in_ps ) AL 30/05/94 Free of in_ps.
Psysteme sc_free1 (Psysteme)
 Psysteme sc_free1( in_ps ) AL 30/05/94 Only pcontrainte of in_ps are freed.
Psysteme sc_concatenate (Psysteme, Psysteme)
 Psysteme sc_concatenate( in_s1, in_s2 ) AL 30/05/94 Append in_s2 to the end of in_s1 and returns in_s1.
boolean sl_length (Psyslist)
 int sl_length( (Psyslist) in_sl ) AL 26/04/95 Returns length of in_sl.
int sl_max_constraints_nb (Psyslist)
 int sl_max_constraints_nb( (Psyslist) in_sl ) Give the maximum constraints nb among systems of in_sl.
boolean sl_is_system_p (Psyslist)
 boolean sl_is_system_p( (Psyslist) in_sl ) AL 16/11/93 Returns True if syslist in_sl has only one Psysteme in it.
Psyslist sl_append_system (Psyslist, Psysteme)
 Psyslist sl_append_system( (Psyslist) in_sl, (Psysteme) in_ps ) Input : A disjunct in_sl to wich in_ps will be added.
Psyslist sl_append_system_first (Psyslist, Psysteme)
 Psyslist sl_append_system_first( in_sl, in_ps ) AL 23/03/95 A new Psyslist with in_ps at the end of in_sl (sharing).
Psyslist sl_new (void)
 Psyslist sl_new() AL 26/10/93 Input : Nothing.
Psyslist sl_dup (Psyslist)
 Psyslist sl_dup( (Psyslist) in_sl ) AL 15/11/93 w - 1 duplication : everything is duplicated, except entities.
Psyslist sl_dup1 (Psyslist)
 Psyslist sl_dup1( (Psyslist) in_sl ) AL 15/11/93 Duplicates input syslist.
Psyslist sl_free (Psyslist)
 Psyslist sl_free(Psyslist psl) BA, AL 30/05/94 w - 1 depth free.
Psyslist sl_free1 (Psyslist)
 Psyslist sl_free1(Psyslist psl) AL 30/05/94 1 depth free.
void sl_set_variable_name (char *(*)(void))
char * sl_get_tab_string (int)
 char* sl_get_tab_string( in_tab ) returns a string of in_tab
void sl_fprint_tab (FILE *, Psyslist, char *(*)(void), int)
void sl_fprint (FILE *, Psyslist, char *(*)(void))
Psyslist sl_read (char *)
 fichier lu par sl_lex.l
void un_fprint_tab (FILE *, char *, char *(*)(void), int, int)

Variables

char *(* union_variable_name )()
 sc_list.c

Define Documentation

#define C3_DEBUG ( fun,
code   ) 

Definition at line 157 of file union.h.

#define C3_DEBUG ( fun,
code   ) 
#define C3_RETURN ( type,
val   )     {return val;}

Definition at line 158 of file union.h.

#define C3_RETURN ( type,
val   )     {return val;}
#define CO_UNDEFINED   (Pcomplement) NULL

Definition at line 23 of file union.h.

#define CO_UNDEFINED   (Pcomplement) NULL
#define dj_faisabilite ( dj   )     dj_feasibility_ofl_ctrl((dj), NO_OFL_CTRL)

Definition at line 105 of file union.h.

#define dj_faisabilite ( dj   )     dj_feasibility_ofl_ctrl((dj), NO_OFL_CTRL)
#define dj_faisabilite_ofl ( dj   )     dj_feasibility_ofl_ctrl((dj), FWD_OFL_CTRL)

Definition at line 107 of file union.h.

#define dj_faisabilite_ofl ( dj   )     dj_feasibility_ofl_ctrl((dj), FWD_OFL_CTRL)
#define dj_feasibility ( dj   )     dj_feasibility_ofl_ctrl((dj), NO_OFL_CTRL)

Definition at line 106 of file union.h.

#define dj_feasibility ( dj   )     dj_feasibility_ofl_ctrl((dj), NO_OFL_CTRL)
#define dj_fprint ( fi,
dj,
fu   )     dj_fprint_tab((fi), (dj), (fu), 0)

Definition at line 103 of file union.h.

#define dj_fprint ( fi,
dj,
fu   )     dj_fprint_tab((fi), (dj), (fu), 0)
#define dj_intersect_djcomp ( dj1,
dj2   )     dj_intersect_djcomp_ofl_ctrl( (dj1), (dj2), NO_OFL_CTRL )

Definition at line 110 of file union.h.

#define dj_intersect_djcomp ( dj1,
dj2   )     dj_intersect_djcomp_ofl_ctrl( (dj1), (dj2), NO_OFL_CTRL )
#define dj_intersect_system ( dj,
ps   )     dj_intersect_system_ofl_ctrl((dj), (ps), NO_OFL_CTRL )

Definition at line 109 of file union.h.

#define dj_intersect_system ( dj,
ps   )     dj_intersect_system_ofl_ctrl((dj), (ps), NO_OFL_CTRL )
#define dj_intersection ( dj1,
dj2   )     dj_intersection_ofl_ctrl((dj1), (dj2), NO_OFL_CTRL)

Definition at line 108 of file union.h.

#define dj_intersection ( dj1,
dj2   )     dj_intersection_ofl_ctrl((dj1), (dj2), NO_OFL_CTRL)

Referenced by dj_disjunct_complement().

#define dj_projection_along_variables ( dj,
pv   )     dj_projection_along_variables_ofl_ctrl((dj),(pv),NO_OFL_CTRL)

Definition at line 111 of file union.h.

#define dj_projection_along_variables ( dj,
pv   )     dj_projection_along_variables_ofl_ctrl((dj),(pv),NO_OFL_CTRL)
#define DJ_UNDEFINED   (Pdisjunct) NULL

Definition at line 19 of file union.h.

#define DJ_UNDEFINED   (Pdisjunct) NULL
#define DJ_UNDEFINED_P ( dj   )     ((dj) == DJ_UNDEFINED)

Definition at line 104 of file union.h.

#define DJ_UNDEFINED_P ( dj   )     ((dj) == DJ_UNDEFINED)
#define dj_variable_substitution_with_eqs ( dj,
co,
pv   )     dj_variable_substitution_with_eqs_ofl_ctrl( (dj), (co), (pv), NO_OFL_CTRL )

Definition at line 113 of file union.h.

#define dj_variable_substitution_with_eqs ( dj,
co,
pv   )     dj_variable_substitution_with_eqs_ofl_ctrl( (dj), (co), (pv), NO_OFL_CTRL )
#define IS_DJ   3

Definition at line 142 of file union.h.

#define IS_DJ   3
#define is_dj_empty_p ( dj   )     dj_empty_p((dj))

Definition at line 80 of file union.h.

#define is_dj_empty_p ( dj   )     dj_empty_p((dj))
#define is_dj_full_p ( dj   )     dj_full_p((dj))

Definition at line 79 of file union.h.

#define is_dj_full_p ( dj   )     dj_full_p((dj))
#define IS_PA   4

Definition at line 143 of file union.h.

#define IS_PA   4
#define is_pa_empty_p ( pa   )     pa_empty_p((pa))

Definition at line 82 of file union.h.

#define is_pa_empty_p ( pa   )     pa_empty_p((pa))
#define is_pa_full_p ( pa   )     pa_full_p((pa))

Definition at line 81 of file union.h.

#define is_pa_full_p ( pa   )     pa_full_p((pa))
#define IS_SC   1

Definition at line 140 of file union.h.

#define IS_SC   1
#define is_sc_my_empty_p ( ps   )     sc_empty_p((ps))

Definition at line 78 of file union.h.

#define is_sc_my_empty_p ( ps   )     sc_empty_p((ps))
#define IS_SL   2

Definition at line 141 of file union.h.

#define IS_SL   2

Referenced by un_fprint_tab().

 
#define my_sc_empty (  )     sc_empty((Pbase) NULL)

Definition at line 77 of file union.h.

 
#define my_sc_empty (  )     sc_empty((Pbase) NULL)
 
#define my_sc_full (  )     sc_full()

FOR BACKWARD COMPATIBILITY.

Definition at line 76 of file union.h.

 
#define my_sc_full (  )     sc_full()
#define pa_convex_hull_equals_union_p ( conv_hull,
ps1,
ps2   )     pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2), NO_OFL_CTRL, FALSE)

Definition at line 131 of file union.h.

#define pa_convex_hull_equals_union_p ( conv_hull,
ps1,
ps2   )     pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2), NO_OFL_CTRL, FALSE)
#define pa_faisabilite ( pa   )     pa_feasibility_ofl_ctrl((pa), NO_OFL_CTRL)

Definition at line 119 of file union.h.

#define pa_faisabilite ( pa   )     pa_feasibility_ofl_ctrl((pa), NO_OFL_CTRL)
#define pa_faisabilite_ofl ( pa   )     pa_feasibility_ofl_ctrl((pa), FWD_OFL_CTRL)

Definition at line 121 of file union.h.

#define pa_faisabilite_ofl ( pa   )     pa_feasibility_ofl_ctrl((pa), FWD_OFL_CTRL)
#define pa_feasibility ( pa   )     pa_feasibility_ofl_ctrl((pa), NO_OFL_CTRL)

Definition at line 120 of file union.h.

#define pa_feasibility ( pa   )     pa_feasibility_ofl_ctrl((pa), NO_OFL_CTRL)
#define pa_fprint ( fi,
pa,
fu   )     pa_fprint_tab((fi), (pa), (fu), 0)

Definition at line 116 of file union.h.

#define pa_fprint ( fi,
pa,
fu   )     pa_fprint_tab((fi), (pa), (fu), 0)
#define pa_inclusion_p ( ps1,
ps2   )     pa_inclusion_p_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)

Definition at line 126 of file union.h.

#define pa_inclusion_p ( ps1,
ps2   )     pa_inclusion_p_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)
 
#define pa_new (  )     pa_make(NULL, NULL)

Definition at line 118 of file union.h.

 
#define pa_new (  )     pa_make(NULL, NULL)
#define pa_path_dup_to_disjunct ( pa   )     pa_path_to_disjunct_ofl_ctrl((pa), NO_OFL_CTRL )

Definition at line 123 of file union.h.

#define pa_path_dup_to_disjunct ( pa   )     pa_path_to_disjunct_ofl_ctrl((pa), NO_OFL_CTRL )
#define pa_path_to_disjunct ( pa   )     pa_path_to_disjunct_ofl_ctrl((pa), NO_OFL_CTRL )

Definition at line 122 of file union.h.

#define pa_path_to_disjunct ( pa   )     pa_path_to_disjunct_ofl_ctrl((pa), NO_OFL_CTRL )

Referenced by adg_update_dfg().

#define pa_path_to_disjunct_ofl ( pa   )     pa_path_to_disjunct_ofl_ctrl((pa), FWD_OFL_CTRL )

Definition at line 127 of file union.h.

#define pa_path_to_disjunct_ofl ( pa   )     pa_path_to_disjunct_ofl_ctrl((pa), FWD_OFL_CTRL )
#define pa_path_to_disjunct_rule4 ( pa   )     pa_path_to_disjunct_rule4_ofl_ctrl((pa), FWD_OFL_CTRL )

Definition at line 128 of file union.h.

#define pa_path_to_disjunct_rule4 ( pa   )     pa_path_to_disjunct_rule4_ofl_ctrl((pa), FWD_OFL_CTRL )
#define pa_path_to_few_disjunct ( pa   )     pa_path_to_few_disjunct_ofl_ctrl((pa), NO_OFL_CTRL)

Definition at line 129 of file union.h.

#define pa_path_to_few_disjunct ( pa   )     pa_path_to_few_disjunct_ofl_ctrl((pa), NO_OFL_CTRL)
#define pa_system_difference ( ps1,
ps2   )     pa_system_difference_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)

Definition at line 130 of file union.h.

#define pa_system_difference ( ps1,
ps2   )     pa_system_difference_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)

Definition at line 130 of file union.h.

#define pa_system_difference ( ps1,
ps2   )     pa_system_difference_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)
#define pa_system_difference ( ps1,
ps2   )     pa_system_difference_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)
#define pa_system_equal_p ( ps1,
ps2   )     pa_system_equal_p_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)

Definition at line 125 of file union.h.

#define pa_system_equal_p ( ps1,
ps2   )     pa_system_equal_p_ofl_ctrl((ps1),(ps2),NO_OFL_CTRL)
#define PA_UNDEFINED   (Ppath) NULL

Definition at line 30 of file union.h.

#define PA_UNDEFINED   (Ppath) NULL
#define PA_UNDEFINED_P ( pa   )     ((pa) == PA_UNDEFINED)

Definition at line 117 of file union.h.

#define PA_UNDEFINED_P ( pa   )     ((pa) == PA_UNDEFINED)
#define PATH_MAX_CONSTRAINTS   12

Misceleanous (debuging.

..)

Definition at line 138 of file union.h.

#define PATH_MAX_CONSTRAINTS   12
#define sc_convex_hull_equals_union_p ( conv_hull,
ps1,
ps2   )     pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2),NO_OFL_CTRL, FALSE)

Definition at line 93 of file union.h.

#define sc_convex_hull_equals_union_p ( conv_hull,
ps1,
ps2   )     pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2),NO_OFL_CTRL, FALSE)
#define sc_convex_hull_equals_union_p_ofl ( conv_hull,
ps1,
ps2   )     pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2), OFL_CTRL, FALSE)

Definition at line 95 of file union.h.

#define sc_convex_hull_equals_union_p_ofl ( conv_hull,
ps1,
ps2   )     pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2), OFL_CTRL, FALSE)
#define sc_convex_hull_equals_union_p_ofl_ctrl ( conv_hull,
ps1,
ps2,
ofl,
bo   )     pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2), (ofl), (bo))

Definition at line 97 of file union.h.

#define sc_convex_hull_equals_union_p_ofl_ctrl ( conv_hull,
ps1,
ps2,
ofl,
bo   )     pa_convex_hull_equals_union_p_ofl_ctrl((conv_hull), (ps1), (ps2), (ofl), (bo))
#define sc_difference ( ps1,
ps2   )     pa_system_difference_ofl_ctrl((ps1),(ps2),FWD_OFL_CTRL)

FOR BACKWARD COMPATIBILITY.

Definition at line 86 of file union.h.

#define sc_difference ( ps1,
ps2   )     pa_system_difference_ofl_ctrl((ps1),(ps2),FWD_OFL_CTRL)
#define sc_elim_redund_with_first ( ps1,
ps2   )     sc_elim_redund_with_first_ofl_ctrl((ps1), (ps2), NO_OFL_CTRL)

OTHERS.

Definition at line 101 of file union.h.

#define sc_elim_redund_with_first ( ps1,
ps2   )     sc_elim_redund_with_first_ofl_ctrl((ps1), (ps2), NO_OFL_CTRL)
#define sc_equal_p ( ps1,
ps2   )     pa_system_equal_p_ofl_ctrl((ps1), (ps2), NO_OFL_CTRL)

Definition at line 90 of file union.h.

#define sc_equal_p ( ps1,
ps2   )     pa_system_equal_p_ofl_ctrl((ps1), (ps2), NO_OFL_CTRL)
#define sc_equal_p_ofl ( ps1,
ps2   )     pa_system_equal_p_ofl_ctrl((ps1), (ps2), FWD_OFL_CTRL)

Definition at line 91 of file union.h.

#define sc_equal_p_ofl ( ps1,
ps2   )     pa_system_equal_p_ofl_ctrl((ps1), (ps2), FWD_OFL_CTRL)
#define sc_equal_p_ofl_ctrl ( ps1,
ps2,
ofl   )     pa_system_equal_p_ofl_ctrl((ps1), (ps2), (ofl))

Definition at line 92 of file union.h.

#define sc_equal_p_ofl_ctrl ( ps1,
ps2,
ofl   )     pa_system_equal_p_ofl_ctrl((ps1), (ps2), (ofl))
#define sc_inclusion_p ( ps1,
ps2   )     pa_inclusion_p_ofl_ctrl((ps1), (ps2), NO_OFL_CTRL)

Definition at line 87 of file union.h.

#define sc_inclusion_p ( ps1,
ps2   )     pa_inclusion_p_ofl_ctrl((ps1), (ps2), NO_OFL_CTRL)
#define sc_inclusion_p_ofl ( ps1,
ps2   )     pa_inclusion_p_ofl_ctrl((ps1), (ps2), FWD_OFL_CTRL)

Definition at line 88 of file union.h.

#define sc_inclusion_p_ofl ( ps1,
ps2   )     pa_inclusion_p_ofl_ctrl((ps1), (ps2), FWD_OFL_CTRL)
#define sc_inclusion_p_ofl_ctrl ( ps1,
ps2,
ofl   )     pa_inclusion_p_ofl_ctrl((ps1), (ps2), (ofl))

Definition at line 89 of file union.h.

#define sc_inclusion_p_ofl_ctrl ( ps1,
ps2,
ofl   )     pa_inclusion_p_ofl_ctrl((ps1), (ps2), (ofl))
#define SL_NULL   (Psyslist) NULL

Definition at line 15 of file union.h.

#define SL_NULL   (Psyslist) NULL
#define UN_EMPTY_SPACE   (Punion) NULL

Definition at line 39 of file union.h.

#define UN_EMPTY_SPACE   (Punion) NULL
#define un_fprint ( fi,
un,
fu,
ty   )     un_fprint_tab((fi), (un), (fu), (ty), 0)

Definition at line 134 of file union.h.

#define un_fprint ( fi,
un,
fu,
ty   )     un_fprint_tab((fi), (un), (fu), (ty), 0)
#define UN_FULL_SPACE   (Punion) NULL

Definition at line 38 of file union.h.

#define UN_FULL_SPACE   (Punion) NULL
#define UN_UNDEFINED   (Punion) NULL

Definition at line 37 of file union.h.

#define UN_UNDEFINED   (Punion) NULL

Typedef Documentation

Definition at line 21 of file union.h.

typedef Ssyslist* Pcomplist

Definition at line 24 of file union.h.

typedef Ssyslist* Pdisjunct

Definition at line 17 of file union.h.

typedef struct Spath * Ppath
typedef struct Ssyslist * Psyslist

Warning! Do not modify this file that is automatically generated!

Modify src/Libs/union/union-local.h instead, to add your own modifications. header file built by cproto

typedef struct Sunion * Punion

Definition at line 21 of file union.h.

Definition at line 24 of file union.h.

Definition at line 17 of file union.h.

typedef struct Spath Spath
typedef struct Ssyslist Ssyslist
typedef struct Sunion Sunion

Enumeration Type Documentation

Implementation of the finite parallel half space lattice hspara.

________ full / | / empty ___ / | \ / keep \ / / \ \ ssplus / opplus \ | ssminus | opminus sszero \ opzero / \ \ / / unpara _____/

Enumerator:
unpara 

compare {h1: a1 X + b1 <= 0} with {hj: aj X + bj <= 0}

sszero 

unparallel -> h1/hj = h1

a1 == aj for same sign (ss) part lattice

ssplus 

b1 == bj -> h1/hj = full

ssminus 

bj > b1 -> h1/hj = full

keep part

opzero 

bj < b1 -> h1/hj = h1

-a1 == aj for opposite sign (op) part lattice

opplus 

b1 == bj -> h1/hj = h1

keep 

bj > b1 -> h1/hj = h1

opminus 

empty part

empty 

b1 < bj -> h1/hj = empty

full 
unpara 

compare {h1: a1 X + b1 <= 0} with {hj: aj X + bj <= 0}

sszero 

unparallel -> h1/hj = h1

a1 == aj for same sign (ss) part lattice

ssplus 

b1 == bj -> h1/hj = full

ssminus 

bj > b1 -> h1/hj = full

keep part

opzero 

bj < b1 -> h1/hj = h1

-a1 == aj for opposite sign (op) part lattice

opplus 

b1 == bj -> h1/hj = h1

keep 

bj > b1 -> h1/hj = h1

opminus 

empty part

empty 

b1 < bj -> h1/hj = empty

full 

Definition at line 55 of file union.h.

00056 {                      /* compare   {h1: a1 X + b1 <= 0} with {hj: aj X + bj <= 0} */      
00057   unpara        = 0,   /*  unparallel ->   h1/hj = h1    */
00058   /**/                 /*  a1 == aj for same sign (ss)  part lattice */ 
00059     sszero      = 1,   /*  b1 == bj   ->   h1/hj = full  */ 
00060     ssplus      = 2,   /*  bj >  b1   ->   h1/hj = full  */
00061   /**/     
00062     /**/               /* keep part                      */
00063       /**/     
00064         ssminus = 3,   /*  bj <  b1   ->   h1/hj = h1    */ 
00065       /**/             /* -a1 == aj for opposite sign (op)  part lattice */
00066         opzero  = 4,   /*  b1 == bj   ->   h1/hj = h1    */ 
00067         opplus  = 5,   /*  bj >  b1   ->   h1/hj = h1    */
00068     keep        = 6,
00069     /**/               /* empty part                     */
00070       opminus   = 7,   /*  b1 <  bj   ->   h1/hj = empty */  
00071     empty       = 8,   
00072   full          = 9     
00073 };


Function Documentation

enum hspara_elem contrainte_parallel_in_liste ( Pcontrainte  in_co,
Pcontrainte  in_lc 
)

enum enum hspara_elem contrainte_parallel_in_liste( in_co, in_lc ) AL950711 input: 1 constraint in_co and a list of constraints in_lc output: hspara_elem (element of the parallel half space lattice) memory: Inspector (nothing is shared, nor modified, output allocated).

complexity: length(in_lc) * comp(vect_parallel()) comment: in_co represents a1 X+b1 <= 0 and in_lc aj X + bj <=0. Returns in_co/in_lc = join_j( vect_parallel( in_co, in_lc_j ) ) between keep, empty and full.

debuging

debuging

Parameters:
in_co n_co
in_lc n_lc

Definition at line 201 of file reduc.c.

References assert, c, C3_DEBUG, fprintf(), full, hspara_join, hspara_to_string, inegalite_fprint(), inegalites_fprint(), keep, union_variable_name, and vect_parallel().

Referenced by sc_supress_parallel_redund_constraints().

00203 {
00204   Pcontrainte         c;
00205   Pvecteur            vpos;
00206   enum hspara_elem    ret_sle = keep;  
00207 
00208   assert(!CONTRAINTE_UNDEFINED_P(in_co));
00209   if (CONTRAINTE_NULLE_P(in_co)) return keep;
00210   
00211   /* debuging */
00212   C3_DEBUG("contrainte_parallel_in_list", {
00213     fprintf(stderr, "Input in_co:");  
00214     inegalite_fprint( stderr, in_co, union_variable_name ); 
00215     fprintf(stderr, "Input in_lc:\n"); 
00216     inegalites_fprint( stderr, in_lc, union_variable_name );
00217   });
00218 
00219   vpos = in_co->vecteur;
00220   
00221   for (c = in_lc; !CONTRAINTE_UNDEFINED_P(c) && (ret_sle != full); c=c->succ) {
00222     Pvecteur         cv   = c->vecteur;
00223     enum hspara_elem hs   = vect_parallel(vpos, cv);
00224 
00225     C3_DEBUG("contrainte_parallel_in_list", {
00226       fprintf(stderr, "ret_sle: %s ,  hs: %s\n", 
00227          hspara_to_string(ret_sle),  
00228          hspara_to_string( hs  )  ); 
00229     });
00230     
00231     ret_sle = hspara_join( ret_sle, hs);
00232   }
00233 
00234 
00235   /* debuging */
00236   C3_DEBUG("contrainte_parallel_in_list", 
00237     { fprintf(stderr, "Output hspara: %s\n", hspara_to_string(ret_sle)); });
00238   
00239   return ret_sle;
00240 }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct dj_append_system ( Pdisjunct  in_dj,
Psysteme  in_ps 
)

Pdisjunct dj_append_system( (Pdisjunct) in_dj, (Psysteme) in_ps ) Input : A disjunct in_dj to wich in_ps will be added.

AL 10/11/93 Output : Disjunct in_dj with in_ps. => ! Sharing. Comment: Nothing is checked on result in_dj.

Parameters:
in_dj n_dj
in_ps n_ps

Definition at line 400 of file disjunct.c.

References dj_full_p(), dj_new(), Ssyslist::psys, and sl_append_system().

Referenced by compatible_pc_p(), dj_system_complement(), and pa_path_to_disjunct_rule4_ofl_ctrl().

00403 { 
00404   Pdisjunct ret_dj;
00405   
00406   if (dj_full_p(in_dj)) { ret_dj = dj_new(); ret_dj->psys = in_ps; }
00407   else {ret_dj = (Pdisjunct) sl_append_system((Psyslist) in_dj, in_ps);}
00408   return ret_dj;
00409 }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct dj_disjunct_complement ( Pdisjunct  in_dj  ) 

Returns complement of in_dj.

No sharing

debugging

Parameters:
in_dj n_dj

Definition at line 296 of file disjunct.c.

References C3_DEBUG, C3_RETURN, dj_dup(), dj_empty_p(), dj_fprint_tab(), dj_full(), dj_full_p(), dj_intersection, dj_system_complement(), DJ_UNDEFINED, DJ_UNDEFINED_P, IS_DJ, NULL, and union_variable_name.

Referenced by dj_intersect_djcomp_ofl_ctrl().

00298 {
00299   Pdisjunct ret_dj;
00300   if DJ_UNDEFINED_P(in_dj) return DJ_UNDEFINED;
00301   if (dj_empty_p(in_dj)||dj_full_p(in_dj)) return dj_dup(in_dj);
00302   
00303   /* debugging */
00304   C3_DEBUG("dj_disjunct_complement (in_ps)",
00305       {dj_fprint_tab(stderr, in_dj, union_variable_name, 1);});
00306 
00307   ret_dj = dj_full();
00308   for(; in_dj != NULL; in_dj = in_dj->succ) 
00309     { ret_dj = dj_intersection(ret_dj, dj_system_complement(in_dj->psys)); }
00310   C3_RETURN(IS_DJ, ret_dj);
00311 }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct dj_dup ( Pdisjunct   ) 

Pdisjunct dj_dup( (Pdisjunct) in_dj ) AL 15/11/93 Duplicates input disjunction.

Definition at line 55 of file disjunct.c.

References dj_full(), dj_full_p(), and sl_dup().

Referenced by dj_disjunct_complement(), dj_intersect_djcomp_ofl_ctrl(), dj_intersection_ofl_ctrl(), and dj_simple_inegs_to_eg().

00057 { 
00058   if (dj_full_p(in_dj)) return dj_full();
00059   return (Pdisjunct) sl_dup( (Psyslist) in_dj ); 
00060 }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct dj_dup1 ( Pdisjunct   ) 

Pdisjunct dj_dup1( (Pdisjunct) in_dj ) AL 31/05/94 1st depth duplication of input disjunction.

Definition at line 73 of file disjunct.c.

References sl_dup1().

00075 { return( (Pdisjunct) sl_dup1( (Psyslist) in_dj ) );  }

Here is the call graph for this function:

Pdisjunct dj_empty ( void   ) 

Pdisjunct dj_empty() AL 18/11/93 Returns a disjunction with sc_empty() element.

Definition at line 108 of file disjunct.c.

References NULL, sc_empty(), and sl_append_system().

Referenced by dj_intersect_djcomp_ofl_ctrl(), dj_intersection_ofl_ctrl(), pa_path_to_disjunct_ofl_ctrl(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), and pa_system_difference_ofl_ctrl().

00109 { return (Pdisjunct) sl_append_system(NULL, sc_empty((Pbase) NULL)); }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean dj_empty_p ( Pdisjunct   ) 

dj_empty_p( (Ppath) in_pa ) AL 30/05/94 Returns True if in_dj = (1*TCST = 0) ^ (NIL)

Definition at line 115 of file disjunct.c.

References DJ_UNDEFINED, NULL, and sc_empty_p().

Referenced by dj_disjunct_complement(), dj_intersect_djcomp_ofl_ctrl(), dj_intersection_ofl_ctrl(), dj_projection_along_variables_ofl_ctrl(), dj_simple_inegs_to_eg(), dj_union(), dj_variable_rename(), dj_variable_substitution_with_eqs_ofl_ctrl(), and pa_feasibility_ofl_ctrl().

00117 {
00118   return( ( in_dj != DJ_UNDEFINED     )    &&
00119      ( in_dj->succ == NULL       )    &&
00120      ( in_dj->psys != NULL       )    &&
00121      ( sc_empty_p( in_dj->psys ) )       );
00122 }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean dj_feasibility_ofl_ctrl ( Pdisjunct  in_dj,
int  ofl_ctrl 
)

boolean dj_feasibility_ofl_ctrl( (Pdisjunct) in_dj, (int) ofl_ctrl ) Returns true if in_dj is a feasible disjunction.

AL,BC 23/02/95

Parameters:
in_dj n_dj
ofl_ctrl fl_ctrl

Definition at line 229 of file disjunct.c.

References DJ_UNDEFINED, FALSE, NULL, Ssyslist::psys, sc_rational_feasibility_ofl_ctrl(), SC_UNDEFINED, Ssyslist::succ, and TRUE.

00232 {
00233   boolean   ret_bool = FALSE;
00234   Pdisjunct dj;
00235 
00236   if ( in_dj == DJ_UNDEFINED ) return FALSE;
00237   for( dj = in_dj; dj != NULL && !ret_bool; dj = dj->succ ) {
00238     if (dj->psys == SC_UNDEFINED) return FALSE;
00239     ret_bool = ret_bool || 
00240       sc_rational_feasibility_ofl_ctrl( dj->psys, ofl_ctrl, TRUE );
00241   }
00242   return ret_bool;
00243 }

Here is the call graph for this function:

void dj_fprint_tab ( FILE *  ,
Pdisjunct  ,
char *  *)(void,
int   
)
Pdisjunct dj_free ( Pdisjunct   ) 

Pdisjunct dj_free( (Pdisjunct) in_dj ) AL 31/05/94 w - 1 depth free of input disjunction.

Definition at line 66 of file disjunct.c.

References sl_free().

Referenced by disjunction_to_region_sc(), dj_union(), pa_feasibility_ofl_ctrl(), pa_path_to_disjunct_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), and pa_system_difference_ofl_ctrl().

00067                  { return (Pdisjunct) sl_free( (Psyslist) in_dj ); }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct dj_free1 ( Pdisjunct   ) 

Pdisjunct dj_free1( (Pdisjunct) in_dj ) AL 31/05/94 1st depth free of input disjunction.

Definition at line 81 of file disjunct.c.

References sl_free1().

Referenced by disjunction_to_region_sc().

00082                  { return (Pdisjunct) sl_free1( (Psyslist) in_dj ); }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct dj_full ( void   ) 

Pdisjunct dj_full() AL 18/11/93 Return full space disjunction = dj_new().

Definition at line 89 of file disjunct.c.

References dj_new().

Referenced by dj_disjunct_complement(), dj_dup(), dj_intersection_ofl_ctrl(), dj_system_complement(), pa_path_to_disjunct_ofl_ctrl(), and pa_path_to_few_disjunct_ofl_ctrl().

00089 { return( dj_new() ); }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean dj_full_p ( Pdisjunct   ) 

dj_full_p( (Pdisjunct) in_dj ) AL 30/05/94 Returns True if in_dj = (NIL) ^ (NIL)

Definition at line 95 of file disjunct.c.

References DJ_UNDEFINED, and NULL.

Referenced by dj_append_system(), dj_disjunct_complement(), dj_dup(), dj_fprint_tab(), dj_intersect_djcomp_ofl_ctrl(), dj_intersection_ofl_ctrl(), dj_projection_along_variables_ofl_ctrl(), dj_simple_inegs_to_eg(), dj_union(), dj_variable_rename(), and dj_variable_substitution_with_eqs_ofl_ctrl().

00097 {
00098   return( (in_dj != DJ_UNDEFINED) &&
00099     ( in_dj->succ == NULL ) &&
00100     ( in_dj->psys  == NULL ) );
00101 }

Here is the caller graph for this function:

Pdisjunct dj_intersect_djcomp_ofl_ctrl ( Pdisjunct  in_dj1,
Pdisjunct  in_dj2,
int  ofl_ctrl 
)

Pdisjunct dj_intersect_djcomp_ofl_ctrl( ) No sharing.

in_dj1 and in_dj2 stay as is.

Special cases

debuging

General cases

Parameters:
in_dj1 n_dj1
in_dj2 n_dj2
ofl_ctrl fl_ctrl

Definition at line 170 of file disjunct.c.

References C3_DEBUG, C3_RETURN, dj_disjunct_complement(), dj_dup(), dj_empty(), dj_empty_p(), dj_fprint_tab(), dj_full_p(), DJ_UNDEFINED, DJ_UNDEFINED_P, dj_union(), fprintf(), free(), IS_DJ, NULL, pa_make(), pa_path_to_few_disjunct_ofl_ctrl(), Ssyslist::psys, Ssyslist::succ, and union_variable_name.

00173 {
00174   Pdisjunct dj, ret_dj;  
00175   
00176   /* Special cases */
00177   if (DJ_UNDEFINED_P(in_dj1) || DJ_UNDEFINED_P(in_dj2)) return DJ_UNDEFINED;
00178   
00179   if (dj_empty_p( in_dj1 ) || dj_full_p(in_dj2)) return dj_empty();
00180   if (dj_full_p ( in_dj1 ))                      return dj_disjunct_complement( in_dj2 );
00181   if (dj_empty_p( in_dj2 ))                      return dj_dup( in_dj1 );
00182   
00183   /* debuging */
00184   C3_DEBUG("dj_intersect_djcomp_ofl_ctrl",{
00185     fprintf(stderr,"Inputs (in_dj1, then in_dj2):");
00186     dj_fprint_tab(stderr, in_dj1, union_variable_name, 1);
00187     dj_fprint_tab(stderr, in_dj2, union_variable_name, 1);
00188   });
00189 
00190   /* General cases */
00191   ret_dj = dj_empty();
00192   for(dj = in_dj1; dj != NULL; dj = dj->succ ){ 
00193     Ppath pa = pa_make( dj->psys, (Pcomplist) in_dj2  ); 
00194     ret_dj   = dj_union( ret_dj, pa_path_to_few_disjunct_ofl_ctrl( pa, ofl_ctrl ) ); 
00195     free(pa);
00196   }
00197   C3_RETURN(IS_DJ, ret_dj);
00198 }

Here is the call graph for this function:

Pdisjunct dj_intersect_system_ofl_ctrl ( Pdisjunct  ,
Psysteme  ,
int   
)
Pdisjunct dj_intersection_ofl_ctrl ( Pdisjunct  in_dj1,
Pdisjunct  in_dj2,
int  ofl_ctrl 
)

Pdisjunct dj_intersection_ofl_ctrl( in_dj1, in_dj2, ofl_ctrl ) Computes intersection of two disjunctions.

AL,BC 23/03/95 Very costly function : -> sc_faisabilite_ofl_ctrl used. No sharing

empty intersection

Parameters:
in_dj1 n_dj1
in_dj2 n_dj2
ofl_ctrl fl_ctrl

Definition at line 131 of file disjunct.c.

References dj_dup(), dj_empty(), dj_empty_p(), dj_full(), dj_full_p(), DJ_UNDEFINED, DJ_UNDEFINED_P, NULL, Ssyslist::psys, sc_append(), sc_dup(), sc_free(), sc_rational_feasibility_ofl_ctrl(), sl_append_system(), Ssyslist::succ, and TRUE.

Referenced by dj_intersect_system_ofl_ctrl(), and pa_path_to_disjunct_ofl_ctrl().

00134 {
00135   Pdisjunct dj1, dj2, ret_dj;
00136   
00137   if (DJ_UNDEFINED_P(in_dj1)||DJ_UNDEFINED_P(in_dj2)) return DJ_UNDEFINED   ;
00138   if (dj_full_p(in_dj1) && dj_full_p(in_dj2))         return dj_full()      ;
00139   if (dj_full_p(in_dj1))                              return dj_dup(in_dj2) ;
00140   if (dj_full_p(in_dj2))                              return dj_dup(in_dj1) ;
00141   if (dj_empty_p(in_dj1)||dj_empty_p(in_dj2))         return dj_empty()     ;
00142   
00143   ret_dj = (Pdisjunct) NULL; 
00144   for(dj1 = in_dj1; dj1 != NULL; dj1 = dj1->succ) {
00145     for(dj2 = in_dj2; dj2 != NULL; dj2 = dj2->succ) {
00146       Psysteme ps = sc_append( sc_dup(dj1->psys), dj2->psys );
00147       if (!sc_rational_feasibility_ofl_ctrl( ps, ofl_ctrl, TRUE )) 
00148    { ps = sc_free( ps ); continue; }
00149       ret_dj = (Pdisjunct) sl_append_system( ret_dj, ps );
00150     }
00151   }
00152   if (ret_dj == (Pdisjunct) NULL) return dj_empty(); /* empty intersection */
00153   return ret_dj;
00154 }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean dj_is_system_p ( Pdisjunct   ) 

boolean dj_is_system_p( (Pdisjunct) in_dj ) AL 16/11/93 Returns True if disjunction in_dj has only one Psysteme in it.

Definition at line 390 of file disjunct.c.

References sl_is_system_p().

00392 { return( sl_is_system_p( (Psyslist) in_dj ) ); }

Here is the call graph for this function:

Pdisjunct dj_new ( void   ) 

disjunct.c

disjunct.c

WARNING THOSE FUNCTIONS ARE AUTOMATICALLY DERIVED

FROM THE WEB SOURCES !Ansi includesLinear includesPdisjunct dj_new() AL 26/10/93 Allocate a new Pdisjunct

Definition at line 49 of file disjunct.c.

References sl_new().

Referenced by dj_append_system(), and dj_full().

00049 { return( (Pdisjunct) sl_new() ); }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct dj_projection_along_variables_ofl_ctrl ( Pdisjunct  in_dj,
Pvecteur  in_pv,
int  ofl_ctrl 
)

Returns projection of in_dj along vars of in_pv.

Sharing : in_dj is modified

Parameters:
in_dj n_dj
in_pv n_pv
ofl_ctrl fl_ctrl

Definition at line 316 of file disjunct.c.

References dj_empty_p(), dj_full_p(), DJ_UNDEFINED, DJ_UNDEFINED_P, NULL, Ssyslist::psys, sc_projection_along_variables_ofl_ctrl(), and Ssyslist::succ.

00320 {
00321   Pdisjunct dj;
00322   if DJ_UNDEFINED_P(in_dj) return DJ_UNDEFINED;
00323   if (dj_empty_p(in_dj)||dj_full_p(in_dj)) return in_dj;
00324   
00325   for(dj = in_dj; dj != NULL; dj = dj->succ) 
00326     { sc_projection_along_variables_ofl_ctrl( &(dj->psys), in_pv, ofl_ctrl ); }
00327   return in_dj;
00328 }

Here is the call graph for this function:

Pdisjunct dj_read ( char *   ) 

void dj_read(FILE*) reads a Pdisjunct

Definition at line 507 of file disjunct.c.

References sl_read().

00509 { return ( (Pdisjunct) sl_read(nomfic) ); }

Here is the call graph for this function:

Pdisjunct dj_simple_inegs_to_eg ( Pdisjunct  in_dj  ) 

Pdisjunct dj_simple_inegs_to_eg( in_dj ) transforms two opposite inequalities in a simple equality in each system of the input disjunction.

Input disjunction is not modified.

Special case

General case

Compare with inequalities

Do we have ineq <= 0 and - ineq <= 0 ?

Parameters:
in_dj n_dj

Definition at line 336 of file disjunct.c.

References assert, contrainte_dup(), contrainte_free(), contrainte_in_liste(), contrainte_make(), contraintes_dup(), dj_dup(), dj_empty_p(), dj_full_p(), DJ_UNDEFINED_P, NULL, Ssyslist::psys, sc_add_egalite(), sc_add_inegalite(), sc_creer_base(), sc_dup(), sc_empty_p(), sc_full_p(), sc_make(), SC_UNDEFINED_P, sl_append_system(), Ssyslist::succ, vect_chg_sgn(), and vect_dup().

Referenced by pa_system_difference_ofl_ctrl().

00338 {
00339   Pdisjunct  dj;
00340   Pdisjunct  ret_dj = NULL;
00341 
00342   /* Special case */
00343   if (DJ_UNDEFINED_P(in_dj) || dj_empty_p(in_dj) || dj_full_p(in_dj)) 
00344     return dj_dup(in_dj);
00345 
00346   /* General case */
00347   for( dj = in_dj; dj != NULL; dj = dj->succ) {
00348     Psysteme     ps = dj->psys, new_ps;
00349     Pcontrainte  ineq;
00350     
00351     assert(!SC_UNDEFINED_P(ps)&&!sc_empty_p(ps)&&!sc_full_p(ps));
00352     
00353     if (ps->nb_ineq <= 1) { 
00354       ret_dj = sl_append_system( ret_dj, sc_dup( ps )); 
00355       continue; 
00356     }
00357 
00358     /* Compare with inequalities */
00359     new_ps = sc_make( contraintes_dup(ps->egalites), CONTRAINTE_UNDEFINED );
00360     for (ineq = ps->inegalites; ineq != NULL; ineq = ineq->succ) {
00361       Pcontrainte  co, ineq2;
00362       Pvecteur     pv = vect_dup(ineq->vecteur); 
00363       vect_chg_sgn        ( pv );
00364       co    = contrainte_make( pv );
00365       ineq2 = contrainte_dup(ineq);
00366 
00367       /* Do we have ineq <= 0 and - ineq <= 0 ? */ 
00368       if (contrainte_in_liste(co, ps->inegalites)) {
00369    if (   !contrainte_in_liste(ineq, new_ps->egalites)
00370        && !contrainte_in_liste(co,   new_ps->egalites) )
00371        sc_add_egalite( new_ps, ineq2 );
00372       }
00373       else { sc_add_inegalite( new_ps, ineq2 ); }
00374       co = contrainte_free( co );
00375     }
00376 
00377     new_ps->base = NULL;
00378     sc_creer_base( new_ps );
00379     ret_dj = (Pdisjunct) sl_append_system( ret_dj, new_ps );
00380   }
00381 
00382   return ret_dj;
00383 }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct dj_system_complement ( Psysteme  in_ps  ) 

Pdisjunct dj_system_complement( (Psystem) in_ps ) AL 26/10/93 Input : A Psysteme.

Output : A disjunction which is complement of in_ps.

debugging

v1 = 1*TCST to build complement system ...

Look for equalities

Look for inequalities

Parameters:
in_ps n_ps

Definition at line 251 of file disjunct.c.

References C3_DEBUG, C3_RETURN, contrainte_make(), dj_append_system(), dj_full(), DJ_UNDEFINED, eq, IS_DJ, NULL, sc_empty_p(), sc_fprint(), sc_make(), SC_UNDEFINED, sl_append_system(), TCST, union_variable_name, VALUE_ONE, vect_add(), vect_chg_sgn(), vect_dup(), vect_new(), and vect_rm().

Referenced by analyze_quast(), dj_disjunct_complement(), pa_path_to_disjunct_ofl_ctrl(), and pa_reduce_simple_complement().

00253 {
00254   Pdisjunct       ret_dj = NULL;
00255   Pvecteur        v1 = NULL, pv = NULL;
00256   Psysteme        ps = NULL;
00257   Pcontrainte     eq = NULL, ineq = NULL;
00258 
00259   if ( in_ps == SC_UNDEFINED ) return DJ_UNDEFINED;
00260   if (sc_empty_p(in_ps))       return dj_full();
00261   
00262   /* debugging */
00263   C3_DEBUG("dj_system_complement (in_ps)",
00264       {sc_fprint(stderr, in_ps, union_variable_name);});
00265 
00266 
00267   /* v1 = 1*TCST to build complement system ... */
00268   v1 = vect_new( TCST, VALUE_ONE);
00269   /* Look for equalities */
00270   for( eq = in_ps->egalites; eq != NULL; eq = eq->succ ) {
00271     ps     = sc_make( CONTRAINTE_UNDEFINED,
00272        contrainte_make( vect_add( v1, eq->vecteur ) ) );
00273     ret_dj =  (Pdisjunct) sl_append_system( ret_dj, ps );
00274     pv     = vect_dup( eq->vecteur ); vect_chg_sgn( pv );
00275     ps     = sc_make( CONTRAINTE_UNDEFINED, contrainte_make(vect_add( v1, pv )));
00276     vect_rm( pv ); pv = NULL;
00277     ret_dj =  (Pdisjunct) sl_append_system( ret_dj, ps );
00278     
00279   }
00280   /* Look for inequalities */
00281   for(ineq = in_ps->inegalites; ineq != NULL; ineq = ineq->succ) {
00282     pv = vect_dup(ineq->vecteur);
00283     vect_chg_sgn( pv );
00284     ps = sc_make( CONTRAINTE_UNDEFINED, contrainte_make(vect_add( v1, pv )));
00285     vect_rm( pv ); pv = NULL;
00286     ret_dj =  dj_append_system( ret_dj, ps );
00287   }
00288    
00289   vect_rm( v1 );
00290   C3_RETURN(IS_DJ, ret_dj);
00291 }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct dj_union ( Pdisjunct  in_dj1,
Pdisjunct  in_dj2 
)

Pdisjunct dj_union( (Pdisjunct) in_dj1, (Pdisjunct) in_dj2 ) Give the union of the two disjunctions.

AL 15/11/93 Memory: systems of the 2 unions are shared. in_dj1 = dj_union(in_dj1,in_dj2); (in_dj1 = dj_free(in_dj1); to remove in_dj1 and in_dj2

Parameters:
in_dj1 n_dj1
in_dj2 n_dj2

Definition at line 208 of file disjunct.c.

References dj_empty_p(), dj_free(), dj_full_p(), DJ_UNDEFINED, DJ_UNDEFINED_P, NULL, and Ssyslist::succ.

Referenced by dj_intersect_djcomp_ofl_ctrl(), and pa_path_to_few_disjunct_ofl_ctrl().

00210 {
00211   Pdisjunct dj;
00212    
00213   if (DJ_UNDEFINED_P(in_dj1) || DJ_UNDEFINED_P(in_dj2)) return DJ_UNDEFINED;
00214   if (dj_empty_p( in_dj2 )) {dj_free(in_dj2); return in_dj1;}
00215   if (dj_full_p ( in_dj2 )) {dj_free(in_dj1); return in_dj2;}
00216   if (dj_empty_p( in_dj1 )) {dj_free(in_dj1); return in_dj2;}
00217   if (dj_full_p ( in_dj1 )) {dj_free(in_dj2); return in_dj1;}
00218 
00219   for( dj = in_dj1; dj->succ != NULL; dj = dj->succ) {};
00220   dj->succ = in_dj2;
00221   return in_dj1;
00222 }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct dj_variable_rename ( Pdisjunct  ,
Variable  ,
Variable   
)

dj_variable_rename replaces in_vold with in_vnew : in_dj is modified

Definition at line 414 of file disjunct.c.

References dj_empty_p(), dj_full_p(), DJ_UNDEFINED, DJ_UNDEFINED_P, NULL, Ssyslist::psys, sc_variable_rename(), and Ssyslist::succ.

00418 { 
00419   Pdisjunct dj;
00420   if DJ_UNDEFINED_P(in_dj) return DJ_UNDEFINED;
00421   if (dj_empty_p(in_dj)||dj_full_p(in_dj)) return in_dj;
00422   
00423   for(dj = in_dj; dj != NULL; dj = dj->succ) 
00424     { sc_variable_rename( dj->psys, in_vold, in_vnew ); }
00425   return in_dj;
00426 }

Here is the call graph for this function:

Pdisjunct dj_variable_substitution_with_eqs_ofl_ctrl ( Pdisjunct  ,
Pcontrainte  ,
Pvecteur  ,
int   
)
boolean pa_convex_hull_equals_union_p_ofl_ctrl ( Psysteme  ,
Psysteme  ,
Psysteme  ,
int  ,
boolean   
)

boolean pa_convex_hull_equals_union_p(conv_hull, ps1, ps2) input : two Psystems and their convex hull AL,BC 23/03/95 output : TRUE if ps1 U ps2 = convex_hull, FALSE otherwise modifies : nothing comment : complexity = nb_constraints(ps1) * nb_constraints(ps2) if ofl_ctrl = OFL_CTRL, conservatively returns ofl_ctrl when an overflow error occurs

Definition at line 935 of file reduc.c.

References CATCH, FWD_OFL_CTRL, NULL, OFL_CTRL, overflow_error, pa_feasibility_ofl_ctrl(), pa_free1(), pa_make(), sl_append_system(), TRY, and UNCATCH.

00939 {
00940   Ppath    chemin;
00941   boolean  result;
00942   int      local_ofl_ctrl = (ofl_ctrl == OFL_CTRL)?FWD_OFL_CTRL:ofl_ctrl;
00943   
00944   chemin = pa_make(conv_hull,sl_append_system(sl_append_system(NULL,ps1),ps2));
00945   
00946   if (ofl_ctrl==OFL_CTRL) {
00947    CATCH(overflow_error) {
00948             result = ofl_res;
00949         }
00950         TRY {
00951             result = !(pa_feasibility_ofl_ctrl(chemin, local_ofl_ctrl));
00952             UNCATCH(overflow_error);
00953         }
00954   }
00955   else
00956       result = !(pa_feasibility_ofl_ctrl(chemin, local_ofl_ctrl));
00957 
00958   chemin = pa_free1(chemin);
00959   return(result);
00960 }

Here is the call graph for this function:

Ppath pa_dup ( Ppath   ) 

void pa_dup(Ppath pa) AL 30/05/94

Definition at line 65 of file path.c.

References pa_make(), PA_UNDEFINED, sc_dup(), and sl_dup().

00067 {
00068   if (in_pa == PA_UNDEFINED ) return PA_UNDEFINED;
00069   return pa_make( sc_dup(in_pa->psys), sl_dup(in_pa->pcomp) );
00070 }

Here is the call graph for this function:

Ppath pa_dup1 ( Ppath   ) 

void pa_dup1(Ppath pa) AL 30/05/94 1 depth duplication: system and complements are shared.

Definition at line 88 of file path.c.

References pa_make(), PA_UNDEFINED, and sl_dup1().

00090 {
00091   if (in_pa == PA_UNDEFINED) return PA_UNDEFINED;
00092   return pa_make( in_pa->psys, sl_dup1(in_pa->pcomp) );
00093 }

Here is the call graph for this function:

Ppath pa_empty ( void   ) 

Ppath pa_empty() AL 18/11/93 Returns empty path : pa_empty = sc_empty(NULL) ^ (NIL).

Definition at line 132 of file path.c.

References NULL, pa_make(), and sc_empty().

Referenced by adg_path_possible_source(), pa_intersect_complement(), pa_intersect_system(), pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), and pa_supress_same_constraints().

00132 { return pa_make(sc_empty(NULL), NULL); }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean pa_empty_p ( Ppath   ) 

pa_empty_p( (Ppath) in_pa ) AL 18/11/93 Returns True if in_pa = (1*TCST = 0) ^ (NIL)

Definition at line 138 of file path.c.

References NULL, PA_UNDEFINED, and sc_empty_p().

Referenced by adg_dataflowgraph(), adg_path_possible_source(), pa_feasibility_ofl_ctrl(), pa_intersect_complement(), pa_intersect_system(), pa_max_constraints_nb(), pa_path_to_disjunct_ofl_ctrl(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), pa_supress_same_constraints(), and pa_transform_eg_in_ineg().

00140 {
00141   return( (in_pa != PA_UNDEFINED) &&
00142     ( in_pa->pcomp == NULL ) &&
00143     ( in_pa->psys != NULL ) &&
00144     ( sc_empty_p( in_pa->psys ) ) );
00145 }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean pa_feasibility_ofl_ctrl ( Ppath  ,
int   
)

boolean pa_feasibility_ofl_ctrl( (Ppath) in_pa, int ofl_ctrl) Returns true if the input path is possible and FALSE if it is not possible or undefined.

Definition at line 306 of file path.c.

References db_get_current_module_name(), dj_empty_p(), dj_free(), FALSE, fflush(), fprintf(), free(), gettimeofday(), malloc(), NULL, pa_empty_p(), pa_fprint, pa_free(), pa_full_p(), pa_max_constraints_nb(), pa_path_to_few_disjunct_ofl_ctrl(), pa_supress_same_constraints(), PA_UNDEFINED_P, sl_length(), sl_max_constraints_nb(), TRUE, and union_variable_name.

Referenced by disjunction_to_region_sc(), pa_convex_hull_equals_union_p_ofl_ctrl(), and pa_inclusion_p_ofl_ctrl().

00309 {
00310   Pdisjunct  dj;
00311   Ppath      pa;
00312   boolean    ret_bo = FALSE;
00313 #ifdef TRACE_PIPS_PATH
00314   FILE*      report_file;
00315 #endif 
00316 
00317   if ( PA_UNDEFINED_P( in_pa )) return FALSE;
00318   if ( pa_empty_p    ( in_pa )) return FALSE;
00319   if ( pa_full_p     ( in_pa )) return TRUE;
00320   
00321 #ifdef TRACE_PIPS_PATH
00322   /* Just to keep trace of input paths if wanted */
00323   if (getenv("KEEP_PATH") != (char*) NULL) {
00324     struct timeval  *tp = (struct timeval*)  malloc(sizeof(struct timeval));
00325     struct timezone *tz = (struct timezone*) malloc(sizeof(struct timezone));
00326     int seconds;
00327     gettimeofday( tp, tz ); seconds = tp->tv_sec;
00328     report_file = fopen("mail_those_paths_to_arnauld","a");
00329     pa_fprint( report_file, in_pa, union_variable_name );
00330     fprintf( report_file, "# %s", ctime( &(seconds) ));
00331     fprintf( report_file, 
00332        "# Module:                            \t%s\n", db_get_current_module_name());
00333     fprintf( report_file, 
00334        "# Input number of complement:        \t%d\n", sl_length(in_pa->pcomp)     );
00335     fprintf( report_file, 
00336        "# Input max constrainst:             \t%d\n", pa_max_constraints_nb(in_pa));
00337     fflush ( report_file ); free( tp ); free( tz );
00338   }
00339 #endif  
00340 
00341   pa = pa_supress_same_constraints( in_pa );
00342   dj = pa_path_to_few_disjunct_ofl_ctrl( pa, ofl_ctrl );
00343   if( dj_empty_p(dj) || (dj == NULL) ) ret_bo = FALSE;
00344   else                                 ret_bo = TRUE;
00345 
00346 
00347 #ifdef TRACE_PIPS_PATH
00348   /* keep trace of paths */
00349   if (getenv("KEEP_PATH") != (char*) NULL) {
00350     fprintf( report_file, 
00351        "# Output number of disjunctions:     \t%d\n", sl_length(dj)            );
00352     fprintf( report_file, 
00353        "# Output max constrainst:            \t%d\n", sl_max_constraints_nb(dj));
00354     fprintf( report_file, 
00355        "# Feasible:                          \t%s\n", (ret_bo) ? "YES":"NO"    );
00356     fclose ( report_file );
00357   }
00358 #endif 
00359 
00360   pa = pa_free( pa );  dj = dj_free( dj );
00361   return ret_bo;
00362 }

Here is the call graph for this function:

Here is the caller graph for this function:

void pa_fprint_tab ( FILE *  ,
Ppath  ,
char *  *)(void,
int   
)
Ppath pa_free ( Ppath   ) 

Ppath pa_free(Ppath pa) BA, AL 30/05/94.

Definition at line 73 of file path.c.

References free(), PA_UNDEFINED, Spath::psys, sc_free(), and sl_free().

Referenced by pa_feasibility_ofl_ctrl(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), and pa_reduce_simple_complement().

00075 {
00076   if (in_pa != PA_UNDEFINED) {
00077     in_pa->psys  = sc_free(in_pa->psys);
00078     in_pa->pcomp = sl_free((Psyslist) in_pa->pcomp);
00079     free( in_pa ); in_pa = PA_UNDEFINED;
00080   }
00081   return((Ppath) PA_UNDEFINED);
00082 }

Here is the call graph for this function:

Here is the caller graph for this function:

Ppath pa_free1 ( Ppath  in_pa  ) 

Ppath pa_free1(Ppath pa) BA, AL 30/05/94 1 depth free.

System and complement are not freed.

Parameters:
in_pa n_pa

Definition at line 99 of file path.c.

References free(), PA_UNDEFINED, and sl_free1().

Referenced by disjunction_to_region_sc(), pa_convex_hull_equals_union_p_ofl_ctrl(), pa_inclusion_p_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), and pa_system_difference_ofl_ctrl().

00101 {
00102   if (in_pa != PA_UNDEFINED) {
00103     sl_free1((Psyslist) in_pa->pcomp);
00104     free( in_pa ); in_pa = PA_UNDEFINED;
00105   }  
00106   return((Ppath) PA_UNDEFINED);
00107 }

Here is the call graph for this function:

Here is the caller graph for this function:

Ppath pa_full ( void   ) 

Ppath pa_full() AL 18/11/93 Returns full space path : pa_full = pa_new().

Definition at line 114 of file path.c.

References pa_new.

Referenced by adg_dataflowgraph(), adg_dataflowgraph_with_extremities(), and pa_supress_same_constraints().

00114 { return pa_new(); }

Here is the caller graph for this function:

boolean pa_full_p ( Ppath   ) 

pa_full_p( (Ppath) in_pa ) AL 18/11/93 Returns True if in_pa = (NIL) ^ (NIL)

Definition at line 120 of file path.c.

References NULL, and PA_UNDEFINED.

Referenced by pa_feasibility_ofl_ctrl(), pa_fprint_tab(), pa_intersect_complement(), pa_intersect_system(), pa_max_constraints_nb(), pa_path_to_disjunct_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), pa_supress_same_constraints(), and pa_transform_eg_in_ineg().

00122 {
00123   return( (in_pa != PA_UNDEFINED) &&
00124     ( in_pa->pcomp == NULL ) &&
00125     ( in_pa->psys  == NULL ) );
00126 }

Here is the caller graph for this function:

boolean pa_inclusion_p_ofl_ctrl ( Psysteme  ,
Psysteme  ,
int   
)

boolean pa_inclusion_p(Psysteme ps1, Psysteme ps2) BA, AL 31/05/94 returns TRUE if ps1 represents a subset of ps2, false otherwise Inspector (no sharing on memory).

Definition at line 865 of file reduc.c.

References CATCH, FALSE, NULL, overflow_error, pa_feasibility_ofl_ctrl(), pa_free1(), pa_make(), sl_append_system(), TRY, and UNCATCH.

Referenced by pa_system_equal_p_ofl_ctrl().

00868 {
00869   boolean   result;
00870   Ppath     chemin = pa_make(ps1, sl_append_system(NULL, ps2));
00871   
00872   CATCH(overflow_error) {
00873     result = FALSE; 
00874   }
00875   TRY {
00876     result = ! (pa_feasibility_ofl_ctrl(chemin, ofl_ctrl));
00877     UNCATCH(overflow_error);
00878   }
00879   chemin = pa_free1(chemin); 
00880   return(result);
00881 }

Here is the call graph for this function:

Here is the caller graph for this function:

Ppath pa_intersect_complement ( Ppath  in_pa,
Pcomplement  in_pc 
)

Ppath pa_intersect_complement( (Ppath) in_pa, (Pcomplement) in_pc ) Computes the intersection between in_pa and in_ps.

AL 17/11/93 No sharing

Parameters:
in_pa n_pa
in_pc n_pc

Definition at line 197 of file path.c.

References pa_empty(), pa_empty_p(), pa_full_p(), pa_make(), PA_UNDEFINED, PA_UNDEFINED_P, sc_dup(), sc_full(), SC_UNDEFINED_P, sl_append_system(), and sl_dup().

Referenced by adg_path_max_source(), adg_path_possible_source(), and adg_update_dfg().

00200 {
00201   Pcomplist  pc;
00202   Psysteme   ps;
00203 
00204   if (PA_UNDEFINED_P(in_pa)||SC_UNDEFINED_P(in_pc)) return PA_UNDEFINED;
00205   if (pa_empty_p(in_pa))                            return pa_empty();
00206 
00207   if (pa_full_p(in_pa)) ps = sc_full(); else  ps = sc_dup(in_pa->psys);
00208   pc = sl_append_system( sl_dup(in_pa->pcomp), sc_dup(in_pc) );
00209   return pa_make(ps, pc) ;
00210 }

Here is the call graph for this function:

Here is the caller graph for this function:

Ppath pa_intersect_system ( Ppath  in_pa,
Psysteme  in_ps 
)

Ppath pa_intersect_system( (Ppath) in_pa, (Psysteme) in_ps ) Computes the intersection between in_pa and in_ps.

AL 25/04/95 No sharing

Parameters:
in_pa n_pa
in_ps n_ps

Definition at line 175 of file path.c.

References NULL, pa_empty(), pa_empty_p(), pa_full_p(), pa_make(), PA_UNDEFINED, PA_UNDEFINED_P, sc_append(), sc_dup(), sc_free(), sc_normalize(), SC_UNDEFINED_P, and sl_dup().

Referenced by adg_max_of_leaves(), adg_path_max_source(), adg_path_possible_source(), and adg_update_dfg().

00178 {
00179   Psysteme ps;
00180 
00181   if (PA_UNDEFINED_P(in_pa)||SC_UNDEFINED_P(in_ps)) 
00182                             return PA_UNDEFINED;
00183   if ( pa_empty_p(in_pa) )  return pa_empty();
00184   if ( pa_full_p(in_pa) )   return pa_make(sc_dup(in_ps),NULL);
00185   
00186   ps = sc_normalize(sc_append( sc_dup(in_pa->psys), in_ps ));
00187   if (ps == NULL){ ps = sc_free(ps); return pa_empty(); }
00188   return pa_make(ps, sl_dup(in_pa->pcomp));
00189 }

Here is the call graph for this function:

Here is the caller graph for this function:

Ppath pa_make ( Psysteme  in_ps,
Pcomplist  in_pcomp 
)

path.c

path.c

WARNING THOSE FUNCTIONS ARE AUTOMATICALLY DERIVED

FROM THE WEB SOURCES !Ansi includesLinear includesPpath pa_make(in_ps, in_pcomp) AL 16/11/93 Allocates a Ppath and initialize it with in_ps and in_pcomp SHARING.

Parameters:
in_ps n_ps
in_pcomp n_pcomp

Definition at line 50 of file path.c.

References exit(), fprintf(), malloc(), NULL, Spath::pcomp, and Spath::psys.

Referenced by disjunction_to_region_sc(), dj_intersect_djcomp_ofl_ctrl(), pa_convex_hull_equals_union_p_ofl_ctrl(), pa_dup(), pa_dup1(), pa_empty(), pa_inclusion_p_ofl_ctrl(), pa_intersect_complement(), pa_intersect_system(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), pa_read(), pa_reduce_simple_complement(), pa_supress_same_constraints(), and pa_system_difference_ofl_ctrl().

00053 {
00054   Ppath ret_pa = (Ppath) malloc( sizeof( Spath ) );
00055   if (ret_pa == NULL) {
00056     (void) fprintf(stderr,"pa_new: Out of memory space\n");
00057     exit(-1);
00058   }
00059   ret_pa->psys = in_ps; ret_pa->pcomp = in_pcomp;
00060   return ret_pa;
00061 }

Here is the call graph for this function:

Here is the caller graph for this function:

int pa_max_constraints_nb ( Ppath   ) 

int pa_max_constraints_nb( (Ppath) in_pa ) Give the maximum constraints nb among systems of in_pa.

Definition at line 152 of file path.c.

References pa_empty_p(), pa_full_p(), PA_UNDEFINED_P, and sl_max_constraints_nb().

Referenced by pa_feasibility_ofl_ctrl(), and pa_path_to_disjunct_rule4_ofl_ctrl().

00154 {
00155   Psysteme   ps;
00156   int        loc, ret_int;
00157 
00158   if (PA_UNDEFINED_P(in_pa)||pa_full_p(in_pa)) return 0;
00159   if ( pa_empty_p(in_pa) )                     return 1;
00160 
00161   ps      = in_pa->psys; 
00162   ret_int = 2*(ps->nb_eq) + ps->nb_ineq;
00163   loc     = sl_max_constraints_nb( (Psyslist) in_pa->pcomp );
00164   
00165   if (loc > ret_int) ret_int = loc;
00166   return ret_int;
00167 }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct pa_path_to_disjunct_ofl_ctrl ( Ppath  in_pa,
int  ofl_ctrl 
)

Pdisjunct pa_path_to_disjunct_ofl_ctrl ( (Ppath) in_pa, (int) ofl_ctrl) Produces a Pdisjunct corresponding to the path Ppath.

No sharing.

comparison between 2 methods

Parameters:
in_pa n_pa
ofl_ctrl fl_ctrl

Definition at line 371 of file path.c.

References C3_DEBUG, dj_empty(), dj_free(), dj_full(), dj_intersection_ofl_ctrl(), dj_system_complement(), DJ_UNDEFINED, fprintf(), NULL, pa_empty_p(), pa_full_p(), PA_UNDEFINED, Ssyslist::psys, sc_dup(), sc_empty_p(), sl_append_system(), sl_length(), and Ssyslist::succ.

Referenced by pa_path_to_disjunct_rule4_ofl_ctrl().

00374 {
00375   Pdisjunct       ret_dj;
00376   Pcomplist       comp;
00377   int             meth1 = 0, meth2 = 1; /* comparison between 2 methods */
00378 
00379   if ( in_pa == PA_UNDEFINED )   return DJ_UNDEFINED;
00380   if (pa_full_p(in_pa))          return dj_full();
00381   if (pa_empty_p(in_pa))         return dj_empty();
00382   if ((in_pa->psys != NULL) && 
00383    sc_empty_p(in_pa->psys)) return dj_empty();
00384   
00385   ret_dj = (Pdisjunct) sl_append_system(NULL, sc_dup(in_pa->psys)); 
00386   for( comp = in_pa->pcomp; comp != NULL; comp = comp->succ) {
00387     Pdisjunct dj1 = dj_system_complement( comp->psys ); 
00388     Pdisjunct dj2 = ret_dj;
00389     int       lg1 = sl_length( dj1 );
00390     int       lg2 = sl_length( dj2 );
00391 
00392     meth1 = meth1 + lg2*lg1 ; meth2 = meth2 * lg1;
00393 
00394     ret_dj        = dj_intersection_ofl_ctrl( ret_dj, dj1, ofl_ctrl);
00395     dj1           = dj_free( dj1 ); dj2 = dj_free( dj2 );
00396   }
00397    
00398   C3_DEBUG("pa_path_to_disjunct_ofl_ctrl", {
00399     fprintf(stderr, "Feasibility calls with method 1 and 2 : %d\t%d\n", 
00400       meth1, meth2);  
00401   });
00402 
00403   return( ret_dj );
00404 }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct pa_path_to_disjunct_rule4_ofl_ctrl ( Ppath  in_pa,
int  ofl_ctrl 
)

Pdisjunct pa_path_to_disjunct_rule4_ofl_ctrl( (Ppath) in_pa, int ofl_ctrl) Returns the corresponding disjunction according rule 4.

AL 05/16/95 No sharing.

Returns according to different cases

we've modified P0 systeme

Parameters:
in_pa n_pa
ofl_ctrl fl_ctrl

Definition at line 567 of file reduc.c.

References C3_DEBUG, C3_RETURN, dj_append_system(), dj_empty(), DJ_UNDEFINED, fprintf(), IS_DJ, NULL, pa_empty_p(), pa_fprint, pa_free(), pa_make(), pa_max_constraints_nb(), pa_path_to_disjunct_ofl_ctrl(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_reduce_simple_complement(), PA_UNDEFINED, PATH_MAX_CONSTRAINTS, Spath::pcomp, Spath::psys, Ssyslist::psys, sc_dup(), sc_elim_redund_with_first_ofl_ctrl(), sc_empty_p(), sc_free(), sc_full_p(), SC_UNDEFINED, sl_append_system(), sl_free(), sl_length(), Ssyslist::succ, and union_variable_name.

Referenced by pa_path_to_disjunct_rule4_ofl_ctrl(), and pa_path_to_few_disjunct_ofl_ctrl().

00570 {
00571   Pcomplist   comp, lcomp = NULL;
00572   Pdisjunct   ret_dj  ; 
00573   Psysteme    systeme ; 
00574   Ppath       pa      ; 
00575   int         pa_clength1, pa_clength2; 
00576 
00577   if (in_pa == PA_UNDEFINED) return DJ_UNDEFINED;
00578   if (pa_empty_p(in_pa))     return dj_empty();
00579 
00580   C3_DEBUG( "pa_path_to_disjunct_rule4_ofl_ctrl", {
00581     fprintf(stderr, "\n\n Input path:\n\n");
00582     pa_fprint(stderr, in_pa, union_variable_name );
00583   });
00584 
00585 
00586   if (pa_max_constraints_nb(in_pa) > PATH_MAX_CONSTRAINTS) 
00587     C3_RETURN(IS_DJ, pa_path_to_disjunct_ofl_ctrl( in_pa, ofl_ctrl));
00588     
00589   systeme = in_pa->psys;
00590   if (in_pa->pcomp == NULL) 
00591     C3_RETURN(IS_DJ, sl_append_system(NULL,sc_dup(systeme)));
00592 
00593   for( comp = in_pa->pcomp; comp != NULL; comp = comp->succ ) {
00594     Psysteme ps;
00595     if (comp->psys == SC_UNDEFINED) 
00596       { sl_free(lcomp); C3_RETURN( IS_DJ, DJ_UNDEFINED ); }
00597 
00598     ps = sc_dup(comp->psys);
00599 
00600     ps = sc_elim_redund_with_first_ofl_ctrl( systeme, ps, ofl_ctrl );
00601 
00602     if (sc_empty_p( ps )) { ps = sc_free(ps); continue; }
00603     if (sc_full_p ( ps ))  
00604       { ps = sc_free(ps); C3_RETURN( IS_DJ, dj_empty() ); }
00605 
00606     lcomp = sl_append_system( lcomp, ps );
00607   }
00608  
00609   pa          = pa_make(sc_dup(in_pa->psys), lcomp); 
00610   pa_clength1 = sl_length( pa->pcomp );
00611   pa          = pa_reduce_simple_complement( pa );
00612   pa_clength2 = sl_length( pa->pcomp );
00613   systeme     = pa->psys;
00614 
00615 
00616   /* Returns according to different cases */
00617   if (pa_empty_p(pa)) 
00618        { ret_dj = dj_empty(); } 
00619   else if (pa_clength2 == 0) 
00620        { ret_dj = dj_append_system(NULL,sc_dup(systeme)); } 
00621   else if (pa_clength1 != pa_clength2)  /* we've modified P0 systeme */
00622        { ret_dj = pa_path_to_disjunct_rule4_ofl_ctrl( pa, ofl_ctrl); } 
00623   else { ret_dj = pa_path_to_disjunct_ofl_ctrl( pa, ofl_ctrl); }
00624 
00625   pa = pa_free( pa );
00626 
00627   C3_RETURN( IS_DJ, ret_dj );
00628 }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct pa_path_to_few_disjunct_ofl_ctrl ( Ppath  in_pa,
int  ofl_ctrl 
)

line 1197 "reduc.w"

Pdisjunct pa_path_to_few_disjunct_ofl_ctrl( (Ppath) in_pa, (int) ofl_ctrl ) Produces a Pdisjunct corresponding to the path Ppath and reduces the number of disjunctions. See "Extension de C3 aux Unions de Polyedres" Version 2, for a complete explanation about this function. in_pa is modified. AL 23/03/95

line 1208 "reduc.w"

If it's an empty path or if it has no complements : return

We are looking for a common hyperplan

removes cons_pv and vect_dup(vect_1)

take care of rule 2

take care of rule 2

Manage memory, free: cons_oppose, common_ps, common_ps_oppose, cons_pv, vect_1, pa1, pa2

Manage memory

Parameters:
in_pa n_pa
ofl_ctrl fl_ctrl

Definition at line 645 of file reduc.c.

References C3_DEBUG, C3_RETURN, contrainte_free(), contrainte_in_liste(), contrainte_make(), dj_empty(), dj_fprint_tab(), dj_free(), dj_full(), DJ_UNDEFINED, dj_union(), FALSE, fprintf(), IS_DJ, NULL, pa_empty(), pa_empty_p(), pa_fprint, pa_fprint_tab(), pa_free(), pa_free1(), pa_full_p(), pa_make(), pa_new, pa_path_to_disjunct_rule4_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), pa_transform_eg_in_ineg(), PA_UNDEFINED_P, Spath::pcomp, Ssyslist::psys, Spath::psys, sc_dup(), SC_EMPTY, sc_faisabilite_ofl, sc_free(), sc_make(), sc_safe_append(), sc_supress_same_constraints(), sl_append_system(), sl_dup(), Ssyslist::succ, TCST, TRUE, union_variable_name, VALUE_ONE, vect_add(), vect_chg_sgn(), vect_dup(), vect_fprint(), vect_new(), and vect_rm().

Referenced by dj_intersect_djcomp_ofl_ctrl(), pa_feasibility_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), and pa_system_difference_ofl_ctrl().

00648 {
00649   
00650 #line 980 "reduc.w"
00651    Psysteme  systeme;  Pdisjunct ret_dj = DJ_UNDEFINED; 
00652 #line 1001 "reduc.w"
00653      Ppath pa; Pcomplist lcomp;
00654 #line 1040 "reduc.w"
00655      
00656   Pcontrainte common_cons = NULL, cons, cons_oppose = NULL; 
00657   Pvecteur    vect_1, cons_pv = NULL;
00658   Pcomplist   comp;
00659   
00660 #line 1111 "reduc.w"
00661      
00662   Pcontrainte common_cons_oppose;
00663   Psysteme    common_ps, common_ps_oppose;
00664   Ppath    pa1, pa2; 
00665   boolean     pa1_empty  = FALSE, pa2_empty  = FALSE;
00666   boolean     pa1_filled = FALSE, pa2_filled = FALSE;
00667   
00668 #line 1144 "reduc.w"
00669      Pdisjunct  dj1 = dj_empty(), dj2 = dj_empty(); 
00670 #line 1214 "reduc.w"
00671 
00672 
00673   
00674 #line 981 "reduc.w"
00675   
00676   C3_DEBUG( "pa_path_to_few_disjunct_ofl_ctrl", {
00677     fprintf(stderr, "\n\n Input path:\n\n");
00678     pa_fprint(stderr, in_pa, union_variable_name );
00679   });
00680   
00681   if (PA_UNDEFINED_P( in_pa ))   C3_RETURN(IS_DJ, DJ_UNDEFINED);
00682   if (pa_full_p     ( in_pa ))   C3_RETURN(IS_DJ, dj_full());
00683   if (pa_empty_p    ( in_pa ))   C3_RETURN(IS_DJ, dj_empty());
00684     
00685   /* If it's an empty path or if it has no complements : return */ 
00686   systeme = in_pa->psys ; 
00687   if (!sc_faisabilite_ofl( systeme )) C3_RETURN(IS_DJ,dj_empty());
00688   if (in_pa->pcomp == NULL) C3_RETURN(IS_DJ,(Pdisjunct) sl_append_system(NULL,sc_dup(systeme)));
00689   
00690 #line 1216 "reduc.w"
00691 
00692   
00693 #line 1002 "reduc.w"
00694   
00695   pa      = pa_make(sc_dup(systeme), sl_dup(in_pa->pcomp)); 
00696   pa      = pa_reduce_simple_complement( pa );
00697   
00698   if (pa_empty_p(pa)) {pa = pa_free(pa); C3_RETURN(IS_DJ,dj_empty());}
00699   
00700   pa      = pa_transform_eg_in_ineg    ( pa ); 
00701   lcomp   = pa->pcomp ; 
00702   systeme = pa->psys  ;
00703   
00704   C3_DEBUG( "pa_path_to_few_disjunct_ofl_ctrl", {
00705     fprintf(stderr, "pa:\n");
00706     pa_fprint_tab(stderr, pa, union_variable_name, 1 );
00707   });
00708   
00709   if ( pa->pcomp == NULL ) { 
00710     pa     = pa_free1(pa); 
00711     ret_dj = (Pdisjunct) sl_append_system(NULL, systeme);
00712     
00713     C3_DEBUG( "pa_path_to_few_disjunct_ofl_ctrl", {
00714       fprintf(stderr, "No complement, returning:\n");
00715       dj_fprint_tab(stderr, ret_dj, union_variable_name, 1 );
00716     });
00717     
00718     return ret_dj;
00719   }
00720   
00721 #line 1217 "reduc.w"
00722 
00723   
00724 #line 1045 "reduc.w"
00725   
00726   /* We are looking for a common hyperplan */
00727   vect_1 = vect_new(TCST, VALUE_ONE); common_cons = NULL;
00728   
00729   for(cons = (lcomp->psys)->inegalites;
00730      (cons != NULL)&&(lcomp->succ != NULL);cons = cons->succ){
00731     boolean is_common = TRUE;
00732     cons_pv           = vect_dup( cons->vecteur ); vect_chg_sgn( cons_pv );
00733     cons_oppose       = contrainte_make(vect_add( cons_pv, vect_1 )); 
00734   
00735     for(comp = lcomp->succ;(comp != NULL) && is_common; comp = comp->succ){
00736       Pcontrainte ineg = (comp->psys)->inegalites;
00737       boolean     is_common1, is_common2;
00738   
00739       is_common1 = contrainte_in_liste( cons,        ineg );
00740       is_common2 = contrainte_in_liste( cons_oppose, ineg );
00741       is_common  = is_common1 || is_common2;
00742     }
00743     if (!is_common) { 
00744       /* removes cons_pv and vect_dup(vect_1) */
00745       cons_oppose = contrainte_free(cons_oppose);
00746       vect_rm( cons_pv ); cons_pv = (Pvecteur) NULL;
00747       continue; 
00748     }
00749     common_cons = cons;
00750     vect_chg_sgn( cons_pv );
00751     break;
00752   } 
00753   
00754   C3_DEBUG( "pa_path_to_few_disjunct_ofl_ctrl", {
00755     fprintf(stderr, "cons_pv: ");
00756     if (common_cons == NULL) fprintf(stderr, "NULL\n"); 
00757     else vect_fprint(stderr, cons_pv, union_variable_name); 
00758   });
00759   
00760 #line 1218 "reduc.w"
00761 
00762   
00763 #line 1086 "reduc.w"
00764   
00765   if( common_cons != NULL ) {
00766     
00767 #line 1118 "reduc.w"
00768     
00769     common_ps          = sc_make( CONTRAINTE_UNDEFINED, contrainte_make(cons_pv) );
00770     cons_pv            = vect_dup( common_cons->vecteur ); vect_chg_sgn( cons_pv );
00771     common_cons_oppose = contrainte_make(vect_add(cons_pv,vect_1));
00772     common_ps_oppose   = sc_make( CONTRAINTE_UNDEFINED, common_cons_oppose );
00773     pa1 = pa_new(); pa2= pa_new();
00774     
00775     for(comp = lcomp; comp != NULL; comp = comp->succ){
00776       Psysteme     local_ps;
00777       Pcontrainte  co = comp->psys->inegalites;
00778       
00779       if (!pa1_empty && contrainte_in_liste(common_cons, co)) {
00780         local_ps = sc_supress_same_constraints( common_ps, comp->psys );
00781         if (local_ps == SC_EMPTY) { pa1 = pa_empty(); pa1_empty = TRUE; continue;}
00782         pa1->pcomp = sl_append_system( pa1->pcomp, local_ps ); pa1_filled = TRUE;
00783       }
00784       else if(!pa2_empty &&  contrainte_in_liste(common_cons_oppose, co)) {
00785         local_ps = sc_supress_same_constraints( common_ps_oppose, comp->psys );
00786         if (local_ps == SC_EMPTY) {pa2 = pa_empty(); pa2_empty = TRUE; continue;}
00787         pa2->pcomp = sl_append_system( pa2->pcomp, local_ps ); pa2_filled = TRUE;
00788       }
00789     }
00790     
00791 #line 1088 "reduc.w"
00792   
00793     
00794 #line 1145 "reduc.w"
00795     
00796     if (pa1_filled) {
00797       /* take care of rule 2 */
00798       if (pa_full_p( pa2 )) pa1->psys = sc_dup( systeme );
00799       else pa1->psys = sc_safe_append( sc_dup(common_ps), systeme );
00800     
00801       C3_DEBUG("pa_path_to_few_disjunct", {
00802         fprintf(stderr, "pa1:\n");  
00803         pa_fprint_tab( stderr, pa1, union_variable_name, 1 );
00804       });
00805     
00806       if (pa_full_p(pa2)||sc_faisabilite_ofl(pa1->psys)) 
00807        {dj_free(dj1);dj1 = pa_path_to_few_disjunct_ofl_ctrl(pa1, ofl_ctrl);}
00808     
00809     }
00810     
00811     if (pa2_filled) {
00812       /* take care of rule 2 */
00813       if (pa_full_p( pa1 )) pa2->psys = sc_dup( systeme );
00814       else pa2->psys = sc_safe_append( sc_dup(common_ps_oppose), systeme );
00815     
00816       C3_DEBUG("pa_path_to_few_disjunct", {
00817         fprintf(stderr, "pa2:\n");  
00818         pa_fprint_tab( stderr, pa2, union_variable_name, 1 );
00819       });
00820       if (pa_full_p(pa1)||sc_faisabilite_ofl(pa2->psys)) 
00821        {dj_free(dj2);dj2 = pa_path_to_few_disjunct_ofl_ctrl(pa2, ofl_ctrl);}
00822     
00823     
00824     }
00825     
00826     ret_dj = dj_union( dj1, dj2 ); 
00827     
00828     /* Manage memory, free:
00829      * cons_oppose, common_ps, common_ps_oppose, 
00830      * cons_pv, vect_1, pa1, pa2
00831      */
00832     cons_oppose      = contrainte_free( cons_oppose );
00833     common_ps        = sc_free( common_ps );
00834     common_ps_oppose = sc_free( common_ps_oppose );
00835     vect_rm(cons_pv); cons_pv = NULL;
00836     pa1 = pa_free(pa1);   pa2 = pa_free(pa2); 
00837     
00838 #line 1089 "reduc.w"
00839   
00840   }
00841   else { 
00842     
00843 #line 1191 "reduc.w"
00844      ret_dj = pa_path_to_disjunct_rule4_ofl_ctrl( pa, ofl_ctrl ); 
00845     
00846 #line 1092 "reduc.w"
00847   
00848   }
00849   
00850   /* Manage memory */
00851   pa = pa_free(pa); vect_rm(vect_1); vect_1 = NULL;
00852   
00853   C3_RETURN(IS_DJ, ret_dj);
00854   
00855 #line 1219 "reduc.w"
00856 
00857 }

Here is the call graph for this function:

Here is the caller graph for this function:

Ppath pa_read ( char *   ) 

void pa_read(FILE*) reads a Ppath

Definition at line 435 of file path.c.

References free(), pa_make(), PA_UNDEFINED, Ssyslist::psys, SL_NULL, sl_read(), and Ssyslist::succ.

00437 {
00438   Ppath       ret_pa;
00439   Psyslist    sl;
00440 
00441   sl = sl_read(nomfic);
00442   if (sl == SL_NULL) return PA_UNDEFINED;
00443   ret_pa = pa_make(sl->psys, (Pcomplist) sl->succ);
00444   free( sl );
00445   return ret_pa;
00446 }

Here is the call graph for this function:

Ppath pa_reduce_simple_complement ( Ppath  in_pa  ) 

Ppath pa_reduce_simple_complement( (Ppath) in_pa ) AL 16/11/93 Scan all the complement.

If one complement is a simple inequality, its complement is computed and intersected with psys part of in_pa. in_pa is modified. (Sharing with in_pa).

Do we have a simple complement ?

also frees pss

Parameters:
in_pa n_pa

Definition at line 219 of file path.c.

References C3_DEBUG, C3_RETURN, dj_free(), dj_system_complement(), FALSE, fprintf(), IS_PA, NULL, pa_empty(), pa_empty_p(), pa_fprint_tab(), pa_free(), pa_free1(), pa_full_p(), pa_make(), PA_UNDEFINED, Ssyslist::psys, sc_empty_p(), sc_faisabilite_ofl, sc_safe_append(), SC_UNDEFINED, sl_append_system(), sl_free(), sl_free1(), Ssyslist::succ, TRUE, and union_variable_name.

Referenced by pa_path_to_disjunct_rule4_ofl_ctrl(), and pa_path_to_few_disjunct_ofl_ctrl().

00221 {
00222   Psysteme      pss;
00223   Pcomplist pco, pco2 = NULL, tofree = NULL;
00224   Ppath         ret_pa;
00225   boolean       at_least_one = FALSE ; /* Do we have a simple complement ? */
00226   
00227   if( pa_full_p(in_pa) || pa_empty_p(in_pa) || (in_pa == PA_UNDEFINED) ) 
00228                 return (in_pa);
00229   
00230   C3_DEBUG("pa_reduce_simple_complement", {
00231     fprintf(stderr, "Input path:\n");  
00232     pa_fprint_tab( stderr, in_pa, union_variable_name, 1 );
00233   });
00234 
00235   pss = in_pa->psys;
00236   for( pco = in_pa->pcomp, pco2 = NULL; pco != NULL; pco = pco->succ ) {
00237     Psysteme ps = pco->psys;
00238     
00239     if (ps == SC_UNDEFINED) { 
00240    pco2  = sl_free1(pco2); 
00241    in_pa = pa_free1(in_pa); 
00242    return PA_UNDEFINED ; 
00243     }
00244     else if (sc_empty_p(ps)) continue;
00245     else if ((ps->nb_ineq == 1) && (ps->nb_eq == 0)) {
00246       Pdisjunct dj = dj_system_complement( ps );
00247       pss          = sc_safe_append( pss, dj->psys );
00248       tofree       = sl_append_system( tofree, ps );
00249       dj           = dj_free( dj ); 
00250       at_least_one = TRUE;
00251     }
00252     else { pco2 = (Pcomplist) sl_append_system( pco2, ps ); }
00253   }
00254 
00255   if(!at_least_one) {
00256     pco2   = sl_free1(pco2);  
00257     ret_pa = in_pa;
00258   }
00259   else if(!sc_faisabilite_ofl(pss)) {
00260     pco2   = sl_free1( pco2   ); 
00261     tofree = sl_free1( tofree );
00262     in_pa  = pa_free ( in_pa  ); /* also frees pss */
00263     ret_pa = pa_empty(); 
00264   } 
00265   else {
00266     in_pa  = pa_free1( in_pa  ); 
00267     tofree = sl_free ( tofree );
00268     ret_pa = pa_make ( pss, pco2 );
00269   }
00270 
00271   C3_RETURN( IS_PA, ret_pa );
00272 }

Here is the call graph for this function:

Here is the caller graph for this function:

Ppath pa_supress_same_constraints ( Ppath  in_pa  ) 

Ppath pa_supress_same_constraints( (Ppath) in_pa ) Supress from complements of in_pa same constraints than those in positif Psystem in_pa->psys.

Returned path have no more equalities. AL050795 No sharing, no modification of inputs.

Special cases

debuging

General case

Psysteme ps = sc_supress_same_constraints( positif, comp->psys );

Parameters:
in_pa n_pa

Definition at line 525 of file reduc.c.

References C3_DEBUG, C3_RETURN, fprintf(), IS_PA, NULL, pa_empty(), pa_empty_p(), pa_fprint_tab(), pa_full(), pa_full_p(), pa_make(), PA_UNDEFINED, PA_UNDEFINED_P, Ssyslist::psys, sc_dup(), sc_faisabilite_ofl, sc_supress_parallel_redund_constraints(), sc_transform_eg_in_ineg(), sl_append_system(), sl_free(), Ssyslist::succ, and union_variable_name.

Referenced by pa_feasibility_ofl_ctrl().

00527 {
00528   Ppath        ret_pa = PA_UNDEFINED;
00529   Pcomplist    comp;
00530   Psysteme     positif;
00531   Psyslist     psl = NULL;
00532 
00533   /* Special cases */
00534   if ( PA_UNDEFINED_P( in_pa )) return PA_UNDEFINED;
00535   if ( pa_empty_p    ( in_pa )) return pa_empty();
00536   if ( pa_full_p     ( in_pa )) return pa_full ();
00537 
00538   /* debuging */
00539   C3_DEBUG( "pa_supress_same_constraints", {
00540     fprintf(stderr, "Input path:\n");
00541     pa_fprint_tab(stderr, in_pa, union_variable_name, 1);
00542   });
00543 
00544   /* General case */
00545   positif = in_pa->psys;
00546   if (!sc_faisabilite_ofl(positif)) return pa_empty();
00547   
00548   for( comp = in_pa->pcomp; comp != NULL; comp = comp->succ) {
00549  /*   Psysteme ps = sc_supress_same_constraints( positif, comp->psys ); */
00550     Psysteme ps = sc_supress_parallel_redund_constraints( comp->psys, positif );
00551     if (ps == NULL) 
00552       {psl = sl_free(psl); ret_pa = pa_empty(); C3_RETURN(IS_PA, ret_pa);}
00553     else psl = sl_append_system( psl, ps );
00554   }
00555 
00556   positif = sc_dup(positif); sc_transform_eg_in_ineg( positif );
00557   ret_pa  = pa_make( positif, (Pcomplist) psl );
00558   C3_RETURN(IS_PA, ret_pa);
00559 }

Here is the call graph for this function:

Here is the caller graph for this function:

Pdisjunct pa_system_difference_ofl_ctrl ( Psysteme  ,
Psysteme  ,
int   
)

Pdisjunct pa_system_difference_ofl_ctrl(ps1, ps2) input : two Psystemes output : a disjunction representing ps1 - ps2 modifies : nothing comment : algorihtm : chemin = ps1 inter complement of (ps2) ret_dj = dj_simple_inegs_to_eg( pa_path_to_few_disjunct(chemin) ).

Definition at line 905 of file reduc.c.

References dj_empty(), dj_free(), dj_simple_inegs_to_eg(), DJ_UNDEFINED, NULL, pa_free1(), pa_make(), pa_path_to_few_disjunct_ofl_ctrl(), sc_dup(), sc_empty_p(), SC_UNDEFINED, and sl_append_system().

00908 {
00909   Ppath     chemin;
00910   Pdisjunct dj, ret_dj;
00911   
00912   if ((ps1 == SC_UNDEFINED)||(ps2 == SC_UNDEFINED)) return DJ_UNDEFINED; 
00913   if (sc_empty_p(ps2)) return sl_append_system(NULL,sc_dup(ps1));
00914   if (sc_empty_p(ps1)) return dj_empty();
00915   
00916   chemin  =  pa_make(ps1, sl_append_system(NULL,ps2));
00917   dj      =  pa_path_to_few_disjunct_ofl_ctrl(chemin, ofl_ctrl);
00918   chemin  =  pa_free1( chemin );
00919   ret_dj  =  dj_simple_inegs_to_eg( dj );
00920   dj      =  dj_free( dj );
00921   return ret_dj;
00922 }

Here is the call graph for this function:

boolean pa_system_equal_p_ofl_ctrl ( Psysteme  ,
Psysteme  ,
int   
)

boolean pa_system_equal_p(Psysteme ps1, Psysteme ps2) BA

Definition at line 887 of file reduc.c.

References pa_inclusion_p_ofl_ctrl().

00890 {
00891     return (  pa_inclusion_p_ofl_ctrl(ps1,ps2, ofl_ctrl) && 
00892          pa_inclusion_p_ofl_ctrl(ps2,ps1, ofl_ctrl) );
00893 }

Here is the call graph for this function:

Ppath pa_transform_eg_in_ineg ( Ppath  in_pa  ) 

Ppath pa_transform_eg_in_ineg( in_pa ) Transforms all equalities of all systems composing in_pa in inequalities and returns in_pa.

in_pa is modified. (Sharing with in_pa).

Parameters:
in_pa n_pa

Definition at line 281 of file path.c.

References NULL, pa_empty_p(), pa_full_p(), PA_UNDEFINED, Ssyslist::psys, sc_transform_eg_in_ineg(), and Ssyslist::succ.

Referenced by pa_path_to_few_disjunct_ofl_ctrl().

00283 {
00284   Pcomplist pco;
00285 
00286   if( pa_full_p(in_pa) || pa_empty_p(in_pa) || (in_pa == PA_UNDEFINED) ) 
00287                 return (in_pa);
00288   
00289   sc_transform_eg_in_ineg( in_pa->psys );
00290   for( pco = in_pa->pcomp; pco != NULL; pco = pco->succ ) 
00291     { sc_transform_eg_in_ineg( pco->psys ); }
00292 
00293   return in_pa;
00294 }

Here is the call graph for this function:

Here is the caller graph for this function:

Psysteme sc_concatenate ( Psysteme  in_s1,
Psysteme  in_s2 
)

Psysteme sc_concatenate( in_s1, in_s2 ) AL 30/05/94 Append in_s2 to the end of in_s1 and returns in_s1.

Freeable with sc_free1(). Sharing.

Memory management and returns

Parameters:
in_s1 n_s1
in_s2 n_s2

Definition at line 154 of file sc_list.c.

References eq, free(), NULL, s1, sc_creer_base(), sc_dup1(), sc_free1(), SC_UNDEFINED_P, and vect_rm().

00156 {
00157   Pcontrainte  eq;
00158   Psysteme  s1, s2;
00159 
00160   s1 = sc_dup1( in_s1 );      s2 = sc_dup1( in_s2 );
00161   if (SC_UNDEFINED_P(in_s1))  {s1 = sc_free1(s1); return(s2);}
00162   if (SC_UNDEFINED_P(in_s2))  {s2 = sc_free1(s2); return(s1);}
00163 
00164   if (s1->nb_eq != 0) {
00165     for (eq = s1->egalites; eq->succ != (Pcontrainte)NULL; eq = eq->succ) ;
00166     eq->succ = s2->egalites; s1->nb_eq += s2->nb_eq;
00167   } 
00168   else { s1->egalites = s2->egalites; s1->nb_eq = s2->nb_eq; }
00169   
00170   if (s1->nb_ineq != 0) {
00171     for (eq = s1->inegalites;eq->succ != (Pcontrainte)NULL;eq = eq->succ) ;
00172     eq->succ = s2->inegalites;  s1->nb_ineq += s2->nb_ineq;
00173   } 
00174   else { s1->inegalites = s2->inegalites; s1->nb_ineq = s2->nb_ineq; }
00175   
00176   /* Memory management and returns */
00177   vect_rm( s1->base ); vect_rm( s2->base ); free( s2 ); s2 = NULL;
00178   s1->base = NULL; sc_creer_base( s1 );
00179   return(s1);
00180 }

Here is the call graph for this function:

Psysteme sc_dup1 ( Psysteme  in_ps  ) 

Psysteme sc_dup1( in_ps ) AL 30/05/94 1 depth copy of in_ps: no duplication of vectors (except for the base).

Sharing !

Parameters:
in_ps n_ps

Definition at line 69 of file sc_list.c.

References assert, contrainte_new(), cp, eq, NULL, sc_add_egalite(), sc_add_inegalite(), sc_new(), SC_UNDEFINED, SC_UNDEFINED_P, vect_dup(), vect_size(), VECTEUR_UNDEFINED, and VECTEUR_UNDEFINED_P.

Referenced by sc_concatenate().

00071 {
00072   Psysteme cp = SC_UNDEFINED;
00073   Pcontrainte eq, eq_cp;
00074   
00075   if (!SC_UNDEFINED_P(in_ps)) {
00076     cp = sc_new();
00077     
00078     for (eq = in_ps->egalites; eq != NULL; eq = eq->succ) {
00079       eq_cp = contrainte_new();
00080       contrainte_vecteur(eq_cp) = contrainte_vecteur(eq);
00081       sc_add_egalite(cp, eq_cp);
00082     }
00083     
00084     for(eq=in_ps->inegalites;eq!=NULL;eq=eq->succ) {
00085       eq_cp = contrainte_new();
00086       contrainte_vecteur(eq_cp) = contrainte_vecteur(eq);
00087       sc_add_inegalite(cp, eq_cp);
00088     }
00089 
00090     if(in_ps->dimension==0) {
00091       assert(VECTEUR_UNDEFINED_P(in_ps->base));
00092       cp->dimension = 0;
00093       cp->base = VECTEUR_UNDEFINED;
00094     }
00095     else {
00096       assert(in_ps->dimension==vect_size(in_ps->base));
00097       cp->dimension = in_ps->dimension;
00098       cp->base = vect_dup(in_ps->base);    
00099     }
00100   }
00101   return(cp);
00102 }

Here is the call graph for this function:

Here is the caller graph for this function:

Psysteme sc_elim_redund_with_first_ofl_ctrl ( Psysteme  in_ps1,
Psysteme  in_ps2,
int  ofl_ctrl 
)

Psysteme sc_elim_redund_with_first_ofl_ctrl( in_ps1, in_ps2, ofl_ctrl ) Returns constraints of in_ps2 which cut in_ps1.

AL 06 04 95 It is assumed that in_ps1 and in_ps2 are feasible ! in_ps1 is not modified, in_ps2 is modified.

Return on special cases

debuging

build in_ps1.and.in_ps2 with sharing on in_ps2 This also works if in_ps1 is full space

debuging

update information on ps1

debuging

Normalize 2 inputs systems

returns if there is no intersection

We run over in_ps2 constraints (shared by ps1) and detect redundance

eliminate the constraint from in_ps2, and thus from ps1

Parameters:
in_ps1 n_ps1
in_ps2 n_ps2
ofl_ctrl fl_ctrl

Definition at line 409 of file reduc.c.

References assert, base_union(), C3_DEBUG, C3_RETURN, contrainte_free(), contrainte_reverse(), eq, eq_set_vect_nul(), fprintf(), IS_SC, NULL, sc_dup(), sc_empty(), sc_fprint(), sc_free(), sc_full(), sc_full_p(), sc_rational_feasibility_ofl_ctrl(), sc_transform_eg_in_ineg(), sc_weak_consistent_p(), TRUE, union_variable_name, vect_fprint(), vect_normalize(), vect_rm(), and vect_size().

Referenced by pa_path_to_disjunct_rule4_ofl_ctrl().

00412 {
00413   Psysteme    ps1; 
00414   Pcontrainte prev_eq = NULL, eq, tail = NULL;
00415   Pbase       pb;
00416 
00417   /* Return on special cases */
00418   if ( sc_full_p(in_ps1) )    return in_ps2;
00419   if ( in_ps1->nb_ineq == 0 ) return in_ps2;
00420 
00421   /* debuging */
00422   C3_DEBUG("sc_elim_redund_with_first", {
00423     fprintf(stderr, "\nInput systems, in_ps1, then in_ps2:\n");  
00424     sc_fprint( stderr, in_ps1, union_variable_name );
00425     sc_fprint( stderr, in_ps2, union_variable_name );
00426   });
00427 
00428 
00429   /* build in_ps1.and.in_ps2 with sharing on in_ps2
00430    * This also works if in_ps1 is full space */
00431   if ( in_ps2->nb_eq != 0 ) sc_transform_eg_in_ineg( in_ps2 );
00432   ps1 = sc_dup( in_ps1 );
00433   for (eq = ps1->inegalites; eq != NULL; tail = eq, eq = eq->succ) {}
00434   tail->succ = in_ps2->inegalites;
00435 
00436   /* debuging */
00437   C3_DEBUG("sc_elim_redund_with_first", {
00438     fprintf(stderr, "ps1 old: nb_eq= %d, nb_ineq= %d, dimension= %d, base= \n", 
00439        ps1->nb_eq, ps1->nb_ineq, ps1->dimension);  
00440     vect_fprint(stderr, ps1->base, union_variable_name);
00441     fprintf(stderr, "in_ps2: nb_eq= %d, nb_ineq= %d, dimension= %d, base= \n", 
00442        in_ps2->nb_eq, in_ps2->nb_ineq, in_ps2->dimension);  
00443     vect_fprint(stderr, in_ps2->base, union_variable_name);
00444   });
00445 
00446   /* update information on ps1 */
00447   ps1->nb_eq     = ps1->nb_eq   + in_ps2->nb_eq;
00448   ps1->nb_ineq   = ps1->nb_ineq + in_ps2->nb_ineq;
00449   pb             = ps1->base;
00450   ps1->base      = base_union( ps1->base, in_ps2->base );
00451   ps1->dimension = vect_size ( ps1->base );
00452   vect_rm( pb );
00453 
00454   /* debuging */
00455   C3_DEBUG("sc_elim_redund_with_first", {
00456     fprintf(stderr, "ps1: nb_eq= %d, nb_ineq= %d, dimension= %d, base= \n", 
00457        ps1->nb_eq, ps1->nb_ineq, ps1->dimension);
00458     vect_fprint(stderr, ps1->base, union_variable_name);
00459   });
00460 
00461   /* Normalize 2 inputs systems */
00462   for (eq = ps1->inegalites; eq != NULL; eq=eq->succ)
00463   {
00464       vect_normalize(eq->vecteur);
00465   }
00466   /* returns if there is no intersection */
00467   if (!sc_rational_feasibility_ofl_ctrl(ps1, ofl_ctrl, TRUE)) { 
00468     tail->succ = NULL;  ps1 = sc_free(ps1); 
00469     in_ps2 = sc_free(in_ps2); in_ps2 = sc_empty(NULL);
00470     C3_RETURN( IS_SC, in_ps2 ); 
00471   }
00472     
00473 
00474   /* We run over in_ps2 constraints (shared by ps1) 
00475    * and detect redundance */
00476   assert(sc_weak_consistent_p(in_ps2));
00477   assert(sc_weak_consistent_p(ps1));
00478   for (eq = tail->succ, prev_eq = tail; eq != NULL; eq = eq->succ)
00479   {
00480       contrainte_reverse(eq); 
00481       assert(sc_weak_consistent_p(ps1));
00482       C3_DEBUG("sc_elim_redund_with_first", {
00483      fprintf(stderr, "\nps1:\n");  
00484      fprintf(stderr, "nb_eq= %d, nb_ineq= %d, dimension= %d\n", 
00485         ps1->nb_eq, ps1->nb_ineq, ps1->dimension);
00486      sc_fprint( stderr, ps1, union_variable_name );
00487       });
00488 
00489       if (sc_rational_feasibility_ofl_ctrl(ps1, ofl_ctrl, TRUE))
00490       {
00491      contrainte_reverse(eq);
00492      prev_eq = prev_eq->succ;
00493       }
00494       else{  
00495      /* eliminate the constraint from in_ps2, and thus from ps1 */   
00496      eq_set_vect_nul(eq);  
00497      if (in_ps2->inegalites == eq)
00498          in_ps2->inegalites = eq->succ;
00499      prev_eq->succ = eq->succ;
00500      eq->succ = CONTRAINTE_UNDEFINED;
00501      eq = contrainte_free(eq);
00502      eq = prev_eq;
00503      in_ps2->nb_ineq--;
00504      ps1->nb_ineq--;
00505      assert(sc_weak_consistent_p(ps1));
00506      assert(sc_weak_consistent_p(in_ps2));
00507       }
00508   }
00509 
00510 
00511   if ( in_ps2->inegalites == NULL ) 
00512     { in_ps2 = sc_free(in_ps2);  in_ps2 = sc_full(); }
00513 
00514   tail->succ = NULL; ps1 = sc_free( ps1 ); 
00515   C3_RETURN( IS_SC, in_ps2 );
00516 }

Here is the call graph for this function:

Here is the caller graph for this function:

Psysteme sc_free ( Psysteme  in_ps  ) 

Psysteme sc_free( in_ps ) AL 30/05/94 Free of in_ps.

Returns NULL to be used as in_ps = sc_free( in_ps );

Parameters:
in_ps n_ps

Definition at line 109 of file sc_list.c.

References NULL, and sc_rm().

Referenced by c_convex_effects_on_actual_parameter_forward_translation(), dj_intersection_ofl_ctrl(), pa_free(), pa_intersect_system(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), sc_elim_redund_with_first_ofl_ctrl(), sc_minmax_of_pvector(), sc_supress_parallel_redund_constraints(), sl_free(), xml_Application(), xml_Boxes(), xml_Call(), xml_Loop(), and xml_Pattern_Paving().

00111 {  sc_rm( in_ps ); return( (Psysteme) NULL ); }

Here is the call graph for this function:

Here is the caller graph for this function:

Psysteme sc_free1 ( Psysteme   ) 

Psysteme sc_free1( in_ps ) AL 30/05/94 Only pcontrainte of in_ps are freed.

Definition at line 118 of file sc_list.c.

References free(), NULL, and vect_rm().

Referenced by sc_concatenate().

00120 {
00121   Pcontrainte pc, pc2;
00122 
00123   if (in_ps != NULL) {
00124     for(pc = in_ps->inegalites; pc != NULL; ) {
00125       pc2 = pc;
00126       pc = pc->succ;
00127       free(pc2);
00128       pc2 = NULL;
00129     }
00130     for(pc = in_ps->egalites; pc != NULL; ) {
00131       pc2 = pc;
00132       pc = pc->succ;
00133       free(pc2);
00134       pc2 = NULL;
00135     }
00136     in_ps->nb_eq = 0;
00137     in_ps->nb_ineq = 0;
00138     in_ps->dimension = 0;
00139     vect_rm( in_ps->base );
00140     in_ps->base = NULL;
00141     
00142     free((char *) in_ps);
00143     in_ps = (Psysteme) NULL;
00144   }
00145   return( (Psysteme) NULL );
00146 }

Here is the call graph for this function:

Here is the caller graph for this function:

Psysteme sc_full ( void   ) 

Psysteme sc_full() similar to sc_new.

Definition at line 55 of file sc_list.c.

References sc_new().

Referenced by pa_intersect_complement(), and sc_elim_redund_with_first_ofl_ctrl().

00055 { return sc_new(); }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean sc_full_p ( Psysteme   ) 

Psysteme sc_full_p( in_ps ) similar to sc_new.

Definition at line 58 of file sc_list.c.

References NULL.

Referenced by dj_simple_inegs_to_eg(), pa_path_to_disjunct_rule4_ofl_ctrl(), sc_elim_redund_with_first_ofl_ctrl(), and sl_fprint_tab().

00060 { return( (in_ps->nb_eq == 0) && (in_ps->nb_ineq == 0) && 
00061           (in_ps->egalites == NULL) && (in_ps->inegalites == NULL) ); }

Here is the caller graph for this function:

Psysteme sc_supress_parallel_redund_constraints ( Psysteme  in_ps1,
Psysteme  in_ps2 
)

Psysteme sc_supress_parallel_redund_constraints( in_ps1, in_ps2 ) input: 2 Psystemes in_ps1 and in_ps2 output: in_ps1 / in_ps2 (cut operation on polyhedrons) memory: Inspector (nothing is shared, nor modified, output allocated).

comment: Supress in dup(in_ps2) parallel constraints that are redundant relatively to in_ps1. Returned Psysteme have only inequalities.

debuging

Transforms equalities in inequalities if necessary

Compare with inequalities

update base and normalize

Manage memory and return

Parameters:
in_ps1 n_ps1
in_ps2 n_ps2

Definition at line 252 of file reduc.c.

References C3_DEBUG, C3_RETURN, contrainte_dup(), contrainte_parallel_in_liste(), empty, FALSE, fprintf(), full, IS_SC, keep, NULL, sc_add_inegalite(), sc_creer_base(), sc_dup(), sc_empty(), sc_empty_p(), sc_fprint(), sc_free(), sc_make(), sc_normalize(), SC_RN, sc_transform_eg_in_ineg(), TRUE, union_variable_name, and vect_rm().

Referenced by pa_supress_same_constraints().

00254 {
00255   Psysteme        ps1, ps2,  ret_ps = NULL;
00256   Pcontrainte     ineq1, ineqs2;
00257   boolean         stop = FALSE, dup1 = FALSE, dup2 = FALSE;
00258   
00259   if ( in_ps1 == SC_RN ) return sc_dup(in_ps2);
00260   
00261   /* debuging */
00262   C3_DEBUG("sc_supress_parallel_constraints", {
00263     fprintf(stderr, "Input systems, in_ps1, then in_ps2:\n");  
00264     sc_fprint( stderr, in_ps1, union_variable_name );
00265     sc_fprint( stderr, in_ps2, union_variable_name );
00266   });
00267   
00268 
00269   /* Transforms equalities in inequalities if necessary */
00270   if (in_ps1->nb_eq != 0) 
00271     { ps1 = sc_dup( in_ps1 ); sc_transform_eg_in_ineg( ps1 ); dup1 = TRUE; }
00272   else ps1 = in_ps1;
00273  
00274   if (in_ps2->nb_eq != 0) 
00275     { ps2 = sc_dup( in_ps2 ); sc_transform_eg_in_ineg( ps2 ); dup2 = TRUE; }
00276   else ps2 = in_ps2;
00277 
00278 
00279   /* Compare with inequalities */
00280   ineqs2 = ps2->inegalites;
00281 
00282   for (ineq1 = ps1->inegalites; ineq1 != NULL && !stop; ineq1 = ineq1->succ) {
00283     enum hspara_elem  sk = contrainte_parallel_in_liste( ineq1, ineqs2 );
00284     switch (sk) 
00285       {
00286       case keep:
00287    if (ret_ps != NULL){ sc_add_inegalite( ret_ps, contrainte_dup(ineq1) ); }
00288    else ret_ps = sc_make( NULL, contrainte_dup(ineq1) );
00289    break;
00290       case empty:
00291    ret_ps = sc_free(ret_ps);
00292    ret_ps = sc_empty(NULL);
00293    stop = TRUE; 
00294    break;
00295       case full: continue; break;
00296       default:  
00297    {
00298      fprintf(stderr, "%s supress_kind == %d should not appear !",
00299         "[sc_supress_parallel_redund_constraints]", (int) sk ); 
00300      abort();
00301    } 
00302       }
00303       
00304   }
00305 
00306   /* update base and normalize */  
00307   if ((ret_ps != NULL) && !sc_empty_p(ret_ps))  { 
00308     vect_rm(ret_ps->base); 
00309     ret_ps->base = NULL; sc_creer_base( ret_ps );
00310     ret_ps = sc_normalize( ret_ps );
00311   }
00312 
00313   /* Manage memory and return */
00314   ps1 = (dup1)? sc_free(ps1) : ps1;
00315   ps2 = (dup2)? sc_free(ps2) : ps2;
00316   C3_RETURN( IS_SC, ret_ps );
00317 }

Here is the call graph for this function:

Here is the caller graph for this function:

Psysteme sc_supress_same_constraints ( Psysteme  in_ps1,
Psysteme  in_ps2 
)

Psysteme sc_supress_same_constraints( in_ps1, in_ps2 ) supress in in_ps2 constraints that are in in_ps1.

Nothing is shared, nor modified. Returned Psysteme have only inequalities. This function should be superseded by sc_supress_parallel_redund_contraints

Compare with equalities a == 0 <=> a <= 0 and -a <= 0

add co to returned inegs

add eq to returned inegs

add co and eq to returned inegs

Compare with inequalities

Parameters:
in_ps1 n_ps1
in_ps2 n_ps2

Definition at line 326 of file reduc.c.

References C3_DEBUG, C3_RETURN, contrainte_chg_sgn(), contrainte_dup(), contrainte_free(), contrainte_in_liste(), contrainte_make(), eq, eq_in_ineq(), fprintf(), IS_SC, NULL, sc_add_inegalite(), sc_creer_base(), sc_dup(), sc_fprint(), sc_make(), sc_normalize(), SC_RN, union_variable_name, vect_chg_sgn(), vect_dup(), and vect_rm().

Referenced by pa_path_to_few_disjunct_ofl_ctrl().

00328 {
00329   Psysteme        ret_ps = NULL;
00330   Pcontrainte     eq, ineq;
00331   
00332   if ( in_ps1 == SC_RN ) return sc_dup(in_ps2);
00333   
00334   C3_DEBUG("sc_supress_same_constraints", {
00335     fprintf(stderr, "\nInput systems, in_ps1, then in_ps2:\n");  
00336     sc_fprint( stderr, in_ps1, union_variable_name );
00337     sc_fprint( stderr, in_ps2, union_variable_name );
00338   });
00339 
00340   /* Compare with equalities a == 0   <=>   a <= 0 and -a <= 0 */
00341   for (eq = in_ps2->egalites; eq != NULL; eq = eq->succ) {
00342     Pcontrainte  co, eq2;
00343     Pvecteur     pv;
00344     boolean      eq_in_ineq, co_in_ineq;
00345 
00346     if (contrainte_in_liste(eq, in_ps1->egalites)) continue;
00347     
00348     pv = vect_dup(eq->vecteur); 
00349     vect_chg_sgn        ( pv );
00350     co = contrainte_make( pv );
00351     if (contrainte_in_liste(co, in_ps1->egalites ))
00352       { co = contrainte_free( co ); continue; }
00353 
00354 
00355     eq_in_ineq = contrainte_in_liste(eq, in_ps1->inegalites);
00356     co_in_ineq = contrainte_in_liste(co, in_ps1->inegalites);
00357     
00358     if (eq_in_ineq && co_in_ineq) { 
00359       co = contrainte_free( co ); 
00360     }
00361     else if (eq_in_ineq) { /* add co to returned inegs */
00362       if (ret_ps != NULL){ sc_add_inegalite( ret_ps, co ); }
00363       else ret_ps = sc_make( NULL, co );
00364     }
00365     else if (co_in_ineq) { /* add eq to returned inegs */
00366       eq2 = contrainte_dup(eq);
00367       if (ret_ps != NULL){ sc_add_inegalite( ret_ps, eq2 ); }
00368       else ret_ps = sc_make( NULL, eq2 );
00369       co = contrainte_free( co ); 
00370     }
00371     else { /* add co and eq to returned inegs */
00372       eq2 = contrainte_dup(eq);
00373       if (ret_ps != NULL){ sc_add_inegalite( ret_ps, eq2 ); }
00374       else ret_ps = sc_make( NULL, eq2 );
00375       sc_add_inegalite( ret_ps, co );
00376     }
00377   }
00378 
00379   /* Compare with inequalities */
00380   for (ineq = in_ps2->inegalites; ineq != NULL; ineq = ineq->succ) {
00381     Pcontrainte io;
00382     if (contrainte_in_liste(ineq, in_ps1->inegalites)) continue;
00383     if (contrainte_in_liste(ineq, in_ps1->egalites))   continue;
00384     io = contrainte_dup( ineq ); contrainte_chg_sgn( io );
00385     if (contrainte_in_liste(io, in_ps1->egalites)) {
00386       io = contrainte_free(io);  
00387       continue;
00388     }
00389     
00390     if (ret_ps != NULL){ sc_add_inegalite( ret_ps, contrainte_dup(ineq) ); }
00391     else ret_ps = sc_make( NULL, contrainte_dup(ineq) );
00392     io = contrainte_free(io);  
00393   }
00394   
00395   if (ret_ps != NULL) 
00396     { vect_rm(ret_ps->base); ret_ps->base = NULL; sc_creer_base( ret_ps );}
00397   
00398   ret_ps = sc_normalize( ret_ps );
00399   C3_RETURN( IS_SC, ret_ps );
00400 }

Here is the call graph for this function:

Here is the caller graph for this function:

Psyslist sl_append_system ( Psyslist  in_sl,
Psysteme  in_ps 
)

Psyslist sl_append_system( (Psyslist) in_sl, (Psysteme) in_ps ) Input : A disjunct in_sl to wich in_ps will be added.

Output : Disjunct in_sl with in_ps. => ! Sharing. Comment: Nothing is checked on result in_sl. AL 10/11/93

Parameters:
in_sl n_sl
in_ps n_ps

Definition at line 237 of file sc_list.c.

References NULL, Ssyslist::psys, sl_new(), and Ssyslist::succ.

Referenced by dj_append_system(), dj_empty(), dj_intersect_system_ofl_ctrl(), dj_intersection_ofl_ctrl(), dj_simple_inegs_to_eg(), dj_system_complement(), pa_convex_hull_equals_union_p_ofl_ctrl(), pa_inclusion_p_ofl_ctrl(), pa_intersect_complement(), pa_path_to_disjunct_ofl_ctrl(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), pa_supress_same_constraints(), pa_system_difference_ofl_ctrl(), sl_append_system_first(), sl_dup(), and sl_dup1().

00240 {
00241   Psyslist ret_sl;
00242   
00243   if (in_ps == NULL) return( in_sl );
00244   ret_sl = sl_new(); ret_sl->psys = in_ps; ret_sl->succ = in_sl;
00245   return( ret_sl );
00246 }

Here is the call graph for this function:

Here is the caller graph for this function:

Psyslist sl_append_system_first ( Psyslist  ,
Psysteme   
)

Psyslist sl_append_system_first( in_sl, in_ps ) AL 23/03/95 A new Psyslist with in_ps at the end of in_sl (sharing).

Definition at line 253 of file sc_list.c.

References NULL, sl_append_system(), SL_NULL, and Ssyslist::succ.

Referenced by slx_parse().

00256 {
00257   Psyslist new_sl = SL_NULL, sl = SL_NULL;
00258   
00259   if (in_ps == NULL) return( in_sl );
00260   new_sl = sl_append_system(NULL, in_ps);
00261   if (in_sl == SL_NULL) return new_sl; 
00262   if (in_sl->succ == NULL) { in_sl->succ = new_sl ; return in_sl; }
00263   for(sl = in_sl; (sl->succ != NULL); sl = sl->succ) {}
00264   sl->succ = new_sl;
00265   return( in_sl );
00266 }

Here is the call graph for this function:

Here is the caller graph for this function:

Psyslist sl_dup ( Psyslist  in_sl  ) 

Psyslist sl_dup( (Psyslist) in_sl ) AL 15/11/93 w - 1 duplication : everything is duplicated, except entities.

Duplicates input syslist.

Parameters:
in_sl n_sl

Definition at line 293 of file sc_list.c.

References NULL, Ssyslist::psys, sc_dup(), sl_append_system(), SL_NULL, and Ssyslist::succ.

Referenced by dj_dup(), pa_dup(), pa_intersect_complement(), pa_intersect_system(), and pa_path_to_few_disjunct_ofl_ctrl().

00295 {
00296   Psyslist  sl, ret_sl = SL_NULL;
00297   for( sl = in_sl; sl != NULL; sl = sl->succ ) {
00298     ret_sl = sl_append_system( ret_sl, sc_dup( sl->psys ) );
00299   }
00300   return ret_sl;
00301 }

Here is the call graph for this function:

Here is the caller graph for this function: