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

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

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