% from 18.3.1992 hk
% user packages, d- and e- groebner bases 

\section{Polynomial rings over Euclidean domains} %----------

The standard theory of Gr\"obner bases relies heavily on the 
fact, that the polynomial ring is a ring over a field. 
If this field condition is dropped to only euclidean domains or 
even principal ideal domains it can be shown that there 
still exist ideal bases with properties like that of Gr\"obner bases. 
For an introduction into the theory and further references 
see \cite{Becker93} chapter 10.1.   
The programs were implemented by \cite{Mark92}.


\subsection{Examples} %-------------------------------------

The algorithms for D- and E-Gr\"obner bases are located in the 
program modules `\verb/DIPIDGB/' and `\verb/DIPDDGB/'. 
The main programs for the computation of E-Gr\"obner bases are 
`\verb/DIIPEGB/' for the base coefficient ring of the integers 
and `\verb/DIDPEGB/' for the base coefficient ring of 
rational univariate polynomials.  
Both procedures take two inputs: 
first the polynomial list and second a trace flag. 
If the trace flag is equal to \verb/0/, then no intermediate 
output is generated;  
if the trace flag is greater than \verb/0/, say \verb/n/, 
then after the \verb/n/-th G- or S-polynomial has been computed 
statistics output is generated. 

The first example shows the computation of an E-Gr\"obner base 
over the coefficient domain of integers, i.e. 
the computation takes place in the polynomial ring 
$\Z \lbrack X, Y \rbrack$. 
The integral polynomial list read function is 
`\verb/PREADI/', the syntax is similar to 
the syntax of the `\verb/PREAD/' function 
as described in \ref{poly.ebnf}. 
The input looks as follows.
  
{\footnotesize %-------------------------
\begin{verbatim} 
       BEGIN CLOUT("Computing integer E-Groebner base ... ");
             BLINES(1);
             P:=PREADI();
             CLOUT("The input polynomials are: ");
             BLINES(1);
             PWRITEI(P);
             Q:=DIIPEGB(P,1000);
             CLOUT("The E-Groebner base is: ");
             BLINES(1);
             PWRITEI(Q);
             CLOUT(" ... finished.");
             BLINES(1);
             END.
       
       (X,Y) L
       (
           ( Y**6 + X**4 Y**4 - X**2 Y**4 - Y**4 - X**4 Y**2 
             + 2 X**2 Y**2 + X**6 - X**4 ),
           ( 2 X**3 Y**4 - X Y**4 - 2 X**3 Y**2 + 2 X Y**2 
             + 3 X**5 - 2 X**3 ),
           ( 3 Y**5 + 2 X**4 Y**3 - 2 X**2 Y**3 - 2 Y**3 
             - X**4 Y + 2 X**2 Y )
       )
\end{verbatim}
}

The following output shows first the input polynomials. 
Then it shows the intermediate statistics after each $1000$ 
G- respectively S-polynomials, together with the effect of 
several criterions used to avoid unnecessary reductions. 
Finaly the resulting E-Gr\"obner base is displayed. 

{\footnotesize %-------------------------
\begin{verbatim} 
       Computing integer E-Groebner base ... 
       The input polynomials are:  
       Polynomial in the variables: (X,Y) 
       Term ordering:  inverse lexicographical. 
       Polynomial list: 
                 (  Y**6 + X**4 Y**4 - X**2 Y**4 - Y**4 - X**4 Y**2
                  +2 X**2 Y**2 + X**6 - X**4 )
                 ( 2 X**3 Y**4 - X Y**4 -2 X**3 Y**2 +2 X Y**2 +3 X
                 **5 -2 X**3 )
                 ( 3 Y**5 +2 X**4 Y**3 -2 X**2 Y**3 -2 Y**3 - X**4 
                 Y +2 X**2 Y )
        
       Number of computed G-polynomials: 1000
       Cancelled due to criterion 1: 651
       Cancelled due to top-D-reducibility: 332
       New polynomials added to G: 17
       Number of critical pairs in D: 47
       Number of critical pairs in C: 81
        
       Number of computed G-polynomials: 2000
       Cancelled due to criterion 1: 1134
       Cancelled due to top-D-reducibility: 845
       New polynomials added to G: 21
       Number of critical pairs in D: 129
       Number of critical pairs in C: 16
        
       Number of computed S-polynomials: 1000
       Cancelled due to criterion 2: 0
       Cancelled due to criterion 3: 441
       New polynomials added to G: 43
       Number of critical pairs in B: 1346
       Number of critical pairs in C: 0
        
       ...
        
       Number of computed S-polynomials: 7000
       Cancelled due to criterion 2: 53
       Cancelled due to criterion 3: 4455
       New polynomials added to G: 75
       Number of critical pairs in B: 260
       Number of critical pairs in C: 0
        
       Number of computed G-polynomials: 7875
       Cancelled due to criterion 1: 5415
       Cancelled due to top-D-reducibility: 2416
       Number of computed S-polynomials: 7875
       Cancelled due to criterion 2: 139
       Cancelled due to criterion 3: 4956
        
       Number of polynomials in G before reduction: 126
       Number of polynomials in G after reduction: 8
        
       The E-Groebner base is: 
        
       Polynomial in the variables: (X,Y) 
       Term ordering:  inverse lexicographical. 
       Polynomial list: 
                 ( 2 X Y**2 + X**13 -2 X**11 + X**9 +2 X**7 -2 X**3
                  )
                 (  X**15 -2 X**11 +4 X**9 )
                 ( 4 X**11 Y -8 X**9 Y +8 X**7 Y )
                 (  X**13 Y -2 X**9 Y +4 X**7 Y )
                 (  Y**4 + X**12 -3 X**10 +3 X**8 - X**4 )
                 ( 2 Y**3 -2 X**10 Y +3 X**8 Y -2 X**6 Y -2 X**2 Y 
                 )
                 (  X**8 Y**2 + X**10 -2 X**8 )
                 ( 2 X**12 -4 X**10 +4 X**8 )
       
       Time: read = 3, eval = 11303, print = 1, gc = 1816.
\end{verbatim}
}
The computing time is $113$ seconds on an IBM RS6000-520. 

The second example shows the computation of an E-Gr\"obner base 
over the coefficient domain of rational univariate polynomials. 
More precisely the computation takes place in the polynomial ring 
$$
  \Q \lbrack B \rbrack \lbrack S, T, Z, P, W \rbrack. 
$$

The domain descriptor read and polynomial read functions 
`\verb/ADDDREAD/' and `\verb/DILRD/' are used as described in the 
section \ref{adip.alg} on the arbitrary domain system. 
The input looks as follows. 

{\footnotesize %-------------------------
\begin{verbatim} 
       BEGIN CLOUT("Computing domain rational polynomial E-Groebner base ...");
             BLINES(1);
             DP:=ADDDREAD(); ADDDWRIT(DP);
             V:=LIST("S","T","Z","P","W"); t:=DIPTODEF(2);
             P:=DILRD(V,DP); 
             CLOUT("The input polynomials are: ");
             BLINES(1);
             DILWR(P,V);
             Q:=DIDPEGB(P,DP,10);
             CLOUT("The E-Groebner base is: "); BLINES(1);
             DILWR(Q,V);
             CLOUT(" ... finished.");
             BLINES(1);
             DIPTODEF(t);
             END.
       
       RP(B)
       (
       ( (45) P + (35) S - (165 B) - (36) ),
       ( (35) P + (40) Z + (25) T - (27) S ),
       ( (15) W + (25) S P + (30) Z - (18) T - (165 B**2) ),
       ( - (9) W + (15) T P + (20) S Z ),
       ( P W + (2) T Z - (11 B**3) ),
       ( (99) W - (11 B) S + (3 B**2) )
       ( (B**2 + 33/50 B + 2673/10000) )
       )
\end{verbatim}
}

The output is as follows. 
For an explanation see the previous example. 

{\footnotesize %-------------------------
\begin{verbatim} 
       Computing domain rational polynomial E-Groebner base ... 
        
       RP(B) (* Rational Polynomial *) 
       
       The input polynomials are: 
        
       (  45  P + 35  S -( 165 B +36 ) ) 
       (  35  P + 40  Z + 25  T - 27  S ) 
       (  15  W + 25  S P + 30  Z - 18  T - 165 B**2  ) 
       (  -9  W + 15  T P + 20  S Z ) 
       (  P W + 2  T Z - 11 B**3  ) 
       (  99  W - 11 B  S + 3 B**2  ) 
        (  B**2 +33/50 B +2673/10000 ) 
        
       Number of computed G-polynomials: 10
       Cancelled due to criterion 1: 10
       Cancelled due to top-D-reducibility: 0
       New polynomials added to G: 0
       Number of critical pairs in D: 0
       Number of critical pairs in C: 11
        
       ...
        
       Number of computed S-polynomials: 100
       Cancelled due to criterion 2: 75
       Cancelled due to criterion 3: 0
       New polynomials added to G: 6
       Number of critical pairs in B: 5
       Number of critical pairs in C: 0
        
       Number of computed G-polynomials: 105
       Cancelled due to criterion 1: 102
       Cancelled due to top-D-reducibility: 1
       Number of computed S-polynomials: 105
       Cancelled due to criterion 2: 80
       Cancelled due to criterion 3: 0
        
       Number of polynomials in G before reduction: 15
       Number of polynomials in G after reduction: 6
        
       The E-Groebner base is: 
        
        (  B**2 +33/50 B +2673/10000 )  
       (  15  W +( 19/8 B +3969/4000 ) ) 
       (  45  P -( 155/2 B +1377/40 ) ) 
       (  -1800  Z -( 2450 B +10287/10 ) ) 
       (  -43659/20  T +( 538461/100 B -1178793/5000 ) ) 
       (  S -( 5/2 B +9/200 ) )
        
       Time: read = 7, eval = 471, print = 0, gc = 355.
\end{verbatim}
}
The computing time is approximately $5$ seconds on an IBM RS6000-520. 


%\section{} %----------

%{\footnotesize %-------------------------
%\begin{verbatim} 
%\end{verbatim}
%}
%{\footnotesize %-------------------------
%\begin{verbatim} 
%\end{verbatim}
%}
