[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.5

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

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