
%%%%%%%%%%%%%%%%%%%%
IMPLEMENTATION:
The algorithm is based on the paper: "D. Kapur, Y.Sun and D.K. Wang: An Efficient Algorithm for Computing a Comprehensive Groebner System of a Parametric Polynomial Systems. Journal of Symbolic Computation 49 (2013) 27–44".

The algorithms are implemented by Fanghui Xiao (xiaofanghui@amss.ac.cn).


%%%%%%%%%%%%%%%%%%%%
PROCEDURES:

1. The PCGS and MCGS.txt file contains the algorithms for computing a comprehensive Groebner system, which contains two parts (Part 1:  CGS algorithm for parametric polynomials; Part 2: CGS algorithm for modules over the parametric polynomial ring).

2. The CheckCGS.txt contains the codes of verifying whether the union of the partition for the parameter space by CGS algorithm is a whole parameter space, when among the input of CGS algorithm, Equ_set={}, DisEqu_set={1}.  

MAIN FUNCTION:  
1. CGS_main ---- compute the comprehensive Groebner system of an ideal genrated by parametric polynomials

2. ModuleCGS --- compute CGS for modules by call the CGS algorithm for parametric polynomials

3. CheckCGS-- verify whether the union of the parameter space partition by CGS algorithm is a whole parameter space

CALLING SEQUENCE:
1.1 CGS_main(Equ_set,DisEqu_set,poly_set,Var_set,Para_set,VarOrder,ParaOrder)
1.2 IdealCGB(Equ_set,DisEqu_set,poly_set,Var_set,Para_set,VarOrder,ParaOrder)

2.1 ModuleCGS(Equ_set, DisEqu_set, Vectors_set, Position_set, NewVar_set, Para_set, ModOrder, ParaOrder) 
2.2 ModuleCGB(Equ_set, DisEqu_set, Vectors_set, Position_set, NewVar_set, Para_set, ModOrder, ParaOrder) 

3. CheckCGS(C)

PARAMETERS:
Equ_set -- a set of polynomials in parameters (equality constraints) 
DisEqu_set -- a set of polynomials in parameters (inequality constraints)
poly_set --  a set of  polynomials  in variables and parameters
Var_set --  a set of  variables   
Para_set -- a set of parameters
VarOrder -- a monomial order w.r.t. variables
ParaOrder -- a monomial order w.r.t. parameters 

Vectors_set --  a set of vectors in a module on normal variables and parameters 
Position_set --   a set of position variables  (or called the placeholder variables)
NewVar_set --  a set of normal variables and position variables
ModOrder -- a module order w.r.t. normal variables and positions variables 


IMPORTANT NOTE:  Position_set is a set of position variables  (or called the placeholder variables) which are regarded as  variable symbol of the standard unit vector and denoted by "e[i]".  That is ,Position_set:={e[1],e[2],...,e[n]}. 
e[1]=(1,0,...,0), e[2]=(0,1,....,0), e[n]=(0,0,...,1). 

C -- a finite set of 3-tuples [E_i, N_i, G_i] (the output of the CGS_main function or ModuleCGS function)

OUTPUT:
1. a finite set of 3-tuples (E_i, N_i, G_i) such that {(V(E_i)\V(N_i), G_i)} constitutes a minimal comprehensive Groebner system of "poly_set" on " V(Equ_set) \ V(DisEqu_set) ", where V(E_i) and V(N_i) are the varieties defined by E_i and N_i, respectively, and E_i and N_i are the sets of polynomials in the parameters, V(E_i)\V(N_i) is a constructiable set defined by [E_i, N_i].

2. a finite set of 3-tuples (E_i, N_i, G_i) such that {(V(E_i)\V(N_i), G_i)} constitutes a minimal comprehensive Groebner system of "Vectors_set" on " V(Equ_set) \ V(DisEqu_set) ", where V(E_i) and V(N_i) are the varieties defined by E_i and N_i, respectively, and E_i and N_i are the sets of polynomials in the parameters, V(E_i)\V(N_i) is a constructiable set defined by [E_i, N_i].

3. false/true (if the union of all V(E_i)\V(N_i) are the whole parameter space, it is true).

#####the difference between the output  of CGS and CGB
### The output polynomial in CGB must be in the ideal generated by the input parametric polynomial (vector) system. 
####The output polynomial in CGS  are not necessarily in the ideal (module) generated  by the input parametric polynomial (vector) system. 


