[BACK]Return to groebner.texi CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-doc / parts

Annotation of OpenXM/src/asir-doc/parts/groebner.texi, Revision 1.4

1.4     ! noro        1: @comment $OpenXM: OpenXM/src/asir-doc/parts/groebner.texi,v 1.3 1999/12/24 04:38:04 noro Exp $
1.2       noro        2: \BJP
1.1       noro        3: @node $B%0%l%V%J4pDl$N7W;;(B,,, Top
                      4: @chapter $B%0%l%V%J4pDl$N7W;;(B
1.2       noro        5: \E
                      6: \BEG
                      7: @node Groebner basis computation,,, Top
                      8: @chapter Groebner basis computation
                      9: \E
1.1       noro       10:
                     11: @menu
1.2       noro       12: \BJP
1.1       noro       13: * $BJ,;6I=8=B?9`<0(B::
                     14: * $B%U%!%$%k$NFI$_9~$_(B::
                     15: * $B4pK\E*$JH!?t(B::
                     16: * $B7W;;$*$h$SI=<($N@)8f(B::
                     17: * $B9`=g=x$N@_Dj(B::
                     18: * $BM-M}<0$r78?t$H$9$k%0%l%V%J4pDl7W;;(B::
                     19: * $B4pDlJQ49(B::
                     20: * $B%0%l%V%J4pDl$K4X$9$kH!?t(B::
1.2       noro       21: \E
                     22: \BEG
                     23: * Distributed polynomial::
                     24: * Reading files::
                     25: * Fundamental functions::
                     26: * Controlling Groebner basis computations::
                     27: * Setting term orderings::
                     28: * Groebner basis computation with rational function coefficients::
                     29: * Change of ordering::
                     30: * Functions for Groebner basis computation::
                     31: \E
1.1       noro       32: @end menu
                     33:
1.2       noro       34: \BJP
1.1       noro       35: @node $BJ,;6I=8=B?9`<0(B,,, $B%0%l%V%J4pDl$N7W;;(B
                     36: @section $BJ,;6I=8=B?9`<0(B
1.2       noro       37: \E
                     38: \BEG
                     39: @node Distributed polynomial,,, Groebner basis computation
                     40: @section Distributed polynomial
                     41: \E
1.1       noro       42:
                     43: @noindent
1.2       noro       44: \BJP
1.1       noro       45: $BJ,;6I=8=B?9`<0$H$O(B, $BB?9`<0$NFbIt7A<0$N0l$D$G$"$k(B. $BDL>o$NB?9`<0(B
                     46: (@code{type} $B$,(B 2) $B$O(B, $B:F5"I=8=$H8F$P$l$k7A<0$GI=8=$5$l$F$$$k(B. $B$9$J$o(B
                     47: $B$A(B, $BFCDj$NJQ?t$r<gJQ?t$H$9$k(B 1 $BJQ?tB?9`<0$G(B, $B$=$NB>$NJQ?t$O(B, $B$=$N(B 1 $BJQ(B
                     48: $B?tB?9`<0$N78?t$K(B, $B<gJQ?t$r4^$^$J$$B?9`<0$H$7$F8=$l$k(B. $B$3$N78?t$,(B, $B$^$?(B,
                     49: $B$"$kJQ?t$r<gJQ?t$H$9$kB?9`<0$H$J$C$F$$$k$3$H$+$i:F5"I=8=$H8F$P$l$k(B.
1.2       noro       50: \E
                     51: \BEG
                     52: A distributed polynomial is a polynomial with a special internal
                     53: representation different from the ordinary one.
                     54:
                     55: An ordinary polynomial (having @code{type} 2) is internally represented
                     56: in a format, called recursive representation.
                     57: In fact, it is represented as an uni-variate polynomial with respect to
                     58: a fixed variable, called main variable of that polynomial,
                     59: where the other variables appear in the coefficients which may again
                     60: polynomials in such variables other than the previous main variable.
                     61: A polynomial in the coefficients is again represented as
                     62: an uni-variate polynomial in a certain fixed variable,
                     63: the main variable.  Thus, by this recursive structure of polynomial
                     64: representation, it is called the `recursive representation.'
                     65: \E
1.1       noro       66:
                     67: @iftex
                     68: @tex
1.2       noro       69: \JP $(x+y+z)^2 = 1 \cdot x^2 + (2 \cdot y + (2 \cdot z)) \cdot x + ((2 \cdot z) \cdot y + (1 \cdot z^2 ))$
                     70: \EG $(x+y+z)^2 = 1 \cdot x^2 + (2 \cdot y + (2 \cdot z)) \cdot x + ((2 \cdot z) \cdot y + (1 \cdot z^2 ))$
1.1       noro       71: @end tex
                     72: @end iftex
                     73: @ifinfo
                     74: @example
                     75: (x+y+z)^2 = 1 x^2 + (2 y + (2 z)) x + ((2 z) y + (1 z^2 ))
                     76: @end example
                     77: @end ifinfo
                     78:
                     79: @noindent
1.2       noro       80: \BJP
1.1       noro       81: $B$3$l$KBP$7(B, $BB?9`<0$r(B, $BJQ?t$NQQ@Q$H78?t$N@Q$NOB$H$7$FI=8=$7$?$b$N$rJ,;6(B
                     82: $BI=8=$H8F$V(B.
1.2       noro       83: \E
                     84: \BEG
                     85: On the other hand,
                     86: we call a representation the distributed representation of a polynomial,
                     87: if a polynomial is represented, according to its original meaning,
                     88: as a sum of monomials,
                     89: where a monomial is the product of power product of variables
                     90: and a coefficient.  We call a polynomial, represented in such an
                     91: internal format, a distributed polynomial. (This naming may sounds
                     92: something strange.)
                     93: \E
1.1       noro       94:
                     95: @iftex
                     96: @tex
1.2       noro       97: \JP $(x+y+z)^2 = 1 \cdot x^2 + 2 \cdot xy + 2 \cdot xz + 1 \cdot y^2 + 2 \cdot yz +1 \cdot z^2$
                     98: \EG $(x+y+z)^2 = 1 \cdot x^2 + 2 \cdot xy + 2 \cdot xz + 1 \cdot y^2 + 2 \cdot yz +1 \cdot z^2$
1.1       noro       99: @end tex
                    100: @end iftex
                    101: @ifinfo
                    102: @example
                    103: (x+y+z)^2 = 1 x^2 + 2 xy + 2 xz + 1 y^2 + 2 yz +1 z^2$
                    104: @end example
                    105: @end ifinfo
                    106:
                    107: @noindent
1.2       noro      108: \BJP
1.1       noro      109: $B%0%l%V%J4pDl7W;;$K$*$$$F$O(B, $BC19`<0$KCmL\$7$FA`:n$r9T$&$?$aB?9`<0$,J,;6I=8=(B
                    110: $B$5$l$F$$$kJ}$,$h$j8zN($N$h$$1i;;$,2DG=$K$J$k(B. $B$3$N$?$a(B, $BJ,;6I=8=B?9`<0$,(B,
                    111: $B<1JL;R(B 9 $B$N7?$H$7$F(B @b{Asir} $B$N%H%C%W%l%Y%k$+$iMxMQ2DG=$H$J$C$F$$$k(B.
                    112: $B$3$3$G(B, $B8e$N@bL@$N$?$a$K(B, $B$$$/$D$+$N8@MU$rDj5A$7$F$*$/(B.
1.2       noro      113: \E
                    114: \BEG
                    115: For computation of Groebner basis, efficient operation is expected if
                    116: polynomials are represented in a distributed representation,
                    117: because major operations for Groebner basis are performed with respect
                    118: to monomials.
                    119: From this view point, we provide the object type distributed polynomial
                    120: with its object identification number 9, and objects having such a type
                    121: are available by @b{Asir} language.
                    122:
                    123: Here, we provide several definitions for the later description.
                    124: \E
1.1       noro      125:
                    126: @table @b
1.2       noro      127: \BJP
1.1       noro      128: @item $B9`(B (term)
                    129: $BJQ?t$NQQ@Q(B. $B$9$J$o$A(B, $B78?t(B 1 $B$NC19`<0$N$3$H(B. @b{Asir} $B$K$*$$$F$O(B,
1.2       noro      130: \E
                    131: \BEG
                    132: @item term
                    133: The power product of variables, i.e., a monomial with coefficient 1.
                    134: In an @b{Asir} session, it is displayed in the form like
                    135: \E
1.1       noro      136:
                    137: @example
                    138: <<0,1,2,3,4>>
                    139: @end example
                    140:
1.2       noro      141: \BJP
1.1       noro      142: $B$H$$$&7A$GI=<($5$l(B, $B$^$?(B, $B$3$N7A$GF~NO2DG=$G$"$k(B. $B$3$NNc$O(B, 5 $BJQ?t$N9`(B
                    143: $B$r<($9(B. $B3FJQ?t$r(B @code{a}, @code{b}, @code{c}, @code{d}, @code{e} $B$H$9$k$H(B
                    144: $B$3$N9`$O(B @code{b*c^2*d^3*e^4} $B$rI=$9(B.
1.2       noro      145: \E
                    146: \BEG
                    147: and also can be input in such a form.
                    148: This example shows a term in 5 variables.  If we assume the 5 variables
                    149: as @code{a}, @code{b}, @code{c}, @code{d}, and @code{e},
                    150: the term represents @code{b*c^2*d^3*e^4} in the ordinary expression.
                    151: \E
1.1       noro      152:
1.2       noro      153: \BJP
1.1       noro      154: @item $B9`=g=x(B (term order)
                    155: $BJ,;6I=8=B?9`<0$K$*$1$k9`$O(B, $B<!$N@-<A$rK~$?$9A4=g=x$K$h$j@0Ns$5$l$k(B.
1.2       noro      156: \E
                    157: \BEG
                    158: @item term order
                    159: Terms are ordered according to a total order with the following properties.
                    160: \E
1.1       noro      161:
                    162: @enumerate
                    163: @item
1.2       noro      164: \JP $BG$0U$N9`(B @code{t} $B$KBP$7(B @code{t} > 1
                    165: \EG For all @code{t} @code{t} > 1.
1.1       noro      166:
                    167: @item
1.2       noro      168: \JP @code{t}, @code{s}, @code{u} $B$r9`$H$9$k;~(B, @code{t} > @code{s} $B$J$i$P(B @code{tu} > @code{su}
                    169: \EG For all @code{t}, @code{s}, @code{u} @code{t} > @code{s} implies @code{tu} > @code{su}.
1.1       noro      170: @end enumerate
                    171:
1.2       noro      172: \BJP
1.1       noro      173: $B$3$N@-<A$rK~$?$9A4=g=x$r9`=g=x$H8F$V(B. $B$3$N=g=x$OJQ?t=g=x(B ($BJQ?t$N%j%9%H(B)
                    174: $B$H9`=g=x7?(B ($B?t(B, $B%j%9%H$^$?$O9TNs(B) $B$K$h$j;XDj$5$l$k(B.
1.2       noro      175: \E
                    176: \BEG
                    177: Such a total order is called a term ordering. A term ordering is specified
                    178: by a variable ordering (a list of variables) and a type of term ordering
                    179: (an integer, a list or a matrix).
                    180: \E
1.1       noro      181:
1.2       noro      182: \BJP
1.1       noro      183: @item $BC19`<0(B (monomial)
                    184: $B9`$H78?t$N@Q(B.
1.2       noro      185: \E
                    186: \BEG
                    187: @item monomial
                    188: The product of a term and a coefficient.
                    189: In an @b{Asir} session, it is displayed in the form like
                    190: \E
1.1       noro      191:
                    192: @example
                    193: 2*<<0,1,2,3,4>>
                    194: @end example
                    195:
1.2       noro      196: \JP $B$H$$$&7A$GI=<($5$l(B, $B$^$?(B, $B$3$N7A$GF~NO2DG=$G$"$k(B.
                    197: \EG and also can be input in such a form.
1.1       noro      198:
1.2       noro      199: \BJP
1.1       noro      200: @itemx $BF,C19`<0(B (head monomial)
                    201: @item $BF,9`(B (head term)
                    202: @itemx $BF,78?t(B (head coefficient)
                    203: $BJ,;6I=8=B?9`<0$K$*$1$k3FC19`<0$O(B, $B9`=g=x$K$h$j@0Ns$5$l$k(B. $B$3$N;~=g(B
                    204: $B=x:GBg$NC19`<0$rF,C19`<0(B, $B$=$l$K8=$l$k9`(B, $B78?t$r$=$l$>$lF,9`(B, $BF,78?t(B
                    205: $B$H8F$V(B.
1.2       noro      206: \E
                    207: \BEG
                    208: @itemx head monomial
                    209: @item head term
                    210: @itemx head coefficient
                    211:
                    212: Monomials in a distributed polynomial is sorted by a total order.
                    213: In such representation, we call the monomial that is maximum
                    214: with respect to the order the head monomial, and its term and coefficient
                    215: the head term and the head coefficient respectively.
                    216: \E
1.1       noro      217: @end table
                    218:
1.2       noro      219: \BJP
1.1       noro      220: @node $B%U%!%$%k$NFI$_9~$_(B,,, $B%0%l%V%J4pDl$N7W;;(B
                    221: @section $B%U%!%$%k$NFI$_9~$_(B
1.2       noro      222: \E
                    223: \BEG
                    224: @node Reading files,,, Groebner basis computation
                    225: @section Reading files
                    226: \E
1.1       noro      227:
                    228: @noindent
1.2       noro      229: \BJP
1.1       noro      230: $B%0%l%V%J4pDl$r7W;;$9$k$?$a$N4pK\E*$JH!?t$O(B @code{dp_gr_main()} $B$*$h$S(B
                    231: @code{dp_gr_mod_main()} $B$J$k(B 2 $B$D$NAH$_9~$_H!?t$G$"$k$,(B, $BDL>o$O(B, $B%Q%i%a%?(B
                    232: $B@_Dj$J$I$r9T$C$?$N$A$3$l$i$r8F$S=P$9%f!<%6H!?t$rMQ$$$k$N$,JXMx$G$"$k(B.
                    233: $B$3$l$i$N%f!<%6H!?t$O(B, $B%U%!%$%k(B @samp{gr} $B$r(B @code{load()} $B$K$h$jFI(B
                    234: $B$_9~$`$3$H$K$h$j;HMQ2DG=$H$J$k(B. @samp{gr} $B$O(B, @b{Asir} $B$NI8=`(B
                    235: $B%i%$%V%i%j%G%#%l%/%H%j$KCV$+$l$F$$$k(B. $B$h$C$F(B, $B4D6-JQ?t(B @code{ASIR_LIBDIR}
                    236: $B$rFC$K0[$J$k%Q%9$K@_Dj$7$J$$8B$j(B, $B%U%!%$%kL>$N$_$GFI$_9~$`$3$H$,$G$-$k(B.
1.2       noro      237: \E
                    238: \BEG
                    239: Facilities for computing Groebner bases are provided not by built-in
                    240: functions but by a set of user functions written in @b{Asir}.
                    241: The set of functions is provided as a file (sometimes called package),
                    242: named @samp{gr}.
                    243: The facilities will be ready to use after you load the package by
                    244: @code{load()}.  The package @samp{gr} is placed in the standard library
                    245: directory of @b{Asir}.  Therefore, it is loaded simply by specifying
                    246: its file name, unless the environment variable @code{ASIR_LIBDIR}
                    247: is set to a non-standard one.
                    248: \E
1.1       noro      249:
                    250: @example
                    251: [0] load("gr")$
                    252: @end example
                    253:
1.2       noro      254: \BJP
1.1       noro      255: @node $B4pK\E*$JH!?t(B,,, $B%0%l%V%J4pDl$N7W;;(B
                    256: @section $B4pK\E*$JH!?t(B
1.2       noro      257: \E
                    258: \BEG
                    259: @node Fundamental functions,,, Groebner basis computation
                    260: @section Fundamental functions
                    261: \E
1.1       noro      262:
                    263: @noindent
1.2       noro      264: \BJP
1.1       noro      265: @samp{gr} $B$G$O?tB?$/$NH!?t$,Dj5A$5$l$F$$$k$,(B, $BD>@\(B
                    266: $B%0%l%V%J4pDl$r7W;;$9$k$?$a$N%H%C%W%l%Y%k$O<!$N(B 3 $B$D$G$"$k(B.
                    267: $B0J2<$G(B, @var{plist} $B$OB?9`<0$N%j%9%H(B, @var{vlist} $B$OJQ?t(B ($BITDj85(B) $B$N%j%9%H(B,
                    268: @var{order} $B$OJQ?t=g=x7?(B, @var{p} $B$O(B @code{2^27} $BL$K~$NAG?t$G$"$k(B.
1.2       noro      269: \E
                    270: \BEG
                    271: There are many functions and options defined in the package @samp{gr}.
                    272: Usually not so many of them are used.  Top level functions for Groebner
                    273: basis computation are the following three functions.
                    274:
                    275: In the following description, @var{plist}, @var{vlist}, @var{order}
                    276: and @var{p} stand for  a list of polynomials,  a list of variables
                    277: (indeterminates), a type of term ordering and a prime less than
                    278: @code{2^27} respectively.
                    279: \E
1.1       noro      280:
                    281: @table @code
                    282: @item gr(@var{plist},@var{vlist},@var{order})
                    283:
1.2       noro      284: \BJP
1.1       noro      285: Gebauer-Moeller $B$K$h$k(B useless pair elimination criteria, sugar
                    286: strategy $B$*$h$S(B Traverso $B$K$h$k(B trace-lifting $B$rMQ$$$?(B Buchberger $B%"%k(B
                    287: $B%4%j%:%`$K$h$kM-M}?t78?t%0%l%V%J4pDl7W;;H!?t(B. $B0lHL$K$O$3$NH!?t$rMQ$$$k(B.
1.2       noro      288: \E
                    289: \BEG
                    290: Function that computes Groebner bases over the rationals. The
                    291: algorithm is Buchberger algorithm with useless pair elimination
                    292: criteria by Gebauer-Moeller, sugar strategy and trace-lifting by
                    293: Traverso. For ordinary computation, this function is used.
                    294: \E
1.1       noro      295:
                    296: @item hgr(@var{plist},@var{vlist},@var{order})
                    297:
1.2       noro      298: \BJP
1.1       noro      299: $BF~NOB?9`<0$r@F<!2=$7$?8e(B @code{gr()} $B$N%0%l%V%J4pDl8uJd@8@.It$K$h$j8u(B
                    300: $BJd@8@.$7(B, $BHs@F<!2=(B, interreduce $B$7$?$b$N$r(B @code{gr()} $B$N%0%l%V%J4pDl(B
                    301: $B%A%'%C%/It$G%A%'%C%/$9$k(B. 0 $B<!85%7%9%F%`(B ($B2r$N8D?t$,M-8B8D$NJ}Dx<07O(B)
                    302: $B$N>l9g(B, sugar strategy $B$,78?tKDD%$r0z$-5/$3$9>l9g$,$"$k(B. $B$3$N$h$&$J>l(B
                    303: $B9g(B, strategy $B$r@F<!2=$K$h$k(B strategy $B$KCV$-49$($k$3$H$K$h$j78?tKDD%$r(B
                    304: $BM^@)$9$k$3$H$,$G$-$k>l9g$,B?$$(B.
1.2       noro      305: \E
                    306: \BEG
                    307: After homogenizing the input polynomials a candidate of the \gr basis
                    308: is computed by trace-lifting. Then the candidate is dehomogenized and
                    309: checked whether it is indeed a Groebner basis of the input.  Sugar
                    310: strategy often causes intermediate coefficient swells.  It is
                    311: empirically known that the combination of homogenization and supresses
                    312: the swells for such cases.
                    313: \E
1.1       noro      314:
                    315: @item gr_mod(@var{plist},@var{vlist},@var{order},@var{p})
                    316:
1.2       noro      317: \BJP
1.1       noro      318: Gebauer-Moeller $B$K$h$k(B useless pair elimination criteria, sugar
                    319: strategy $B$*$h$S(B Buchberger $B%"%k%4%j%:%`$K$h$k(B GF(p) $B78?t%0%l%V%J4pDl7W(B
                    320: $B;;H!?t(B.
1.2       noro      321: \E
                    322: \BEG
                    323: Function that computes Groebner bases over GF(@var{p}). The same
                    324: algorithm as @code{gr()} is used.
                    325: \E
1.1       noro      326:
                    327: @end table
                    328:
1.2       noro      329: \BJP
1.1       noro      330: @node $B7W;;$*$h$SI=<($N@)8f(B,,, $B%0%l%V%J4pDl$N7W;;(B
                    331: @section $B7W;;$*$h$SI=<($N@)8f(B
1.2       noro      332: \E
                    333: \BEG
                    334: @node Controlling Groebner basis computations,,, Groebner basis computation
                    335: @section Controlling Groebner basis computations
                    336: \E
1.1       noro      337:
                    338: @noindent
1.2       noro      339: \BJP
1.1       noro      340: $B%0%l%V%J4pDl$N7W;;$K$*$$$F(B, $B$5$^$6$^$J%Q%i%a%?@_Dj$r9T$&$3$H$K$h$j7W;;(B,
                    341: $BI=<($r@)8f$9$k$3$H$,$G$-$k(B. $B$3$l$i$O(B, $BAH$_9~$_H!?t(B @code{dp_gr_flags()}
                    342: $B$K$h$j@_Dj;2>H$9$k$3$H$,$G$-$k(B. $BL50z?t$G(B @code{dp_gr_flags()} $B$r<B9T$9$k(B
                    343: $B$H(B, $B8=:_@_Dj$5$l$F$$$k%Q%i%a%?$,(B, $BL>A0$HCM$N%j%9%H$GJV$5$l$k(B.
1.2       noro      344: \E
                    345: \BEG
                    346: One can cotrol a Groebner basis computation by setting various parameters.
                    347: These parameters can be set and examined by a built-in function
                    348: @code{dp_gr_flags()}. Without argument it returns the current settings.
                    349: \E
1.1       noro      350:
                    351: @example
                    352: [100] dp_gr_flags();
                    353: [Demand,0,NoSugar,0,NoCriB,0,NoGC,0,NoMC,0,NoRA,0,NoGCD,0,Top,0,ShowMag,1,
                    354: Print,1,Stat,0,Reverse,0,InterReduce,0,Multiple,0]
                    355: [101]
                    356: @end example
                    357:
1.2       noro      358: \BJP
1.1       noro      359: $B0J2<$G(B, $B3F%Q%i%a%?$N0UL#$r@bL@$9$k(B. on $B$N>l9g$H$O(B, $B%Q%i%a%?$,(B 0 $B$G$J$$>l9g$r(B
                    360: $B$$$&(B. $B$3$l$i$N%Q%i%a%?$N=i4|CM$OA4$F(B 0 (off) $B$G$"$k(B.
1.2       noro      361: \E
                    362: \BEG
                    363: The return value is a list which contains the names of parameters and their
                    364: values. The meaning of the parameters are as follows. `on' means that the
                    365: parameter is not zero.
                    366: \E
1.1       noro      367:
                    368: @table @code
                    369: @item NoSugar
1.2       noro      370: \BJP
1.1       noro      371: on $B$N>l9g(B, sugar strategy $B$NBe$o$j$K(B Buchberger$B$N(B normal strategy $B$,MQ(B
                    372: $B$$$i$l$k(B.
1.2       noro      373: \E
                    374: \BEG
                    375: If `on', Buchberger's normal strategy is used instead of sugar strategy.
                    376: \E
1.1       noro      377:
                    378: @item NoCriB
1.2       noro      379: \JP on $B$N>l9g(B, $BITI,MWBP8!=P5,=`$N$&$A(B, $B5,=`(B B $B$rE,MQ$7$J$$(B.
                    380: \EG If `on', criterion B among the Gebauer-Moeller's criteria is not applied.
1.1       noro      381:
                    382: @item NoGC
1.2       noro      383: \JP on $B$N>l9g(B, $B7k2L$,%0%l%V%J4pDl$K$J$C$F$$$k$+$I$&$+$N%A%'%C%/$r9T$o$J$$(B.
                    384: \BEG
                    385: If `on', the check that a Groebner basis candidate is indeed a Groebner basis,
                    386: is not executed.
                    387: \E
1.1       noro      388:
                    389: @item NoMC
1.2       noro      390: \BJP
1.1       noro      391: on $B$N>l9g(B, $B7k2L$,F~NO%$%G%"%k$HF1Ey$N%$%G%"%k$G$"$k$+$I$&$+$N%A%'%C%/(B
                    392: $B$r9T$o$J$$(B.
1.2       noro      393: \E
                    394: \BEG
                    395: If `on', the check that the resulting polynomials generates the same ideal as
                    396: the ideal generated by the input, is not executed.
                    397: \E
1.1       noro      398:
                    399: @item NoRA
1.2       noro      400: \BJP
1.1       noro      401: on $B$N>l9g(B, $B7k2L$r(B reduced $B%0%l%V%J4pDl$K$9$k$?$a$N(B
                    402: interreduce $B$r9T$o$J$$(B.
1.2       noro      403: \E
                    404: \BEG
                    405: If `on', the interreduction, which makes the Groebner basis reduced, is not
                    406: executed.
                    407: \E
1.1       noro      408:
                    409: @item NoGCD
1.2       noro      410: \BJP
1.1       noro      411: on $B$N>l9g(B, $BM-M}<078?t$N%0%l%V%J4pDl7W;;$K$*$$$F(B, $B@8@.$5$l$?B?9`<0$N(B,
                    412: $B78?t$N(B content $B$r$H$i$J$$(B.
1.2       noro      413: \E
                    414: \BEG
                    415: If `on', content removals are not executed during a Groebner basis computation
                    416: over a rational function field.
                    417: \E
1.1       noro      418:
                    419: @item Top
1.2       noro      420: \JP on $B$N>l9g(B, normal form $B7W;;$K$*$$$FF,9`>C5n$N$_$r9T$&(B.
                    421: \EG If `on', Only the head term of the polynomial being reduced is reduced.
1.1       noro      422:
1.2       noro      423: @comment @item Interreduce
                    424: @comment \BJP
                    425: @comment on $B$N>l9g(B, $BB?9`<0$r@8@.$9$kKh$K(B, $B$=$l$^$G@8@.$5$l$?4pDl$r$=$NB?9`<0$K(B
                    426: @comment $B$h$k(B normal form $B$GCV$-49$($k(B.
                    427: @comment \E
                    428: @comment \BEG
                    429: @comment If `on', intermediate basis elements are reduced by using a newly generated
                    430: @comment basis element.
                    431: @comment \E
1.1       noro      432:
                    433: @item Reverse
1.2       noro      434: \BJP
1.1       noro      435: on $B$N>l9g(B, normal form $B7W;;$N:]$N(B reducer $B$r(B, $B?7$7$/@8@.$5$l$?$b$N$rM%(B
                    436: $B@h$7$FA*$V(B.
1.2       noro      437: \E
                    438: \BEG
                    439: If `on', the selection strategy of reducer in a normal form computation
                    440: is such that a newer reducer is used first.
                    441: \E
1.1       noro      442:
                    443: @item Print
1.2       noro      444: \JP on $B$N>l9g(B, $B%0%l%V%J4pDl7W;;$NESCf$K$*$1$k$5$^$6$^$J>pJs$rI=<($9$k(B.
                    445: \BEG
                    446: If `on', various informations during a Groebner basis computation is
                    447: displayed.
                    448: \E
1.1       noro      449:
                    450: @item Stat
1.2       noro      451: \BJP
1.1       noro      452: on $B$G(B @code{Print} $B$,(B off $B$J$i$P(B, @code{Print} $B$,(B on $B$N$H$-I=<($5(B
                    453: $B$l$k%G!<%?$NFb(B, $B=87W%G!<%?$N$_$,I=<($5$l$k(B.
1.2       noro      454: \E
                    455: \BEG
                    456: If `on', a summary of informations is shown after a Groebner basis
                    457: computation. Note that the summary is always shown if @code{Print} is `on'.
                    458: \E
1.1       noro      459:
                    460: @item ShowMag
1.2       noro      461: \BJP
1.1       noro      462: on $B$G(B @code{Print} $B$,(B on $B$J$i$P(B, $B@8@.$,@8@.$5$l$kKh$K(B, $B$=$NB?9`<0$N(B
                    463: $B78?t$N%S%C%HD9$NOB$rI=<($7(B, $B:G8e$K(B, $B$=$l$i$NOB$N:GBgCM$rI=<($9$k(B.
1.2       noro      464: \E
                    465: \BEG
                    466: If `on' and @code{Print} is `on', the sum of bit length of
                    467: coefficients of a generated basis element, which we call @var{magnitude},
                    468: is shown after every normal computation.  After comleting the
                    469: computation the maximal value among the sums is shown.
                    470: \E
1.1       noro      471:
                    472: @item Multiple
1.2       noro      473: \BJP
1.1       noro      474: 0 $B$G$J$$@0?t$N;~(B, $BM-M}?t>e$N@55,7A7W;;$K$*$$$F(B, $B78?t$N%S%C%HD9$NOB$,(B
                    475: @code{Multiple} $BG\$K$J$k$4$H$K78?tA4BN$N(B GCD $B$,7W;;$5$l(B, $B$=$N(B GCD $B$G(B
                    476: $B3d$C$?B?9`<0$r4JLs$9$k(B. @code{Multiple} $B$,(B 1 $B$J$i$P(B, $B4JLs$9$k$4$H$K(B
                    477: GCD $B7W;;$,9T$o$l0lHL$K$O8zN($,0-$/$J$k$,(B, @code{Multiple} $B$r(B 2 $BDxEY(B
                    478: $B$H$9$k$H(B, $B5pBg$J@0?t$,78?t$K8=$l$k>l9g(B, $B8zN($,NI$/$J$k>l9g$,$"$k(B.
1.2       noro      479: \E
                    480: \BEG
                    481: If a non-zero integer, in a normal form computation
                    482: over the rationals, the integer content of the polynomial being
                    483: reduced is removed when its magnitude becomes @code{Multiple} times
                    484: larger than a registered value, which is set to the magnitude of the
                    485: input polynomial. After each content removal the registered value is
                    486: set to the magnitude of the resulting polynomial. @code{Multiple} is
                    487: equal to 1, the simiplification is done after every normal form computation.
                    488: It is empirically known that it is often efficient to set @code{Multiple} to 2
                    489: for the case where large integers appear during the computation.
                    490: \E
1.1       noro      491:
                    492: @item Demand
1.2       noro      493:
                    494: \BJP
1.1       noro      495: $B@5Ev$J%G%#%l%/%H%jL>(B ($BJ8;zNs(B) $B$rCM$K;}$D$H$-(B, $B@8@.$5$l$?B?9`<0$O%a%b%j(B
                    496: $BCf$K$*$+$l$:(B, $B$=$N%G%#%l%/%H%jCf$K%P%$%J%j%G!<%?$H$7$FCV$+$l(B, $B$=$NB?9`(B
                    497: $B<0$rMQ$$$k(B normal form $B7W;;$N:](B, $B<+F0E*$K%a%b%jCf$K%m!<%I$5$l$k(B. $B3FB?(B
                    498: $B9`<0$O(B, $BFbIt$G$N%$%s%G%C%/%9$r%U%!%$%kL>$K;}$D%U%!%$%k$K3JG<$5$l$k(B.
                    499: $B$3$3$G;XDj$5$l$?%G%#%l%/%H%j$K=q$+$l$?%U%!%$%k$O<+F0E*$K$O>C5n$5$l$J$$(B
                    500: $B$?$a(B, $B%f!<%6$,@UG$$r;}$C$F>C5n$9$kI,MW$,$"$k(B.
1.2       noro      501: \E
                    502: \BEG
                    503: If the value (a character string) is a valid directory name, then
                    504: generated basis elements are put in the directory and are loaded on
                    505: demand during normal form computations.  Each elements is saved in the
                    506: binary form and its name coincides with the index internally used in
                    507: the computation. These binary files are not removed automatically
                    508: and one should remove them by hand.
                    509: \E
1.1       noro      510: @end table
                    511:
                    512: @noindent
1.2       noro      513: \JP @code{Print} $B$,(B 0 $B$G$J$$>l9g<!$N$h$&$J%G!<%?$,I=<($5$l$k(B.
                    514: \EG If @code{Print} is `on', the following informations are shown.
1.1       noro      515:
                    516: @example
                    517: [93] gr(cyclic(4),[c0,c1,c2,c3],0)$
                    518: mod= 99999989, eval = []
                    519: (0)(0)<<0,2,0,0>>(2,3),nb=2,nab=5,rp=2,sugar=2,mag=4
                    520: (0)(0)<<0,1,2,0>>(1,2),nb=3,nab=6,rp=2,sugar=3,mag=4
                    521: (0)(0)<<0,1,1,2>>(0,1),nb=4,nab=7,rp=3,sugar=4,mag=6
                    522: .
                    523: (0)(0)<<0,0,3,2>>(5,6),nb=5,nab=8,rp=2,sugar=5,mag=4
                    524: (0)(0)<<0,1,0,4>>(4,6),nb=6,nab=9,rp=3,sugar=5,mag=4
                    525: (0)(0)<<0,0,2,4>>(6,8),nb=7,nab=10,rp=4,sugar=6,mag=6
                    526: ....gb done
                    527: reduceall
                    528: .......
                    529: membercheck
                    530: (0,0)(0,0)(0,0)(0,0)
                    531: gbcheck total 8 pairs
                    532: ........
                    533: UP=(0,0)SP=(0,0)SPM=(0,0)NF=(0,0)NFM=(0.010002,0)ZNFM=(0.010002,0)PZ=(0,0)
                    534: NP=(0,0)MP=(0,0)RA=(0,0)MC=(0,0)GC=(0,0)T=40,B=0 M=8 F=6 D=12 ZR=5 NZR=6
                    535: Max_mag=6
                    536: [94]
                    537: @end example
                    538:
                    539: @noindent
1.2       noro      540: \BJP
1.1       noro      541: $B:G=i$KI=<($5$l$k(B @code{mod}, @code{eval} $B$O(B, trace-lifting $B$GMQ$$$i$l$kK!(B
                    542: $B$G$"$k(B. @code{mod} $B$OAG?t(B, @code{eval} $B$OM-M}<078?t$N>l9g$KMQ$$$i$l$k(B
                    543: $B?t$N%j%9%H$G$"$k(B.
1.2       noro      544: \E
                    545: \BEG
                    546: In this example @code{mod} and @code{eval} indicate moduli used in
                    547: trace-lifting. @code{mod} is a prime and @code{eval} is a list of integers
                    548: used for evaluation when the ground field is a field of rational functions.
                    549: \E
1.1       noro      550:
                    551: @noindent
1.2       noro      552: \JP $B7W;;ESCf$GB?9`<0$,@8@.$5$l$kKh$K<!$N7A$N%G!<%?$,I=<($5$l$k(B.
                    553: \EG The following information is shown after every normal form computation.
1.1       noro      554:
                    555: @example
                    556: (TNF)(TCONT)HT(INDEX),nb=NB,nab=NAB,rp=RP,sugar=S,mag=M
                    557: @end example
                    558:
                    559: @noindent
1.2       noro      560: \JP $B$=$l$i$N0UL#$O<!$NDL$j(B.
                    561: \EG Meaning of each component is as follows.
1.1       noro      562:
                    563: @table @code
1.2       noro      564: \BJP
1.1       noro      565: @item TNF
1.2       noro      566:
1.1       noro      567: normal form $B7W;;;~4V(B ($BIC(B)
                    568:
                    569: @item TCONT
1.2       noro      570:
1.1       noro      571: content $B7W;;;~4V(B ($BIC(B)
                    572:
                    573: @item HT
1.2       noro      574:
1.1       noro      575: $B@8@.$5$l$?B?9`<0$NF,9`(B
                    576:
                    577: @item INDEX
1.2       noro      578:
1.1       noro      579: S-$BB?9`<0$r9=@.$9$kB?9`<0$N%$%s%G%C%/%9$N%Z%"(B
                    580:
                    581: @item NB
1.2       noro      582:
1.1       noro      583: $B8=:_$N(B, $B>iD9@-$r=|$$$?4pDl$N?t(B
                    584:
                    585: @item NAB
1.2       noro      586:
1.1       noro      587: $B8=:_$^$G$K@8@.$5$l$?4pDl$N?t(B
                    588:
                    589: @item RP
1.2       noro      590:
1.1       noro      591: $B;D$j$N%Z%"$N?t(B
                    592:
                    593: @item S
1.2       noro      594:
1.1       noro      595: $B@8@.$5$l$?B?9`<0$N(B sugar $B$NCM(B
                    596:
                    597: @item M
1.2       noro      598:
1.1       noro      599: $B@8@.$5$l$?B?9`<0$N78?t$N%S%C%HD9$NOB(B (@code{ShowMag} $B$,(B on $B$N;~$KI=<($5$l$k(B. )
1.2       noro      600: \E
                    601: \BEG
                    602: @item TNF
                    603:
                    604: CPU time for normal form computation (second)
                    605:
                    606: @item TCONT
                    607:
                    608: CPU time for content removal(second)
                    609:
                    610: @item HT
                    611:
                    612: Head term of the generated basis element
                    613:
                    614: @item INDEX
                    615:
                    616: Pair of indices which corresponds to the reduced S-polynomial
                    617:
                    618: @item NB
                    619:
                    620: Number of basis elements after removing redundancy
                    621:
                    622: @item NAB
                    623:
                    624: Number of all the basis elements
                    625:
                    626: @item RP
                    627:
                    628: Number of remaining pairs
                    629:
                    630: @item S
                    631:
                    632: Sugar of the generated basis element
                    633:
                    634: @item M
                    635:
                    636: Magnitude of the genrated basis element (shown if @code{ShowMag} is `on'.)
                    637: \E
1.1       noro      638: @end table
                    639:
                    640: @noindent
1.2       noro      641: \BJP
1.1       noro      642: $B:G8e$K(B, $B=87W%G!<%?$,I=<($5$l$k(B. $B0UL#$O<!$NDL$j(B.
                    643: ($B;~4V$NI=<($K$*$$$F(B, $B?t;z$,(B 2 $B$D$"$k$b$N$O(B, $B7W;;;~4V$H(B GC $B;~4V$N%Z%"$G$"$k(B.)
1.2       noro      644: \E
                    645: \BEG
                    646: The summary of the informations shown after a Groebner basis
                    647: computation is as follows.  If a component shows timings and it
                    648: contains two numbers, they are a pair of time for computation and time
                    649: for garbage colection.
                    650: \E
1.1       noro      651:
                    652: @table @code
1.2       noro      653: \BJP
1.1       noro      654: @item UP
1.2       noro      655:
1.1       noro      656: $B%Z%"$N%j%9%H$NA`:n$K$+$+$C$?;~4V(B
                    657:
                    658: @item SP
1.2       noro      659:
1.1       noro      660: $BM-M}?t>e$N(B S-$BB?9`<07W;;;~4V(B
                    661:
                    662: @item SPM
1.2       noro      663:
1.1       noro      664: $BM-8BBN>e$N(B S-$BB?9`<07W;;;~4V(B
                    665:
                    666: @item NF
1.2       noro      667:
1.1       noro      668: $BM-M}?t>e$N(B normal form $B7W;;;~4V(B
                    669:
                    670: @item NFM
1.2       noro      671:
1.1       noro      672: $BM-8BBN>e$N(B normal form $B7W;;;~4V(B
                    673:
                    674: @item ZNFM
1.2       noro      675:
1.1       noro      676: @code{NFM} $B$NFb(B, 0 $B$X$N(B reduction $B$K$+$+$C$?;~4V(B
                    677:
                    678: @item PZ
1.2       noro      679:
1.1       noro      680: content $B7W;;;~4V(B
                    681:
                    682: @item NP
1.2       noro      683:
1.1       noro      684: $BM-M}?t78?tB?9`<0$N78?t$KBP$9$k>jM>1i;;$N7W;;;~4V(B
                    685:
                    686: @item MP
1.2       noro      687:
1.1       noro      688: S-$BB?9`<0$r@8@.$9$k%Z%"$NA*Br$K$+$+$C$?;~4V(B
                    689:
                    690: @item RA
1.2       noro      691:
1.1       noro      692: interreduce $B7W;;;~4V(B
                    693:
                    694: @item MC
1.2       noro      695:
1.1       noro      696: trace-lifting $B$K$*$1$k(B, $BF~NOB?9`<0$N%a%s%P%7%C%W7W;;;~4V(B
                    697:
                    698: @item GC
1.2       noro      699:
1.1       noro      700: $B7k2L$N%0%l%V%J4pDl8uJd$N%0%l%V%J4pDl%A%'%C%/;~4V(B
                    701:
                    702: @item T
1.2       noro      703:
1.1       noro      704: $B@8@.$5$l$?%Z%"$N?t(B
                    705:
                    706: @item B, M, F, D
1.2       noro      707:
1.1       noro      708: $B3F(B criterion $B$K$h$j=|$+$l$?%Z%"$N?t(B
                    709:
                    710: @item ZR
1.2       noro      711:
1.1       noro      712: 0 $B$K(B reduce $B$5$l$?%Z%"$N?t(B
                    713:
                    714: @item NZR
1.2       noro      715:
1.1       noro      716: 0 $B$G$J$$B?9`<0$K(B reduce $B$5$l$?%Z%"$N?t(B
                    717:
                    718: @item Max_mag
1.2       noro      719:
1.1       noro      720: $B@8@.$5$l$?B?9`<0$N(B, $B78?t$N%S%C%HD9$NOB$N:GBgCM(B
1.2       noro      721: \E
                    722: \BEG
                    723: @item UP
                    724:
                    725: Time to manipulate the list of critical pairs
                    726:
                    727: @item SP
                    728:
                    729: Time to compute S-polynomials over the rationals
                    730:
                    731: @item SPM
                    732:
                    733: Time to compute S-polynomials over a finite field
                    734:
                    735: @item NF
                    736:
                    737: Time to compute normal forms over the rationals
                    738:
                    739: @item NFM
                    740:
                    741: Time to compute normal forms over a finite field
                    742:
                    743: @item ZNFM
                    744:
                    745: Time for zero reductions in @code{NFM}
                    746:
                    747: @item PZ
                    748:
                    749: Time to remove integer contets
                    750:
                    751: @item NP
                    752:
                    753: Time to compute remainders for coefficients of polynomials with coeffieints
                    754: in the rationals
                    755:
                    756: @item MP
                    757:
                    758: Time to select pairs from which S-polynomials are computed
                    759:
                    760: @item RA
                    761:
                    762: Time to interreduce the Groebner basis candidate
                    763:
                    764: @item MC
1.1       noro      765:
1.2       noro      766: Time to check that each input polynomial is a member of the ideal
                    767: generated by the Groebner basis candidate.
                    768:
                    769: @item GC
                    770:
                    771: Time to check that the Groebner basis candidate is a Groebner basis
                    772:
                    773: @item T
                    774:
                    775: Number of critical pairs generated
                    776:
                    777: @item B, M, F, D
                    778:
                    779: Number of critical pairs removed by using each criterion
                    780:
                    781: @item ZR
                    782:
                    783: Number of S-polynomials reduced to 0
                    784:
                    785: @item NZR
                    786:
                    787: Number of S-polynomials reduced to non-zero results
                    788:
                    789: @item Max_mag
                    790:
                    791: Maximal magnitude among all the generated polynomials
                    792: \E
1.1       noro      793: @end table
                    794:
1.2       noro      795: \BJP
1.1       noro      796: @node $B9`=g=x$N@_Dj(B,,, $B%0%l%V%J4pDl$N7W;;(B
                    797: @section $B9`=g=x$N@_Dj(B
1.2       noro      798: \E
                    799: \BEG
                    800: @node Setting term orderings,,, Groebner basis computation
                    801: @section Setting term orderings
                    802: \E
1.1       noro      803:
                    804: @noindent
1.2       noro      805: \BJP
1.1       noro      806: $B9`$OFbIt$G$O(B, $B3FJQ?t$K4X$9$k;X?t$r@.J,$H$9$k@0?t%Y%/%H%k$H$7$FI=8=$5$l(B
                    807: $B$k(B. $BB?9`<0$rJ,;6I=8=B?9`<0$KJQ49$9$k:](B, $B3FJQ?t$,$I$N@.J,$KBP1~$9$k$+$r(B
                    808: $B;XDj$9$k$N$,(B, $BJQ?t%j%9%H$G$"$k(B. $B$5$i$K(B, $B$=$l$i@0?t%Y%/%H%k$NA4=g=x$r(B
                    809: $B;XDj$9$k$N$,9`=g=x$N7?$G$"$k(B. $B9`=g=x7?$O(B, $B?t(B, $B?t$N%j%9%H$"$k$$$O(B
                    810: $B9TNs$GI=8=$5$l$k(B.
1.2       noro      811: \E
                    812: \BEG
                    813: A term is internally represented as an integer vector whose components
                    814: are exponents with respect to variables. A variable list specifies the
                    815: correspondences between variables and components. A type of term ordering
                    816: specifies a total order for integer vectors. A type of term ordering is
                    817: represented by an integer, a list of integer or matrices.
                    818: \E
1.1       noro      819:
                    820: @noindent
1.2       noro      821: \JP $B4pK\E*$J9`=g=x7?$H$7$F<!$N(B 3 $B$D$,$"$k(B.
                    822: \EG There are following three fundamental types.
1.1       noro      823:
                    824: @table @code
1.2       noro      825: \JP @item 0 (DegRevLex; @b{$BA4<!?t5U<-=q<0=g=x(B})
                    826: \EG @item 0 (DegRevLex; @b{total degree reverse lexicographic ordering})
1.1       noro      827:
1.2       noro      828: \BJP
1.1       noro      829: $B0lHL$K(B, $B$3$N=g=x$K$h$k%0%l%V%J4pDl7W;;$,:G$b9bB.$G$"$k(B. $B$?$@$7(B,
                    830: $BJ}Dx<0$r2r$/$H$$$&L\E*$KMQ$$$k$3$H$O(B, $B0lHL$K$O$G$-$J$$(B. $B$3$N(B
                    831: $B=g=x$K$h$k%0%l%V%J4pDl$O(B, $B2r$N8D?t$N7W;;(B, $B%$%G%"%k$N%a%s%P%7%C%W$d(B,
                    832: $BB>$NJQ?t=g=x$X$N4pDlJQ49$N$?$a$N%=!<%9$H$7$FMQ$$$i$l$k(B.
1.2       noro      833: \E
                    834: \BEG
                    835: In general, computation by this ordering shows the fastest speed
                    836: in most Groebner basis computations.
                    837: However, for the purpose to solve polynomial equations, this type
                    838: of ordering is, in general, not so suitable.
                    839: The Groebner bases obtained by this ordering is used for computing
                    840: the number of solutions, solving ideal membership problem and seeds
                    841: for conversion to other Groebner bases under different ordering.
                    842: \E
1.1       noro      843:
1.2       noro      844: \JP @item 1 (DegLex; @b{$BA4<!?t<-=q<0=g=x(B})
                    845: \EG @item 1 (DegLex; @b{total degree lexicographic ordering})
1.1       noro      846:
1.2       noro      847: \BJP
1.1       noro      848: $B$3$N=g=x$b(B, $B<-=q<0=g=x$KHf$Y$F9bB.$K%0%l%V%J4pDl$r5a$a$k$3$H$,$G$-$k$,(B,
                    849: @code{DegRevLex} $B$HF1MMD>@\$=$N7k2L$rMQ$$$k$3$H$O:$Fq$G$"$k(B. $B$7$+$7(B,
                    850: $B<-=q<0=g=x$N%0%l%V%J4pDl$r5a$a$k:]$K(B, $B@F<!2=8e$K$3$N=g=x$G%0%l%V%J4pDl(B
                    851: $B$r5a$a$F$$$k(B.
1.2       noro      852: \E
                    853: \BEG
                    854: By this type term ordering, Groebner bases are obtained fairly faster
                    855: than Lex (lexicographic) ordering, too.
                    856: Alike the @code{DegRevLex} ordering, the result, in general, cannot directly
                    857: be used for solving polynomial equations.
                    858: It is used, however, in such a way
                    859: that a Groebner basis is computed in this ordering after homogenization
                    860: to obtain the final lexicographic Groebner basis.
                    861: \E
1.1       noro      862:
1.2       noro      863: \JP @item 2 (Lex; @b{$B<-=q<0=g=x(B})
                    864: \EG @item 2 (Lex; @b{lexicographic ordering})
1.1       noro      865:
1.2       noro      866: \BJP
1.1       noro      867: $B$3$N=g=x$K$h$k%0%l%V%J4pDl$O(B, $BJ}Dx<0$r2r$/>l9g$K:GE,$N7A$N4pDl$rM?$($k$,(B
                    868: $B7W;;;~4V$,$+$+$j2a$.$k$N$,FqE@$G$"$k(B. $BFC$K(B, $B2r$,M-8B8D$N>l9g(B, $B7k2L$N(B
                    869: $B78?t$,6K$a$FD9Bg$JB?G\D9?t$K$J$k>l9g$,B?$$(B. $B$3$N>l9g(B, @code{gr()},
                    870: @code{hgr()} $B$K$h$k7W;;$,6K$a$FM-8z$K$J$k>l9g$,B?$$(B.
1.2       noro      871: \E
                    872: \BEG
                    873: Groebner bases computed by this ordering give the most convenient
                    874: Groebner bases for solving the polynomial equations.
                    875: The only and serious shortcoming is the enormously long computation
                    876: time.
                    877: It is often observed that the number coefficients of the result becomes
                    878: very very long integers, especially if the ideal is 0-dimensional.
                    879: For such a case, it is empirically true for many cases
                    880: that i.e., computation by
                    881: @code{gr()} and/or @code{hgr()} may be quite effective.
                    882: \E
1.1       noro      883: @end table
                    884:
                    885: @noindent
1.2       noro      886: \BJP
1.1       noro      887: $B$3$l$i$rAH$_9g$o$;$F%j%9%H$G;XDj$9$k$3$H$K$h$j(B, $BMM!9$J>C5n=g=x$,;XDj$G$-$k(B.
                    888: $B$3$l$O(B,
1.2       noro      889: \E
                    890: \BEG
                    891: By combining these fundamental orderingl into a list, one can make
                    892: various term ordering called elimination orderings.
                    893: \E
1.1       noro      894:
                    895: @code{[[O1,L1],[O2,L2],...]}
                    896:
                    897: @noindent
1.2       noro      898: \BJP
1.1       noro      899: $B$G;XDj$5$l$k(B. @code{Oi} $B$O(B 0, 1, 2 $B$N$$$:$l$+$G(B, @code{Li} $B$OJQ?t$N8D(B
                    900: $B?t$rI=$9(B. $B$3$N;XDj$O(B, $BJQ?t$r@hF,$+$i(B @code{L1}, @code{L2} , ...$B8D(B
                    901: $B$:$D$NAH$KJ,$1(B, $B$=$l$>$l$NJQ?t$K4X$7(B, $B=g$K(B @code{O1}, @code{O2},
                    902: ...$B$N9`=g=x7?$GBg>.$,7hDj$9$k$^$GHf3S$9$k$3$H$r0UL#$9$k(B. $B$3$N7?$N(B
                    903: $B=g=x$O0lHL$K>C5n=g=x$H8F$P$l$k(B.
1.2       noro      904: \E
                    905: \BEG
                    906: In this example @code{Oi} indicates 0, 1 or 2 and @code{Li} indicates
                    907: the number of variables subject to the correspoinding orderings.
                    908: This specification means the following.
                    909:
                    910: The variable list is separated into sub lists from left to right where
                    911: the @code{i}-th list contains @code{Li} members and it corresponds to
                    912: the ordering of type @code{Oi}. The result of a comparison is equal
                    913: to that for the leftmost different sub components. This type of ordering
                    914: is called an elimination ordering.
                    915: \E
1.1       noro      916:
                    917: @noindent
1.2       noro      918: \BJP
1.1       noro      919: $B$5$i$K(B, $B9TNs$K$h$j9`=g=x$r;XDj$9$k$3$H$,$G$-$k(B. $B0lHL$K(B, @code{n} $B9T(B
                    920: @code{m} $BNs$N<B?t9TNs(B @code{M} $B$,<!$N@-<A$r;}$D$H$9$k(B.
1.2       noro      921: \E
                    922: \BEG
                    923: Furthermore one can specify a term ordering by a matix.
                    924: Suppose that a real @code{n}, @code{m} matrix @code{M} has the
                    925: following properties.
                    926: \E
1.1       noro      927:
                    928: @enumerate
                    929: @item
1.2       noro      930: \JP $BD9$5(B @code{m} $B$N@0?t%Y%/%H%k(B @code{v} $B$KBP$7(B @code{Mv=0} $B$H(B @code{v=0} $B$OF1CM(B.
                    931: \BEG
                    932: For all integer verctors @code{v} of length @code{m} @code{Mv=0} is equivalent
                    933: to @code{v=0}.
                    934: \E
1.1       noro      935:
                    936: @item
1.2       noro      937: \BJP
1.1       noro      938: $BHsIi@.J,$r;}$DD9$5(B @code{m} $B$N(B 0 $B$G$J$$@0?t%Y%/%H%k(B @code{v} $B$KBP$7(B,
                    939: @code{Mv} $B$N(B 0 $B$G$J$$:G=i$N@.J,$OHsIi(B.
1.2       noro      940: \E
                    941: \BEG
                    942: For all non-negative integer vectors @code{v} the first non-zero component
                    943: of @code{Mv} is non-negative.
                    944: \E
1.1       noro      945: @end enumerate
                    946:
                    947: @noindent
1.2       noro      948: \BJP
1.1       noro      949: $B$3$N;~(B, 2 $B$D$N%Y%/%H%k(B @code{t}, @code{s} $B$KBP$7(B,
                    950: @code{t>s} $B$r(B, @code{M(t-s)} $B$N(B 0 $B$G$J$$:G=i$N@.J,$,HsIi(B,
                    951: $B$GDj5A$9$k$3$H$K$h$j9`=g=x$,Dj5A$G$-$k(B.
1.2       noro      952: \E
                    953: \BEG
                    954: Then we can define a term ordering such that, for two vectors
                    955: @code{t}, @code{s}, @code{t>s} means that the first non-zero component
                    956: of @code{M(t-s)} is non-negative.
                    957: \E
1.1       noro      958:
                    959: @noindent
1.2       noro      960: \BJP
1.1       noro      961: $B9`=g=x7?$O(B, @code{gr()} $B$J$I$N0z?t$H$7$F;XDj$5$l$kB>(B, $BAH$_9~$_H!?t(B
                    962: @code{dp_ord()} $B$G;XDj$5$l(B, $B$5$^$6$^$JH!?t$N<B9T$N:]$K;2>H$5$l$k(B.
1.2       noro      963: \E
                    964: \BEG
                    965: Types of term orderings are used as arguments of functions such as
                    966: @code{gr()}. It is also set internally by @code{dp_ord()} and is used
                    967: during executions of various functions.
                    968: \E
1.1       noro      969:
                    970: @noindent
1.2       noro      971: \BJP
1.1       noro      972: $B$3$l$i$N=g=x$N6qBNE*$JDj5A$*$h$S%0%l%V%J4pDl$K4X$9$k99$K>\$7$$2r@b$O(B
                    973: @code{[Becker,Weispfenning]} $B$J$I$r;2>H$N$3$H(B.
1.2       noro      974: \E
                    975: \BEG
                    976: For concrete definitions of term ordering and more information
                    977: about Groebner basis, refer to, for example, the book
                    978: @code{[Becker,Weispfenning]}.
                    979: \E
1.1       noro      980:
                    981: @noindent
1.2       noro      982: \JP $B9`=g=x7?$N@_Dj$NB>$K(B, $BJQ?t$N=g=x<+BN$b7W;;;~4V$KBg$-$J1F6A$rM?$($k(B.
                    983: \BEG
                    984: Note that the variable ordering have strong effects on the computation
                    985: time as well as the choice of types of term orderings.
                    986: \E
1.1       noro      987:
                    988: @example
                    989: [90] B=[x^10-t,x^8-z,x^31-x^6-x-y]$
                    990: [91] gr(B,[x,y,z,t],2);
                    991: [x^2-2*y^7+(-41*t^2-13*t-1)*y^2+(2*t^17-12*t^14+42*t^12+30*t^11-168*t^9
                    992: -40*t^8+70*t^7+252*t^6+30*t^5-140*t^4-168*t^3+2*t^2-12*t+16)*z^2*y
                    993: +(-12*t^16+72*t^13-28*t^11-180*t^10+112*t^8+240*t^7+28*t^6-127*t^5
                    994: -167*t^4-55*t^3+30*t^2+58*t-15)*z^4,
                    995: (y+t^2*z^2)*x+y^7+(20*t^2+6*t+1)*y^2+(-t^17+6*t^14-21*t^12-15*t^11+84*t^9
                    996: +20*t^8-35*t^7-126*t^6-15*t^5+70*t^4+84*t^3-t^2+5*t-9)*z^2*y+(6*t^16-36*t^13
                    997: +14*t^11+90*t^10-56*t^8-120*t^7-14*t^6+64*t^5+84*t^4+27*t^3-16*t^2-30*t+7)*z^4,
                    998: (t^3-1)*x-y^6+(-6*t^13+24*t^10-20*t^8-36*t^7+40*t^5+24*t^4-6*t^3-20*t^2-6*t-1)*y
                    999: +(t^17-6*t^14+9*t^12+15*t^11-36*t^9-20*t^8-5*t^7+54*t^6+15*t^5+10*t^4-36*t^3
                   1000: -11*t^2-5*t+9)*z^2,
                   1001: -y^8-8*t*y^3+16*z^2*y^2+(-8*t^16+48*t^13-56*t^11-120*t^10+224*t^8+160*t^7
                   1002: -56*t^6-336*t^5-112*t^4+112*t^3+224*t^2+24*t-56)*z^4*y+(t^24-8*t^21+20*t^19
                   1003: +28*t^18-120*t^16-56*t^15+14*t^14+300*t^13+70*t^12-56*t^11-400*t^10-84*t^9
                   1004: +84*t^8+268*t^7+84*t^6-56*t^5-63*t^4-36*t^3+46*t^2-12*t+1)*z,
                   1005: 2*t*y^5+z*y^2+(-2*t^11+8*t^8-20*t^6-12*t^5+40*t^3+8*t^2-10*t-20)*z^3*y+8*t^14
                   1006: -32*t^11+48*t^8-t^7-32*t^5-6*t^4+9*t^2-t,
                   1007: -z*y^3+(t^7-2*t^4+3*t^2+t)*y+(-2*t^6+4*t^3+2*t-2)*z^2,
                   1008: 2*t^2*y^3+z^2*y^2+(-2*t^5+4*t^2-6)*z^4*y+(4*t^8-t^7-8*t^5+2*t^4-4*t^3+5*t^2-t)*z,
                   1009: z^3*y^2+2*t^3*y+(-t^7+2*t^4+t^2-t)*z^2,
                   1010: -t*z*y^2-2*z^3*y+t^8-2*t^5-t^3+t^2,
                   1011: -t^3*y^2-2*t^2*z^2*y+(t^6-2*t^3-t+1)*z^4,
                   1012: z^5-t^4]
                   1013: [93] gr(B,[t,z,y,x],2);
                   1014: [x^10-t,x^8-z,x^31-x^6-x-y]
                   1015: @end example
                   1016:
                   1017: @noindent
1.2       noro     1018: \BJP
1.1       noro     1019: $BJQ?t=g=x(B @code{[x,y,z,t]} $B$K$*$1$k%0%l%V%J4pDl$O(B, $B4pDl$N?t$bB?$/(B, $B$=$l$>$l$N(B
                   1020: $B<0$bBg$-$$(B. $B$7$+$7(B, $B=g=x(B @code{[t,z,y,x]} $B$K$b$H$G$O(B, @code{B} $B$,$9$G$K(B
                   1021: $B%0%l%V%J4pDl$H$J$C$F$$$k(B. $BBg;(GD$K$$$($P(B, $B<-=q<0=g=x$G%0%l%V%J4pDl$r5a$a$k(B
                   1022: $B$3$H$O(B, $B:8B&$N(B ($B=g=x$N9b$$(B) $BJQ?t$r(B, $B1&B&$N(B ($B=g=x$NDc$$(B) $BJQ?t$G=q$-I=$9(B
                   1023: $B$3$H$G$"$j(B, $B$3$NNc$N>l9g$O(B, @code{t},  @code{z}, @code{y} $B$,4{$K(B
                   1024: @code{x} $B$GI=$5$l$F$$$k$3$H$+$i$3$N$h$&$J6KC<$J7k2L$H$J$C$?$o$1$G$"$k(B.
                   1025: $B<B:]$K8=$l$k7W;;$K$*$$$F$O(B, $B$3$N$h$&$KA*$V$Y$-JQ?t=g=x$,L@$i$+$G$"$k(B
                   1026: $B$3$H$O>/$J$/(B, $B;n9T:x8m$,I,MW$J>l9g$b$"$k(B.
1.2       noro     1027: \E
                   1028: \BEG
                   1029: As you see in the above example, the Groebner base under variable
                   1030: ordering @code{[x,y,z,t]} has a lot of bases and each base itself is
                   1031: large.  Under variable ordering @code{[t,z,y,x]}, however, @code{B} itself
                   1032: is already the Groebner basis.
                   1033: Roughly speaking, to obtain a Groebner base under the lexicographic
                   1034: ordering is to express the variables on the left (having higher order)
                   1035: in terms of variables on the right (having lower order).
                   1036: In the example, variables @code{t},  @code{z}, and @code{y} are already
                   1037: expressed by variable @code{x}, and the above explanation justifies
                   1038: such a drastic experimental results.
                   1039: In practice, however, optimum ordering for variables may not known
                   1040: beforehand, and some heuristic trial may be inevitable.
                   1041: \E
1.1       noro     1042:
1.2       noro     1043: \BJP
1.1       noro     1044: @node $BM-M}<0$r78?t$H$9$k%0%l%V%J4pDl7W;;(B,,, $B%0%l%V%J4pDl$N7W;;(B
                   1045: @section $BM-M}<0$r78?t$H$9$k%0%l%V%J4pDl7W;;(B
1.2       noro     1046: \E
                   1047: \BEG
                   1048: @node Groebner basis computation with rational function coefficients,,, Groebner basis computation
                   1049: @section Groebner basis computation with rational function coefficients
                   1050: \E
1.1       noro     1051:
                   1052: @noindent
1.2       noro     1053: \BJP
1.1       noro     1054: @code{gr()} $B$J$I$N%H%C%W%l%Y%kH!?t$O(B, $B$$$:$l$b(B, $BF~NOB?9`<0%j%9%H$K(B
                   1055: $B8=$l$kJQ?t(B ($BITDj85(B) $B$H(B, $BJQ?t%j%9%H$K8=$l$kJQ?t$rHf3S$7$F(B, $BJQ?t%j%9%H$K(B
                   1056: $B$J$$JQ?t$,F~NOB?9`<0$K8=$l$F$$$k>l9g$K$O(B, $B<+F0E*$K(B, $B$=$NJQ?t$r(B, $B78?t(B
                   1057: $BBN$N85$H$7$F07$&(B.
1.2       noro     1058: \E
                   1059: \BEG
                   1060: Such variables that appear within the input polynomials but
                   1061: not appearing in the input variable list are automatically treated
                   1062: as elements in the coefficient field
                   1063: by top level functions, such as @code{gr()}.
                   1064: \E
1.1       noro     1065:
                   1066: @example
                   1067: [64] gr([a*x+b*y-c,d*x+e*y-f],[x,y],2);
                   1068: [(-e*a+d*b)*x-f*b+e*c,(-e*a+d*b)*y+f*a-d*c]
                   1069: @end example
                   1070:
                   1071: @noindent
1.2       noro     1072: \BJP
1.1       noro     1073: $B$3$NNc$G$O(B, @code{a}, @code{b}, @code{c}, @code{d} $B$,78?tBN$N85$H$7$F(B
                   1074: $B07$o$l$k(B. $B$9$J$o$A(B, $BM-M}H!?tBN(B
                   1075: @b{F} = @b{Q}(@code{a},@code{b},@code{c},@code{d}) $B>e$N(B 2 $BJQ?tB?9`<04D(B
                   1076: @b{F}[@code{x},@code{y}] $B$K$*$1$k%0%l%V%J4pDl$r5a$a$k$3$H$K$J$k(B.
                   1077: $BCm0U$9$Y$-$3$H$O(B,
                   1078: $B78?t$,BN$H$7$F07$o$l$F$$$k$3$H$G$"$k(B. $B$9$J$o$A(B, $B78?t$N4V$KB?9`<0(B
                   1079: $B$H$7$F$N6&DL0x;R$,$"$C$?>l9g$K$O(B, $B7k2L$+$i$=$N0x;R$O=|$+$l$F$$$k(B
                   1080: $B$?$a(B, $BM-M}?tBN>e$NB?9`<04D>e$NLdBj$H$7$F9M$($?>l9g$N7k2L$H$O0lHL(B
                   1081: $B$K$O0[$J$k(B. $B$^$?(B, $B<g$H$7$F7W;;8zN(>e$NLdBj$N$?$a(B, $BJ,;6I=8=B?9`<0(B
                   1082: $B$N78?t$H$7$F<B:]$K5v$5$l$k$N$OB?9`<0$^$G$G$"$k(B. $B$9$J$o$A(B, $BJ,Jl$r(B
                   1083: $B;}$DM-M}<0$OJ,;6I=8=B?9`<0$N78?t$H$7$F$O5v$5$l$J$$(B.
1.2       noro     1084: \E
                   1085: \BEG
                   1086: In this example, variables @code{a}, @code{b}, @code{c}, and @code{d}
                   1087: are treated as elements in the coefficient field.
                   1088: In this case, a Groebner basis is computed
                   1089: on a bi-variate polynomial ring
                   1090: @b{F}[@code{x},@code{y}]
                   1091: over rational function field
                   1092:  @b{F} = @b{Q}(@code{a},@code{b},@code{c},@code{d}).
                   1093: Notice that coefficients are considered as a member in a field.
                   1094: As a consequence, polynomial factors common to the coefficients
                   1095: are removed so that the result, in general, is different from
                   1096: the result that would be obtained when the problem is considered
                   1097: as a computation of Groebner basis over a polynomial ring
                   1098: with rational function coefficients.
                   1099: And note that coefficients of a distributed polynomial are limited
                   1100: to numbers and polynomials because of efficiency.
                   1101: \E
1.1       noro     1102:
1.2       noro     1103: \BJP
1.1       noro     1104: @node $B4pDlJQ49(B,,, $B%0%l%V%J4pDl$N7W;;(B
                   1105: @section $B4pDlJQ49(B
1.2       noro     1106: \E
                   1107: \BEG
                   1108: @node Change of ordering,,, Groebner basis computation
                   1109: @section Change of orderng
                   1110: \E
1.1       noro     1111:
                   1112: @noindent
1.2       noro     1113: \BJP
1.1       noro     1114: $B<-=q<0=g=x$N%0%l%V%J4pDl$r5a$a$k>l9g(B, $BD>@\(B @code{gr()} $B$J$I$r5/F0$9$k(B
                   1115: $B$h$j(B, $B0lC6B>$N=g=x(B ($BNc$($PA4<!?t5U<-=q<0=g=x(B) $B$N%0%l%V%J4pDl$r7W;;$7$F(B,
                   1116: $B$=$l$rF~NO$H$7$F<-=q<0=g=x$N%0%l%V%J4pDl$r7W;;$9$kJ}$,8zN($,$h$$>l9g(B
                   1117: $B$,$"$k(B. $B$^$?(B, $BF~NO$,2?$i$+$N=g=x$G$N%0%l%V%J4pDl$K$J$C$F$$$k>l9g(B, $B4pDl(B
                   1118: $BJQ49$H8F$P$l$kJ}K!$K$h$j(B, Buchberger $B%"%k%4%j%:%`$K$h$i$:$K8zN(NI$/(B
                   1119: $B<-=q<0=g=x$N%0%l%V%J4pDl$,7W;;$G$-$k>l9g$,$"$k(B. $B$3$N$h$&$JL\E*$N$?$a$N(B
                   1120: $BH!?t$,(B, $B%f!<%6Dj5AH!?t$H$7$F(B @samp{gr} $B$K$$$/$D$+Dj5A$5$l$F$$$k(B.
                   1121: $B0J2<$N(B 2 $B$D$NH!?t$O(B, $BJQ?t=g=x(B @var{vlist1}, $B9`=g=x7?(B @var{order} $B$G(B
                   1122: $B4{$K%0%l%V%J4pDl$H$J$C$F$$$kB?9`<0%j%9%H(B @var{gbase} $B$r(B, $BJQ?t=g=x(B
                   1123: @var{vlist2} $B$K$*$1$k<-=q<0=g=x$N%0%l%V%J4pDl$KJQ49$9$kH!?t$G$"$k(B.
1.2       noro     1124: \E
                   1125: \BEG
                   1126: When we compute a lex order Groebner basis, it is often efficient to
                   1127: compute it via Groebner basis with respect to another order such as
                   1128: degree reverse lex order, rather than to compute it directory by
                   1129: @code{gr()} etc. If we know that an input is a Groebner basis with
                   1130: respect to an order, we can apply special methods called change of
                   1131: ordering for a Groebner basis computation with respect to another
                   1132: order, without using Buchberger algorithm. The following two functions
                   1133: are ones for change of ordering such that they convert a Groebner
                   1134: basis @var{gbase} with respect to the variable order @var{vlist1} and
                   1135: the order type @var{order} into a lex Groebner basis with respect
                   1136: to the variable order @var{vlist2}.
                   1137: \E
1.1       noro     1138:
                   1139: @table @code
                   1140: @item tolex(@var{gbase},@var{vlist1},@var{order},@var{vlist2})
                   1141:
1.2       noro     1142: \BJP
1.1       noro     1143: $B$3$NH!?t$O(B, @var{gbase} $B$,M-M}?tBN>e$N%7%9%F%`$N>l9g$K$N$_;HMQ2DG=$G$"$k(B.
                   1144: $B$3$NH!?t$O(B, $B<-=q<0=g=x$N%0%l%V%J4pDl$r(B, $BM-8BBN>e$G7W;;$5$l$?%0%l%V%J4pDl(B
                   1145: $B$r?w7?$H$7$F(B, $BL$Dj78?tK!$*$h$S(B Hensel $B9=@.$K$h$j5a$a$k$b$N$G$"$k(B.
1.2       noro     1146: \E
                   1147: \BEG
                   1148: This function can be used only when @var{gbase} is an ideal over the
                   1149: rationals.  The input @var{gbase} must be a Groebner basis with respect
                   1150: to the variable order @var{vlist1} and the order type @var{order}. Moreover
                   1151: the ideal generated by @var{gbase} must be zero-dimensional.
                   1152: This computes the lex Groebner basis of @var{gbase}
                   1153: by using the modular change of ordering algorithm. The algorithm first
                   1154: computes the lex Groebner basis over a finite field. Then each element
                   1155: in the lex Groebner basis over the rationals is computed with undetermined
                   1156: coefficient method and linear equation solving by Hensel lifting.
                   1157: \E
1.1       noro     1158:
                   1159: @item tolex_tl(@var{gbase},@var{vlist1},@var{order},@var{vlist2},@var{homo})
                   1160:
1.2       noro     1161: \BJP
1.1       noro     1162: $B$3$NH!?t$O(B, $B<-=q<0=g=x$N%0%l%V%J4pDl$r(B Buchberger $B%"%k%4%j%:%`$K$h$j5a(B
                   1163: $B$a$k$b$N$G$"$k$,(B, $BF~NO$,$"$k=g=x$K$*$1$k%0%l%V%J4pDl$G$"$k>l9g$N(B
                   1164: trace-lifting$B$K$*$1$k%0%l%V%J4pDl8uJd$NF,9`(B, $BF,78?t$N@-<A$rMxMQ$7$F(B,
                   1165: $B:G=*E*$J%0%l%V%J4pDl%A%'%C%/(B, $B%$%G%"%k%a%s%P%7%C%W%A%'%C%/$r>JN,$7$F$$(B
                   1166: $B$k$?$a(B, $BC1$K(BBuchberger $B%"%k%4%j%:%`$r7+$jJV$9$h$j8zN($h$/7W;;$G$-$k(B.
                   1167: $B99$K(B, $BF~NO$,(B 0 $B<!85%7%9%F%`$N>l9g(B, $B<+F0E*$K$b$&(B 1 $B$D$NCf4VE*$J9`=g=x$r(B
                   1168: $B7PM3$7$F<-=q<0=g=x$N%0%l%V%J4pDl$r7W;;$9$k(B. $BB?$/$N>l9g(B, $B$3$NJ}K!$O(B,
                   1169: $BD>@\<-=q<0=g=x$N7W;;$r9T$&$h$j8zN($,$h$$(B. ($B$b$A$m$sNc30$"$j(B. )
                   1170: $B0z?t(B @var{homo} $B$,(B 0 $B$G$J$$;~(B, @code{hgr()} $B$HF1MM$K@F<!2=$r7PM3$7$F(B
                   1171: $B7W;;$r9T$&(B.
1.2       noro     1172: \E
                   1173: \BEG
                   1174: This function computes the lex Groebner basis of @var{gbase}.  The
                   1175: input @var{gbase} must be a Groebner basis with respect to the
                   1176: variable order @var{vlist1} and the order type @var{order}.
                   1177: Buchberger algorithm with trace lifting is used to compute the lex
                   1178: Groebner basis, however the Groebner basis check and the ideal
                   1179: membership check can be omitted by using several properties derived
                   1180: from the fact that the input is a Groebner basis. So it is more
                   1181: efficient than simple repetition of Buchberger algorithm. If the input
                   1182: is zero-dimensional, this function inserts automatically a computation
                   1183: of Groebner basis with respect to an elimination order, which makes
                   1184: the whole computation more efficient for many cases. If @var{homo} is
                   1185: not equal to 0, homogenization is used in each step.
                   1186: \E
1.1       noro     1187: @end table
                   1188:
                   1189: @noindent
1.2       noro     1190: \BJP
1.1       noro     1191: $B$=$NB>(B, 0 $B<!85%7%9%F%`$KBP$7(B, $BM?$($i$l$?B?9`<0$N:G>.B?9`<0$r5a$a$k(B
                   1192: $BH!?t(B, 0 $B<!85%7%9%F%`$N2r$r(B, $B$h$j%3%s%Q%/%H$KI=8=$9$k$?$a$NH!?t$J$I$,(B
                   1193: @samp{gr} $B$GDj5A$5$l$F$$$k(B. $B$3$l$i$K$D$$$F$O8D!9$NH!?t$N@bL@$r;2>H$N$3$H(B.
1.2       noro     1194: \E
                   1195: \BEG
                   1196: For zero-dimensional systems, there are several fuctions to
                   1197: compute the minimal polynomial of a polynomial and or a more compact
                   1198: representation for zeros of the system. They are all defined in @samp{gr}.
                   1199: Refer to the sections for each functions.
                   1200: \E
1.1       noro     1201:
1.2       noro     1202: \BJP
1.1       noro     1203: @node $B%0%l%V%J4pDl$K4X$9$kH!?t(B,,, $B%0%l%V%J4pDl$N7W;;(B
                   1204: @section $B%0%l%V%J4pDl$K4X$9$kH!?t(B
1.2       noro     1205: \E
                   1206: \BEG
                   1207: @node Functions for Groebner basis computation,,, Groebner basis computation
                   1208: @section Functions for Groebner basis computation
                   1209: \E
1.1       noro     1210:
                   1211: @menu
                   1212: * gr hgr gr_mod::
                   1213: * lex_hensel lex_tl tolex tolex_d tolex_tl::
                   1214: * lex_hensel_gsl tolex_gsl tolex_gsl_d::
                   1215: * gr_minipoly minipoly::
                   1216: * tolexm minipolym::
                   1217: * dp_gr_main dp_gr_mod_main::
                   1218: * dp_f4_main dp_f4_mod_main::
                   1219: * dp_gr_flags dp_gr_print::
                   1220: * dp_ord::
                   1221: * dp_ptod::
                   1222: * dp_dtop::
                   1223: * dp_mod dp_rat::
                   1224: * dp_homo dp_dehomo::
                   1225: * dp_ptozp dp_prim::
                   1226: * dp_nf dp_nf_mod dp_true_nf dp_true_nf_mod::
                   1227: * dp_hm dp_ht dp_hc dp_rest::
                   1228: * dp_td dp_sugar::
                   1229: * dp_lcm::
                   1230: * dp_redble::
                   1231: * dp_subd::
                   1232: * dp_mbase::
                   1233: * dp_mag::
                   1234: * dp_red dp_red_mod::
                   1235: * dp_sp dp_sp_mod::
                   1236: * p_nf p_nf_mod p_true_nf p_true_nf_mod ::
                   1237: * p_terms::
                   1238: * gb_comp::
                   1239: * katsura hkatsura cyclic hcyclic::
                   1240: * dp_vtoe dp_etov::
                   1241: * lex_hensel_gsl tolex_gsl tolex_gsl_d::
1.3       noro     1242: * primadec primedec::
1.1       noro     1243: @end menu
                   1244:
1.2       noro     1245: \JP @node gr hgr gr_mod,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   1246: \EG @node gr hgr gr_mod,,, Functions for Groebner basis computation
1.1       noro     1247: @subsection @code{gr}, @code{hgr}, @code{gr_mod}, @code{dgr}
                   1248: @findex gr
                   1249: @findex hgr
                   1250: @findex gr_mod
                   1251: @findex dgr
                   1252:
                   1253: @table @t
                   1254: @item gr(@var{plist},@var{vlist},@var{order})
                   1255: @itemx hgr(@var{plist},@var{vlist},@var{order})
                   1256: @itemx gr_mod(@var{plist},@var{vlist},@var{order},@var{p})
                   1257: @itemx dgr(@var{plist},@var{vlist},@var{order},@var{procs})
1.2       noro     1258: \JP :: $B%0%l%V%J4pDl$N7W;;(B
                   1259: \EG :: Groebner basis computation
1.1       noro     1260: @end table
                   1261:
                   1262: @table @var
                   1263: @item return
1.2       noro     1264: \JP $B%j%9%H(B
                   1265: \EG list
1.4     ! noro     1266: @item plist  vlist  procs
1.2       noro     1267: \JP $B%j%9%H(B
                   1268: \EG list
1.1       noro     1269: @item order
1.2       noro     1270: \JP $B?t(B, $B%j%9%H$^$?$O9TNs(B
                   1271: \EG number, list or matrix
1.1       noro     1272: @item p
1.2       noro     1273: \JP 2^27 $BL$K~$NAG?t(B
                   1274: \EG prime less than 2^27
1.1       noro     1275: @end table
                   1276:
                   1277: @itemize @bullet
1.2       noro     1278: \BJP
1.1       noro     1279: @item
                   1280: $BI8=`%i%$%V%i%j$N(B @samp{gr} $B$GDj5A$5$l$F$$$k(B.
                   1281: @item
                   1282: $B$$$:$l$b(B, $BB?9`<0%j%9%H(B @var{plist} $B$N(B, $BJQ?t=g=x(B @var{vlist}, $B9`=g=x7?(B
                   1283: @var{order} $B$K4X$9$k%0%l%V%J4pDl$r5a$a$k(B. @code{gr()}, @code{hgr()}
                   1284: $B$O(B $BM-M}?t78?t(B, @code{gr_mod()} $B$O(B GF(@var{p}) $B78?t$H$7$F7W;;$9$k(B.
                   1285: @item
                   1286: @var{vlist} $B$OITDj85$N%j%9%H(B. @var{vlist} $B$K8=$l$J$$ITDj85$O(B,
                   1287: $B78?tBN$KB0$9$k$H8+$J$5$l$k(B.
                   1288: @item
                   1289: @code{gr()}, trace-lifting ($B%b%8%e%i1i;;$rMQ$$$?9bB.2=(B) $B$*$h$S(B sugar
                   1290: strategy $B$K$h$k7W;;(B, @code{hgr()} $B$O(B trace-lifting $B$*$h$S(B
                   1291: $B@F<!2=$K$h$k(B $B6:@5$5$l$?(B sugar strategy $B$K$h$k7W;;$r9T$&(B.
                   1292: @item
                   1293: @code{dgr()} $B$O(B, @code{gr()}, @code{dgr()} $B$r(B
                   1294: $B;R%W%m%;%9%j%9%H(B @var{procs} $B$N(B 2 $B$D$N%W%m%;%9$K$h$jF1;~$K7W;;$5$;(B,
                   1295: $B@h$K7k2L$rJV$7$?J}$N7k2L$rJV$9(B. $B7k2L$OF10l$G$"$k$,(B, $B$I$A$i$NJ}K!$,(B
                   1296: $B9bB.$+0lHL$K$OITL@$N$?$a(B, $B<B:]$N7P2a;~4V$rC;=L$9$k$N$KM-8z$G$"$k(B.
                   1297: @item
                   1298: @code{dgr()} $B$GI=<($5$l$k;~4V$O(B, $B$3$NH!?t$,<B9T$5$l$F$$$k%W%m%;%9$G$N(B
                   1299: CPU $B;~4V$G$"$j(B, $B$3$NH!?t$N>l9g$O$[$H$s$IDL?.$N$?$a$N;~4V$G$"$k(B.
1.2       noro     1300: \E
                   1301: \BEG
                   1302: @item
                   1303: These functions are defined in @samp{gr} in the standard library
                   1304: directory.
                   1305: @item
                   1306: They compute a Groebner basis of a polynomial list @var{plist} with
                   1307: respect to the variable order @var{vlist} and the order type @var{order}.
                   1308: @code{gr()} and @code{hgr()} compute a Groebner basis over the rationals
                   1309: and @code{gr_mod} computes over GF(@var{p}).
                   1310: @item
                   1311: Variables not included in @var{vlist} are regarded as
                   1312: included in the ground field.
                   1313: @item
                   1314: @code{gr()} uses trace-lifting (an improvement by modular computation)
                   1315:  and sugar strategy.
                   1316: @code{hgr()} uses trace-lifting and a cured sugar strategy
                   1317: by using homogenization.
                   1318: @item
                   1319: @code{dgr()} executes @code{gr()}, @code{dgr()} simultaneously on
                   1320: two process in a child process list @var{procs} and returns
                   1321: the result obtained first. The results returned from both the process
                   1322: should be equal, but it is not known in advance which method is faster.
                   1323: Therefore this function is useful to reduce the actual elapsed time.
                   1324: @item
                   1325: The CPU time shown after an exection of @code{dgr()} indicates
                   1326: that of the master process, and most of the time corresponds to the time
                   1327: for communication.
                   1328: \E
1.1       noro     1329: @end itemize
                   1330:
                   1331: @example
                   1332: [0] load("gr")$
                   1333: [64] load("cyclic")$
                   1334: [74] G=gr(cyclic(5),[c0,c1,c2,c3,c4],2);
                   1335: [c4^15+122*c4^10-122*c4^5-1,...]
                   1336: [75] GM=gr_mod(cyclic(5),[c0,c1,c2,c3,c4],2,31991)$
                   1337: 24628*c4^15+29453*c4^10+2538*c4^5+7363
                   1338: [76] (G[0]*24628-GM[0])%31991;
                   1339: 0
                   1340: @end example
                   1341:
                   1342: @table @t
1.2       noro     1343: \JP @item $B;2>H(B
                   1344: \EG @item References
1.1       noro     1345: @comment @fref{dp_gr_main dp_gr_mod_main},
                   1346: @fref{dp_gr_main dp_gr_mod_main},
                   1347: @fref{dp_ord}.
                   1348: @end table
                   1349:
1.2       noro     1350: \JP @node lex_hensel lex_tl tolex tolex_d tolex_tl,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   1351: \EG @node lex_hensel lex_tl tolex tolex_d tolex_tl,,, Functions for Groebner basis computation
1.1       noro     1352: @subsection @code{lex_hensel}, @code{lex_tl}, @code{tolex}, @code{tolex_d}, @code{tolex_tl}
                   1353: @findex lex_hensel
                   1354: @findex lex_tl
                   1355: @findex tolex
                   1356: @findex tolex_d
                   1357: @findex tolex_tl
                   1358:
                   1359: @table @t
                   1360: @item lex_hensel(@var{plist},@var{vlist1},@var{order},@var{vlist2},@var{homo})
                   1361: @itemx lex_tl(@var{plist},@var{vlist1},@var{order},@var{vlist2},@var{homo})
1.2       noro     1362: \JP :: $B4pDlJQ49$K$h$k<-=q<0=g=x%0%l%V%J4pDl$N7W;;(B
                   1363: \EG:: Groebner basis computation with respect to a lex order by change of ordering
1.1       noro     1364: @item tolex(@var{plist},@var{vlist1},@var{order},@var{vlist2})
                   1365: @itemx tolex_d(@var{plist},@var{vlist1},@var{order},@var{vlist2},@var{procs})
                   1366: @itemx tolex_tl(@var{plist},@var{vlist1},@var{order},@var{vlist2},@var{homo})
1.2       noro     1367: \JP :: $B%0%l%V%J4pDl$rF~NO$H$9$k(B, $B4pDlJQ49$K$h$k<-=q<0=g=x%0%l%V%J4pDl$N7W;;(B
                   1368: \EG :: Groebner basis computation with respect to a lex order by change of ordering, starting from a Groebner basis
1.1       noro     1369: @end table
                   1370:
                   1371: @table @var
                   1372: @item return
1.2       noro     1373: \JP $B%j%9%H(B
                   1374: \EG list
1.4     ! noro     1375: @item plist  vlist1  vlist2  procs
1.2       noro     1376: \JP $B%j%9%H(B
                   1377: \EG list
1.1       noro     1378: @item order
1.2       noro     1379: \JP $B?t(B, $B%j%9%H$^$?$O9TNs(B
                   1380: \EG number, list or matrix
1.1       noro     1381: @item homo
1.2       noro     1382: \JP $B%U%i%0(B
                   1383: \EG flag
1.1       noro     1384: @end table
                   1385:
                   1386: @itemize @bullet
1.2       noro     1387: \BJP
1.1       noro     1388: @item
                   1389: $BI8=`%i%$%V%i%j$N(B @samp{gr} $B$GDj5A$5$l$F$$$k(B.
                   1390: @item
                   1391: @code{lex_hensel()}, @code{lex_tl()} $B$O(B,
                   1392: $BB?9`<0%j%9%H(B @var{plist} $B$N(B, $BJQ?t=g=x(B @var{vlist1}, $B9`=g=x7?(B
                   1393: @var{order} $B$K4X$9$k%0%l%V%J4pDl$r5a$a(B, $B$=$l$r(B, $BJQ?t=g=x(B @var{vlist2}
                   1394: $B$N<-=q<0=g=x%0%l%V%J4pDl$KJQ49$9$k(B.
                   1395: @item
                   1396: @code{tolex()}, @code{tolex_tl()} $B$O(B,
                   1397: $BJQ?t=g=x(B @var{vlist1}, $B9`=g=x7?(B @var{order} $B$K4X$9$k%0%l%V%J4pDl$G$"$k(B
                   1398: $BB?9`<0%j%9%H(B @var{plist} $B$rJQ?t=g=x(B @var{vlist2} $B$N<-=q<0=g=x%0%l%V%J(B
                   1399: $B4pDl$KJQ49$9$k(B.
                   1400: @code{tolex_d()} $B$O(B, @code{tolex()} $B$K$*$1$k(B, $B3F4pDl$N7W;;$r(B, $B;R%W%m%;%9(B
                   1401: $B%j%9%H(B @var{procs} $B$N3F%W%m%;%9$KJ,;67W;;$5$;$k(B.
                   1402: @item
                   1403: @code{lex_hensel()}, @code{lex_tl()} $B$K$*$$$F$O(B, $B<-=q<0=g=x%0%l%V%J4pDl$N(B
                   1404: $B7W;;$O<!$N$h$&$K9T$o$l$k(B. (@code{[Noro,Yokoyama]} $B;2>H(B.)
                   1405: @enumerate
                   1406: @item
                   1407: @var{vlist1}, @var{order} $B$K4X$9$k%0%l%V%J4pDl(B @var{G0} $B$r7W;;$9$k(B.
                   1408: (@code{lex_hensel()} $B$N$_(B. )
                   1409: @item
                   1410: @var{G0} $B$N3F85$N(B @var{vlist2} $B$K4X$9$k<-=q<0=g=x$K$*$1$kF,78?t$r3d$i$J$$(B
                   1411: $B$h$&$JAG?t(B @var{p} $B$rA*$S(B, GF(@var{p}) $B>e$G$N<-=q<0=g=x%0%l%V%J4pDl(B
                   1412: @var{Gp} $B$r7W;;$9$k(B.
                   1413: @item
                   1414: @var{Gp} $B$K8=$l$k$9$Y$F$N9`$N(B, @var{G0} $B$K4X$9$k@55,7A(B @var{NF} $B$r7W;;$9$k(B.
                   1415: @item
                   1416: @var{Gp} $B$N3F85(B @var{f} $B$K$D$-(B, @var{f} $B$N78?t$rL$Dj78?t$G(B,
                   1417: @var{f} $B$N3F9`$rBP1~$9$k(B @var{NF} $B$N85$GCV$-49$((B, $B3F9`$N78?t$r(B 0 $B$HCV$$$?(B,
                   1418: $BL$Dj78?t$K4X$9$k@~7AJ}Dx<07O(B @var{Lf} $B$r:n$k(B.
                   1419: @item
                   1420: @var{Lf} $B$,(B, $BK!(B @var{p} $B$G0l0U2r$r;}$D$3$H$rMQ$$$F(B @var{Lf} $B$N2r$r(B
                   1421: $BK!(B @var{p}$B$N2r$+$i(B Hensel $B9=@.$K$h$j5a$a$k(B.
                   1422: @item
                   1423: $B$9$Y$F$N(B @var{Gp} $B$N85$K$D$-@~7AJ}Dx<0$,2r$1$?$i$=$N2rA4BN$,5a$a$k(B
                   1424: $B<-=q<0=g=x$G$N%0%l%V%J4pDl(B. $B$b$7$I$l$+$N@~7AJ}Dx<0$N5a2r$K<:GT$7$?$i(B,
                   1425: @var{p} $B$r$H$jD>$7$F$d$jD>$9(B.
                   1426: @end enumerate
                   1427:
                   1428: @item
                   1429: @code{lex_tl()}, @code{tolex_tl()} $B$K$*$$$F$O(B, $B<-=q<0=g=x%0%l%V%J4pDl$N(B
                   1430: $B7W;;$O<!$N$h$&$K9T$o$l$k(B.
                   1431:
                   1432: @enumerate
                   1433: @item
                   1434: @var{vlist1}, @var{order} $B$K4X$9$k%0%l%V%J4pDl(B @var{G0} $B$r7W;;$9$k(B.
                   1435: (@code{lex_hensel()} $B$N$_(B. )
                   1436: @item
                   1437: @var{G0} $B$,(B 0 $B<!85%7%9%F%`$G$J$$$H$-(B, @var{G0} $B$rF~NO$H$7$F(B,
                   1438: @var{G0} $B$N3F85$N(B @var{vlist2} $B$K4X$9$k<-=q<0=g=x$K$*$1$kF,78?t$r3d$i$J$$(B
                   1439: $B$h$&$JAG?t(B @var{p} $B$rA*$S(B, @var{p} $B$rMQ$$$?(B trace-lifting $B$K$h$j<-=q<0(B
                   1440: $B=g=x$N%0%l%V%J4pDl8uJd$r5a$a(B, $B$b$75a$^$C$?$J$i%A%'%C%/$J$7$K$=$l$,5a$a$k(B
                   1441: $B%0%l%V%J4pDl$H$J$k(B. $B$b$7<:GT$7$?$i(B, @var{p} $B$r$H$jD>$7$F$d$jD>$9(B.
                   1442: @item
                   1443: @var{G0} $B$,(B 0 $B<!85%7%9%F%`$N$H$-(B, @var{G0} $B$rF~NO$H$7$F(B,
                   1444: $B$^$:(B, @var{vlist2} $B$N:G8e$NJQ?t0J30$r>C5n$9$k>C5n=g=x$K$h$j(B
                   1445: $B%0%l%V%J4pDl(B @var{G1} $B$r7W;;$7(B, $B$=$l$+$i<-=q<0=g=x$N%0%l%V%J4pDl$r(B
                   1446: $B7W;;$9$k(B. $B$=$N:](B, $B3F%9%F%C%W$G$O(B, $BF~NO$N3F85$N(B, $B5a$a$k=g=x$K$*$1$k(B
                   1447: $BF,78?t$r3d$i$J$$AG?t$rMQ$$$?(B trace-lifting $B$G%0%l%V%J4pDl8uJd$r5a$a(B,
                   1448: $B$b$75a$^$C$?$i%A%'%C%/$J$7$K$=$l$,$=$N=g=x$G$N%0%l%V%J4pDl$H$J$k(B.
                   1449: @end enumerate
                   1450:
                   1451: @item
                   1452: $BM-M}<078?t$N7W;;$O(B, @code{lex_tl()}, @code{tolex_tl()} $B$N$_<u$1IU$1$k(B.
                   1453: @item
                   1454: @code{homo} $B$,(B 0 $B$G$J$$>l9g(B, $BFbIt$G5/F0$5$l$k(B Buchberger $B%"%k%4%j%:%`$K(B
                   1455: $B$*$$$F(B, $B@F<!2=$,9T$o$l$k(B.
                   1456: @item
                   1457: @code{tolex_d()} $B$GI=<($5$l$k;~4V$O(B, $B$3$NH!?t$,<B9T$5$l$F$$$k%W%m%;%9$K(B
                   1458: $B$*$$$F9T$o$l$?7W;;$KBP1~$7$F$$$F(B, $B;R%W%m%;%9$K$*$1$k;~4V$O4^$^$l$J$$(B.
1.2       noro     1459: \E
                   1460: \BEG
                   1461: @item
                   1462: These functions are defined in @samp{gr} in the standard library
                   1463: directory.
                   1464: @item
                   1465: @code{lex_hensel()} and @code{lex_tl()} first compute a Groebner basis
                   1466: with respect to the variable order @var{vlist1} and the order type @var{order}.
                   1467: Then the Groebner basis is converted into a lex order Groebner basis
                   1468: with respect to the varable order @var{vlist2}.
                   1469: @item
                   1470: @code{tolex()} and @code{tolex_tl()} convert a Groebner basis @var{plist}
                   1471: with respect to the variable order @var{vlist1} and the order type @var{order}
                   1472: into a lex order Groebner basis
                   1473: with respect to the varable order @var{vlist2}.
                   1474: @code{tolex_d()} does computations of basis elements in @code{tolex()}
                   1475: in parallel on the processes in a child process list @var{procs}.
                   1476: @item
                   1477: In @code{lex_hensel()} and @code{tolex_hensel()} a lex order Groebner basis
                   1478: is computed as follows.(Refer to @code{[Noro,Yokoyama]}.)
                   1479: @enumerate
                   1480: @item
                   1481: Compute a Groebner basis @var{G0} with respect to @var{vlist1} and @var{order}.
                   1482: (Only in @code{lex_hensel()}. )
                   1483: @item
                   1484: Choose a prime which does not divide head coefficients of elements in @var{G0}
                   1485: with respect to @var{vlist1} and @var{order}. Then compute a lex order
                   1486: Groebner basis @var{Gp} over GF(@var{p}) with respect to @var{vlist2}.
                   1487: @item
                   1488: Compute @var{NF}, the set of all the normal forms with respect to
                   1489: @var{G0} of terms appearing in @var{Gp}.
                   1490: @item
                   1491: For each element @var{f} in @var{Gp}, replace coefficients and terms in @var{f}
                   1492: with undetermined coefficients and the corresponding polynomials in @var{NF}
                   1493: respectively, and generate a system of liear equation @var{Lf} by equating
                   1494: the coefficients of terms in the replaced polynomial with 0.
                   1495: @item
                   1496: Solve @var{Lf} by Hensel lifting, starting from the unique mod @var{p}
                   1497: solution.
                   1498: @item
                   1499: If all the linear equations generated from the elements in @var{Gp}
                   1500: could be solved, then the set of solutions corresponds to a lex order
                   1501: Groebner basis. Otherwise redo the whole process with another @var{p}.
                   1502: @end enumerate
                   1503:
                   1504: @item
                   1505: In @code{lex_tl()} and @code{tolex_tl()} a lex order Groebner basis
                   1506: is computed as follows.(Refer to @code{[Noro,Yokoyama]}.)
                   1507:
                   1508: @enumerate
                   1509: @item
                   1510: Compute a Groebner basis @var{G0} with respect to @var{vlist1} and @var{order}.
                   1511: (Only in @code{lex_tl()}. )
                   1512: @item
                   1513: If @var{G0} is not zero-dimensional, choose a prime which does not divide
                   1514: head coefficients of elements in @var{G0} with respect to @var{vlist1} and
                   1515: @var{order}. Then compute a candidate of a lex order Groebner basis
                   1516: via trace lifting with @var{p}. If it succeeds the candidate is indeed
                   1517: a lex order Groebner basis without any check. Otherwise redo the whole
                   1518: process with another @var{p}.
                   1519: @item
                   1520:
                   1521: If @var{G0} is zero-dimensional, starting from @var{G0},
                   1522: compute a Groebner basis @var{G1} with respect to an elimination order
                   1523: to eliminate variables other than the last varibale in @var{vlist2}.
                   1524: Then compute a lex order Groebner basis stating from @var{G1}. These
                   1525: computations are done by trace lifting and the selection of a mudulus
                   1526: @var{p} is the same as in non zero-dimensional cases.
                   1527: @end enumerate
                   1528:
                   1529: @item
                   1530: Computations with rational function coefficients can be done only by
                   1531: @code{lex_tl()} and @code{tolex_tl()}.
                   1532: @item
                   1533: If @code{homo} is not equal to 0, homogenization is used in Buchberger
                   1534: algorithm.
                   1535: @item
                   1536: The CPU time shown after an execution of @code{tolex_d()} indicates
                   1537: that of the master process, and it does not include the time in child
                   1538: processes.
                   1539: \E
1.1       noro     1540: @end itemize
                   1541:
                   1542: @example
                   1543: [78] K=katsura(5)$
                   1544: 30msec + gc : 20msec
                   1545: [79] V=[u5,u4,u3,u2,u1,u0]$
                   1546: 0msec
                   1547: [80] G0=hgr(K,V,2)$
                   1548: 91.558sec + gc : 15.583sec
                   1549: [81] G1=lex_hensel(K,V,0,V,0)$
                   1550: 49.049sec + gc : 9.961sec
                   1551: [82] G2=lex_tl(K,V,0,V,1)$
                   1552: 31.186sec + gc : 3.500sec
                   1553: [83] gb_comp(G0,G1);
                   1554: 1
                   1555: 10msec
                   1556: [84] gb_comp(G0,G2);
                   1557: 1
                   1558: @end example
                   1559:
                   1560: @table @t
1.2       noro     1561: \JP @item $B;2>H(B
                   1562: \EG @item References
1.1       noro     1563: @fref{dp_gr_main dp_gr_mod_main},
1.2       noro     1564: \JP @fref{dp_ord}, @fref{$BJ,;67W;;(B}
                   1565: \EG @fref{dp_ord}, @fref{Distributed computation}
1.1       noro     1566: @end table
                   1567:
1.2       noro     1568: \JP @node lex_hensel_gsl tolex_gsl tolex_gsl_d,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   1569: \EG @node lex_hensel_gsl tolex_gsl tolex_gsl_d,,, Functions for Groebner basis computation
1.1       noro     1570: @subsection @code{lex_hensel_gsl}, @code{tolex_gsl}, @code{tolex_gsl_d}
                   1571: @findex lex_hensel_gsl
                   1572: @findex tolex_gsl
                   1573: @findex tolex_gsl_d
                   1574:
                   1575: @table @t
                   1576: @item lex_hensel_gsl(@var{plist},@var{vlist1},@var{order},@var{vlist2},@var{homo})
1.2       noro     1577: \JP :: GSL $B7A<0$N%$%G%"%k4pDl$N7W;;(B
                   1578: \EG ::Computation of an GSL form ideal basis
1.1       noro     1579: @item tolex_gsl(@var{plist},@var{vlist1},@var{order},@var{vlist2},@var{homo})
                   1580: @itemx tolex_gsl_d(@var{plist},@var{vlist1},@var{order},@var{vlist2},@var{homo},@var{procs})
1.2       noro     1581: \JP :: $B%0%l%V%J4pDl$rF~NO$H$9$k(B, GSL $B7A<0$N%$%G%"%k4pDl$N7W;;(B
                   1582: \EG :: Computation of an GSL form ideal basis stating from a Groebner basis
1.1       noro     1583: @end table
                   1584:
                   1585: @table @var
                   1586: @item return
1.2       noro     1587: \JP $B%j%9%H(B
                   1588: \EG list
1.4     ! noro     1589: @item plist  vlist1  vlist2  procs
1.2       noro     1590: \JP $B%j%9%H(B
                   1591: \EG list
1.1       noro     1592: @item order
1.2       noro     1593: \JP $B?t(B, $B%j%9%H$^$?$O9TNs(B
                   1594: \EG number, list or matrix
1.1       noro     1595: @item homo
1.2       noro     1596: \JP $B%U%i%0(B
                   1597: \EG flag
1.1       noro     1598: @end table
                   1599:
                   1600: @itemize @bullet
1.2       noro     1601: \BJP
1.1       noro     1602: @item
                   1603: @code{lex_hensel_gsl()} $B$O(B @code{lex_hensel()} $B$N(B, @code{tolex_gsl()} $B$O(B
                   1604: @code{tolex()} $B$NJQ<o$G(B, $B7k2L$N$_$,0[$J$k(B.
                   1605: @code{tolex_gsl_d()} $B$O(B, $B4pDl7W;;$r(B, @code{procs} $B$G;XDj$5$l$k;R%W%m%;%9$K(B
                   1606: $BJ,;67W;;$5$;$k(B.
                   1607: @item
                   1608: $BF~NO$,(B 0 $B<!85%7%9%F%`$G(B, $B$=$N<-=q<0=g=x%0%l%V%J4pDl$,(B
                   1609: @code{[f0,x1-f1,...,xn-fn]} (@code{f0},...,@code{fn} $B$O(B
                   1610: @code{x0} $B$N(B 1 $BJQ?tB?9`<0(B) $B$J$k7A(B ($B$3$l$r(B SL $B7A<0$H8F$V(B) $B$r;}$D>l9g(B,
                   1611: @code{[[x1,g1,d1],...,[xn,gn,dn],[x0,f0,f0']]} $B$J$k%j%9%H(B ($B$3$l$r(B GSL $B7A<0$H8F$V(B)
                   1612: $B$rJV$9(B.
1.2       noro     1613: $B$3$3$G(B, @code{gi} $B$O(B, @code{di*f0'*fi-gi} $B$,(B @code{f0} $B$G3d$j@Z$l$k$h$&$J(B
1.1       noro     1614: @code{x0} $B$N(B1 $BJQ?tB?9`<0$G(B,
                   1615: $B2r$O(B @code{f0(x0)=0} $B$J$k(B @code{x0} $B$KBP$7(B, @code{[x1=g1/(d1*f0'),...,xn=gn/(dn*f0')]}
                   1616: $B$H$J$k(B. $B<-=q<0=g=x%0%l%V%J4pDl$,>e$N$h$&$J7A$G$J$$>l9g(B, @code{tolex()} $B$K(B
                   1617: $B$h$kDL>o$N%0%l%V%J4pDl$rJV$9(B.
                   1618: @item
                   1619: GSL $B7A<0$K$h$jI=$5$l$k4pDl$O%0%l%V%J4pDl$G$O$J$$$,(B, $B0lHL$K78?t$,(B SL $B7A<0(B
                   1620: $B$N%0%l%V%J4pDl$h$jHs>o$K>.$5$$$?$a7W;;$bB.$/(B, $B2r$b5a$a$d$9$$(B.
                   1621: @code{tolex_gsl_d()} $B$GI=<($5$l$k;~4V$O(B, $B$3$NH!?t$,<B9T$5$l$F$$$k%W%m%;%9$K(B
                   1622: $B$*$$$F9T$o$l$?7W;;$KBP1~$7$F$$$F(B, $B;R%W%m%;%9$K$*$1$k;~4V$O4^$^$l$J$$(B.
1.2       noro     1623: \E
                   1624: \BEG
                   1625: @item
                   1626: @code{lex_hensel_gsl()} and @code{lex_hensel()} are variants of
                   1627: @code{tolex_gsl()} and @code{tolex()} respectively. The results are
                   1628: Groebner basis or a kind of ideal basis, called GSL form.
                   1629: @code{tolex_gsl_d()} does basis computations in parallel on child
                   1630: processes specified in @code{procs}.
                   1631:
                   1632: @item
                   1633: If the input is zero-dimensional and a lex order Groebner basis has
                   1634: the form @code{[f0,x1-f1,...,xn-fn]} (@code{f0},...,@code{fn} are
                   1635: univariate polynomials of @code{x0}; SL form), then this these
                   1636: functions return a list such as
                   1637: @code{[[x1,g1,d1],...,[xn,gn,dn],[x0,f0,f0']]} (GSL form).  In this list
                   1638: @code{gi} is a univariate polynomial of @code{x0} such that
                   1639: @code{di*f0'*fi-gi} divides @code{f0} and the roots of the input ideal is
                   1640: @code{[x1=g1/(d1*f0'),...,xn=gn/(dn*f0')]} for @code{x0}
                   1641: such that @code{f0(x0)=0}.
                   1642: If the lex order Groebner basis does not have the above form,
                   1643: these functions return
                   1644: a lex order Groebner basis computed by @code{tolex()}.
                   1645: @item
                   1646: Though an ideal basis represented as GSL form is not a Groebner basis
                   1647: we can expect that the coefficients are much smaller than those in a Groebner
                   1648: basis and that the computation is efficient.
                   1649: The CPU time shown after an execution of @code{tolex_gsl_d()} indicates
                   1650: that of the master process, and it does not include the time in child
                   1651: processes.
                   1652: \E
1.1       noro     1653: @end itemize
                   1654:
                   1655: @example
                   1656: [103] K=katsura(5)$
                   1657: [104] V=[u5,u4,u3,u2,u1,u0]$
                   1658: [105] G0=gr(K,V,0)$
                   1659: [106] GSL=tolex_gsl(G0,V,0,V)$
                   1660: [107] GSL[0];
                   1661: [u1,8635837421130477667200000000*u0^31-...]
                   1662: [108] GSL[1];
                   1663: [u2,10352277157007342793600000000*u0^31-...]
                   1664: [109] GSL[5];
                   1665: [u0,11771021876193064124640000000*u0^32-...,376672700038178051988480000000*u0^31-...]
                   1666: @end example
                   1667:
                   1668: @table @t
1.2       noro     1669: \JP @item $B;2>H(B
                   1670: \EG @item References
1.1       noro     1671: @fref{lex_hensel lex_tl tolex tolex_d tolex_tl},
1.2       noro     1672: \JP @fref{$BJ,;67W;;(B}
                   1673: \EG @fref{Distributed computation}
1.1       noro     1674: @end table
                   1675:
1.2       noro     1676: \JP @node gr_minipoly minipoly,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   1677: \EG @node gr_minipoly minipoly,,, Functions for Groebner basis computation
1.1       noro     1678: @subsection @code{gr_minipoly}, @code{minipoly}
                   1679: @findex gr_minipoly
                   1680: @findex minipoly
                   1681:
                   1682: @table @t
                   1683: @item gr_minipoly(@var{plist},@var{vlist},@var{order},@var{poly},@var{v},@var{homo})
1.2       noro     1684: \JP :: $BB?9`<0$N(B, $B%$%G%"%k$rK!$H$7$?:G>.B?9`<0$N7W;;(B
                   1685: \EG :: Computation of the minimal polynomial of a polynomial modulo an ideal
1.1       noro     1686: @item minipoly(@var{plist},@var{vlist},@var{order},@var{poly},@var{v})
1.2       noro     1687: \JP :: $B%0%l%V%J4pDl$rF~NO$H$9$k(B, $BB?9`<0$N:G>.B?9`<0$N7W;;(B
                   1688: \EG :: Computation of the minimal polynomial of a polynomial modulo an ideal
1.1       noro     1689: @end table
                   1690:
                   1691: @table @var
                   1692: @item return
1.2       noro     1693: \JP $BB?9`<0(B
                   1694: \EG polynomial
1.4     ! noro     1695: @item plist  vlist
1.2       noro     1696: \JP $B%j%9%H(B
                   1697: \EG list
1.1       noro     1698: @item order
1.2       noro     1699: \JP $B?t(B, $B%j%9%H$^$?$O9TNs(B
                   1700: \EG number, list or matrix
1.1       noro     1701: @item poly
1.2       noro     1702: \JP $BB?9`<0(B
                   1703: \EG polynomial
1.1       noro     1704: @item v
1.2       noro     1705: \JP $BITDj85(B
                   1706: \EG indeterminate
1.1       noro     1707: @item homo
1.2       noro     1708: \JP $B%U%i%0(B
                   1709: \EG flag
1.1       noro     1710: @end table
                   1711:
                   1712: @itemize @bullet
1.2       noro     1713: \BJP
1.1       noro     1714: @item
                   1715: @code{gr_minipoly()} $B$O%0%l%V%J4pDl$N7W;;$+$i9T$$(B, @code{minipoly()} $B$O(B
                   1716: $BF~NO$r%0%l%V%J4pDl$H$_$J$9(B.
                   1717: @item
                   1718: $B%$%G%"%k(B I $B$,BN(B K $B>e$NB?9`<04D(B K[X] $B$N(B 0 $B<!85%$%G%"%k$N;~(B,
                   1719: K[@var{v}] $B$N85(B f(@var{v}) $B$K(B f(@var{p}) mod I $B$rBP1~$5$;$k(B
                   1720: $B4D=`F17?$N3K$O(B 0 $B$G$J$$B?9`<0$K$h$j@8@.$5$l$k(B. $B$3$N@8@.85$r(B @var{p}
                   1721: $B$N(B, $BK!(B @var{I} $B$G$N:G>.B?9`<0$H8F$V(B.
                   1722: @item
                   1723: @code{gr_minipoly()}, @code{minipoly()} $B$O(B, $BB?9`<0(B @var{p} $B$N:G>.B?9`<0(B
                   1724: $B$r5a$a(B, @var{v} $B$rJQ?t$H$9$kB?9`<0$H$7$FJV$9(B.
                   1725: @item
                   1726: $B:G>.B?9`<0$O(B, $B%0%l%V%J4pDl$N(B 1 $B$D$N85$H$7$F7W;;$9$k$3$H$b$G$-$k$,(B,
                   1727: $B:G>.B?9`<0$N$_$r5a$a$?$$>l9g(B, @code{minipoly()}, @code{gr_minipoly()} $B$O(B
                   1728: $B%0%l%V%J4pDl$rMQ$$$kJ}K!$KHf$Y$F8zN($,$h$$(B.
                   1729: @item
                   1730: @code{gr_minipoly()} $B$K;XDj$9$k9`=g=x$H$7$F$O(B, $BDL>oA4<!?t5U<-=q<0=g=x$r(B
                   1731: $BMQ$$$k(B.
1.2       noro     1732: \E
                   1733: \BEG
                   1734: @item
                   1735: @code{gr_minipoly()} begins by computing a Groebner basis.
                   1736: @code{minipoly()} regards an input as a Groebner basis with respect to
                   1737: the variable order @var{vlist} and the order type @var{order}.
                   1738: @item
                   1739: Let K be a field. If an ideal @var{I} in K[X] is zero-dimensional, then, for
                   1740: a polynomial @var{p} in K[X], the kernel of a homomorphism from
                   1741: K[@var{v}] to K[X]/@var{I} which maps f(@var{v}) to f(@var{p}) mod @var{I}
                   1742: is generated by a polynomial. The generator is called the minimal polynomial
                   1743: of @var{p} modulo @var{I}.
                   1744: @item
                   1745: @code{gr_minipoly()} and @code{minipoly()} computes the minimal polynomial
                   1746: of a polynomial @var{p} and returns it as a polynomial of @var{v}.
                   1747: @item
                   1748: The minimal polynomial can be computed as an element of a Groebner basis.
                   1749: But if we are only interested in the minimal polynomial,
                   1750: @code{minipoly()} and @code{gr_minipoly()} can compute it more efficiently
                   1751: than methods using Groebner basis computation.
                   1752: @item
                   1753: It is recommended to use a degree reverse lex order as a term order
                   1754: for @code{gr_minipoly()}.
                   1755: \E
1.1       noro     1756: @end itemize
                   1757:
                   1758: @example
                   1759: [117] G=tolex(G0,V,0,V)$
                   1760: 43.818sec + gc : 11.202sec
                   1761: [118] GSL=tolex_gsl(G0,V,0,V)$
                   1762: 17.123sec + gc : 2.590sec
                   1763: [119] MP=minipoly(G0,V,0,u0,z)$
                   1764: 4.370sec + gc : 780msec
                   1765: @end example
                   1766:
                   1767: @table @t
1.2       noro     1768: \JP @item $B;2>H(B
                   1769: \EG @item References
1.1       noro     1770: @fref{lex_hensel lex_tl tolex tolex_d tolex_tl}.
                   1771: @end table
                   1772:
1.2       noro     1773: \JP @node tolexm minipolym,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   1774: \EG @node tolexm minipolym,,, Functions for Groebner basis computation
1.1       noro     1775: @subsection @code{tolexm}, @code{minipolym}
                   1776: @findex tolexm
                   1777: @findex minipolym
                   1778:
                   1779: @table @t
                   1780: @item tolexm(@var{plist},@var{vlist1},@var{order},@var{vlist2},@var{mod})
1.2       noro     1781: \JP :: $BK!(B @var{mod} $B$G$N4pDlJQ49$K$h$k%0%l%V%J4pDl7W;;(B
                   1782: \EG :: Groebner basis computation modulo @var{mod} by change of ordering.
1.1       noro     1783: @item minipolym(@var{plist},@var{vlist1},@var{order},@var{poly},@var{v},@var{mod})
1.2       noro     1784: \JP :: $BK!(B @var{mod} $B$G$N%0%l%V%J4pDl$K$h$kB?9`<0$N:G>.B?9`<0$N7W;;(B
                   1785: \EG :: Minimal polynomial computation modulo @var{mod} the same method as
1.1       noro     1786: @end table
                   1787:
                   1788: @table @var
                   1789: @item return
1.2       noro     1790: \JP @code{tolexm()} : $B%j%9%H(B, @code{minipolym()} : $BB?9`<0(B
                   1791: \EG @code{tolexm()} : list, @code{minipolym()} : polynomial
1.4     ! noro     1792: @item plist  vlist1  vlist2
1.2       noro     1793: \JP $B%j%9%H(B
                   1794: \EG list
1.1       noro     1795: @item order
1.2       noro     1796: \JP $B?t(B, $B%j%9%H$^$?$O9TNs(B
                   1797: \EG number, list or matrix
1.1       noro     1798: @item mod
1.2       noro     1799: \JP $BAG?t(B
                   1800: \EG prime
1.1       noro     1801: @end table
                   1802:
                   1803: @itemize @bullet
1.2       noro     1804: \BJP
1.1       noro     1805: @item
                   1806: $BF~NO(B @var{plist} $B$O$$$:$l$b(B $BJQ?t=g=x(B @var{vlist1}, $B9`=g=x7?(B @var{order},
                   1807: $BK!(B @var{mod} $B$K$*$1$k%0%l%V%J4pDl$G$J$1$l$P$J$i$J$$(B.
                   1808: @item
                   1809: @code{minipolym()} $B$O(B @code{minipoly} $B$KBP1~$9$k7W;;$rK!(B @var{mod}$B$G9T$&(B.
                   1810: @item
                   1811: @code{tolexm()} $B$O(B FGLM $BK!$K$h$k4pDlJQ49$K$h$j(B @var{vlist2},
                   1812: $B<-=q<0=g=x$K$h$k%0%l%V%J4pDl$r7W;;$9$k(B.
1.2       noro     1813: \E
                   1814: \BEG
                   1815: @item
                   1816: An input @var{plist} must be a Groebner basis modulo @var{mod}
                   1817: with respect to the variable order @var{vlist1} and the order type @var{order}.
                   1818: @item
                   1819: @code{minipolym()} executes the same computation as in @code{minipoly}.
                   1820: @item
                   1821: @code{tolexm()} computes a lex order Groebner basis modulo @var{mod}
                   1822: with respect to the variable order @var{vlist2}, by using FGLM algorithm.
                   1823: \E
1.1       noro     1824: @end itemize
                   1825:
                   1826: @example
                   1827: [197] tolexm(G0,V,0,V,31991);
                   1828: [8271*u0^31+10435*u0^30+816*u0^29+26809*u0^28+...,...]
                   1829: [198] minipolym(G0,V,0,u0,z,31991);
                   1830: z^32+11405*z^31+20868*z^30+21602*z^29+...
                   1831: @end example
                   1832:
                   1833: @table @t
1.2       noro     1834: \JP @item $B;2>H(B
                   1835: \EG @item References
1.1       noro     1836: @fref{lex_hensel lex_tl tolex tolex_d tolex_tl},
                   1837: @fref{gr_minipoly minipoly}.
                   1838: @end table
                   1839:
1.2       noro     1840: \JP @node dp_gr_main dp_gr_mod_main,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   1841: \EG @node dp_gr_main dp_gr_mod_main,,, Functions for Groebner basis computation
1.1       noro     1842: @subsection @code{dp_gr_main}, @code{dp_gr_mod_main}
                   1843: @findex dp_gr_main
                   1844: @findex dp_gr_mod_main
                   1845:
                   1846: @table @t
                   1847: @item dp_gr_main(@var{plist},@var{vlist},@var{homo},@var{modular},@var{order})
                   1848: @itemx dp_gr_mod_main(@var{plist},@var{vlist},@var{homo},@var{modular},@var{order})
1.2       noro     1849: \JP :: $B%0%l%V%J4pDl$N7W;;(B ($BAH$_9~$_H!?t(B)
                   1850: \EG :: Groebner basis computation (built-in functions)
1.1       noro     1851: @end table
                   1852:
                   1853: @table @var
                   1854: @item return
1.2       noro     1855: \JP $B%j%9%H(B
                   1856: \EG list
1.4     ! noro     1857: @item plist  vlist
1.2       noro     1858: \JP $B%j%9%H(B
                   1859: \EG list
1.1       noro     1860: @item order
1.2       noro     1861: \JP $B?t(B, $B%j%9%H$^$?$O9TNs(B
                   1862: \EG number, list or matrix
1.1       noro     1863: @item homo
1.2       noro     1864: \JP $B%U%i%0(B
                   1865: \EG flag
1.1       noro     1866: @item modular
1.2       noro     1867: \JP $B%U%i%0$^$?$OAG?t(B
                   1868: \EG flag or prime
1.1       noro     1869: @end table
                   1870:
                   1871: @itemize @bullet
1.2       noro     1872: \BJP
1.1       noro     1873: @item
                   1874: $B$3$l$i$NH!?t$O(B, $B%0%l%V%J4pDl7W;;$N4pK\E*AH$_9~$_H!?t$G$"$j(B, @code{gr()},
                   1875: @code{hgr()}, @code{gr_mod()} $B$J$I$O$9$Y$F$3$l$i$NH!?t$r8F$S=P$7$F7W;;(B
                   1876: $B$r9T$C$F$$$k(B.
                   1877: @item
                   1878: $B%U%i%0(B @var{homo} $B$,(B 0 $B$G$J$$;~(B, $BF~NO$r@F<!2=$7$F$+$i(B Buchberger $B%"%k%4%j%:%`(B
                   1879: $B$r<B9T$9$k(B.
                   1880: @item
                   1881: @code{dp_gr_mod_main()} $B$KBP$7$F$O(B, @var{modular} $B$O(B, GF(@var{modular}) $B>e(B
                   1882: $B$G$N7W;;$r0UL#$9$k(B.
                   1883: @code{dp_gr_main()} $B$KBP$7$F$O(B, @var{modular} $B$O<!$N$h$&$J0UL#$r;}$D(B.
                   1884: @enumerate
                   1885: @item
                   1886: @var{modular} $B$,(B 1 $B$N;~(B, trace-lifting $B$K$h$k7W;;$r9T$&(B. $BAG?t$O(B
                   1887: @code{lprime(0)} $B$+$i=g$K@.8y$9$k$^$G(B @code{lprime()} $B$r8F$S=P$7$F@8@.$9$k(B.
                   1888: @item
                   1889: @var{modular} $B$,(B 2 $B0J>e$N<+A3?t$N;~(B, $B$=$NCM$rAG?t$H$_$J$7$F(B trace-lifting
                   1890: $B$r9T$&(B. $B$=$NAG?t$G<:GT$7$?>l9g(B, 0 $B$rJV$9(B.
                   1891: @item
                   1892: @var{modular} $B$,Ii$N>l9g(B,
                   1893: @var{-modular} $B$KBP$7$F>e=R$N5,B'$,E,MQ$5$l$k$,(B, trace-lifting $B$N:G=*(B
                   1894: $BCJ3,$N%0%l%V%J4pDl%A%'%C%/$H%$%G%"%k%a%s%P%7%C%W%A%'%C%/$,>JN,$5$l$k(B.
                   1895: @end enumerate
                   1896:
                   1897: @item
                   1898: @code{gr(P,V,O)} $B$O(B @code{dp_gr_main(P,V,0,1,O)}, @code{hgr(P,V,O)} $B$O(B
                   1899: @code{dp_gr_main(P,V,1,1,O)}, @code{gr_mod(P,V,O,M)} $B$O(B
                   1900: @code{dp_gr_mod_main(P,V,0,M,O)} $B$r$=$l$>$l<B9T$9$k(B.
                   1901: @item
                   1902: @var{homo}, @var{modular} $B$NB>$K(B, @code{dp_gr_flags()} $B$G@_Dj$5$l$k(B
                   1903: $B$5$^$6$^$J%U%i%0$K$h$j7W;;$,@)8f$5$l$k(B.
1.2       noro     1904: \E
                   1905: \BEG
                   1906: @item
                   1907: These functions are fundamental built-in functions for Groebner basis
                   1908: computation and @code{gr()},@code{hgr()} and @code{gr_mod()}
                   1909: are all interfaces to these functions.
                   1910: @item
                   1911: If @var{homo} is not equal to 0, homogenization is applied before entering
                   1912: Buchberger algorithm
                   1913: @item
                   1914: For @code{dp_gr_mod_main()}, @var{modular} means a computation over
                   1915: GF(@var{modular}).
                   1916: For @code{dp_gr_main()}, @var{modular} has the following mean.
                   1917: @enumerate
                   1918: @item
                   1919: If @var{modular} is 1 , trace lifting is used. Primes for trace lifting
                   1920: are generated by @code{lprime()}, starting from @code{lprime(0)}, until
                   1921: the computation succeeds.
                   1922: @item
                   1923: If @var{modular} is an integer  greater than 1, the integer is regarded as a
                   1924: prime and trace lifting is executed by using the prime. If the computation
                   1925: fails then 0 is returned.
                   1926: @item
                   1927: If @var{modular} is negative, the above rule is applied for @var{-modular}
                   1928: but the Groebner basis check and ideal-membership check are omitted in
                   1929: the last stage of trace lifting.
                   1930: @end enumerate
                   1931:
                   1932: @item
                   1933: @code{gr(P,V,O)}, @code{hgr(P,V,O)} and @code{gr_mod(P,V,O,M)} execute
                   1934: @code{dp_gr_main(P,V,0,1,O)}, @code{dp_gr_main(P,V,1,1,O)}
                   1935: and @code{dp_gr_mod_main(P,V,0,M,O)} respectively.
                   1936: @item
                   1937: Actual computation is controlled by various parameters set by
                   1938: @code{dp_gr_flags()}, other then by @var{homo} and @var{modular}.
                   1939: \E
1.1       noro     1940: @end itemize
                   1941:
                   1942: @table @t
1.2       noro     1943: \JP @item $B;2>H(B
                   1944: \EG @item References
1.1       noro     1945: @fref{dp_ord},
                   1946: @fref{dp_gr_flags dp_gr_print},
                   1947: @fref{gr hgr gr_mod},
1.2       noro     1948: \JP @fref{$B7W;;$*$h$SI=<($N@)8f(B}.
                   1949: \EG @fref{Controlling Groebner basis computations}
1.1       noro     1950: @end table
                   1951:
1.2       noro     1952: \JP @node dp_f4_main dp_f4_mod_main,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   1953: \EG @node dp_f4_main dp_f4_mod_main,,, Functions for Groebner basis computation
1.1       noro     1954: @subsection @code{dp_f4_main}, @code{dp_f4_mod_main}
                   1955: @findex dp_f4_main
                   1956: @findex dp_f4_mod_main
                   1957:
                   1958: @table @t
                   1959: @item dp_f4_main(@var{plist},@var{vlist},@var{order})
                   1960: @itemx dp_f4_mod_main(@var{plist},@var{vlist},@var{order})
1.2       noro     1961: \JP :: F4 $B%"%k%4%j%:%`$K$h$k%0%l%V%J4pDl$N7W;;(B ($BAH$_9~$_H!?t(B)
                   1962: \EG :: Groebner basis computation by F4 algorithm (built-in functions)
1.1       noro     1963: @end table
                   1964:
                   1965: @table @var
                   1966: @item return
1.2       noro     1967: \JP $B%j%9%H(B
                   1968: \EG list
1.4     ! noro     1969: @item plist  vlist
1.2       noro     1970: \JP $B%j%9%H(B
                   1971: \EG list
1.1       noro     1972: @item order
1.2       noro     1973: \JP $B?t(B, $B%j%9%H$^$?$O9TNs(B
                   1974: \EG number, list or matrix
1.1       noro     1975: @end table
                   1976:
                   1977: @itemize @bullet
1.2       noro     1978: \BJP
1.1       noro     1979: @item
                   1980: F4 $B%"%k%4%j%:%`$K$h$j%0%l%V%J4pDl$N7W;;$r9T$&(B.
                   1981: @item
                   1982: F4 $B%"%k%4%j%:%`$O(B, J.C. Faugere $B$K$h$jDs>'$5$l$??7@$Be%0%l%V%J4pDl(B
                   1983: $B;;K!$G$"$j(B, $BK\<BAu$O(B, $BCf9q>jM>DjM}$K$h$k@~7AJ}Dx<05a2r$rMQ$$$?(B
                   1984: $B;n83E*$J<BAu$G$"$k(B.
                   1985: @item
                   1986: $B0z?t$*$h$SF0:n$O$=$l$>$l(B @code{dp_gr_main()}, @code{dp_gr_mod_main()}
                   1987: $B$HF1MM$G$"$k(B.
1.2       noro     1988: \E
                   1989: \BEG
                   1990: @item
                   1991: These functions compute Groebner bases by F4 algorithm.
                   1992: @item
                   1993: F4 is a new generation algorithm for Groebner basis computation
                   1994: invented by J.C. Faugere. The current implementation of @code{dp_f4_main()}
                   1995: uses Chinese Remainder theorem and not highly optimized.
                   1996: @item
                   1997: Arguments and actions are the same as those of
                   1998: @code{dp_gr_main()}, @code{dp_gr_mod_main()}.
                   1999: \E
1.1       noro     2000: @end itemize
                   2001:
                   2002: @table @t
1.2       noro     2003: \JP @item $B;2>H(B
                   2004: \EG @item References
1.1       noro     2005: @fref{dp_ord},
                   2006: @fref{dp_gr_flags dp_gr_print},
                   2007: @fref{gr hgr gr_mod},
1.2       noro     2008: \JP @fref{$B7W;;$*$h$SI=<($N@)8f(B}.
                   2009: \EG @fref{Controlling Groebner basis computations}
1.1       noro     2010: @end table
                   2011:
1.2       noro     2012: \JP @node dp_gr_flags dp_gr_print,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2013: \EG @node dp_gr_flags dp_gr_print,,, Functions for Groebner basis computation
1.1       noro     2014: @subsection @code{dp_gr_flags}, @code{dp_gr_print}
                   2015: @findex dp_gr_flags
                   2016: @findex dp_gr_print
                   2017:
                   2018: @table @t
                   2019: @item dp_gr_flags([@var{list}])
                   2020: @itemx dp_gr_print([@var{0|1}])
1.2       noro     2021: \JP :: $B7W;;$*$h$SI=<(MQ%Q%i%a%?$N@_Dj(B, $B;2>H(B
                   2022: \BEG :: Set and show various parameters for cotrolling computations
                   2023: and showing informations.
                   2024: \E
1.1       noro     2025: @end table
                   2026:
                   2027: @table @var
                   2028: @item return
1.2       noro     2029: \JP $B@_DjCM(B
                   2030: \EG value currently set
1.1       noro     2031: @item list
1.2       noro     2032: \JP $B%j%9%H(B
                   2033: \EG list
1.1       noro     2034: @end table
                   2035:
                   2036: @itemize @bullet
1.2       noro     2037: \BJP
1.1       noro     2038: @item
                   2039: @code{dp_gr_main()}, @code{dp_gr_mod_main()} $B<B9T;~$K$*$1$k$5$^$6$^(B
                   2040: $B$J%Q%i%a%?$r@_Dj(B, $B;2>H$9$k(B.
                   2041: @item
                   2042: $B0z?t$,$J$$>l9g(B, $B8=:_$N@_Dj$,JV$5$l$k(B.
                   2043: @item
                   2044: $B0z?t$O(B, @code{["Print",1,"NoSugar",1,...]} $B$J$k7A$N%j%9%H$G(B, $B:8$+$i=g$K(B
                   2045: $B@_Dj$5$l$k(B. $B%Q%i%a%?L>$OJ8;zNs$GM?$($kI,MW$,$"$k(B.
                   2046: @item
                   2047: @code{dp_gr_print()} $B$O(B, $BFC$K%Q%i%a%?(B @code{Print} $B$NCM$rD>@\@_Dj(B, $B;2>H(B
                   2048: $B$G$-$k(B. $B$3$l$O(B, @code{dp_gr_main()} $B$J$I$r%5%V%k!<%A%s$H$7$FMQ$$$k%f!<%6(B
                   2049: $BH!?t$K$*$$$F(B, @code{Print} $B$NCM$r8+$F(B, $B$=$N%5%V%k!<%A%s$,Cf4V>pJs$NI=<((B
                   2050: $B$r9T$&:]$K(B, $B?WB.$K%U%i%0$r8+$k$3$H$,$G$-$k$h$&$KMQ0U$5$l$F$$$k(B.
1.2       noro     2051: \E
                   2052: \BEG
                   2053: @item
                   2054: @code{dp_gr_flags()} sets and shows various parameters for Groebner basis
                   2055:  computation.
                   2056: @item
                   2057: If no argument is specified the current settings are returned.
                   2058: @item
                   2059: Arguments must be specified as a list such as
                   2060:  @code{["Print",1,"NoSugar",1,...]}. Names of parameters must be character
                   2061: strings.
                   2062: @item
                   2063: @code{dp_gr_print()} is used to set and show the value of a parameter
                   2064: @code{Print}. This functions is prepared to get quickly the value of
                   2065: @code{Print} when a user defined function calling @code{dp_gr_main()} etc.
                   2066: uses the value as a flag for showing intermediate informations.
                   2067: \E
1.1       noro     2068: @end itemize
                   2069:
                   2070: @table @t
1.2       noro     2071: \JP @item $B;2>H(B
                   2072: \EG @item References
                   2073: \JP @fref{$B7W;;$*$h$SI=<($N@)8f(B}
                   2074: \EG @fref{Controlling Groebner basis computations}
1.1       noro     2075: @end table
                   2076:
1.2       noro     2077: \JP @node dp_ord,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2078: \EG @node dp_ord,,, Functions for Groebner basis computation
1.1       noro     2079: @subsection @code{dp_ord}
                   2080: @findex dp_ord
                   2081:
                   2082: @table @t
                   2083: @item dp_ord([@var{order}])
1.2       noro     2084: \JP :: $BJQ?t=g=x7?$N@_Dj(B, $B;2>H(B
                   2085: \EG :: Set and show the ordering type.
1.1       noro     2086: @end table
                   2087:
                   2088: @table @var
                   2089: @item return
1.2       noro     2090: \JP $BJQ?t=g=x7?(B ($B?t(B, $B%j%9%H$^$?$O9TNs(B)
                   2091: \EG ordering type (number, list or matrix)
1.1       noro     2092: @item order
1.2       noro     2093: \JP $B?t(B, $B%j%9%H$^$?$O9TNs(B
                   2094: \EG number, list or matrix
1.1       noro     2095: @end table
                   2096:
                   2097: @itemize @bullet
1.2       noro     2098: \BJP
1.1       noro     2099: @item
                   2100: $B0z?t$,$"$k;~(B, $BJQ?t=g=x7?$r(B @var{order} $B$K@_Dj$9$k(B. $B0z?t$,$J$$;~(B,
                   2101: $B8=:_@_Dj$5$l$F$$$kJQ?t=g=x7?$rJV$9(B.
                   2102:
                   2103: @item
                   2104: $BJ,;6I=8=B?9`<0$K4X$9$kH!?t(B, $B1i;;$O0z?t$H$7$FJQ?t=g=x7?$r$H$k$b$N$H$H$i$J$$$b$N(B
                   2105: $B$,$"$j(B, $B$H$i$J$$$b$N$K4X$7$F$O(B, $B$=$N;~E@$G@_Dj$5$l$F$$$kCM$rMQ$$$F7W;;$,(B
                   2106: $B9T$o$l$k(B.
                   2107:
                   2108: @item
                   2109: @code{gr()} $B$J$I(B, $B0z?t$H$7$FJQ?t=g=x7?$r$H$k$b$N$O(B, $BFbIt$G(B @code{dp_ord()}
                   2110: $B$r8F$S=P$7(B, $BJQ?t=g=x7?$r@_Dj$9$k(B. $B$3$N@_Dj$O(B, $B7W;;=*N;8e$b@8$-;D$k(B.
                   2111:
                   2112: @item
                   2113: $BJ,;6I=8=B?9`<0$N;MB'1i;;$b(B, $B@_Dj$5$l$F$$$kCM$rMQ$$$F7W;;$5$l$k(B. $B=>$C$F(B,
                   2114: $B$=$NB?9`<0$,@8@.$5$l$?;~E@$K$*$1$kJQ?t=g=x7?$,(B, $B;MB'1i;;;~$K@5$7$/@_Dj(B
                   2115: $B$5$l$F$$$J$1$l$P$J$i$J$$(B. $B$^$?(B, $B1i;;BP>]$H$J$kB?9`<0$O(B, $BF10l$NJQ?t=g=x(B
                   2116: $B7?$K4p$E$$$F@8@.$5$l$?$b$N$G$J$1$l$P$J$i$J$$(B.
                   2117:
                   2118: @item
                   2119: $B%H%C%W%l%Y%kH!?t0J30$NH!?t$rD>@\8F$S=P$9>l9g$K$O(B, $B$3$NH!?t$K$h$j(B
                   2120: $BJQ?t=g=x7?$r@5$7$/@_Dj$7$J$1$l$P$J$i$J$$(B.
1.2       noro     2121: \E
                   2122: \BEG
                   2123: @item
                   2124: If an argument is specified, the function
                   2125: sets the current ordering type to @var{order}.
                   2126: If no argument is specified, the function returns the ordering
                   2127: type currently set.
                   2128:
                   2129: @item
                   2130: There are two types of functions concerning distributed polynomial,
                   2131: functions which take a ordering type and those which don't take it.
                   2132: The latter ones use the current setting.
                   2133:
                   2134: @item
                   2135: Functions such as @code{gr()}, which need a ordering type as an argument,
                   2136: call @code{dp_ord()} internally during the execution.
                   2137: The setting remains after the execution.
                   2138:
                   2139: Fundamental arithmetics for distributed polynomial also use the current
                   2140: setting. Therefore, when such arithmetics for distributed polynomials
                   2141: are done, the current setting must coincide with the ordering type
                   2142: which was used upon the creation of the polynomials. It is assumed
                   2143: that such polynomials were generated under the same ordering type.
                   2144:
                   2145: @item
                   2146: Type of term ordering must be correctly set by this function
                   2147: when functions other than top level functions are called directly.
                   2148: \E
1.1       noro     2149: @end itemize
                   2150:
                   2151: @example
                   2152: [19] dp_ord(0)$
                   2153: [20] <<1,2,3>>+<<3,1,1>>;
                   2154: (1)*<<1,2,3>>+(1)*<<3,1,1>>
                   2155: [21] dp_ord(2)$
                   2156: [22] <<1,2,3>>+<<3,1,1>>;
                   2157: (1)*<<3,1,1>>+(1)*<<1,2,3>>
                   2158: @end example
                   2159:
                   2160: @table @t
1.2       noro     2161: \JP @item $B;2>H(B
                   2162: \EG @item References
                   2163: \JP @fref{$B9`=g=x$N@_Dj(B}
                   2164: \EG @fref{Setting term orderings}
1.1       noro     2165: @end table
                   2166:
1.2       noro     2167: \JP @node dp_ptod,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2168: \EG @node dp_ptod,,, Functions for Groebner basis computation
1.1       noro     2169: @subsection @code{dp_ptod}
                   2170: @findex dp_ptod
                   2171:
                   2172: @table @t
                   2173: @item dp_ptod(@var{poly},@var{vlist})
1.2       noro     2174: \JP :: $BB?9`<0$rJ,;6I=8=B?9`<0$KJQ49$9$k(B.
                   2175: \EG :: Converts an ordinary polynomial into a distributed polynomial.
1.1       noro     2176: @end table
                   2177:
                   2178: @table @var
                   2179: @item return
1.2       noro     2180: \JP $BJ,;6I=8=B?9`<0(B
                   2181: \EG distributed polynomial
1.1       noro     2182: @item poly
1.2       noro     2183: \JP $BB?9`<0(B
                   2184: \EG polynomial
1.1       noro     2185: @item vlist
1.2       noro     2186: \JP $B%j%9%H(B
                   2187: \EG list
1.1       noro     2188: @end table
                   2189:
                   2190: @itemize @bullet
1.2       noro     2191: \BJP
1.1       noro     2192: @item
                   2193: $BJQ?t=g=x(B @var{vlist} $B$*$h$S8=:_$NJQ?t=g=x7?$K=>$C$FJ,;6I=8=B?9`<0$KJQ49$9$k(B.
                   2194: @item
                   2195: @var{vlist} $B$K4^$^$l$J$$ITDj85$O(B, $B78?tBN$KB0$9$k$H$7$FJQ49$5$l$k(B.
1.2       noro     2196: \E
                   2197: \BEG
                   2198: @item
                   2199: According to the variable ordering @var{vlist} and current
                   2200: type of term ordering, this function converts an ordinary
                   2201: polynomial into a distributed polynomial.
                   2202: @item
                   2203: Indeterminates not included in @var{vlist} are regarded to belong to
                   2204: the coefficient field.
                   2205: \E
1.1       noro     2206: @end itemize
                   2207:
                   2208: @example
                   2209: [50] dp_ord(0);
                   2210: 1
                   2211: [51] dp_ptod((x+y+z)^2,[x,y,z]);
                   2212: (1)*<<2,0,0>>+(2)*<<1,1,0>>+(1)*<<0,2,0>>+(2)*<<1,0,1>>+(2)*<<0,1,1>>
                   2213: +(1)*<<0,0,2>>
                   2214: [52] dp_ptod((x+y+z)^2,[x,y]);
                   2215: (1)*<<2,0>>+(2)*<<1,1>>+(1)*<<0,2>>+(2*z)*<<1,0>>+(2*z)*<<0,1>>+(z^2)*<<0,0>>
                   2216: @end example
                   2217:
                   2218: @table @t
1.2       noro     2219: \JP @item $B;2>H(B
                   2220: \EG @item References
1.1       noro     2221: @fref{dp_dtop},
                   2222: @fref{dp_ord}.
                   2223: @end table
                   2224:
1.2       noro     2225: \JP @node dp_dtop,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2226: \EG @node dp_dtop,,, Functions for Groebner basis computation
1.1       noro     2227: @subsection @code{dp_dtop}
                   2228: @findex dp_dtop
                   2229:
                   2230: @table @t
                   2231: @item dp_dtop(@var{dpoly},@var{vlist})
1.2       noro     2232: \JP :: $BJ,;6I=8=B?9`<0$rB?9`<0$KJQ49$9$k(B.
                   2233: \EG :: Converts a distributed polynomial into an ordinary polynomial.
1.1       noro     2234: @end table
                   2235:
                   2236: @table @var
                   2237: @item return
1.2       noro     2238: \JP $BB?9`<0(B
                   2239: \EG polynomial
1.1       noro     2240: @item dpoly
1.2       noro     2241: \JP $BJ,;6I=8=B?9`<0(B
                   2242: \EG distributed polynomial
1.1       noro     2243: @item vlist
1.2       noro     2244: \JP $B%j%9%H(B
                   2245: \EG list
1.1       noro     2246: @end table
                   2247:
                   2248: @itemize @bullet
1.2       noro     2249: \BJP
1.1       noro     2250: @item
                   2251: $BJ,;6I=8=B?9`<0$r(B, $BM?$($i$l$?ITDj85%j%9%H$rMQ$$$FB?9`<0$KJQ49$9$k(B.
                   2252: @item
                   2253: $BITDj85%j%9%H$O(B, $BD9$5J,;6I=8=B?9`<0$NJQ?t$N8D?t$H0lCW$7$F$$$l$P2?$G$b$h$$(B.
1.2       noro     2254: \E
                   2255: \BEG
                   2256: @item
                   2257: This function converts a distributed polynomial into an ordinary polynomial
                   2258: according to a list of indeterminates @var{vlist}.
                   2259: @item
                   2260: @var{vlist} is such a list that its length coincides with the number of
                   2261: variables of @var{dpoly}.
                   2262: \E
1.1       noro     2263: @end itemize
                   2264:
                   2265: @example
                   2266: [53] T=dp_ptod((x+y+z)^2,[x,y]);
                   2267: (1)*<<2,0>>+(2)*<<1,1>>+(1)*<<0,2>>+(2*z)*<<1,0>>+(2*z)*<<0,1>>+(z^2)*<<0,0>>
                   2268: [54] P=dp_dtop(T,[a,b]);
                   2269: z^2+(2*a+2*b)*z+a^2+2*b*a+b^2
                   2270: @end example
                   2271:
1.2       noro     2272: \JP @node dp_mod dp_rat,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2273: \EG @node dp_mod dp_rat,,, Functions for Groebner basis computation
1.1       noro     2274: @subsection @code{dp_mod}, @code{dp_rat}
                   2275: @findex dp_mod
                   2276: @findex dp_rat
                   2277:
                   2278: @table @t
                   2279: @item dp_mod(@var{p},@var{mod},@var{subst})
1.2       noro     2280: \JP :: $BM-M}?t78?tJ,;6I=8=B?9`<0$NM-8BBN78?t$X$NJQ49(B
                   2281: \EG :: Converts a disributed polynomial into one with coefficients in a finite field.
1.1       noro     2282: @item dp_rat(@var{p})
1.2       noro     2283: \JP :: $BM-8BBN78?tJ,;6I=8=B?9`<0$NM-M}?t78?t$X$NJQ49(B
                   2284: \BEG
                   2285: :: Converts a distributed polynomial with coefficients in a finite field into
                   2286: one with coefficients in the rationals.
                   2287: \E
1.1       noro     2288: @end table
                   2289:
                   2290: @table @var
                   2291: @item return
1.2       noro     2292: \JP $BJ,;6I=8=B?9`<0(B
                   2293: \EG distributed polynomial
1.1       noro     2294: @item p
1.2       noro     2295: \JP $BJ,;6I=8=B?9`<0(B
                   2296: \EG distributed polynomial
1.1       noro     2297: @item mod
1.2       noro     2298: \JP $BAG?t(B
                   2299: \EG prime
1.1       noro     2300: @item subst
1.2       noro     2301: \JP $B%j%9%H(B
                   2302: \EG list
1.1       noro     2303: @end table
                   2304:
                   2305: @itemize @bullet
1.2       noro     2306: \BJP
1.1       noro     2307: @item
                   2308: @code{dp_nf_mod()}, @code{dp_true_nf_mod()} $B$O(B, $BF~NO$H$7$FM-8BBN78?t$N(B
                   2309: $BJ,;6I=8=B?9`<0$rI,MW$H$9$k(B. $B$3$N$h$&$J>l9g(B, @code{dp_mod()} $B$K$h$j(B
                   2310: $BM-M}?t78?tJ,;6I=8=B?9`<0$rJQ49$7$FMQ$$$k$3$H$,$G$-$k(B. $B$^$?(B, $BF@$i$l$?(B
                   2311: $B7k2L$O(B, $BM-8BBN78?tB?9`<0$H$O1i;;$G$-$k$,(B, $BM-M}?t78?tB?9`<0$H$O1i;;$G$-$J$$(B
                   2312: $B$?$a(B, @code{dp_rat()} $B$K$h$jJQ49$9$kI,MW$,$"$k(B.
                   2313: @item
                   2314: $BM-8BBN78?t$N1i;;$K$*$$$F$O(B, $B$"$i$+$8$a(B @code{setmod()} $B$K$h$jM-8BBN$N85$N(B
                   2315: $B8D?t$r;XDj$7$F$*$/I,MW$,$"$k(B.
                   2316: @item
                   2317: @var{subst} $B$O(B, $B78?t$,M-M}<0$N>l9g(B, $B$=$NM-M}<0$NJQ?t$K$"$i$+$8$a?t$rBeF~(B
                   2318: $B$7$?8eM-8BBN78?t$KJQ49$9$k$H$$$&A`:n$r9T$&:]$N(B, $BBeF~CM$r;XDj$9$k$b$N$G(B,
                   2319: @code{[[@var{var},@var{value}],...]} $B$N7A$N%j%9%H$G$"$k(B.
1.2       noro     2320: \E
                   2321: \BEG
                   2322: @item
                   2323: @code{dp_nf_mod()} and @code{dp_true_nf_mod()} require
                   2324: distributed polynomials with coefficients in a finite field as arguments.
                   2325: @code{dp_mod()} is used to convert distributed polynomials with rational
                   2326: number coefficients into appropriate ones.
                   2327: Polynomials with coefficients in a finite field
                   2328: cannot be used as inputs of operations with polynomials
                   2329: with rational number coefficients. @code{dp_rat()} is used for such cases.
                   2330: @item
                   2331: The ground finite field must be set in advance by using @code{setmod()}.
                   2332: @item
                   2333: @var{subst} is such a list as @code{[[@var{var},@var{value}],...]}.
                   2334: This is valid when the ground field of the input polynomial is a
                   2335: rational function field. @var{var}'s are variables in the ground field and
                   2336: the list means that @var{value} is substituted for @var{var} before
                   2337: converting the coefficients into elements of a finite field.
                   2338: \E
1.1       noro     2339: @end itemize
                   2340:
                   2341: @example
                   2342: @end example
                   2343:
                   2344: @table @t
1.2       noro     2345: \JP @item $B;2>H(B
                   2346: \EG @item References
1.1       noro     2347: @fref{dp_nf dp_nf_mod dp_true_nf dp_true_nf_mod},
                   2348: @fref{subst psubst},
                   2349: @fref{setmod}.
                   2350: @end table
                   2351:
1.2       noro     2352: \JP @node dp_homo dp_dehomo,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2353: \EG @node dp_homo dp_dehomo,,, Functions for Groebner basis computation
1.1       noro     2354: @subsection @code{dp_homo}, @code{dp_dehomo}
                   2355: @findex dp_homo
                   2356: @findex dp_dehomo
                   2357:
                   2358: @table @t
                   2359: @item dp_homo(@var{dpoly})
1.2       noro     2360: \JP :: $BJ,;6I=8=B?9`<0$N@F<!2=(B
                   2361: \EG :: Homogenize a distributed polynomial
1.1       noro     2362: @item dp_dehomo(@var{dpoly})
1.2       noro     2363: \JP :: $B@F<!J,;6I=8=B?9`<0$NHs@F<!2=(B
                   2364: \EG :: Dehomogenize a homogenious distributed polynomial
1.1       noro     2365: @end table
                   2366:
                   2367: @table @var
                   2368: @item return
1.2       noro     2369: \JP $BJ,;6I=8=B?9`<0(B
                   2370: \EG distributed polynomial
1.1       noro     2371: @item dpoly
1.2       noro     2372: \JP $BJ,;6I=8=B?9`<0(B
                   2373: \EG distributed polynomial
1.1       noro     2374: @end table
                   2375:
                   2376: @itemize @bullet
1.2       noro     2377: \BJP
1.1       noro     2378: @item
                   2379: @code{dp_homo()} $B$O(B, @var{dpoly} $B$N(B $B3F9`(B @var{t} $B$K$D$$$F(B, $B;X?t%Y%/%H%k$ND9$5$r(B
                   2380: 1 $B?-$P$7(B, $B:G8e$N@.J,$NCM$r(B @var{d}-@code{deg(@var{t})}
                   2381: (@var{d} $B$O(B @var{dpoly} $B$NA4<!?t(B) $B$H$7$?J,;6I=8=B?9`<0$rJV$9(B.
                   2382: @item
                   2383: @code{dp_dehomo()} $B$O(B, @var{dpoly} $B$N3F9`$K$D$$$F(B, $B;X?t%Y%/%H%k$N:G8e$N@.J,(B
                   2384: $B$r<h$j=|$$$?J,;6B?9`<0$rJV$9(B.
                   2385: @item
                   2386: $B$$$:$l$b(B, $B@8@.$5$l$?B?9`<0$rMQ$$$?1i;;$r9T$&>l9g(B, $B$=$l$i$KE,9g$9$k9`=g=x$r(B
                   2387: $B@5$7$/@_Dj$9$kI,MW$,$"$k(B.
                   2388: @item
                   2389: @code{hgr()} $B$J$I$K$*$$$F(B, $BFbItE*$KMQ$$$i$l$F$$$k(B.
1.2       noro     2390: \E
                   2391: \BEG
                   2392: @item
                   2393: @code{dp_homo()} makes a copy of @var{dpoly}, extends
                   2394: the length of the exponent vector of each term @var{t} in the copy by 1,
                   2395: and sets the value of the newly appended
                   2396: component to @var{d}-@code{deg(@var{t})}, where @var{d} is the total
                   2397: degree of @var{dpoly}.
                   2398: @item
                   2399: @code{dp_dehomo()} make a copy of @var{dpoly} and removes the last component
                   2400: of each terms in the copy.
                   2401: @item
                   2402: Appropriate term orderings must be set when the results are used as inputs
                   2403: of some operations.
                   2404: @item
                   2405: These are used internally in @code{hgr()} etc.
                   2406: \E
1.1       noro     2407: @end itemize
                   2408:
                   2409: @example
                   2410: [202] X=<<1,2,3>>+3*<<1,2,1>>;
                   2411: (1)*<<1,2,3>>+(3)*<<1,2,1>>
                   2412: [203] dp_homo(X);
                   2413: (1)*<<1,2,3,0>>+(3)*<<1,2,1,2>>
                   2414: [204] dp_dehomo(@@);
                   2415: (1)*<<1,2,3>>+(3)*<<1,2,1>>
                   2416: @end example
                   2417:
                   2418: @table @t
1.2       noro     2419: \JP @item $B;2>H(B
                   2420: \EG @item References
1.1       noro     2421: @fref{gr hgr gr_mod}.
                   2422: @end table
                   2423:
1.2       noro     2424: \JP @node dp_ptozp dp_prim,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2425: \EG @node dp_ptozp dp_prim,,, Functions for Groebner basis computation
1.1       noro     2426: @subsection @code{dp_ptozp}, @code{dp_prim}
                   2427: @findex dp_ptozp
                   2428: @findex dp_prim
                   2429:
                   2430: @table @t
                   2431: @item dp_ptozp(@var{dpoly})
1.2       noro     2432: \JP :: $BDj?tG\$7$F78?t$r@0?t78?t$+$D78?t$N@0?t(B GCD $B$r(B 1 $B$K$9$k(B.
                   2433: \BEG
                   2434: :: Converts a distributed polynomial @var{poly} with rational coefficients
                   2435: into an integral distributed polynomial such that GCD of all its coefficients
                   2436: is 1.
                   2437: \E
1.1       noro     2438: @itemx dp_prim(@var{dpoly})
1.2       noro     2439: \JP :: $BM-M}<0G\$7$F78?t$r@0?t78?tB?9`<078?t$+$D78?t$NB?9`<0(B GCD $B$r(B 1 $B$K$9$k(B.
                   2440: \BEG
                   2441: :: Converts a distributed polynomial @var{poly} with rational function
                   2442: coefficients into an integral distributed polynomial such that polynomial
                   2443: GCD of all its coefficients is 1.
                   2444: \E
1.1       noro     2445: @end table
                   2446:
                   2447: @table @var
                   2448: @item return
1.2       noro     2449: \JP $BJ,;6I=8=B?9`<0(B
                   2450: \EG distributed polynomial
1.1       noro     2451: @item dpoly
1.2       noro     2452: \JP $BJ,;6I=8=B?9`<0(B
                   2453: \EG distributed polynomial
1.1       noro     2454: @end table
                   2455:
                   2456: @itemize @bullet
1.2       noro     2457: \BJP
1.1       noro     2458: @item
                   2459: @code{dp_ptozp()} $B$O(B,  @code{ptozp()} $B$KAjEv$9$kA`:n$rJ,;6I=8=B?9`<0$K(B
                   2460: $BBP$7$F9T$&(B. $B78?t$,B?9`<0$r4^$`>l9g(B, $B78?t$K4^$^$l$kB?9`<06&DL0x;R$O(B
                   2461: $B<h$j=|$+$J$$(B.
                   2462: @item
                   2463: @code{dp_prim()} $B$O(B, $B78?t$,B?9`<0$r4^$`>l9g(B, $B78?t$K4^$^$l$kB?9`<06&DL0x;R(B
                   2464: $B$r<h$j=|$/(B.
1.2       noro     2465: \E
                   2466: \BEG
                   2467: @item
                   2468: @code{dp_ptozp()} executes the same operation as @code{ptozp()} for
                   2469: a distributed polynomial. If the coefficients include polynomials,
                   2470: polynomial contents included in the coefficients are not removed.
                   2471: @item
                   2472: @code{dp_prim()} removes polynomial contents.
                   2473: \E
1.1       noro     2474: @end itemize
                   2475:
                   2476: @example
                   2477: [208] X=dp_ptod(3*(x-y)*(y-z)*(z-x),[x]);
                   2478: (-3*y+3*z)*<<2>>+(3*y^2-3*z^2)*<<1>>+(-3*z*y^2+3*z^2*y)*<<0>>
                   2479: [209] dp_ptozp(X);
                   2480: (-y+z)*<<2>>+(y^2-z^2)*<<1>>+(-z*y^2+z^2*y)*<<0>>
                   2481: [210] dp_prim(X);
                   2482: (1)*<<2>>+(-y-z)*<<1>>+(z*y)*<<0>>
                   2483: @end example
                   2484:
                   2485: @table @t
1.2       noro     2486: \JP @item $B;2>H(B
                   2487: \EG @item References
1.1       noro     2488: @fref{ptozp}.
                   2489: @end table
                   2490:
1.2       noro     2491: \JP @node dp_nf dp_nf_mod dp_true_nf dp_true_nf_mod,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2492: \EG @node dp_nf dp_nf_mod dp_true_nf dp_true_nf_mod,,, Functions for Groebner basis computation
1.1       noro     2493: @subsection @code{dp_nf}, @code{dp_nf_mod}, @code{dp_true_nf}, @code{dp_true_nf_mod}
                   2494: @findex dp_nf
                   2495: @findex  dp_true_nf
                   2496: @findex dp_nf_mod
                   2497: @findex  dp_true_nf_mod
                   2498:
                   2499: @table @t
                   2500: @item dp_nf(@var{indexlist},@var{dpoly},@var{dpolyarray},@var{fullreduce})
                   2501: @item dp_nf_mod(@var{indexlist},@var{dpoly},@var{dpolyarray},@var{fullreduce},@var{mod})
1.2       noro     2502: \JP :: $BJ,;6I=8=B?9`<0$N@55,7A$r5a$a$k(B. ($B7k2L$ODj?tG\$5$l$F$$$k2DG=@-$"$j(B)
1.1       noro     2503:
1.2       noro     2504: \BEG
                   2505: :: Computes the normal form of a distributed polynomial.
                   2506: (The result may be multiplied by a constant in the ground field.)
                   2507: \E
1.1       noro     2508: @item dp_true_nf(@var{indexlist},@var{dpoly},@var{dpolyarray},@var{fullreduce})
                   2509: @item dp_true_nf_mod(@var{indexlist},@var{dpoly},@var{dpolyarray},@var{fullreduce},@var{mod})
1.2       noro     2510: \JP :: $BJ,;6I=8=B?9`<0$N@55,7A$r5a$a$k(B. ($B??$N7k2L$r(B @code{[$BJ,;R(B, $BJ,Jl(B]} $B$N7A$GJV$9(B)
                   2511: \BEG
                   2512: :: Computes the normal form of a distributed polynomial. (The true result
                   2513: is returned in such a list as @code{[numerator, denominator]})
                   2514: \E
1.1       noro     2515: @end table
                   2516:
                   2517: @table @var
                   2518: @item return
1.2       noro     2519: \JP @code{dp_nf()} : $BJ,;6I=8=B?9`<0(B, @code{dp_true_nf()} : $B%j%9%H(B
                   2520: \EG @code{dp_nf()} : distributed polynomial, @code{dp_true_nf()} : list
1.1       noro     2521: @item indexlist
1.2       noro     2522: \JP $B%j%9%H(B
                   2523: \EG list
1.1       noro     2524: @item dpoly
1.2       noro     2525: \JP $BJ,;6I=8=B?9`<0(B
                   2526: \EG distributed polynomial
1.1       noro     2527: @item dpolyarray
1.2       noro     2528: \JP $BG[Ns(B
                   2529: \EG array of distributed polynomial
1.1       noro     2530: @item fullreduce
1.2       noro     2531: \JP $B%U%i%0(B
                   2532: \EG flag
1.1       noro     2533: @item mod
1.2       noro     2534: \JP $BAG?t(B
                   2535: \EG prime
1.1       noro     2536: @end table
                   2537:
                   2538: @itemize @bullet
1.2       noro     2539: \BJP
1.1       noro     2540: @item
                   2541: $BJ,;6I=8=B?9`<0(B @var{dpoly} $B$N@55,7A$r5a$a$k(B.
                   2542: @item
                   2543: @code{dp_nf_mod()}, @code{dp_true_nf_mod()} $B$NF~NO$O(B, @code{dp_mod()} $B$J$I(B
                   2544: $B$K$h$j(B, $BM-8BBN>e$NJ,;6I=8=B?9`<0$K$J$C$F$$$J$1$l$P$J$i$J$$(B.
                   2545: @item
                   2546: $B7k2L$KM-M}?t(B, $BM-M}<0$,4^$^$l$k$N$rHr$1$k$?$a(B, @code{dp_nf()} $B$O(B
                   2547: $B??$NCM$NDj?tG\$NCM$rJV$9(B. $BM-M}<078?t$N>l9g$N(B @code{dp_nf_mod()} $B$bF1MM(B
                   2548: $B$G$"$k$,(B, $B78?tBN$,M-8BBN$N>l9g(B @code{dp_nf_mod()} $B$O??$NCM$rJV$9(B.
                   2549: @item
                   2550: @code{dp_true_nf()}, @code{dp_true_nf_mod()} $B$O(B,
                   2551: @code{[@var{nm},@var{dn}]} $B$J$k7A$N%j%9%H$rJV$9(B.
                   2552: $B$?$@$7(B, @var{nm} $B$O78?t$KJ,?t(B, $BM-M}<0$r4^$^$J$$J,;6I=8=B?9`<0(B, @var{dn} $B$O(B
                   2553: $B?t$^$?$OB?9`<0$G(B @var{nm}/@var{dn} $B$,??$NCM$H$J$k(B.
                   2554: @item
                   2555: @var{dpolyarray} $B$OJ,;6I=8=B?9`<0$rMWAG$H$9$k%Y%/%H%k(B,
                   2556: @var{indexlist} $B$O@55,2=7W;;$KMQ$$$k(B @var{dpolyarray} $B$NMWAG$N%$%s%G%C%/%9(B
                   2557: $B$N%j%9%H(B.
                   2558: @item
                   2559: @var{fullreduce} $B$,(B 0 $B$G$J$$$H$-A4$F$N9`$KBP$7$F4JLs$r9T$&(B. @var{fullreduce}
                   2560: $B$,(B 0 $B$N$H$-F,9`$N$_$KBP$7$F4JLs$r9T$&(B.
                   2561: @item
                   2562: @var{indexlist} $B$G;XDj$5$l$?B?9`<0$O(B, $BA0$NJ}$N$b$N$,M%@hE*$K;H$o$l$k(B.
                   2563: @item
                   2564: $B0lHL$K$O(B @var{indexlist} $B$NM?$(J}$K$h$jH!?t$NCM$O0[$J$k2DG=@-$,$"$k$,(B,
                   2565: $B%0%l%V%J4pDl$KBP$7$F$O0l0UE*$KDj$^$k(B.
                   2566: @item
                   2567: $BJ,;6I=8=$G$J$$8GDj$5$l$?B?9`<0=89g$K$h$k@55,7A$rB??t5a$a$kI,MW$,$"$k>l9g(B
                   2568: $B$KJXMx$G$"$k(B. $BC10l$N1i;;$K4X$7$F$O(B, @code{p_nf}, @code{p_true_nf} $B$r(B
                   2569: $BMQ$$$k$H$h$$(B.
1.2       noro     2570: \E
                   2571: \BEG
                   2572: @item
                   2573: Computes the normal form of a distributed polynomial.
                   2574: @item
                   2575: @code{dp_nf_mod()} and @code{dp_true_nf_mod()} require
                   2576: distributed polynomials with coefficients in a finite field as arguments.
                   2577: @item
                   2578: The result of @code{dp_nf()} may be multiplied by a constant in the
                   2579: ground field in order to make the result integral. The same is true
                   2580: for @code{dp_nf_mod()}, but it returns the true normal form if
                   2581: the ground field is a finite field.
                   2582: @item
                   2583: @code{dp_true_nf()} and @code{dp_true_nf_mod()} return
                   2584: such a list as @code{[@var{nm},@var{dn}]}.
                   2585: Here @var{nm} is a distributed polynomial whose coefficients are integral
                   2586: in the ground field, @var{dn} is an integral element in the ground
                   2587: field and @var{nm}/@var{dn} is the true normal form.
                   2588: @item
                   2589: @var{dpolyarray} is a vector whose components are distributed polynomials
                   2590: and @var{indexlist} is a list of indices which is used for the normal form
                   2591: computation.
                   2592: @item
                   2593: When argument @var{fullreduce} has non-zero value,
                   2594: all terms are reduced. When it has value 0,
                   2595: only the head term is reduced.
                   2596: @item
                   2597: As for the polynomials specified by @var{indexlist}, one specified by
                   2598: an index placed at the preceding position has priority to be selected.
                   2599: @item
                   2600: In general, the result of the function may be different depending on
                   2601: @var{indexlist}.  However, the result is unique for Groebner bases.
                   2602: @item
                   2603: These functions are useful when a fixed non-distributed polynomial set
                   2604: is used as a set of reducers to compute normal forms of many polynomials.
                   2605: For single computation @code{p_nf} and @code{p_true_nf} are sufficient.
                   2606: \E
1.1       noro     2607: @end itemize
                   2608:
                   2609: @example
                   2610: [0] load("gr")$
                   2611: [64] load("katsura")$
                   2612: [69] K=katsura(4)$
                   2613: [70] dp_ord(2)$
                   2614: [71] V=[u0,u1,u2,u3,u4]$
                   2615: [72] DP1=newvect(length(K),map(dp_ptod,K,V))$
                   2616: [73] G=gr(K,V,2)$
                   2617: [74] DP2=newvect(length(G),map(dp_ptod,G,V))$
                   2618: [75] T=dp_ptod((u0-u1+u2-u3+u4)^2,V)$
                   2619: [76] dp_dtop(dp_nf([0,1,2,3,4],T,DP1,1),V);
                   2620: u4^2+(6*u3+2*u2+6*u1-2)*u4+9*u3^2+(6*u2+18*u1-6)*u3+u2^2+(6*u1-2)*u2+9*u1^2-6*u1+1
                   2621: [77] dp_dtop(dp_nf([4,3,2,1,0],T,DP1,1),V);
                   2622: -5*u4^2+(-4*u3-4*u2-4*u1)*u4-u3^2-3*u3-u2^2+(2*u1-1)*u2-2*u1^2-3*u1+1
                   2623: [78] dp_dtop(dp_nf([0,1,2,3,4],T,DP2,1),V);
                   2624: -1138087976845165778088612297273078520347097001020471455633353049221045677593
                   2625: 0005716505560062087150928400876150217079820311439477560587583488*u4^15+...
                   2626: [79] dp_dtop(dp_nf([4,3,2,1,0],T,DP2,1),V);
                   2627: -1138087976845165778088612297273078520347097001020471455633353049221045677593
                   2628: 0005716505560062087150928400876150217079820311439477560587583488*u4^15+...
                   2629: [80] @@78==@@79;
                   2630: 1
                   2631: @end example
                   2632:
                   2633: @table @t
1.2       noro     2634: \JP @item $B;2>H(B
                   2635: \EG @item References
1.1       noro     2636: @fref{dp_dtop},
                   2637: @fref{dp_ord},
                   2638: @fref{dp_mod dp_rat},
                   2639: @fref{p_nf p_nf_mod p_true_nf p_true_nf_mod}.
                   2640: @end table
                   2641:
1.2       noro     2642: \JP @node dp_hm dp_ht dp_hc dp_rest,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2643: \EG @node dp_hm dp_ht dp_hc dp_rest,,, Functions for Groebner basis computation
1.1       noro     2644: @subsection @code{dp_hm}, @code{dp_ht}, @code{dp_hc}, @code{dp_rest}
                   2645: @findex dp_hm
                   2646: @findex dp_ht
                   2647: @findex dp_hc
                   2648: @findex dp_rest
                   2649:
                   2650: @table @t
                   2651: @item dp_hm(@var{dpoly})
1.2       noro     2652: \JP :: $BF,C19`<0$r<h$j=P$9(B.
                   2653: \EG :: Gets the head monomial.
1.1       noro     2654: @item dp_ht(@var{dpoly})
1.2       noro     2655: \JP :: $BF,9`$r<h$j=P$9(B.
                   2656: \EG :: Gets the head term.
1.1       noro     2657: @item dp_hc(@var{dpoly})
1.2       noro     2658: \JP :: $BF,78?t$r<h$j=P$9(B.
                   2659: \EG :: Gets the head coefficient.
1.1       noro     2660: @item dp_rest(@var{dpoly})
1.2       noro     2661: \JP :: $BF,C19`<0$r<h$j=|$$$?;D$j$rJV$9(B.
                   2662: \EG :: Gets the remainder of the polynomial where the head monomial is removed.
1.1       noro     2663: @end table
                   2664:
                   2665: @table @var
1.2       noro     2666: \BJP
1.1       noro     2667: @item return
                   2668: @code{dp_hm()}, @code{dp_ht()}, @code{dp_rest()} : $BJ,;6I=8=B?9`<0(B,
                   2669: @code{dp_hc()} : $B?t$^$?$OB?9`<0(B
                   2670: @item dpoly
                   2671: $BJ,;6I=8=B?9`<0(B
1.2       noro     2672: \E
                   2673: \BEG
                   2674: @item return
                   2675: @code{dp_hm()}, @code{dp_ht()}, @code{dp_rest()} : distributed polynomial
                   2676: @code{dp_hc()} : number or polynomial
                   2677: @item dpoly
                   2678: distributed polynomial
                   2679: \E
1.1       noro     2680: @end table
                   2681:
                   2682: @itemize @bullet
1.2       noro     2683: \BJP
1.1       noro     2684: @item
                   2685: $B$3$l$i$O(B, $BJ,;6I=8=B?9`<0$N3FItJ,$r<h$j=P$9$?$a$NH!?t$G$"$k(B.
                   2686: @item
                   2687: $BJ,;6I=8=B?9`<0(B @var{p} $B$KBP$7<!$,@.$jN)$D(B.
1.2       noro     2688: \E
                   2689: \BEG
                   2690: @item
                   2691: These are used to get various parts of a distributed polynomial.
                   2692: @item
                   2693: The next equations hold for a distributed polynomial @var{p}.
                   2694: \E
1.1       noro     2695: @table @code
                   2696: @item @var{p} = dp_hm(@var{p}) + dp_rest(@var{p})
                   2697: @item dp_hm(@var{p}) = dp_hc(@var{p}) dp_ht(@var{p})
                   2698: @end table
                   2699: @end itemize
                   2700:
                   2701: @example
                   2702: [87] dp_ord(0)$
                   2703: [88] X=ptozp((a46^2+7/10*a46+7/48)*u3^4-50/27*a46^2-35/27*a46-49/216)$
                   2704: [89] T=dp_ptod(X,[u3,u4,a46])$
                   2705: [90] dp_hm(T);
                   2706: (2160)*<<4,0,2>>
                   2707: [91] dp_ht(T);
                   2708: (1)*<<4,0,2>>
                   2709: [92] dp_hc(T);
                   2710: 2160
                   2711: [93] dp_rest(T);
                   2712: (1512)*<<4,0,1>>+(315)*<<4,0,0>>+(-4000)*<<0,0,2>>+(-2800)*<<0,0,1>>
                   2713: +(-490)*<<0,0,0>>
                   2714: @end example
                   2715:
1.2       noro     2716: \JP @node dp_td dp_sugar,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2717: \EG @node dp_td dp_sugar,,, Functions for Groebner basis computation
1.1       noro     2718: @subsection @code{dp_td}, @code{dp_sugar}
                   2719: @findex dp_td
                   2720: @findex dp_sugar
                   2721:
                   2722: @table @t
                   2723: @item dp_td(@var{dpoly})
1.2       noro     2724: \JP :: $BF,9`$NA4<!?t$rJV$9(B.
                   2725: \EG :: Gets the total degree of the head term.
1.1       noro     2726: @item dp_sugar(@var{dpoly})
1.2       noro     2727: \JP :: $BB?9`<0$N(B @code{sugar} $B$rJV$9(B.
                   2728: \EG :: Gets the @code{sugar} of a polynomial.
1.1       noro     2729: @end table
                   2730:
                   2731: @table @var
                   2732: @item return
1.2       noro     2733: \JP $B<+A3?t(B
                   2734: \EG non-negative integer
1.1       noro     2735: @item dpoly
1.2       noro     2736: \JP $BJ,;6I=8=B?9`<0(B
                   2737: \EG distributed polynomial
1.1       noro     2738: @item onoff
1.2       noro     2739: \JP $B%U%i%0(B
                   2740: \EG flag
1.1       noro     2741: @end table
                   2742:
                   2743: @itemize @bullet
1.2       noro     2744: \BJP
1.1       noro     2745: @item
                   2746: @code{dp_td()} $B$O(B, $BF,9`$NA4<!?t(B, $B$9$J$o$A3FJQ?t$N;X?t$NOB$rJV$9(B.
                   2747: @item
                   2748: $BJ,;6I=8=B?9`<0$,@8@.$5$l$k$H(B, @code{sugar} $B$H8F$P$l$k$"$k@0?t$,IUM?(B
                   2749: $B$5$l$k(B. $B$3$NCM$O(B $B2>A[E*$K@F<!2=$7$F7W;;$7$?>l9g$K7k2L$,;}$DA4<!?t$NCM$H$J$k(B.
                   2750: @item
                   2751: @code{sugar} $B$O(B, $B%0%l%V%J4pDl7W;;$K$*$1$k@55,2=BP$NA*Br$N%9%H%i%F%8$r(B
                   2752: $B7hDj$9$k$?$a$N=EMW$J;X?K$H$J$k(B.
1.2       noro     2753: \E
                   2754: \BEG
                   2755: @item
                   2756: Function @code{dp_td()} returns the total degree of the head term,
                   2757: i.e., the sum of all exponent of variables in that term.
                   2758: @item
                   2759: Upon creation of a distributed polynomial, an integer called @code{sugar}
                   2760: is associated.  This value is
                   2761: the total degree of the virtually homogenized one of the original
                   2762: polynomial.
                   2763: @item
                   2764: The quantity @code{sugar} is an important guide to determine the
                   2765: selection strategy of critical pairs in Groebner basis computation.
                   2766: \E
1.1       noro     2767: @end itemize
                   2768:
                   2769: @example
                   2770: [74] dp_ord(0)$
                   2771: [75] X=<<1,2>>+<<0,1>>$
                   2772: [76] Y=<<1,2>>+<<1,0>>$
                   2773: [77] Z=X-Y;
                   2774: (-1)*<<1,0>>+(1)*<<0,1>>
                   2775: [78] dp_sugar(T);
                   2776: 3
                   2777: @end example
                   2778:
1.2       noro     2779: \JP @node dp_lcm,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2780: \EG @node dp_lcm,,, Functions for Groebner basis computation
1.1       noro     2781: @subsection @code{dp_lcm}
                   2782: @findex dp_lcm
                   2783:
                   2784: @table @t
                   2785: @item dp_lcm(@var{dpoly1},@var{dpoly2})
1.2       noro     2786: \JP :: $B:G>.8xG\9`$rJV$9(B.
                   2787: \EG :: Returns the least common multiple of the head terms of the given two polynomials.
1.1       noro     2788: @end table
                   2789:
                   2790: @table @var
                   2791: @item return
1.2       noro     2792: \JP $BJ,;6I=8=B?9`<0(B
                   2793: \EG distributed polynomial
1.4     ! noro     2794: @item dpoly1  dpoly2
1.2       noro     2795: \JP $BJ,;6I=8=B?9`<0(B
                   2796: \EG distributed polynomial
1.1       noro     2797: @end table
                   2798:
                   2799: @itemize @bullet
1.2       noro     2800: \BJP
1.1       noro     2801: @item
                   2802: $B$=$l$>$l$N0z?t$NF,9`$N:G>.8xG\9`$rJV$9(B. $B78?t$O(B 1 $B$G$"$k(B.
1.2       noro     2803: \E
                   2804: \BEG
                   2805: @item
                   2806: Returns the least common multiple of the head terms of the given
                   2807: two polynomials, where coefficient is always set to 1.
                   2808: \E
1.1       noro     2809: @end itemize
                   2810:
                   2811: @example
                   2812: [100] dp_lcm(<<1,2,3,4,5>>,<<5,4,3,2,1>>);
                   2813: (1)*<<5,4,3,4,5>>
                   2814: @end example
                   2815:
                   2816: @table @t
1.2       noro     2817: \JP @item $B;2>H(B
                   2818: \EG @item References
1.1       noro     2819: @fref{p_nf p_nf_mod p_true_nf p_true_nf_mod}.
                   2820: @end table
                   2821:
1.2       noro     2822: \JP @node dp_redble,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2823: \EG @node dp_redble,,, Functions for Groebner basis computation
1.1       noro     2824: @subsection @code{dp_redble}
                   2825: @findex dp_redble
                   2826:
                   2827: @table @t
                   2828: @item dp_redble(@var{dpoly1},@var{dpoly2})
1.2       noro     2829: \JP :: $BF,9`$I$&$7$,@0=|2DG=$+$I$&$+D4$Y$k(B.
                   2830: \EG :: Checks whether one head term is divisible by the other head term.
1.1       noro     2831: @end table
                   2832:
                   2833: @table @var
                   2834: @item return
1.2       noro     2835: \JP $B@0?t(B
                   2836: \EG integer
1.4     ! noro     2837: @item dpoly1  dpoly2
1.2       noro     2838: \JP $BJ,;6I=8=B?9`<0(B
                   2839: \EG distributed polynomial
1.1       noro     2840: @end table
                   2841:
                   2842: @itemize @bullet
1.2       noro     2843: \BJP
1.1       noro     2844: @item
                   2845: @var{dpoly1} $B$NF,9`$,(B @var{dpoly2} $B$NF,9`$G3d$j@Z$l$l$P(B 1, $B3d$j@Z$l$J$1$l$P(B
                   2846: 0 $B$rJV$9(B.
                   2847: @item
                   2848: $BB?9`<0$N4JLs$r9T$&:](B, $B$I$N9`$r4JLs$G$-$k$+$rC5$9$N$KMQ$$$k(B.
1.2       noro     2849: \E
                   2850: \BEG
                   2851: @item
                   2852: Returns 1 if the head term of @var{dpoly2} divides the head term of
                   2853: @var{dpoly1}; otherwise 0.
                   2854: @item
                   2855: Used for finding candidate terms at reduction of polynomials.
                   2856: \E
1.1       noro     2857: @end itemize
                   2858:
                   2859: @example
                   2860: [148] C;
                   2861: (1)*<<1,1,1,0,0>>+(1)*<<0,1,1,1,0>>+(1)*<<1,1,0,0,1>>+(1)*<<1,0,0,1,1>>
                   2862: [149] T;
                   2863: (3)*<<2,1,0,0,0>>+(3)*<<1,2,0,0,0>>+(1)*<<0,3,0,0,0>>+(6)*<<1,1,1,0,0>>
                   2864: [150] for ( ; T; T = dp_rest(T)) print(dp_redble(T,C));
                   2865: 0
                   2866: 0
                   2867: 0
                   2868: 1
                   2869: @end example
                   2870:
                   2871: @table @t
1.2       noro     2872: \JP @item $B;2>H(B
                   2873: \EG @item References
1.1       noro     2874: @fref{dp_red dp_red_mod}.
                   2875: @end table
                   2876:
1.2       noro     2877: \JP @node dp_subd,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2878: \EG @node dp_subd,,, Functions for Groebner basis computation
1.1       noro     2879: @subsection @code{dp_subd}
                   2880: @findex dp_subd
                   2881:
                   2882: @table @t
                   2883: @item dp_subd(@var{dpoly1},@var{dpoly2})
1.2       noro     2884: \JP :: $BF,9`$N>&C19`<0$rJV$9(B.
                   2885: \EG :: Returns the quotient monomial of the head terms.
1.1       noro     2886: @end table
                   2887:
                   2888: @table @var
                   2889: @item return
1.2       noro     2890: \JP $BJ,;6I=8=B?9`<0(B
                   2891: \EG distributed polynomial
1.4     ! noro     2892: @item dpoly1  dpoly2
1.2       noro     2893: \JP $BJ,;6I=8=B?9`<0(B
                   2894: \EG distributed polynomial
1.1       noro     2895: @end table
                   2896:
                   2897: @itemize @bullet
1.2       noro     2898: \BJP
1.1       noro     2899: @item
                   2900: @code{dp_ht(@var{dpoly1})/dp_ht(@var{dpoly2})} $B$r5a$a$k(B. $B7k2L$N78?t$O(B 1
                   2901: $B$G$"$k(B.
                   2902: @item
                   2903: $B3d$j@Z$l$k$3$H$,$"$i$+$8$a$o$+$C$F$$$kI,MW$,$"$k(B.
1.2       noro     2904: \E
                   2905: \BEG
                   2906: @item
                   2907: Gets @code{dp_ht(@var{dpoly1})/dp_ht(@var{dpoly2})}.
                   2908: The coefficient of the result is always set to 1.
                   2909: @item
                   2910: Divisibility assumed.
                   2911: \E
1.1       noro     2912: @end itemize
                   2913:
                   2914: @example
                   2915: [162] dp_subd(<<1,2,3,4,5>>,<<1,1,2,3,4>>);
                   2916: (1)*<<0,1,1,1,1>>
                   2917: @end example
                   2918:
                   2919: @table @t
1.2       noro     2920: \JP @item $B;2>H(B
                   2921: \EG @item References
1.1       noro     2922: @fref{dp_red dp_red_mod}.
                   2923: @end table
                   2924:
1.2       noro     2925: \JP @node dp_vtoe dp_etov,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2926: \EG @node dp_vtoe dp_etov,,, Functions for Groebner basis computation
1.1       noro     2927: @subsection @code{dp_vtoe}, @code{dp_etov}
                   2928: @findex dp_vtoe
                   2929: @findex dp_etov
                   2930:
                   2931: @table @t
                   2932: @item dp_vtoe(@var{vect})
1.2       noro     2933: \JP :: $B;X?t%Y%/%H%k$r9`$KJQ49(B
                   2934: \EG :: Converts an exponent vector into a term.
1.1       noro     2935: @item dp_etov(@var{dpoly})
1.2       noro     2936: \JP :: $BF,9`$r;X?t%Y%/%H%k$KJQ49(B
                   2937: \EG :: Convert the head term of a distributed polynomial into an exponent vector.
1.1       noro     2938: @end table
                   2939:
                   2940: @table @var
                   2941: @item return
1.2       noro     2942: \JP @code{dp_vtoe} : $BJ,;6I=8=B?9`<0(B, @code{dp_etov} : $B%Y%/%H%k(B
                   2943: \EG @code{dp_vtoe} : distributed polynomial, @code{dp_etov} : vector
1.1       noro     2944: @item vect
1.2       noro     2945: \JP $B%Y%/%H%k(B
                   2946: \EG vector
1.1       noro     2947: @item dpoly
1.2       noro     2948: \JP $BJ,;6I=8=B?9`<0(B
                   2949: \EG distributed polynomial
1.1       noro     2950: @end table
                   2951:
                   2952: @itemize @bullet
1.2       noro     2953: \BJP
1.1       noro     2954: @item
                   2955: @code{dp_vtoe()} $B$O(B, $B%Y%/%H%k(B @var{vect} $B$r;X?t%Y%/%H%k$H$9$k9`$r@8@.$9$k(B.
                   2956: @item
                   2957: @code{dp_etov()} $B$O(B, $BJ,;6I=8=B?9`<0(B @code{dpoly} $B$NF,9`$N;X?t%Y%/%H%k$r(B
                   2958: $B%Y%/%H%k$KJQ49$9$k(B.
1.2       noro     2959: \E
                   2960: \BEG
                   2961: @item
                   2962: @code{dp_vtoe()} generates a term whose exponent vector is @var{vect}.
                   2963: @item
                   2964: @code{dp_etov()} generates a vector which is the exponent vector of the
                   2965: head term of @code{dpoly}.
                   2966: \E
1.1       noro     2967: @end itemize
                   2968:
                   2969: @example
                   2970: [211] X=<<1,2,3>>;
                   2971: (1)*<<1,2,3>>
                   2972: [212] V=dp_etov(X);
                   2973: [ 1 2 3 ]
                   2974: [213] V[2]++$
                   2975: [214] Y=dp_vtoe(V);
                   2976: (1)*<<1,2,4>>
                   2977: @end example
                   2978:
1.2       noro     2979: \JP @node dp_mbase,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   2980: \EG @node dp_mbase,,, Functions for Groebner basis computation
1.1       noro     2981: @subsection @code{dp_mbase}
                   2982: @findex dp_mbase
                   2983:
                   2984: @table @t
                   2985: @item dp_mbase(@var{dplist})
1.2       noro     2986: \JP :: monomial $B4pDl$N7W;;(B
                   2987: \EG :: Computes the monomial basis
1.1       noro     2988: @end table
                   2989:
                   2990: @table @var
                   2991: @item return
1.2       noro     2992: \JP $BJ,;6I=8=B?9`<0$N%j%9%H(B
                   2993: \EG list of distributed polynomial
1.1       noro     2994: @item dplist
1.2       noro     2995: \JP $BJ,;6I=8=B?9`<0$N%j%9%H(B
                   2996: \EG list of distributed polynomial
1.1       noro     2997: @end table
                   2998:
                   2999: @itemize @bullet
1.2       noro     3000: \BJP
1.1       noro     3001: @item
                   3002: $B$"$k=g=x$G%0%l%V%J4pDl$H$J$C$F$$$kB?9`<0=89g$N(B, $B$=$N=g=x$K4X$9$kJ,;6I=8=(B
                   3003: $B$G$"$k(B @var{dplist} $B$K$D$$$F(B,
                   3004: @var{dplist} $B$,(B K[X] $BCf$G@8@.$9$k%$%G%"%k(B I $B$,(B 0 $B<!85$N;~(B,
                   3005: K $B>eM-8B<!85@~7A6u4V$G$"$k(B K[X]/I $B$N(B monomial $B$K$h$k4pDl$r5a$a$k(B.
                   3006: @item
                   3007: $BF@$i$l$?4pDl$N8D?t$,(B, K[X]/I $B$N(B K-$B@~7A6u4V$H$7$F$N<!85$KEy$7$$(B.
1.2       noro     3008: \E
                   3009: \BEG
                   3010: @item
                   3011: Assuming that @var{dplist} is a list of distributed polynomials which
                   3012: is a Groebner basis with respect to the current ordering type and
                   3013: that the ideal @var{I} generated by @var{dplist} in K[X] is zero-dimensional,
                   3014: this function computes the monomial basis of a finite dimenstional K-vector
                   3015: space K[X]/I.
                   3016: @item
                   3017: The number of elements in the monomial basis is equal to the
                   3018: K-dimenstion of K[X]/I.
                   3019: \E
1.1       noro     3020: @end itemize
                   3021:
                   3022: @example
                   3023: [215] K=katsura(5)$
                   3024: [216] V=[u5,u4,u3,u2,u1,u0]$
                   3025: [217] G0=gr(K,V,0)$
                   3026: [218] H=map(dp_ptod,G0,V)$
                   3027: [219] map(dp_ptod,dp_mbase(H),V)$
                   3028: [u0^5,u4*u0^3,u3*u0^3,u2*u0^3,u1*u0^3,u0^4,u3^2*u0,u2*u3*u0,u1*u3*u0,
                   3029: u1*u2*u0,u1^2*u0,u4*u0^2,u3*u0^2,u2*u0^2,u1*u0^2,u0^3,u3^2,u2*u3,u1*u3,
                   3030: u1*u2,u1^2,u4*u0,u3*u0,u2*u0,u1*u0,u0^2,u4,u3,u2,u1,u0,1]
                   3031: @end example
                   3032:
                   3033: @table @t
1.2       noro     3034: \JP @item $B;2>H(B
                   3035: \EG @item References
1.1       noro     3036: @fref{gr hgr gr_mod}.
                   3037: @end table
                   3038:
1.2       noro     3039: \JP @node dp_mag,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   3040: \EG @node dp_mag,,, Functions for Groebner basis computation
1.1       noro     3041: @subsection @code{dp_mag}
                   3042: @findex dp_mag
                   3043:
                   3044: @table @t
                   3045: @item dp_mag(@var{p})
1.2       noro     3046: \JP :: $B78?t$N%S%C%HD9$NOB$rJV$9(B
                   3047: \EG :: Computes the sum of bit lengths of coefficients of a distributed polynomial.
1.1       noro     3048: @end table
                   3049:
                   3050: @table @var
                   3051: @item return
1.2       noro     3052: \JP $B?t(B
                   3053: \EG integer
1.1       noro     3054: @item p
1.2       noro     3055: \JP $BJ,;6I=8=B?9`<0(B
                   3056: \EG distributed polynomial
1.1       noro     3057: @end table
                   3058:
                   3059: @itemize @bullet
1.2       noro     3060: \BJP
1.1       noro     3061: @item
                   3062: $BJ,;6I=8=B?9`<0$N78?t$K8=$l$kM-M}?t$K$D$-(B, $B$=$NJ,JlJ,;R(B ($B@0?t$N>l9g$OJ,;R(B)
                   3063: $B$N%S%C%HD9$NAmOB$rJV$9(B.
                   3064: @item
                   3065: $BBP>]$H$J$kB?9`<0$NBg$-$5$NL\0B$H$7$FM-8z$G$"$k(B. $BFC$K(B, 0 $B<!85%7%9%F%`$K$*$$$F$O(B
                   3066: $B78?tKDD%$,LdBj$H$J$j(B, $BESCf@8@.$5$l$kB?9`<0$,78?tKDD%$r5/$3$7$F$$$k$+$I$&$+(B
                   3067: $B$NH=Dj$KLrN)$D(B.
                   3068: @item
                   3069: @code{dp_gr_flags()} $B$G(B, @code{ShowMag}, @code{Print} $B$r(B on $B$K$9$k$3$H$K$h$j(B
                   3070: $BESCf@8@.$5$l$kB?9`<0$K$?$$$9$k(B @code{dp_mag()} $B$NCM$r8+$k$3$H$,$G$-$k(B.
1.2       noro     3071: \E
                   3072: \BEG
                   3073: @item
                   3074: This function computes the sum of bit lengths of coefficients of a
                   3075: distributed polynomial @var{p}. If a coefficient is non integral,
                   3076: the sum of bit lengths of the numerator and the denominator is taken.
                   3077: @item
                   3078: This is a measure of the size of a polynomial. Especially for
                   3079: zero-dimensional system coefficient swells are often serious and
                   3080: the returned value is useful to detect such swells.
                   3081: @item
                   3082: If @code{ShowMag} and @code{Print} for @code{dp_gr_flags()} are on,
                   3083: values of @code{dp_mag()} for intermediate basis elements are shown.
                   3084: \E
1.1       noro     3085: @end itemize
                   3086:
                   3087: @example
                   3088: [221] X=dp_ptod((x+2*y)^10,[x,y])$
                   3089: [222] dp_mag(X);
                   3090: 115
                   3091: @end example
                   3092:
                   3093: @table @t
1.2       noro     3094: \JP @item $B;2>H(B
                   3095: \EG @item References
1.1       noro     3096: @fref{dp_gr_flags dp_gr_print}.
                   3097: @end table
                   3098:
1.2       noro     3099: \JP @node dp_red dp_red_mod,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   3100: \EG @node dp_red dp_red_mod,,, Functions for Groebner basis computation
1.1       noro     3101: @subsection @code{dp_red}, @code{dp_red_mod}
                   3102: @findex dp_red
                   3103: @findex dp_red_mod
                   3104:
                   3105: @table @t
                   3106: @item dp_red(@var{dpoly1},@var{dpoly2},@var{dpoly3})
                   3107: @item dp_red_mod(@var{dpoly1},@var{dpoly2},@var{dpoly3},@var{mod})
1.2       noro     3108: \JP :: $B0l2s$N4JLsA`:n(B
                   3109: \EG :: Single reduction operation
1.1       noro     3110: @end table
                   3111:
                   3112: @table @var
                   3113: @item return
1.2       noro     3114: \JP $B%j%9%H(B
                   3115: \EG list
1.4     ! noro     3116: @item dpoly1  dpoly2  dpoly3
1.2       noro     3117: \JP $BJ,;6I=8=B?9`<0(B
                   3118: \EG distributed polynomial
1.1       noro     3119: @item vlist
1.2       noro     3120: \JP $B%j%9%H(B
                   3121: \EG list
1.1       noro     3122: @item mod
1.2       noro     3123: \JP $BAG?t(B
                   3124: \EG prime
1.1       noro     3125: @end table
                   3126:
                   3127: @itemize @bullet
1.2       noro     3128: \BJP
1.1       noro     3129: @item
                   3130: @var{dpoly1} + @var{dpoly2} $B$J$kJ,;6I=8=B?9`<0$r(B @var{dpoly3} $B$G(B
                   3131: 1 $B2s4JLs$9$k(B.
                   3132: @item
                   3133: @code{dp_red_mod()} $B$NF~NO$O(B, $BA4$FM-8BBN78?t$KJQ49$5$l$F$$$kI,MW$,$"$k(B.
                   3134: @item
                   3135: $B4JLs$5$l$k9`$O(B @var{dpoly2} $B$NF,9`$G$"$k(B. $B=>$C$F(B, @var{dpoly2} $B$N(B
                   3136: $BF,9`$,(B @var{dpoly3} $B$NF,9`$G3d$j@Z$l$k$3$H$,$"$i$+$8$a$o$+$C$F$$$J$1$l$P(B
                   3137: $B$J$i$J$$(B.
                   3138: @item
                   3139: $B0z?t$,@0?t78?t$N;~(B, $B4JLs$O(B, $BJ,?t$,8=$l$J$$$h$&(B, $B@0?t(B @var{a}, @var{b},
1.4     ! noro     3140: $B9`(B @var{t} $B$K$h$j(B @var{a}(@var{dpoly1} + @var{dpoly2})-@var{bt} @var{dpoly3} $B$H$7$F7W;;$5$l$k(B.
1.1       noro     3141: @item
                   3142: $B7k2L$O(B, @code{[@var{a dpoly1},@var{a dpoly2 - bt dpoly3}]} $B$J$k%j%9%H$G$"$k(B.
1.2       noro     3143: \E
                   3144: \BEG
                   3145: @item
                   3146: Reduces a distributed polynomial, @var{dpoly1} + @var{dpoly2},
                   3147: by @var{dpoly3} for single time.
                   3148: @item
                   3149: An input for @code{dp_red_mod()} must be converted into a distributed
                   3150: polynomial with coefficients in a finite field.
                   3151: @item
                   3152: This implies that
                   3153: the divisibility of the head term of @var{dpoly2} by the head term of
                   3154: @var{dpoly3} is assumed.
                   3155: @item
                   3156: When integral coefficients, computation is so carefully performed that
                   3157: no rational operations appear in the reduction procedure.
                   3158: It is computed for integers @var{a} and @var{b}, and a term @var{t} as:
1.4     ! noro     3159: @var{a}(@var{dpoly1} + @var{dpoly2})-@var{bt} @var{dpoly3}.
1.2       noro     3160: @item
                   3161: The result is a list @code{[@var{a dpoly1},@var{a dpoly2 - bt dpoly3}]}.
                   3162: \E
1.1       noro     3163: @end itemize
                   3164:
                   3165: @example
                   3166: [157] D=(3)*<<2,1,0,0,0>>+(3)*<<1,2,0,0,0>>+(1)*<<0,3,0,0,0>>;
                   3167: (3)*<<2,1,0,0,0>>+(3)*<<1,2,0,0,0>>+(1)*<<0,3,0,0,0>>
                   3168: [158] R=(6)*<<1,1,1,0,0>>;
                   3169: (6)*<<1,1,1,0,0>>
                   3170: [159] C=12*<<1,1,1,0,0>>+(1)*<<0,1,1,1,0>>+(1)*<<1,1,0,0,1>>;
                   3171: (12)*<<1,1,1,0,0>>+(1)*<<0,1,1,1,0>>+(1)*<<1,1,0,0,1>>
                   3172: [160] dp_red(D,R,C);
                   3173: [(6)*<<2,1,0,0,0>>+(6)*<<1,2,0,0,0>>+(2)*<<0,3,0,0,0>>,(-1)*<<0,1,1,1,0>>
                   3174: +(-1)*<<1,1,0,0,1>>]
                   3175: @end example
                   3176:
                   3177: @table @t
1.2       noro     3178: \JP @item $B;2>H(B
                   3179: \EG @item References
1.1       noro     3180: @fref{dp_mod dp_rat}.
                   3181: @end table
                   3182:
1.2       noro     3183: \JP @node dp_sp dp_sp_mod,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   3184: \EG @node dp_sp dp_sp_mod,,, Functions for Groebner basis computation
1.1       noro     3185: @subsection @code{dp_sp}, @code{dp_sp_mod}
                   3186: @findex dp_sp
                   3187: @findex dp_sp_mod
                   3188:
                   3189: @table @t
                   3190: @item dp_sp(@var{dpoly1},@var{dpoly2})
                   3191: @item dp_sp_mod(@var{dpoly1},@var{dpoly2},@var{mod})
1.2       noro     3192: \JP :: S-$BB?9`<0$N7W;;(B
                   3193: \EG :: Computation of an S-polynomial
1.1       noro     3194: @end table
                   3195:
                   3196: @table @var
                   3197: @item return
1.2       noro     3198: \JP $BJ,;6I=8=B?9`<0(B
                   3199: \EG distributed polynomial
1.4     ! noro     3200: @item dpoly1  dpoly2
1.2       noro     3201: \JP $BJ,;6I=8=B?9`<0(B
                   3202: \EG distributed polynomial
1.1       noro     3203: @item mod
1.2       noro     3204: \JP $BAG?t(B
                   3205: \EG prime
1.1       noro     3206: @end table
                   3207:
                   3208: @itemize @bullet
1.2       noro     3209: \BJP
1.1       noro     3210: @item
                   3211: @var{dpoly1}, @var{dpoly2} $B$N(B S-$BB?9`<0$r7W;;$9$k(B.
                   3212: @item
                   3213: @code{dp_sp_mod()} $B$NF~NO$O(B, $BA4$FM-8BBN78?t$KJQ49$5$l$F$$$kI,MW$,$"$k(B.
                   3214: @item
                   3215: $B7k2L$KM-M}?t(B, $BM-M}<0$,F~$k$N$rHr$1$k$?$a(B, $B7k2L$,Dj?tG\(B, $B$"$k$$$OB?9`<0(B
                   3216: $BG\$5$l$F$$$k2DG=@-$,$"$k(B.
1.2       noro     3217: \E
                   3218: \BEG
                   3219: @item
                   3220: This function computes the S-polynomial of @var{dpoly1} and @var{dpoly2}.
                   3221: @item
                   3222: Inputs of @code{dp_sp_mod()} must be polynomials with coefficients in a
                   3223: finite field.
                   3224: @item
                   3225: The result may be multiplied by a constant in the ground field in order to
                   3226: make the result integral.
                   3227: \E
1.1       noro     3228: @end itemize
                   3229:
                   3230: @example
                   3231: [227] X=dp_ptod(x^2*y+x*y,[x,y]);
                   3232: (1)*<<2,1>>+(1)*<<1,1>>
                   3233: [228] Y=dp_ptod(x*y^2+x*y,[x,y]);
                   3234: (1)*<<1,2>>+(1)*<<1,1>>
                   3235: [229] dp_sp(X,Y);
                   3236: (-1)*<<2,1>>+(1)*<<1,2>>
                   3237: @end example
                   3238:
                   3239: @table @t
1.2       noro     3240: \JP @item $B;2>H(B
                   3241: \EG @item References
1.1       noro     3242: @fref{dp_mod dp_rat}.
                   3243: @end table
1.2       noro     3244: \JP @node p_nf p_nf_mod p_true_nf p_true_nf_mod,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   3245: \EG @node p_nf p_nf_mod p_true_nf p_true_nf_mod,,, Functions for Groebner basis computation
1.1       noro     3246: @subsection @code{p_nf}, @code{p_nf_mod}, @code{p_true_nf}, @code{p_true_nf_mod}
                   3247: @findex p_nf
                   3248: @findex p_nf_mod
                   3249: @findex p_true_nf
                   3250: @findex p_true_nf_mod
                   3251:
                   3252: @table @t
                   3253: @item p_nf(@var{poly},@var{plist},@var{vlist},@var{order})
                   3254: @itemx p_nf_mod(@var{poly},@var{plist},@var{vlist},@var{order},@var{mod})
1.2       noro     3255: \JP :: $BI=8=B?9`<0$N@55,7A$r5a$a$k(B. ($B7k2L$ODj?tG\$5$l$F$$$k2DG=@-$"$j(B)
                   3256: \BEG
                   3257: :: Computes the normal form of the given polynomial.
                   3258: (The result may be multiplied by a constant.)
                   3259: \E
1.1       noro     3260: @item p_true_nf(@var{poly},@var{plist},@var{vlist},@var{order})
                   3261: @itemx p_true_nf_mod(@var{poly},@var{plist},@var{vlist},@var{order},@var{mod})
1.2       noro     3262: \JP :: $BI=8=B?9`<0$N@55,7A$r5a$a$k(B. ($B??$N7k2L$r(B @code{[$BJ,;R(B, $BJ,Jl(B]} $B$N7A$GJV$9(B)
                   3263: \BEG
                   3264: :: Computes the normal form of the given polynomial. (The result is returned
                   3265: as a form of @code{[numerator, denominator]})
                   3266: \E
1.1       noro     3267: @end table
                   3268:
                   3269: @table @var
                   3270: @item return
1.2       noro     3271: \JP @code{p_nf} : $BB?9`<0(B, @code{p_true_nf} : $B%j%9%H(B
                   3272: \EG @code{p_nf} : polynomial, @code{p_true_nf} : list
1.1       noro     3273: @item poly
1.2       noro     3274: \JP $BB?9`<0(B
                   3275: \EG polynomial
1.4     ! noro     3276: @item plist vlist
1.2       noro     3277: \JP $B%j%9%H(B
                   3278: \EG list
1.1       noro     3279: @item order
1.2       noro     3280: \JP $B?t(B, $B%j%9%H$^$?$O9TNs(B
                   3281: \EG number, list or matrix
1.1       noro     3282: @item mod
1.2       noro     3283: \JP $BAG?t(B
                   3284: \EG prime
1.1       noro     3285: @end table
                   3286:
                   3287: @itemize @bullet
1.2       noro     3288: \BJP
1.1       noro     3289: @item
                   3290: @samp{gr} $B$GDj5A$5$l$F$$$k(B.
                   3291: @item
                   3292: $BB?9`<0$N(B, $BB?9`<0%j%9%H$K$h$k@55,7A$r5a$a$k(B.
                   3293: @item
                   3294: @code{dp_nf()}, @code{dp_true_nf()}, @code{dp_nf_mod()}, @code{dp_true_nf_mod}
                   3295: $B$KBP$9$k%$%s%?%U%'!<%9$G$"$k(B.
                   3296: @item
                   3297: @var{poly} $B$*$h$S(B @var{plist} $B$O(B, $BJQ?t=g=x(B @var{vlist} $B$*$h$S(B
                   3298: $BJQ?t=g=x7?(B @var{otype} $B$K=>$C$FJ,;6I=8=B?9`<0$KJQ49$5$l(B,
                   3299: @code{dp_nf()}, @code{dp_true_nf()}, @code{dp_nf_mod()},
                   3300: @code{dp_true_nf_mod()} $B$KEO$5$l$k(B.
                   3301: @item
                   3302: @code{dp_nf()}, @code{dp_true_nf()}, @code{dp_nf_mod()},
                   3303: @code{dp_true_nf_mod()} $B$O(B @var{fullreduce} $B$,(B 1 $B$G8F$S=P$5$l$k(B.
                   3304: @item
                   3305: $B7k2L$OB?9`<0$KJQ49$5$l$F=PNO$5$l$k(B.
                   3306: @item
                   3307: @code{p_true_nf()}, @code{p_true_nf_mod()} $B$N=PNO$K4X$7$F$O(B,
                   3308: @code{dp_true_nf()}, @code{dp_true_nf_mod()} $B$N9`$r;2>H(B.
1.2       noro     3309: \E
                   3310: \BEG
                   3311: @item
                   3312: Defined in the package @samp{gr}.
                   3313: @item
                   3314: Obtains the normal form of a polynomial by a polynomial list.
                   3315: @item
                   3316: These are interfaces to @code{dp_nf()}, @code{dp_true_nf()}, @code{dp_nf_mod()},
                   3317:  @code{dp_true_nf_mod}
                   3318: @item
                   3319: The polynomial @var{poly} and the polynomials in @var{plist} is
                   3320: converted, according to the variable ordering @var{vlist} and
                   3321: type of term ordering @var{otype}, into their distributed polynomial
                   3322: counterparts and passed to @code{dp_nf()}.
                   3323: @item
                   3324: @code{dp_nf()}, @code{dp_true_nf()}, @code{dp_nf_mod()} and
                   3325: @code{dp_true_nf_mod()}
                   3326: is called with value 1 for @var{fullreduce}.
                   3327: @item
                   3328: The result is converted back into an ordinary polynomial.
                   3329: @item
                   3330: As for @code{p_true_nf()}, @code{p_true_nf_mod()}
                   3331: refer to @code{dp_true_nf()} and @code{dp_true_nf_mod()}.
                   3332: \E
1.1       noro     3333: @end itemize
                   3334:
                   3335: @example
                   3336: [79] K = katsura(5)$
                   3337: [80] V = [u5,u4,u3,u2,u1,u0]$
                   3338: [81] G = hgr(K,V,2)$
                   3339: [82] p_nf(K[1],G,V,2);
                   3340: 0
                   3341: [83] L = p_true_nf(K[1]+1,G,V,2);
                   3342: [-1503...,-1503...]
                   3343: [84] L[0]/L[1];
                   3344: 1
                   3345: @end example
                   3346:
                   3347: @table @t
1.2       noro     3348: \JP @item $B;2>H(B
                   3349: \EG @item References
1.1       noro     3350: @fref{dp_ptod},
                   3351: @fref{dp_dtop},
                   3352: @fref{dp_ord},
                   3353: @fref{dp_nf dp_nf_mod dp_true_nf dp_true_nf_mod}.
                   3354: @end table
                   3355:
1.2       noro     3356: \JP @node p_terms,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   3357: \EG @node p_terms,,, Functions for Groebner basis computation
1.1       noro     3358: @subsection @code{p_terms}
                   3359: @findex p_terms
                   3360:
                   3361: @table @t
                   3362: @item p_terms(@var{poly},@var{vlist},@var{order})
1.2       noro     3363: \JP :: $BB?9`<0$K$"$i$o$l$kC19`$r%j%9%H$K$9$k(B.
                   3364: \EG :: Monomials appearing in the given polynomial is collected into a list.
1.1       noro     3365: @end table
                   3366:
                   3367: @table @var
                   3368: @item return
1.2       noro     3369: \JP $B%j%9%H(B
                   3370: \EG list
1.1       noro     3371: @item poly
1.2       noro     3372: \JP $BB?9`<0(B
                   3373: \EG polynomial
1.1       noro     3374: @item vlist
1.2       noro     3375: \JP $B%j%9%H(B
                   3376: \EG list
1.1       noro     3377: @item order
1.2       noro     3378: \JP $B?t(B, $B%j%9%H$^$?$O9TNs(B
                   3379: \EG number, list or matrix
1.1       noro     3380: @end table
                   3381:
                   3382: @itemize @bullet
1.2       noro     3383: \BJP
1.1       noro     3384: @item
                   3385: @samp{gr} $B$GDj5A$5$l$F$$$k(B.
                   3386: @item
                   3387: $BB?9`<0$rC19`$KE83+$7$?;~$K8=$l$k9`$r%j%9%H$K$7$FJV$9(B.
                   3388: @var{vlist} $B$*$h$S(B @var{order} $B$K$h$jDj$^$k9`=g=x$K$h$j(B, $B=g=x$N9b$$$b$N(B
                   3389: $B$,%j%9%H$N@hF,$KMh$k$h$&$K%=!<%H$5$l$k(B.
                   3390: @item
                   3391: $B%0%l%V%J4pDl$O$7$P$7$P78?t$,5pBg$K$J$k$?$a(B, $B<B:]$K$I$N9`$,8=$l$F(B
                   3392: $B$$$k$N$+$r8+$k$?$a$J$I$KMQ$$$k(B.
1.2       noro     3393: \E
                   3394: \BEG
                   3395: @item
                   3396: Defined in the package @samp{gr}.
                   3397: @item
                   3398: This returns a list which contains all non-zero monomials in the given
                   3399: polynomial.  The monomials are ordered according to the current
                   3400: type of term ordering and @var{vlist}.
                   3401: @item
                   3402: Since polynomials in a Groebner base often have very large coefficients,
                   3403: examining a polynomial as it is may sometimes be difficult to perform.
                   3404: For such a case, this function enables to examine which term is really
                   3405: exists.
                   3406: \E
1.1       noro     3407: @end itemize
                   3408:
                   3409: @example
                   3410: [233] G=gr(katsura(5),[u5,u4,u3,u2,u1,u0],2)$
                   3411: [234] p_terms(G[0],[u5,u4,u3,u2,u1,u0],2);
                   3412: [u5,u0^31,u0^30,u0^29,u0^28,u0^27,u0^26,u0^25,u0^24,u0^23,u0^22,u0^21,u0^20,
                   3413: u0^19,u0^18,u0^17,u0^16,u0^15,u0^14,u0^13,u0^12,u0^11,u0^10,u0^9,u0^8,u0^7,
                   3414: u0^6,u0^5,u0^4,u0^3,u0^2,u0,1]
                   3415: @end example
                   3416:
1.2       noro     3417: \JP @node gb_comp,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   3418: \EG @node gb_comp,,, Functions for Groebner basis computation
1.1       noro     3419: @subsection @code{gb_comp}
                   3420: @findex gb_comp
                   3421:
                   3422: @table @t
                   3423: @item gb_comp(@var{plist1}, @var{plist2})
1.2       noro     3424: \JP :: $BB?9`<0%j%9%H$,(B, $BId9f$r=|$$$F=89g$H$7$FEy$7$$$+$I$&$+D4$Y$k(B.
                   3425: \EG :: Checks whether two polynomial lists are equal or not as a set
1.1       noro     3426: @end table
                   3427:
                   3428: @table @var
1.2       noro     3429: \JP @item return 0 $B$^$?$O(B 1
                   3430: \EG @item return 0 or 1
1.4     ! noro     3431: @item plist1  plist2
1.1       noro     3432: @end table
                   3433:
                   3434: @itemize @bullet
1.2       noro     3435: \BJP
1.1       noro     3436: @item
                   3437: @var{plist1}, @var{plist2} $B$K$D$$$F(B, $BId9f$r=|$$$F=89g$H$7$FEy$7$$$+$I$&$+(B
                   3438: $BD4$Y$k(B.
                   3439: @item
                   3440: $B0[$J$kJ}K!$G5a$a$?%0%l%V%J4pDl$O(B, $B4pDl$N=g=x(B, $BId9f$,0[$J$k>l9g$,$"$j(B,
                   3441: $B$=$l$i$,Ey$7$$$+$I$&$+$rD4$Y$k$?$a$KMQ$$$k(B.
1.2       noro     3442: \E
                   3443: \BEG
                   3444: @item
                   3445: This function checks whether @var{plist1} and @var{plist2} are equal or
                   3446: not as a set .
                   3447: @item
                   3448: For the same input and the same term ordering different
                   3449: functions for Groebner basis computations may produce different outputs
                   3450: as lists. This function compares such lists whether they are equal
                   3451: as a generating set of an ideal.
                   3452: \E
1.1       noro     3453: @end itemize
                   3454:
                   3455: @example
                   3456: [243] C=cyclic(6)$
                   3457: [244] V=[c0,c1,c2,c3,c4,c5]$
                   3458: [245] G0=gr(C,V,0)$
                   3459: [246] G=tolex(G0,V,0,V)$
                   3460: [247] GG=lex_tl(C,V,0,V,0)$
                   3461: [248] gb_comp(G,GG);
                   3462: 1
                   3463: @end example
                   3464:
1.2       noro     3465: \JP @node katsura hkatsura cyclic hcyclic,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   3466: \EG @node katsura hkatsura cyclic hcyclic,,, Functions for Groebner basis computation
1.1       noro     3467: @subsection @code{katsura}, @code{hkatsura}, @code{cyclic}, @code{hcyclic}
                   3468: @findex katsura
                   3469: @findex hkatsura
                   3470: @findex cyclic
                   3471: @findex hcyclic
                   3472:
                   3473: @table @t
                   3474: @item katsura(@var{n})
                   3475: @item hkatsura(@var{n})
                   3476: @item cyclic(@var{n})
                   3477: @item hcyclic(@var{n})
1.2       noro     3478: \JP :: $BB?9`<0%j%9%H$N@8@.(B
                   3479: \EG :: Generates a polynomial list of standard benchmark.
1.1       noro     3480: @end table
                   3481:
                   3482: @table @var
                   3483: @item return
1.2       noro     3484: \JP $B%j%9%H(B
                   3485: \EG list
1.1       noro     3486: @item n
1.2       noro     3487: \JP $B@0?t(B
                   3488: \EG integer
1.1       noro     3489: @end table
                   3490:
                   3491: @itemize @bullet
1.2       noro     3492: \BJP
1.1       noro     3493: @item
                   3494: @code{katsura()} $B$O(B @samp{katsura}, @code{cyclic()} $B$O(B @samp{cyclic}
                   3495: $B$GDj5A$5$l$F$$$k(B.
                   3496: @item
                   3497: $B%0%l%V%J4pDl7W;;$G$7$P$7$P%F%9%H(B, $B%Y%s%A%^!<%/$KMQ$$$i$l$k(B @code{katsura},
                   3498: @code{cyclic} $B$*$h$S$=$N@F<!2=$r@8@.$9$k(B.
                   3499: @item
                   3500: @code{cyclic} $B$O(B @code{Arnborg}, @code{Lazard}, @code{Davenport} $B$J$I$N(B
                   3501: $BL>$G8F$P$l$k$3$H$b$"$k(B.
1.2       noro     3502: \E
                   3503: \BEG
                   3504: @item
                   3505: Function @code{katsura()} is defined in @samp{katsura}, and
                   3506: function @code{cyclic()} in  @samp{cyclic}.
                   3507: @item
                   3508: These functions generate a series of polynomial sets, respectively,
                   3509: which are often used for testing and bench marking:
                   3510: @code{katsura}, @code{cyclic} and their homogenized versions.
                   3511: @item
                   3512: Polynomial set @code{cyclic} is sometimes called by other name:
                   3513: @code{Arnborg}, @code{Lazard}, and @code{Davenport}.
                   3514: \E
1.1       noro     3515: @end itemize
                   3516:
                   3517: @example
                   3518: [74] load("katsura")$
                   3519: [79] load("cyclic")$
                   3520: [89] katsura(5);
                   3521: [u0+2*u4+2*u3+2*u2+2*u1+2*u5-1,2*u4*u0-u4+2*u1*u3+u2^2+2*u5*u1,
                   3522: 2*u3*u0+2*u1*u4-u3+(2*u1+2*u5)*u2,2*u2*u0+2*u2*u4+(2*u1+2*u5)*u3-u2+u1^2,
                   3523: 2*u1*u0+(2*u3+2*u5)*u4+2*u2*u3+2*u1*u2-u1,
                   3524: u0^2-u0+2*u4^2+2*u3^2+2*u2^2+2*u1^2+2*u5^2]
                   3525: [90] hkatsura(5);
                   3526: [-t+u0+2*u4+2*u3+2*u2+2*u1+2*u5,
                   3527: -u4*t+2*u4*u0+2*u1*u3+u2^2+2*u5*u1,-u3*t+2*u3*u0+2*u1*u4+(2*u1+2*u5)*u2,
                   3528: -u2*t+2*u2*u0+2*u2*u4+(2*u1+2*u5)*u3+u1^2,
                   3529: -u1*t+2*u1*u0+(2*u3+2*u5)*u4+2*u2*u3+2*u1*u2,
                   3530: -u0*t+u0^2+2*u4^2+2*u3^2+2*u2^2+2*u1^2+2*u5^2]
                   3531: [91] cyclic(6);
                   3532: [c5*c4*c3*c2*c1*c0-1,
                   3533: ((((c4+c5)*c3+c5*c4)*c2+c5*c4*c3)*c1+c5*c4*c3*c2)*c0+c5*c4*c3*c2*c1,
                   3534: (((c3+c5)*c2+c5*c4)*c1+c5*c4*c3)*c0+c4*c3*c2*c1+c5*c4*c3*c2,
                   3535: ((c2+c5)*c1+c5*c4)*c0+c3*c2*c1+c4*c3*c2+c5*c4*c3,
                   3536: (c1+c5)*c0+c2*c1+c3*c2+c4*c3+c5*c4,c0+c1+c2+c3+c4+c5]
                   3537: [92] hcyclic(6);
                   3538: [-c^6+c5*c4*c3*c2*c1*c0,
                   3539: ((((c4+c5)*c3+c5*c4)*c2+c5*c4*c3)*c1+c5*c4*c3*c2)*c0+c5*c4*c3*c2*c1,
                   3540: (((c3+c5)*c2+c5*c4)*c1+c5*c4*c3)*c0+c4*c3*c2*c1+c5*c4*c3*c2,
                   3541: ((c2+c5)*c1+c5*c4)*c0+c3*c2*c1+c4*c3*c2+c5*c4*c3,
                   3542: (c1+c5)*c0+c2*c1+c3*c2+c4*c3+c5*c4,c0+c1+c2+c3+c4+c5]
                   3543: @end example
                   3544:
                   3545: @table @t
1.2       noro     3546: \JP @item $B;2>H(B
                   3547: \EG @item References
1.1       noro     3548: @fref{dp_dtop}.
                   3549: @end table
                   3550:
1.3       noro     3551: \JP @node primadec primedec,,, $B%0%l%V%J4pDl$K4X$9$kH!?t(B
                   3552: \EG @node primadec primedec,,, Functions for Groebner basis computation
                   3553: @subsection @code{primadec}, @code{primedec}
                   3554: @findex primadec
                   3555: @findex primedec
                   3556:
                   3557: @table @t
                   3558: @item primadec(@var{plist},@var{vlist})
                   3559: @item primedec(@var{plist},@var{vlist})
                   3560: \JP :: $B%$%G%"%k$NJ,2r(B
                   3561: \EG :: Computes decompositions of ideals.
                   3562: @end table
                   3563:
                   3564: @table @var
                   3565: @item return
                   3566: @itemx plist
                   3567: \JP $BB?9`<0%j%9%H(B
                   3568: \EG list of polynomials
                   3569: @item vlist
                   3570: \JP $BJQ?t%j%9%H(B
                   3571: \EG list of variables
                   3572: @end table
                   3573:
                   3574: @itemize @bullet
                   3575: \BJP
                   3576: @item
                   3577: @code{primadec()}, @code{primedec} $B$O(B @samp{primdec} $B$GDj5A$5$l$F$$$k(B.
                   3578: @item
                   3579: @code{primadec()}, @code{primedec()} $B$O$=$l$>$lM-M}?tBN>e$G$N%$%G%"%k$N(B
                   3580: $B=`AGJ,2r(B, $B:,4p$NAG%$%G%"%kJ,2r$r9T$&(B.
                   3581: @item
                   3582: $B0z?t$OB?9`<0%j%9%H$*$h$SJQ?t%j%9%H$G$"$k(B. $BB?9`<0$OM-M}?t78?t$N$_$,5v$5$l$k(B.
                   3583: @item
                   3584: @code{primadec} $B$O(B @code{[$B=`AG@.J,(B, $BIUB0AG%$%G%"%k(B]} $B$N%j%9%H$rJV$9(B.
                   3585: @item
                   3586: @code{primadec} $B$O(B $BAG0x;R$N%j%9%H$rJV$9(B.
                   3587: @item
                   3588: $B7k2L$K$*$$$F(B, $BB?9`<0%j%9%H$H$7$FI=<($5$l$F$$$k3F%$%G%"%k$OA4$F(B
                   3589: $B%0%l%V%J4pDl$G$"$k(B. $BBP1~$9$k9`=g=x$O(B, $B$=$l$>$l(B
                   3590: $BJQ?t(B @code{PRIMAORD}, @code{PRIMEORD} $B$K3JG<$5$l$F$$$k(B.
                   3591: @item
                   3592: @code{primadec} $B$O(B @code{[Shimoyama,Yokoyama]} $B$N=`AGJ,2r%"%k%4%j%:%`(B
                   3593: $B$r<BAu$7$F$$$k(B.
                   3594: @item
                   3595: $B$b$7AG0x;R$N$_$r5a$a$?$$$J$i(B, @code{primedec} $B$r;H$&J}$,$h$$(B.
                   3596: $B$3$l$O(B, $BF~NO%$%G%"%k$,:,4p%$%G%"%k$G$J$$>l9g$K(B, @code{primadec}
                   3597: $B$N7W;;$KM>J,$J%3%9%H$,I,MW$H$J$k>l9g$,$"$k$+$i$G$"$k(B.
                   3598: \E
                   3599: \BEG
                   3600: @item
                   3601: Function @code{primadec()} and @code{primedec} are defined in @samp{primdec}.
                   3602: @item
                   3603: @code{primadec()}, @code{primedec()} are the function for primary
                   3604: ideal decomposition and prime decomposition of the radical over the
                   3605: rationals respectively.
                   3606: @item
                   3607: The arguments are a list of polynomials and a list of variables.
                   3608: These functions accept ideals with rational function coefficients only.
                   3609: @item
                   3610: @code{primadec} returns the list of pair lists consisting a primary component
                   3611: and its associated prime.
                   3612: @item
                   3613: @code{primedec} returns the list of prime components.
                   3614: @item
                   3615: Each component is a Groebner basis and the corresponding term order
                   3616: is indicated by the global variables @code{PRIMAORD}, @code{PRIMEORD}
                   3617: respectively.
                   3618: @item
                   3619: @code{primadec} implements the primary decompostion algorithm
                   3620: in @code{[Shimoyama,Yokoyama]}.
                   3621: @item
                   3622: If one only wants to know the prime components of an ideal, then
                   3623: use @code{primedec} because @code{primadec} may need additional costs
                   3624: if an input ideal is not radical.
                   3625: \E
                   3626: @end itemize
                   3627:
                   3628: @example
                   3629: [84] load("primdec")$
                   3630: [102] primedec([p*q*x-q^2*y^2+q^2*y,-p^2*x^2+p^2*x+p*q*y,
                   3631: (q^3*y^4-2*q^3*y^3+q^3*y^2)*x-q^3*y^4+q^3*y^3,
                   3632: -q^3*y^4+2*q^3*y^3+(-q^3+p*q^2)*y^2],[p,q,x,y]);
                   3633: [[y,x],[y,p],[x,q],[q,p],[x-1,q],[y-1,p],[(y-1)*x-y,q*y^2-2*q*y-p+q]]
                   3634: [103] primadec([x,z*y,w*y^2,w^2*y-z^3,y^3],[x,y,z,w]);
                   3635: [[[x,z*y,y^2,w^2*y-z^3],[z,y,x]],[[w,x,z*y,z^3,y^3],[w,z,y,x]]]
                   3636: @end example
                   3637:
                   3638: @table @t
                   3639: \JP @item $B;2>H(B
                   3640: \EG @item References
                   3641: @fref{fctr sqfr},
                   3642: \JP @fref{$B9`=g=x$N@_Dj(B}.
                   3643: \EG @fref{Setting term orderings}.
                   3644: @end table

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>