[BACK]Return to sm1.oxweave CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-contrib / packages / doc

Annotation of OpenXM/src/asir-contrib/packages/doc/sm1.oxweave, Revision 1.10

1.10    ! takayama    1: /*$OpenXM: OpenXM/src/asir-contrib/packages/doc/sm1.oxweave,v 1.9 2003/05/19 05:15:52 takayama Exp $ */
1.1       takayama    2:
                      3: /*&C-texi
                      4: @c DO NOT EDIT THIS FILE   oxphc.texi
                      5: */
1.6       takayama    6: /*&C-texi
                      7: @node SM1 Functions,,, Top
                      8: */
1.1       takayama    9: /*&jp-texi
                     10: @chapter SM1 $BH!?t(B
                     11:
                     12: $B$3$N@a$G$O(B sm1 $B$N(B ox $B%5!<%P(B @code{ox_sm1_forAsir}
                     13: $B$H$N%$%s%?%U%'!<%94X?t$r2r@b$9$k(B.
                     14: $B$3$l$i$N4X?t$O%U%!%$%k(B  @file{sm1} $B$GDj5A$5$l$F$$$k(B.
                     15: @file{sm1} $B$O(B @file{$(OpenXM_HOME)/lib/asir-contrib} $B$K$"$k(B.
                     16: $B%7%9%F%`(B @code{sm1} $B$OHyJ,:nMQAG4D$G7W;;$9$k$?$a$N%7%9%F%`$G$"$k(B.
                     17: $B7W;;Be?t4v2?$N$$$m$$$m$JITJQNL$N7W;;$,HyJ,:nMQAG$N7W;;$K5"Ce$9$k(B.
                     18: @code{sm1} $B$K$D$$$F$NJ8=q$O(B @code{OpenXM/doc/kan96xx} $B$K$"$k(B.
                     19:
                     20: $B$H$3$KCG$j$,$J$$$+$.$j$3$N@a$N$9$Y$F$N4X?t$O(B,
                     21: $BM-M}?t78?t$N<0$rF~NO$H$7$F$&$1$D$1$J$$(B.
                     22: $B$9$Y$F$NB?9`<0$N78?t$O@0?t$G$J$$$H$$$1$J$$(B.
                     23:
                     24: @tex
                     25: $B6u4V(B
                     26: $X:={\bf C} \setminus \{ 0, 1 \} = {\bf C} \setminus V(x(x-1))$
                     27: $B$N%I%i!<%`%3%[%b%m%872C#$N<!85$r7W;;$7$F$_$h$&(B.
                     28: $X$ $B$OJ?LL$KFs$D$N7j$r$"$1$?6u4V$G$"$k$N$G(B, $BE@(B $x=0$, $x=1$ $B$N$^$o$j$r(B
                     29: $B$^$o$kFs$D$N%k!<%W$,(B1$B<!85$N%[%b%m%8!<72$N6u4V$r$O$k(B.
                     30: $B$7$?$,$C$F(B, 1$B<!85%I%i!<%`%3%[%b%m%872$N<!85$O(B $2$ $B$G$"$k(B.
                     31: @code{sm1} $B$O(B $0$ $B<!85$N%3%[%b%m%872$N<!85$*$h$S(B $1$ $B<!85$N%3%[%b%m%872$N(B
                     32: $B<!85$rEz$($k(B.
                     33: @end tex
                     34: */
                     35: /*&eg-texi
                     36: @chapter SM1 Functions
                     37:
                     38: This chapter describes  interface functions for
                     39: sm1 ox server @code{ox_sm1_forAsir}.
                     40: These interface functions are defined in the file @file{sm1}.
                     41: The file @file{sm1} is @*
                     42: at @file{$(OpenXM_HOME)/lib/asir/contrib-packages}.
                     43: The system @code{sm1} is a system to compute in the ring of differential
                     44: operators.
                     45: Many constructions of invariants
                     46: in the computational algebraic geometry reduce
                     47: to constructions in the ring of differential operators.
                     48: Documents on @code{sm1} are in
                     49: the directory @code{OpenXM/doc/kan96xx}.
                     50:
                     51: All the coefficients of input polynomials should be
                     52: integers for most functions in this section.
                     53: Other functions accept rational numbers as inputs
                     54: and it will be explicitely noted in each explanation
                     55: of these functions.
                     56:
                     57:
                     58:
                     59: @tex
                     60: Let us evaluate the dimensions of the de Rham cohomology groups
                     61: of
                     62: $X:={\bf C} \setminus \{ 0, 1 \} = {\bf C} \setminus V(x(x-1))$.
                     63: The space $X$ is a two punctured plane, so two loops that encircles the
                     64: points $x=0$ and $x=1$ respectively spans the first homology group.
                     65: Hence, the dimension of the first de Rham cohomology group is $2$.
                     66: @code{sm1} answers the dimensions of the 0th and the first
                     67: cohomology groups.
                     68: @end tex
                     69: */
                     70: /*&C-texi
                     71: @example
                     72:
1.5       takayama   73: @include opening.texi
1.1       takayama   74:
1.8       takayama   75: [283] sm1.deRham([x*(x-1),[x]]);
1.1       takayama   76: [1,2]
                     77: @end example
                     78: */
                     79: /*&C-texi
                     80: @noindent
                     81: The author of @code{sm1} : Nobuki Takayama, @code{takayama@@math.sci.kobe-u.ac.jp} @*
                     82: The author of sm1 packages : Toshinori Oaku, @code{oaku@@twcu.ac.jp} @*
                     83: Reference: [SST] Saito, M., Sturmfels, B., Takayama, N.,
                     84: Grobner Deformations of Hypergeometric Differential Equations,
                     85: 1999, Springer.
                     86: See the appendix.
                     87: */
1.6       takayama   88:
                     89: /*
                     90: @menu
                     91: * ox_sm1_forAsir::
1.8       takayama   92: * sm1.start::
1.10    ! takayama   93: * sm1.sm1::
1.8       takayama   94: * sm1.push_int0::
                     95: * sm1.gb::
                     96: * sm1.deRham::
                     97: * sm1.hilbert::
1.6       takayama   98: * hilbert_polynomial::
1.8       takayama   99: * sm1.genericAnn::
                    100: * sm1.wTensor0::
                    101: * sm1.reduction::
                    102: * sm1.xml_tree_to_prefix_string::
                    103: * sm1.syz::
                    104: * sm1.mul::
                    105: * sm1.distraction::
                    106: * sm1.gkz::
                    107: * sm1.appell1::
                    108: * sm1.appell4::
                    109: * sm1.rank::
                    110: * sm1.auto_reduce::
                    111: * sm1.slope::
1.6       takayama  112: @end menu
                    113: */
                    114:
1.1       takayama  115: /*&jp-texi
                    116: @section @code{ox_sm1_forAsir} $B%5!<%P(B
                    117: */
                    118: /*&eg-texi
                    119: @section @code{ox_sm1_forAsir} Server
                    120: */
                    121:
                    122: /*&eg-texi
                    123: @node ox_sm1_forAsir,,, Top
                    124: @subsection @code{ox_sm1_forAsir}
                    125: @findex ox_sm1_forAsir
                    126: @table @t
                    127: @item ox_sm1_forAsir
                    128: ::  @code{sm1} server for @code{asir}.
                    129: @end table
                    130: @itemize @bullet
                    131: @item
                    132:    @code{ox_sm1_forAsir} is the @code{sm1} server started from asir
1.8       takayama  133:     by the command @code{sm1.start}.
1.1       takayama  134:     In the standard setting,  @*
                    135:     @code{ox_sm1_forAsir} =
                    136:          @file{$(OpenXM_HOME)/lib/sm1/bin/ox_sm1}
                    137:        +
                    138:          @file{$(OpenXM_HOME)/lib/sm1/callsm1.sm1}   (macro file) @*
                    139:        +
                    140:          @file{$(OpenXM_HOME)/lib/sm1/callsm1b.sm1}  (macro file) @*
                    141:    The macro files @file{callsm1.sm1} and @file{callsm1b.sm1}
                    142:    are searched from
                    143:    current directory, @code{$(LOAD_SM1_PATH)},
                    144:    @code{$(OpenXM_HOME)/lib/sm1},
                    145:    @code{/usr/local/lib/sm1}
                    146:    in this order.
                    147: @item Note for programmers:  See the files
                    148:     @file{$(OpenXM_HOME)/src/kxx/oxserver00.c},
                    149:     @file{$(OpenXM_HOME)/src/kxx/sm1stackmachine.c}
                    150: to build your own server by reading @code{sm1} macros.
                    151: @end itemize
                    152: */
                    153: /*&jp-texi
                    154: @node ox_sm1_forAsir,,, Top
                    155: @subsection @code{ox_sm1_forAsir}
                    156: @findex ox_sm1_forAsir
                    157: @table @t
                    158: @item ox_sm1_forAsir
                    159: ::  @code{asir} $B$N$?$a$N(B @code{sm1} $B%5!<%P(B.
                    160: @end table
                    161: @itemize @bullet
                    162: @item
                    163:    $B%5!<%P(B @code{ox_sm1_forAsir} $B$O(B @code{asir} $B$h$j%3%^%s%I(B
1.8       takayama  164:     @code{sm1.start} $B$G5/F0$5$l$k(B @code{sm1} $B%5!<%P$G$"$k(B.
1.1       takayama  165:
                    166:     $BI8=`E*@_Dj$G$O(B, @*
                    167:     @code{ox_sm1_forAsir} =
                    168:          @file{$(OpenXM_HOME)/lib/sm1/bin/ox_sm1}
                    169:        +
                    170:          @file{$(OpenXM_HOME)/lib/sm1/callsm1.sm1}   (macro file) @*
                    171:        +
                    172:          @file{$(OpenXM_HOME)/lib/sm1/callsm1b.sm1}  (macro file) @*
                    173:   $B$G$"$j(B, $B$3$l$i$N%^%/%m%U%!%$%k$O(B, $B0lHL$K$O(B
                    174:    current directory, @code{$(LOAD_SM1_PATH)},
                    175:    @code{$(OpenXM_HOME)/lib/sm1},
                    176:    @code{/usr/local/lib/sm1}
                    177:     $B$N=gHV$G$5$,$5$l$k(B.
                    178: @item $B%W%m%0%i%^!<$N$?$a$N%N!<%H(B:
                    179: @code{sm1} $B%^%/%m$rFI$_9~$s$G<+J,FH<+$N%5!<%P$r:n$k$K$O(B
                    180:     $B<!$N%U%!%$%k$b8+$h(B
                    181:     @file{$(OpenXM_HOME)/src/kxx/oxserver00.c},
                    182:     @file{$(OpenXM_HOME)/src/kxx/sm1stackmachine.c}
                    183: @end itemize
                    184: */
                    185:
                    186:
                    187: /*&jp-texi
                    188: @section $BH!?t0lMw(B
                    189: */
                    190: /*&eg-texi
                    191: @section Functions
                    192: */
                    193:
                    194: /*&eg-texi
1.8       takayama  195: @c sort-sm1.start
                    196: @node sm1.start,,, SM1 Functions
                    197: @subsection @code{sm1.start}
                    198: @findex sm1.start
1.1       takayama  199: @table @t
1.8       takayama  200: @item sm1.start()
1.1       takayama  201: ::  Start  @code{ox_sm1_forAsir} on the localhost.
                    202: @end table
                    203:
                    204: @table @var
                    205: @item return
                    206: Integer
                    207: @end table
                    208:
                    209: @itemize @bullet
                    210: @item Start @code{ox_sm1_forAsir} on the localhost.
                    211:     It returns the descriptor of @code{ox_sm1_forAsir}.
                    212: @item Set @code{Xm_noX = 1} to start @code{ox_sm1_forAsir}
                    213: without a debug window.
                    214: @item You might have to set suitable orders of variable by the command
                    215: @code{ord}.  For example,
                    216: when you are working in the
                    217: ring of differential operators on the variable @code{x} and @code{dx}
                    218: (@code{dx} stands for
                    219: @tex $\partial/\partial x$
                    220: @end tex
                    221: ),
                    222: @code{sm1} server assumes that
                    223: the variable @code{dx} is collected to the right and the variable
                    224: @code{x} is collected to the left in the printed expression.
                    225: In the example below, you  must not use the variable @code{cc}
                    226: for computation in @code{sm1}.
                    227: @item The variables from @code{a} to @code{z} except @code{d} and @code{o}
                    228: and @code{x0}, ..., @code{x20}, @code{y0}, ..., @code{y20},
                    229: @code{z0}, ..., @code{z20} can be used as variables for ring of
                    230: differential operators in default. (cf. @code{Sm1_ord_list} in @code{sm1}).
1.8       takayama  231: @item The descriptor is stored in @code{static Sm1_proc}.
                    232: The descriptor can be obtained by the function
                    233: @code{sm1.get_Sm1_proc()}.
1.1       takayama  234: @end itemize
                    235: */
                    236: /*&jp-texi
1.8       takayama  237: @c sort-sm1.start
                    238: @node sm1.start,,, SM1 Functions
                    239: @subsection @code{sm1.start}
                    240: @findex sm1.start
1.1       takayama  241: @table @t
1.8       takayama  242: @item sm1.start()
1.1       takayama  243: ::  localhost $B$G(B  @code{ox_sm1_forAsir} $B$r%9%?!<%H$9$k(B.
                    244: @end table
                    245:
                    246: @table @var
                    247: @item return
                    248: $B@0?t(B
                    249: @end table
                    250:
                    251: @itemize @bullet
                    252: @item localhost $B$G(B @code{ox_sm1_forAsir} $B$r%9%?!<%H$9$k(B.
                    253: $B%5!<%P(B @code{ox_sm1_forAsir} $B$N<1JLHV9f$rLa$9(B.
                    254: @item @code{Xm_noX = 1} $B$H$*$/$H%5!<%P(B @code{ox_sm1_forAsir} $B$r%G%P%C%0MQ$N(B
                    255: $B%&%#%s%I%&$J$7$K5/F0$G$-$k(B.
                    256: @item $B%3%^%s%I(B @code{ord} $B$rMQ$$$FJQ?t=g=x$r@5$7$/@_Dj$7$F$*$/I,MW$,(B
                    257: $B$"$k(B.
                    258: $B$?$H$($P(B,
                    259: $BJQ?t(B @code{x} $B$H(B @code{dx} $B>e$NHyJ,:nMQAG4D(B
                    260: (@code{dx} $B$O(B
                    261: @tex $\partial/\partial x$
                    262: @end tex
                    263: $B$KBP1~(B)
                    264: $B$G7W;;$7$F$$$k$H$-(B,
                    265: @code{sm1} $B%5!<%P$O<0$r0u:~$7$?$H$-(B,
                    266: $BJQ?t(B @code{dx} $B$O1&B&$K=8$a$lJQ?t(B
                    267: @code{x} $B$O:8B&$K$"$D$a$i$l$F$$$k$H2>Dj$7$F$$$k(B.
                    268: $B<!$NNc$G$O(B, $BJQ?t(B @code{cc} $B$r(B @code{sm1} $B$G$N7W;;$N$?$a$KMQ$$$F$O$$$1$J$$(B.
                    269: @item @code{a} $B$h$j(B @code{z} $B$N$J$+$G(B,  @code{d} $B$H(B @code{o} $B$r=|$$$?$b$N(B,
                    270: $B$=$l$+$i(B, @code{x0}, ..., @code{x20}, @code{y0}, ..., @code{y20},
                    271: @code{z0}, ..., @code{z20} $B$O(B, $B%G%U%)!<%k%H$GHyJ,:nMQAG4D$NJQ?t$H$7$F(B
                    272: $B;H$($k(B (cf. @code{Sm1_ord_list} in @code{sm1}).
1.8       takayama  273: @item $B<1JLHV9f$O(B @code{static Sm1_proc} $B$K3JG<$5$l$k(B.
                    274: $B$3$N<1JLHV9f$O4X?t(B @code{sm1.get_Sm1_proc()} $B$G$H$j$@$9$3$H$,$G$-$k(B.
1.1       takayama  275: @end itemize
                    276: */
                    277: /*&C-texi
                    278: @example
                    279: [260] ord([da,a,db,b]);
                    280: [da,a,db,b,dx,dy,dz,x,y,z,dt,ds,t,s,u,v,w,
                    281: ......... omit ..................
                    282: ]
                    283: [261] a*da;
                    284: a*da
                    285: [262] cc*dcc;
                    286: dcc*cc
1.8       takayama  287: [263] sm1.mul(da,a,[a]);
1.1       takayama  288: a*da+1
1.8       takayama  289: [264] sm1.mul(a,da,[a]);
1.1       takayama  290: a*da
                    291: @end example
                    292: */
                    293: /*&eg-texi
                    294: @table @t
                    295: @item Reference
1.8       takayama  296:     @code{ox_launch}, @code{sm1.push_int0}, @code{sm1.push_poly0},
1.1       takayama  297:     @code{ord}
                    298: @end table
                    299: */
                    300: /*&jp-texi
                    301: @table @t
                    302: @item $B;2>H(B
1.8       takayama  303:     @code{ox_launch}, @code{sm1.push_int0}, @code{sm1.push_poly0},
1.1       takayama  304:     @code{ord}
                    305: @end table
                    306: */
                    307:
                    308:
                    309:
                    310: /*&eg-texi
                    311: @c sort-sm1
1.10    ! takayama  312: @node sm1.sm1,,, SM1 Functions
        !           313: @subsection @code{sm1.sm1}
        !           314: @findex sm1.sm1
1.1       takayama  315: @table @t
1.10    ! takayama  316: @item sm1.sm1(@var{p},@var{s})
1.1       takayama  317: ::  ask the @code{sm1} server to execute the command string @var{s}.
                    318: @end table
                    319:
                    320: @table @var
                    321: @item return
                    322: Void
                    323: @item p
                    324: Number
                    325: @item s
                    326: String
                    327: @end table
                    328:
                    329: @itemize @bullet
                    330: @item  It asks the @code{sm1} server of the descriptor number @var{p}
                    331: to execute the command string @var{s}.
1.9       takayama  332: (In the next example, the descriptor number is 0.)
1.1       takayama  333: @end itemize
                    334: */
                    335: /*&jp-texi
1.10    ! takayama  336: @node sm1.sm1,,, SM1 Functions
        !           337: @subsection @code{sm1.sm1}
        !           338: @findex sm1.sm1
1.1       takayama  339: @table @t
1.10    ! takayama  340: @item sm1.sm1(@var{p},@var{s})
1.1       takayama  341: ::  $B%5!<%P(B @code{sm1} $B$K%3%^%s%INs(B @var{s} $B$r<B9T$7$F$/$l$k$h$&$K$?$N$`(B.
                    342: @end table
                    343:
                    344: @table @var
                    345: @item return
                    346: $B$J$7(B
                    347: @item p
                    348: $B?t(B
                    349: @item s
                    350: $BJ8;zNs(B
                    351: @end table
                    352:
                    353: @itemize @bullet
                    354: @item  $B<1JLHV9f(B @var{p} $B$N(B @code{sm1} $B%5!<%P$K(B
                    355: $B%3%^%s%INs(B @var{s} $B$r<B9T$7$F$/$l$k$h$&$KMj$`(B.
1.9       takayama  356:  ($B<!$NNc$G$O(B, $B<1JLHV9f(B 0)
1.1       takayama  357: @end itemize
                    358: */
                    359: /*&C-texi
                    360: @example
1.10    ! takayama  361: [261] sm1.sm1(0," ( (x-1)^2 ) . ");
1.1       takayama  362: 0
                    363: [262] ox_pop_string(0);
                    364: x^2-2*x+1
1.10    ! takayama  365: [263] sm1.sm1(0," [(x*(x-1))  [(x)]] deRham ");
1.1       takayama  366: 0
                    367: [264] ox_pop_string(0);
                    368: [1 , 2]
                    369: @end example
                    370: */
1.10    ! takayama  371:
1.1       takayama  372: /*&jp-texi
                    373: @table @t
                    374: @item $B;2>H(B
1.8       takayama  375:     @code{sm1.start}, @code{ox_push_int0}, @code{sm1.push_poly0}, @code{sm1.get_Sm1_proc()}.
1.1       takayama  376: @end table
                    377: */
                    378: /*&eg-texi
                    379: @table @t
                    380: @item Reference
1.8       takayama  381:     @code{sm1.start}, @code{ox_push_int0}, @code{sm1.push_poly0}, @code{sm1.get_Sm1_proc()}.
1.1       takayama  382: @end table
                    383: */
                    384:
                    385:
                    386: /*&eg-texi
1.8       takayama  387: @c sort-sm1.push_int0
                    388: @node sm1.push_int0,,, SM1 Functions
                    389: @subsection @code{sm1.push_int0}
                    390: @findex sm1.push_int0
1.1       takayama  391: @table @t
1.8       takayama  392: @item sm1.push_int0(@var{p},@var{f})
1.1       takayama  393: ::   push the object @var{f} to the server with the descriptor number @var{p}.
                    394: @end table
                    395:
                    396: @table @var
                    397: @item return
                    398: Void
                    399: @item p
                    400: Number
                    401: @item f
                    402: Object
                    403: @end table
                    404:
                    405: @itemize @bullet
                    406: @item When @code{type(@var{f})} is 2 (recursive polynomial),
                    407:     @var{f} is converted to a string (type == 7)
                    408:     and is sent to the server by @code{ox_push_cmo}.
                    409: @item When @code{type(@var{f})} is 0 (zero),
                    410:      it is translated to the 32 bit integer zero
                    411:     on the server.
                    412:     Note that @code{ox_push_cmo(@var{p},0)} sends @code{CMO_NULL} to the server.
                    413: In other words, the server does not get the 32 bit integer 0 nor
                    414: the bignum 0.
                    415: @item  @code{sm1} integers are classfied into the 32 bit integer and
                    416: the bignum.
                    417: When @code{type(@var{f})} is 1 (number), it is translated to the
                    418: 32 bit integer on the server.
                    419: Note that @code{ox_push_cmo(@var{p},1234)} send the bignum 1234 to the
                    420: @code{sm1} server.
                    421: @item In other cases,  @code{ox_push_cmo} is called without data conversion.
                    422: @end itemize
                    423: */
                    424: /*&jp-texi
1.8       takayama  425: @c sort-sm1.push_int0
                    426: @node sm1.push_int0,,, SM1 Functions
                    427: @subsection @code{sm1.push_int0}
                    428: @findex sm1.push_int0
1.1       takayama  429: @table @t
1.8       takayama  430: @item sm1.push_int0(@var{p},@var{f})
1.1       takayama  431: ::   $B%*%V%8%'%/%H(B @var{f} $B$r<1JL;R(B @var{p} $B$N%5!<%P$XAw$k(B.
                    432: @end table
                    433:
                    434: @table @var
                    435: @item return
                    436: $B$J$7(B
                    437: @item p
                    438: $B?t(B
                    439: @item f
                    440: $B%*%V%8%'%/%H(B
                    441: @end table
                    442:
                    443: @itemize @bullet
                    444: @item @code{type(@var{f})} $B$,(B 2 ($B:F5"B?9`<0(B) $B$N$H$-(B,
                    445:     @var{f} $B$OJ8;zNs(B (type == 7) $B$KJQ49$5$l$F(B,
                    446:     @code{ox_push_cmo} $B$rMQ$$$F%5!<%P$XAw$i$l$k(B.
                    447: @item @code{type(@var{f})} $B$,(B 0 (zero) $B$N$H$-$O(B,
                    448:     $B%5!<%P>e$G$O(B, 32 bit $B@0?t$H2r<a$5$l$k(B.
                    449:     $B$J$*(B @code{ox_push_cmo(P,0)} $B$O%5!<%P$KBP$7$F(B @code{CMO_NULL}
                    450: $B$r$*$/$k$N$G(B, $B%5!<%PB&$G$O(B, 32 bit $B@0?t$r<u$1<h$k$o$1$G$O$J$$(B.
                    451: @item  @code{sm1} $B$N@0?t$O(B, 32 bit $B@0?t$H(B bignum $B$K$o$1$k$3$H$,$G$-$k(B.
                    452: @code{type(@var{f})} $B$,(B 1 ($B?t(B)$B$N$H$-(B, $B$3$N4X?t$O(B 32 bit integer $B$r%5!<%P$K(B
                    453: $B$*$/$k(B.
                    454: @code{ox_push_cmo(@var{p},1234)} $B$O(B bignum $B$N(B 1234 $B$r(B
                    455: @code{sm1} $B%5!<%P$K$*$/$k$3$H$KCm0U$7$h$&(B.
                    456: @item $B$=$NB>$N>l9g$K$O(B  @code{ox_push_cmo} $B$r%G!<%?7?$NJQ49$J$7$K8F$S=P$9(B.
                    457: @end itemize
                    458: */
                    459: /*&C
                    460: @example
1.8       takayama  461: [219] P=sm1.start();
1.1       takayama  462: 0
1.8       takayama  463: [220] sm1.push_int0(P,x*dx+1);
1.1       takayama  464: 0
                    465: [221] A=ox_pop_cmo(P);
                    466: x*dx+1
                    467: [223] type(A);
                    468: 7   (string)
                    469: @end example
                    470:
                    471: @example
1.8       takayama  472: [271] sm1.push_int0(0,[x*(x-1),[x]]);
1.1       takayama  473: 0
                    474: [272] ox_execute_string(0," deRham ");
                    475: 0
                    476: [273] ox_pop_cmo(0);
                    477: [1,2]
                    478: @end example
                    479: */
                    480: /*&eg-texi
                    481: @table @t
                    482: @item Reference
                    483:     @code{ox_push_cmo}
                    484: @end table
                    485: */
                    486: /*&jp-texi
                    487: @table @t
                    488: @item Reference
                    489:     @code{ox_push_cmo}
                    490: @end table
                    491: */
                    492:
                    493:
                    494:
                    495: /*&eg-texi
1.8       takayama  496: @c sort-sm1.gb
                    497: @node sm1.gb,,, SM1 Functions
                    498: @node sm1.gb_d,,, SM1 Functions
                    499: @subsection @code{sm1.gb}
                    500: @findex sm1.gb
                    501: @findex sm1.gb_d
1.1       takayama  502: @table @t
1.8       takayama  503: @item sm1.gb([@var{f},@var{v},@var{w}]|proc=@var{p},sorted=@var{q},dehomogenize=@var{r})
1.1       takayama  504: ::  computes the Grobner basis of @var{f} in the ring of differential
                    505: operators with the variable @var{v}.
1.8       takayama  506: @item sm1.gb_d([@var{f},@var{v},@var{w}]|proc=@var{p})
1.1       takayama  507: ::  computes the Grobner basis of @var{f} in the ring of differential
                    508: operators with the variable @var{v}.
                    509: The result will be returned as a list of distributed polynomials.
                    510: @end table
                    511:
                    512: @table @var
                    513: @item return
                    514: List
1.3       takayama  515: @item p, q, r
1.1       takayama  516: Number
                    517: @item f, v, w
                    518: List
                    519: @end table
                    520:
                    521: @itemize @bullet
                    522: @item
                    523:    It returns the Grobner basis of the set of polynomials @var{f}
                    524:    in the ring of deferential operators with the variables @var{v}.
                    525: @item
                    526:    The weight vectors are given by @var{w}, which can be omitted.
                    527:     If @var{w} is not given,
                    528:     the graded reverse lexicographic order will be used to compute Grobner basis.
                    529: @item
1.8       takayama  530:    The return value of @code{sm1.gb}
1.1       takayama  531:     is the list of the Grobner basis of @var{f} and the initial
                    532:     terms (when @var{w} is not given) or initial ideal (when @var{w} is given).
                    533: @item
1.8       takayama  534:    @code{sm1.gb_d} returns the results by a list of distributed polynomials.
1.1       takayama  535:     Monomials in each distributed polynomial are ordered in the given order.
                    536:     The return value consists of
                    537:     [variable names, order matrix, grobner basis in districuted polynomials,
                    538:      initial monomials or initial polynomials].
                    539: @item
                    540:    When a non-term order is given, the Grobner basis is computed in
                    541:    the homogenized Weyl algebra  (See Section 1.2 of the book of SST).
                    542:    The homogenization variable h is automatically added.
1.2       takayama  543: @item
1.8       takayama  544:    When the optional variable @var{q} is set, @code{sm1.gb} returns,
1.2       takayama  545:    as the third return value, a list of
                    546:    the Grobner basis and the initial ideal
                    547:    with sums of monomials sorted by the given order.
                    548:    Each polynomial is expressed as a string temporally for now.
1.3       takayama  549:    When the optional variable @var{r} is set to one,
                    550:    the polynomials are dehomogenized (,i.e., h is set to 1).
1.1       takayama  551: @end itemize
                    552: */
                    553: /*&jp-texi
1.8       takayama  554: @c sort-sm1.gb
                    555: @node sm1.gb,,, SM1 Functions
                    556: @node sm1.gb_d,,, SM1 Functions
                    557: @subsection @code{sm1.gb}
                    558: @findex sm1.gb
                    559: @findex sm1.gb_d
1.1       takayama  560: @table @t
1.8       takayama  561: @item sm1.gb([@var{f},@var{v},@var{w}]|proc=@var{p},sorted=@var{q},dehomogenize=@var{r})
1.1       takayama  562: ::  @var{v} $B>e$NHyJ,:nMQAG4D$K$*$$$F(B @var{f} $B$N%0%l%V%J4pDl$r7W;;$9$k(B.
1.8       takayama  563: @item sm1.gb_d([@var{f},@var{v},@var{w}]|proc=@var{p})
1.1       takayama  564: ::  @var{v} $B>e$NHyJ,:nMQAG4D$K$*$$$F(B @var{f} $B$N%0%l%V%J4pDl$r7W;;$9$k(B. $B7k2L$rJ,;6B?9`<0$N%j%9%H$GLa$9(B.
                    565: @end table
                    566:
                    567: @table @var
                    568: @item return
                    569: $B%j%9%H(B
1.3       takayama  570: @item p, q, r
1.1       takayama  571: $B?t(B
                    572: @item f, v, w
                    573: $B%j%9%H(B
                    574: @end table
                    575:
                    576: @itemize @bullet
                    577: @item
                    578:    @var{v} $B>e$NHyJ,:nMQAG4D$K$*$$$F(B @var{f} $B$N%0%l%V%J4pDl$r7W;;$9$k(B.
                    579: @item
                    580:    Weight $B%Y%/%H%k(B @var{w} $B$O>JN,$7$F$h$$(B.
                    581:    $B>JN,$7$?>l9g(B, graded reverse lexicographic order $B$r$D$+$C$F(B
                    582:    $B%V%l%V%J4pDl$r7W;;$9$k(B.
                    583: @item
1.8       takayama  584:    @code{sm1.gb} $B$NLa$jCM$O(B @var{f} $B$N%0%l%V%J4pDl$*$h$S%$%K%7%c%k%b%N%_%"%k(B
1.1       takayama  585:   ( @var{w} $B$,$J$$$H$-(B ) $B$^$?$O(B $B%$%K%7%!%kB?9`<0(B ( @var{w} $B$,M?$($i$?$H$-(B)
                    586:   $B$N%j%9%H$G$"$k(B.
                    587: @item
1.8       takayama  588:    @code{sm1.gb_d} $B$O7k2L$rJ,;6B?9`<0$N%j%9%H$GLa$9(B.
1.1       takayama  589:     $BB?9`<0$NCf$K8=$l$k%b%N%_%"%k$O%0%l%V%J4pDl$r7W;;$9$k$H$-$KM?$($i$?=g=x$G%=!<%H$5$l$F$$$k(B.
                    590:    $BLa$jCM$O(B
                    591:     [$BJQ?tL>$N%j%9%H(B, $B=g=x$r$-$a$k9TNs(B, $B%0%l%V%J4pDl(B, $B%$%K%7%c%k%b%N%_%"%k$^$?$O%$%K%7%!%kB?9`<0(B]
                    592:    $B$G$"$k(B.
                    593: @item
                    594:    Term order $B$G$J$$=g=x$,M?$($i$l$?>l9g$O(B, $BF1<!2=%o%$%kBe?t$G%0%l%V%J4pDl$,7W;;$5$l$k(B (SST $B$NK\$N(B Section 1.2 $B$r8+$h(B).
                    595: $BF1<!2=JQ?t(B @code{h} $B$,7k2L$K2C$o$k(B.
1.2       takayama  596: @item $B%*%W%7%g%J%kJQ?t(B @var{q} $B$,%;%C%H$5$l$F$$$k$H$-$O(B,
                    597:     3 $BHVL\$NLa$jCM$H$7$F(B, $B%0%l%V%J4pDl$*$h$S%$%K%7%!%k$N%j%9%H$,(B
                    598:     $BM?$($i$l$?=g=x$G%=!<%H$5$l$?%b%N%_%"%k$NOB$H$7$FLa$5$l$k(B.
                    599:     $B$$$^$N$H$3$m$3$NB?9`<0$O(B, $BJ8;zNs$GI=8=$5$l$k(B.
1.3       takayama  600:     $B%*%W%7%g%J%kJQ?t(B @var{r} $B$,%;%C%H$5$l$F$$$k$H$-$O(B,
                    601:     $BLa$jB?9`<0$O(B dehomogenize $B$5$l$k(B ($B$9$J$o$A(B h $B$K(B 1 $B$,BeF~$5$l$k(B).
1.1       takayama  602: @end itemize
                    603: */
                    604: /*&C-texi
                    605: @example
1.8       takayama  606: [293] sm1.gb([[x*dx+y*dy-1,x*y*dx*dy-2],[x,y]]);
1.1       takayama  607: [[x*dx+y*dy-1,y^2*dy^2+2],[x*dx,y^2*dy^2]]
                    608: @end example
                    609: */
                    610: /*&eg-texi
                    611: In the example above,
                    612: @tex the set $\{ x \partial_x + y \partial_y -1,
                    613:                  y^2 \partial_y^2+2\}$
                    614: is the Gr\"obner basis of the input with respect to the
                    615: graded reverse lexicographic order such that
                    616: $ 1 \leq \partial_y \leq \partial_x \leq y \leq x \leq \cdots$.
                    617: The set $\{x \partial_x, y^2 \partial_y\}$ is the leading monomials
                    618: (the initial monominals) of the Gr\"obner basis.
                    619: @end tex
                    620: */
                    621: /*&jp-texi
                    622: $B>e$NNc$K$*$$$F(B,
                    623: @tex $B=89g(B $\{ x \partial_x + y \partial_y -1,
                    624:                  y^2 \partial_y^2+2\}$
                    625: $B$O(B
                    626: $ 1 \leq \partial_y \leq \partial_x \leq y \leq x \leq \cdots$
                    627: $B$G$"$k$h$&$J(B
                    628: graded reverse lexicographic order $B$K4X$9$k%0%l%V%J4pDl$G$"$k(B.
                    629: $B=89g(B $\{x \partial_x, y^2 \partial_y\}$ $B$O%0%l%V%J4pDl$N3F85$K(B
                    630: $BBP$9$k(B leading monomial (initial monomial) $B$G$"$k(B.
                    631: @end tex
                    632: */
                    633: /*&C-texi
                    634: @example
1.8       takayama  635: [294] sm1.gb([[dx^2+dy^2-4,dx*dy-1],[x,y],[[dx,50,dy,2,x,1]]]);
1.1       takayama  636: [[dx+dy^3-4*dy,-dy^4+4*dy^2-1],[dx,-dy^4]]
                    637: @end example
                    638: */
                    639: /*&eg-texi
                    640: In the example above, two monomials
                    641: @tex
                    642: $m = x^a y^b \partial_x^c \partial_y^d$ and
                    643: $m' = x^{a'} y^{b'} \partial_x^{c'} \partial_y^{d'}$
                    644: are firstly compared by the weight vector
                    645: {\tt (dx,dy,x,y) = (50,2,1,0)}
                    646: (i.e., $m$ is larger than $m'$ if $50c+2d+a > 50c'+2d'+a'$)
                    647: and when the comparison is tie, then these are
                    648: compared by the reverse lexicographic order
                    649: (i.e., if $50c+2d+a = 50c'+2d'+a'$, then use the reverse lexicogrpahic order).
                    650: @end tex
                    651: */
                    652: /*&jp-texi
                    653: $B>e$NNc$K$*$$$FFs$D$N%b%N%_%"%k(B
                    654: @tex
                    655: $m = x^a y^b \partial_x^c \partial_y^d$ $B$*$h$S(B
                    656: $m' = x^{a'} y^{b'} \partial_x^{c'} \partial_y^{d'}$
                    657: $B$O:G=i$K(B weight vector
                    658: {\tt (dx,dy,x,y) = (50,2,1,0)} $B$rMQ$$$FHf3S$5$l$k(B
                    659: ($B$D$^$j(B $m$ $B$O(B $50c+2d+a > 50c'+2d'+a'$ $B$N$H$-(B
                    660:  $m'$ $B$h$jBg$-$$(B )
                    661: $B<!$K$3$NHf3S$G>!Ii$,$D$+$J$$$H$-$O(B reverse lexicographic order $B$GHf3S$5$l$k(B
                    662: ($B$D$^$j(B $50c+2d+a = 50c'+2d'+a'$ $B$N$H$-(B reverse lexicographic order $B$GHf3S(B
                    663: $B$5$l$k(B).
                    664: @end tex
1.2       takayama  665: */
                    666: /*&C-texi
                    667: @example
1.8       takayama  668: [294] F=sm1.gb([[dx^2+dy^2-4,dx*dy-1],[x,y],[[dx,50,dy,2,x,1]]]|sorted=1);
1.2       takayama  669:       map(print,F[2][0])$
                    670:       map(print,F[2][1])$
                    671: @end example
1.1       takayama  672: */
                    673: /*&C-texi
                    674: @example
                    675: [595]
1.8       takayama  676:    sm1.gb([["dx*(x*dx +y*dy-2)-1","dy*(x*dx + y*dy -2)-1"],
1.1       takayama  677:              [x,y],[[dx,1,x,-1],[dy,1]]]);
                    678:
                    679: [[x*dx^2+(y*dy-h^2)*dx-h^3,x*dy*dx+y*dy^2-h^2*dy-h^3,h^3*dx-h^3*dy],
                    680:  [x*dx^2+(y*dy-h^2)*dx,x*dy*dx+y*dy^2-h^2*dy-h^3,h^3*dx]]
                    681:
                    682: [596]
1.8       takayama  683:    sm1.gb_d([["dx (x dx +y dy-2)-1","dy (x dx + y dy -2)-1"],
1.1       takayama  684:              "x,y",[[dx,1,x,-1],[dy,1]]]);
                    685: [[[e0,x,y,H,E,dx,dy,h],
                    686:  [[0,-1,0,0,0,1,0,0],[0,0,0,0,0,0,1,0],[1,0,0,0,0,0,0,0],
                    687:   [0,1,1,1,1,1,1,0],[0,0,0,0,0,0,-1,0],[0,0,0,0,0,-1,0,0],
                    688:   [0,0,0,0,-1,0,0,0],[0,0,0,-1,0,0,0,0],[0,0,-1,0,0,0,0,0],
                    689:   [0,0,0,0,0,0,0,1]]],
                    690: [[(1)*<<0,0,1,0,0,1,1,0>>+(1)*<<0,1,0,0,0,2,0,0>>+(-1)*<<0,0,0,0,0,1,0,2>>+(-1)*
                    691: <<0,0,0,0,0,0,0,3>>,(1)*<<0,0,1,0,0,0,2,0>>+(1)*<<0,1,0,0,0,1,1,0>>+(-1)*<<0,0,0
                    692: ,0,0,0,1,2>>+(-1)*<<0,0,0,0,0,0,0,3>>,(1)*<<0,0,0,0,0,1,0,3>>+(-1)*<<0,0,0,0,0,0
                    693: ,1,3>>],
                    694:  [(1)*<<0,0,1,0,0,1,1,0>>+(1)*<<0,1,0,0,0,2,0,0>>+(-1)*<<0,0,0,0,0,1,0,2>>,(1)*<
                    695: <0,0,1,0,0,0,2,0>>+(1)*<<0,1,0,0,0,1,1,0>>+(-1)*<<0,0,0,0,0,0,1,2>>+(-1)*<<0,0,0
                    696: ,0,0,0,0,3>>,(1)*<<0,0,0,0,0,1,0,3>>]]]
                    697: @end example
                    698: */
                    699:
                    700: /*&eg-texi
                    701: @table @t
                    702: @item Reference
1.8       takayama  703:     @code{sm1.reduction}, @code{sm1.rat_to_p}
1.1       takayama  704: @end table
                    705: */
                    706: /*&jp-texi
                    707: @table @t
                    708: @item $B;2>H(B
1.8       takayama  709:     @code{sm1.reduction}, @code{sm1.rat_to_p}
1.1       takayama  710: @end table
                    711: */
                    712:
                    713:
                    714:
                    715: /*&eg-texi
1.8       takayama  716: @c sort-sm1.deRham
                    717: @node sm1.deRham,,, SM1 Functions
                    718: @subsection @code{sm1.deRham}
                    719: @findex sm1.deRham
1.1       takayama  720: @table @t
1.8       takayama  721: @item sm1.deRham([@var{f},@var{v}]|proc=@var{p})
1.1       takayama  722: ::  ask the server to evaluate the dimensions of the de Rham cohomology  groups
                    723: of C^n - (the zero set of @var{f}=0).
                    724: @end table
                    725:
                    726: @table @var
                    727: @item return
                    728: List
                    729: @item p
                    730: Number
                    731: @item f
                    732: String or polynomial
                    733: @item v
                    734: List
                    735: @end table
                    736:
                    737: @itemize @bullet
                    738: @item  It returns the dimensions of the de Rham cohomology groups
                    739:     of X = C^n \ V(@var{f}).
                    740:    In other words,  it returns
                    741:       [dim H^0(X,C), dim H^1(X,C), dim H^2(X,C), ..., dim H^n(X,C)].
                    742: @item   @var{v} is a list of variables. n = @code{length(@var{v})}.
                    743: @item
1.8       takayama  744:    @code{sm1.deRham} requires huge computer resources.
                    745:     For example, @code{sm1.deRham(0,[x*y*z*(x+y+z-1)*(x-y),[x,y,z]])}
1.1       takayama  746:     is already very hard.
                    747: @item
                    748:  To efficiently analyze the roots of b-function, @code{ox_asir} should be used
                    749:   from @code{ox_sm1_forAsir}.
                    750:     It is recommended to load the communication module for @code{ox_asir}
                    751:     by the command @*
                    752:    @code{sm1(0,"[(parse) (oxasir.sm1) pushfile] extension");}
                    753:  This command is automatically executed when @code{ox_sm1_forAsir} is started.
1.8       takayama  754: @item If you make an interruption to the function @code{sm1.deRham}
                    755: by @code{ox_reset(sm1.get_Sm1_proc());}, the server might get out of the standard
1.1       takayama  756: mode. So, it is strongly recommended to execute the command
1.8       takayama  757: @code{ox_shutdown(sm1.get_Sm1_proc());} to interrupt and restart the server.
1.1       takayama  758: @end itemize
                    759: */
                    760: /*&jp-texi
1.8       takayama  761: @c sort-sm1.deRham
                    762: @node sm1.deRham,,, SM1 Functions
                    763: @subsection @code{sm1.deRham}
                    764: @findex sm1.deRham
1.1       takayama  765: @table @t
1.8       takayama  766: @item sm1.deRham([@var{f},@var{v}]|proc=@var{p})
1.1       takayama  767: ::  $B6u4V(B C^n - (the zero set of @var{f}=0) $B$N%I%i!<%`%3%[%b%m%872$N<!85$r7W;;$7$F$/$l$k$h$&$K%5!<%P$KMj$`(B.
                    768: @end table
                    769:
                    770: @table @var
                    771: @item return
                    772: $B%j%9%H(B
                    773: @item p
                    774: $B?t(B
                    775: @item f
                    776: $BJ8;zNs(B $B$^$?$O(B $BB?9`<0(B
                    777: @item v
                    778: $B%j%9%H(B
                    779: @end table
                    780:
                    781: @itemize @bullet
                    782: @item $B$3$NH!?t$O6u4V(B X = C^n \ V(@var{f}) $B$N%I%i!<%`%3%[%b%m%872$N<!85$r7W;;$9$k(B.
                    783:    $B$9$J$o$A(B,
                    784:    [dim H^0(X,C), dim H^1(X,C), dim H^2(X,C), ..., dim H^n(X,C)]
                    785:    $B$rLa$9(B.
                    786: @item   @var{v} $B$OJQ?t$N%j%9%H(B. n = @code{length(@var{v})} $B$G$"$k(B.
                    787: @item
1.8       takayama  788:    @code{sm1.deRham} $B$O7W;;5!$N;q8;$rBgNL$K;HMQ$9$k(B.
                    789:     $B$?$H$($P(B @code{sm1.deRham(0,[x*y*z*(x+y+z-1)*(x-y),[x,y,z]])}
1.1       takayama  790:    $B$N7W;;$9$i$9$G$KHs>o$KBgJQ$G$"$k(B.
                    791: @item
                    792:   b-$B4X?t$N:,$r8zN($h$/2r@O$9$k$K$O(B, @code{ox_asir} $B$,(B @code{ox_sm1_forAsir}
                    793:   $B$h$j;HMQ$5$l$k$Y$-$G$"$k(B.  $B%3%^%s%I(B @*
                    794:    @code{sm1(0,"[(parse) (oxasir.sm1) pushfile] extension");}
                    795:    $B$rMQ$$$F(B, @code{ox_asir} $B$H$NDL?.%b%8%e!<%k$r$"$i$+$8$a%m!<%I$7$F$*$/$H$h$$(B.
                    796:    $B$3$N%3%^%s%I$O(B @code{ox_asir_forAsir} $B$N%9%?!<%H;~$K<+F0E*$K<B9T$5$l$F$$$k(B.
                    797: @item
1.8       takayama  798:   @code{sm1.deRham} $B$r(B @code{ox_reset(sm1.get_Sm1_proc());} $B$GCfCG$9$k$H(B,
1.1       takayama  799:   $B0J8e(B sm1 $B%5!<%P$,HsI8=`%b!<%I$KF~$jM=4|$7$J$$F0:n$r$9$k>l9g(B
1.8       takayama  800:   $B$,$"$k$N$G(B, $B%3%^%s%I(B @code{ox_shutdown(sm1.get_Sm1_proc());} $B$G(B, @code{ox_sm1_forAsir}
1.1       takayama  801:   $B$r0l;~(B shutdown $B$7$F%j%9%?!<%H$7$?J}$,0BA4$G$"$k(B.
                    802: @end itemize
                    803: */
                    804: /*&C-texi
                    805: @example
1.8       takayama  806: [332] sm1.deRham([x^3-y^2,[x,y]]);
1.1       takayama  807: [1,1,0]
1.8       takayama  808: [333] sm1.deRham([x*(x-1),[x]]);
1.1       takayama  809: [1,2]
                    810: @end example
                    811: */
                    812: /*&eg-texi
                    813: @table @t
                    814: @item Reference
1.8       takayama  815:     @code{sm1.start}, @code{deRham} (sm1 command)
1.5       takayama  816: @item Algorithm:
1.1       takayama  817:     Oaku, Takayama, An algorithm for de Rham cohomology groups of the
                    818:     complement of an affine variety via D-module computation,
                    819:     Journal of pure and applied algebra 139 (1999), 201--233.
                    820: @end table
                    821: */
                    822: /*&jp-texi
                    823: @table @t
                    824: @item $B;2>H(B
1.8       takayama  825:     @code{sm1.start}, @code{deRham} (sm1 command)
1.5       takayama  826: @item Algorithm:
1.1       takayama  827:     Oaku, Takayama, An algorithm for de Rham cohomology groups of the
                    828:     complement of an affine variety via D-module computation,
                    829:     Journal of pure and applied algebra 139 (1999), 201--233.
                    830: @end table
                    831: */
                    832:
                    833:
                    834:
                    835:
                    836: /*&eg-texi
1.8       takayama  837: @c sort-sm1.hilbert
                    838: @node sm1.hilbert,,, SM1 Functions
                    839: @subsection @code{sm1.hilbert}
                    840: @findex sm1.hilbert
1.1       takayama  841: @findex hilbert_polynomial
                    842: @table @t
1.8       takayama  843: @item sm1.hilbert([@var{f},@var{v}]|proc=@var{p})
1.1       takayama  844: ::  ask the server to compute the Hilbert polynomial for the set of polynomials @var{f}.
                    845: @item hilbert_polynomial(@var{f},@var{v})
                    846: ::  ask the server to compute the Hilbert polynomial for the set of polynomials @var{f}.
                    847: @end table
                    848:
                    849: @table @var
                    850: @item return
                    851: Polynomial
                    852: @item p
                    853: Number
                    854: @item f, v
                    855: List
                    856: @end table
                    857:
                    858: @itemize @bullet
                    859: @item  It returns the Hilbert polynomial h(k) of the set of polynomials
                    860:     @var{f}
                    861:     with respect to the set of variables @var{v}.
                    862: @item
                    863:     h(k) = dim_Q F_k/I \cap F_k  where F_k the set of polynomials of which
                    864:     degree is less than or equal to k and I is the ideal generated by the
                    865:     set of polynomials @var{f}.
                    866: @item
1.8       takayama  867:    Note for sm1.hilbert:
1.1       takayama  868:    For an efficient computation, it is preferable that
                    869:    the set of polynomials @var{f} is a set of monomials.
                    870:    In fact, this function firstly compute a Grobner basis of @var{f}, and then
                    871:    compute the Hilbert polynomial of the initial monomials of the basis.
                    872:    If the input @var{f} is already a Grobner
                    873:    basis, a Grobner basis is recomputed in this function,
                    874:    which is a waste of time and Grobner basis computation in the ring of
                    875:    polynomials in @code{sm1} is  slower than in @code{asir}.
                    876: @end itemize
                    877: */
                    878: /*&jp-texi
1.8       takayama  879: @c sort-sm1.hilbert
                    880: @node sm1.hilbert,,, SM1 Functions
                    881: @subsection @code{sm1.hilbert}
                    882: @findex sm1.hilbert
1.1       takayama  883: @findex hilbert_polynomial
                    884: @table @t
1.8       takayama  885: @item sm1.hilbert([@var{f},@var{v}]|proc=@var{p})
1.1       takayama  886: :: $BB?9`<0$N=89g(B @var{f} $B$N%R%k%Y%k%HB?9`<0$r7W;;$9$k(B.
                    887: @item hilbert_polynomial(@var{f},@var{v})
                    888: :: $BB?9`<0$N=89g(B @var{f} $B$N%R%k%Y%k%HB?9`<0$r7W;;$9$k(B.
                    889: @end table
                    890:
                    891: @table @var
                    892: @item return
                    893: $BB?9`<0(B
                    894: @item p
                    895: $B?t(B
                    896: @item f, v
                    897: $B%j%9%H(B
                    898: @end table
                    899:
                    900: @itemize @bullet
                    901: @item  $BB?9`<0$N=89g(B @var{f} $B$NJQ?t(B @var{v} $B$K$+$s$9$k%R%k%Y%k%HB?9`<0(B h(k)
                    902:    $B$r7W;;$9$k(B.
                    903: @item
                    904:     h(k) = dim_Q F_k/I \cap F_k  $B$3$3$G(B F_k $B$O<!?t$,(B k $B0J2<$G$"$k$h$&$J(B
                    905:     $BB?9`<0$N=89g$G$"$k(B. I $B$OB?9`<0$N=89g(B @var{f} $B$G@8@.$5$l$k%$%G%"%k$G$"$k(B.
                    906: @item
1.8       takayama  907:    sm1.hilbert $B$K$+$s$9$k%N!<%H(B:
1.1       takayama  908:    $B8zN($h$/7W;;$9$k$K$O(B @var{f} $B$O%b%N%_%"%k$N=89g$K$7$?J}$,$$$$(B.
                    909:    $B<B:](B, $B$3$NH!?t$O$^$:(B @var{f} $B$N%0%l%V%J4pDl$r7W;;$7(B, $B$=$l$+$i$=$N(B initial
                    910:    monomial $BC#$N%R%k%Y%k%HB?9`<0$r7W;;$9$k(B.
                    911:   $B$7$?$,$C$F(B, $BF~NO(B @var{f} $B$,$9$G$K%0%l%V%J4pDl$@$H$3$NH!?t$N$J$+$G$b$&0lEY(B
                    912:    $B%0%l%V%J4pDl$N7W;;$,$*$3$J$o$l$k(B. $B$3$l$O;~4V$NL5BL$G$"$k$7(B, @code{sm1} $B$N(B
                    913:   $BB?9`<0%0%l%V%J4pDl7W;;$O(B @code{asir} $B$h$jCY$$(B.
                    914: @end itemize
                    915: */
                    916:
                    917: /*&C-texi
                    918: @example
                    919:
                    920: [346] load("katsura")$
                    921: [351] A=hilbert_polynomial(katsura(5),[u0,u1,u2,u3,u4,u5]);
                    922: 32
                    923:
                    924: @end example
                    925:
                    926: @example
                    927: [279] load("katsura")$
                    928: [280] A=gr(katsura(5),[u0,u1,u2,u3,u4,u5],0)$
                    929: [281] dp_ord();
                    930: 0
                    931: [282] B=map(dp_ht,map(dp_ptod,A,[u0,u1,u2,u3,u4,u5]));
                    932: [(1)*<<1,0,0,0,0,0>>,(1)*<<0,0,0,2,0,0>>,(1)*<<0,0,1,1,0,0>>,(1)*<<0,0,2,0,0,0>>,
                    933:  (1)*<<0,1,1,0,0,0>>,(1)*<<0,2,0,0,0,0>>,(1)*<<0,0,0,1,1,1>>,(1)*<<0,0,0,1,2,0>>,
                    934:  (1)*<<0,0,1,0,2,0>>,(1)*<<0,1,0,0,2,0>>,(1)*<<0,1,0,1,1,0>>,(1)*<<0,0,0,0,2,2>>,
                    935:   (1)*<<0,0,1,0,1,2>>,(1)*<<0,1,0,0,1,2>>,(1)*<<0,1,0,1,0,2>>,(1)*<<0,0,0,0,3,1>>,
                    936:   (1)*<<0,0,0,0,4,0>>,(1)*<<0,0,0,0,1,4>>,(1)*<<0,0,0,1,0,4>>,(1)*<<0,0,1,0,0,4>>,
                    937:  (1)*<<0,1,0,0,0,4>>,(1)*<<0,0,0,0,0,6>>]
                    938: [283] C=map(dp_dtop,B,[u0,u1,u2,u3,u4,u5]);
                    939: [u0,u3^2,u3*u2,u2^2,u2*u1,u1^2,u5*u4*u3,u4^2*u3,u4^2*u2,u4^2*u1,u4*u3*u1,
                    940:  u5^2*u4^2,u5^2*u4*u2,u5^2*u4*u1,u5^2*u3*u1,u5*u4^3,u4^4,u5^4*u4,u5^4*u3,
                    941:  u5^4*u2,u5^4*u1,u5^6]
1.8       takayama  942: [284] sm1.hilbert([C,[u0,u1,u2,u3,u4,u5]]);
1.1       takayama  943: 32
                    944: @end example
                    945: */
                    946:
                    947: /*&eg-texi
                    948: @table @t
                    949: @item Reference
1.8       takayama  950:     @code{sm1.start}, @code{sm1.gb}, @code{longname}
1.1       takayama  951: @end table
                    952: */
                    953: /*&jp-texi
                    954: @table @t
                    955: @item $B;2>H(B
1.8       takayama  956:     @code{sm1.start}, @code{sm1.gb}, @code{longname}
1.1       takayama  957: @end table
                    958: */
                    959:
                    960:
                    961: /*&eg-texi
1.8       takayama  962: @c sort-sm1.genericAnn
                    963: @node sm1.genericAnn,,, SM1 Functions
                    964: @subsection @code{sm1.genericAnn}
                    965: @findex sm1.genericAnn
1.1       takayama  966: @table @t
1.8       takayama  967: @item sm1.genericAnn([@var{f},@var{v}]|proc=@var{p})
1.1       takayama  968: ::  It computes  the annihilating ideal for @var{f}^s.
                    969:     @var{v} is the list of variables.  Here, s is @var{v}[0] and
                    970:     @var{f} is a polynomial in the variables @code{rest}(@var{v}).
                    971: @end table
                    972:
                    973: @table @var
                    974: @item return
                    975: List
                    976: @item p
                    977: Number
                    978: @item f
                    979: Polynomial
                    980: @item v
                    981: List
                    982: @end table
                    983:
                    984: @itemize @bullet
                    985: @item  This function computes  the annihilating ideal for @var{f}^s.
                    986:     @var{v} is the list of variables.  Here, s is @var{v}[0] and
                    987:     @var{f} is a polynomial in the variables @code{rest}(@var{v}).
                    988: @end itemize
                    989: */
                    990: /*&jp-texi
1.8       takayama  991: @c sort-sm1.genericAnn
                    992: @node sm1.genericAnn,,, SM1 Functions
                    993: @subsection @code{sm1.genericAnn}
                    994: @findex sm1.genericAnn
1.1       takayama  995: @table @t
1.8       takayama  996: @item sm1.genericAnn([@var{f},@var{v}]|proc=@var{p})
1.1       takayama  997: ::  @var{f}^s $B$N$_$?$9HyJ,J}Dx<0A4BN$r$b$H$a$k(B.
                    998:     @var{v} $B$OJQ?t$N%j%9%H$G$"$k(B.  $B$3$3$G(B, s $B$O(B @var{v}[0] $B$G$"$j(B,
                    999:     @var{f} $B$OJQ?t(B @code{rest}(@var{v}) $B>e$NB?9`<0$G$"$k(B.
                   1000: @end table
                   1001:
                   1002: @table @var
                   1003: @item return
                   1004: $B%j%9%H(B
                   1005: @item p
                   1006: $B?t(B
                   1007: @item f
                   1008: $BB?9`<0(B
                   1009: @item v
                   1010: $B%j%9%H(B
                   1011: @end table
                   1012:
                   1013: @itemize @bullet
                   1014: @item $B$3$NH!?t$O(B,
                   1015:   @var{f}^s $B$N$_$?$9HyJ,J}Dx<0A4BN$r$b$H$a$k(B.
                   1016:     @var{v} $B$OJQ?t$N%j%9%H$G$"$k(B.  $B$3$3$G(B, s $B$O(B @var{v}[0] $B$G$"$j(B,
                   1017:     @var{f} $B$OJQ?t(B @code{rest}(@var{v}) $B>e$NB?9`<0$G$"$k(B.
                   1018: @end itemize
                   1019: */
                   1020: /*&C-texi
                   1021: @example
1.8       takayama 1022: [595] sm1.genericAnn([x^3+y^3+z^3,[s,x,y,z]]);
1.1       takayama 1023: [-x*dx-y*dy-z*dz+3*s,z^2*dy-y^2*dz,z^2*dx-x^2*dz,y^2*dx-x^2*dy]
                   1024: @end example
                   1025: */
                   1026: /*&eg-texi
                   1027: @table @t
                   1028: @item Reference
1.8       takayama 1029:     @code{sm1.start}
1.1       takayama 1030: @end table
                   1031: */
                   1032: /*&jp-texi
                   1033: @table @t
                   1034: @item $B;2>H(B
1.8       takayama 1035:     @code{sm1.start}
1.1       takayama 1036: @end table
                   1037: */
                   1038:
                   1039:
                   1040:
                   1041: /*&eg-texi
1.8       takayama 1042: @c sort-sm1.wTensor0
                   1043: @node sm1.wTensor0,,, SM1 Functions
                   1044: @subsection @code{sm1.wTensor0}
                   1045: @findex sm1.wTensor0
1.1       takayama 1046: @table @t
1.8       takayama 1047: @item sm1.wTensor0([@var{f},@var{g},@var{v},@var{w}]|proc=@var{p})
1.1       takayama 1048: ::   It computes the D-module theoretic 0-th tensor product
                   1049:     of @var{f} and @var{g}.
                   1050: @end table
                   1051:
                   1052: @table @var
                   1053: @item return
                   1054: List
                   1055: @item p
                   1056: Number
                   1057: @item f, g, v, w
                   1058: List
                   1059: @end table
                   1060:
                   1061: @itemize @bullet
                   1062: @item
                   1063:    It returns the D-module theoretic 0-th tensor product
                   1064:    of @var{f} and @var{g}.
                   1065: @item
                   1066:   @var{v} is a list of variables.
                   1067:   @var{w} is a list of weights.  The integer @var{w}[i] is
                   1068:   the weight of the variable @var{v}[i].
                   1069: @item
1.8       takayama 1070:    @code{sm1.wTensor0} calls @code{wRestriction0} of @code{ox_sm1},
1.1       takayama 1071:    which requires a generic weight
                   1072:     vector @var{w} to compute the restriction.
                   1073:     If @var{w} is not generic, the computation fails.
                   1074: @item Let F and G be solutions of @var{f} and @var{g} respectively.
                   1075: Intuitively speaking, the 0-th tensor product is a system of
                   1076: differential equations which annihilates the function FG.
                   1077: @item The answer is a submodule of a free module D^r in general even if
                   1078: the inputs @var{f} and @var{g} are left ideals of D.
                   1079: @end itemize
                   1080: */
                   1081:
                   1082: /*&jp-texi
1.8       takayama 1083: @c sort-sm1.wTensor0
                   1084: @node sm1.wTensor0,,, SM1 Functions
                   1085: @subsection @code{sm1.wTensor0}
                   1086: @findex sm1.wTensor0
1.1       takayama 1087: @table @t
1.8       takayama 1088: @item sm1.wTensor0([@var{f},@var{g},@var{v},@var{w}]|proc=@var{p})
1.1       takayama 1089: ::   @var{f} $B$H(B @var{g} $B$N(B D-module $B$H$7$F$N(B 0 $B<!%F%s%=%k@Q$r(B
                   1090: $B7W;;$9$k(B.
                   1091: @end table
                   1092:
                   1093: @table @var
                   1094: @item return
                   1095: $B%j%9%H(B
                   1096: @item p
                   1097: $B?t(B
                   1098: @item f, g, v, w
                   1099: $B%j%9%H(B
                   1100: @end table
                   1101:
                   1102: @itemize @bullet
                   1103: @item
                   1104:    @var{f} $B$H(B @var{g} $B$N(B
                   1105:    D-$B2C72$H$7$F$N(B 0 $B<!%F%s%=%k@Q$r7W;;$9$k(B.
                   1106: @item
                   1107:   @var{v} $B$OJQ?t$N%j%9%H$G$"$k(B.
                   1108:   @var{w} $B$O(B weight $B$N%j%9%H$G$"$k(B.
                   1109:   $B@0?t(B @var{w}[i] $B$OJQ?t(B @var{v}[i] $B$N(B weight $B$G$"$k(B.
                   1110: @item
1.8       takayama 1111:    @code{sm1.wTensor0} $B$O(B @code{ox_sm1} $B$N(B @code{wRestriction0}
1.1       takayama 1112:    $B$r$h$s$G$$$k(B.
                   1113:   @code{wRestriction0} $B$O(B, generic $B$J(B weight $B%Y%/%H%k(B @var{w}
                   1114:   $B$r$b$H$K$7$F@)8B$r7W;;$7$F$$$k(B.
                   1115:   Weight $B%Y%/%H%k(B @var{w} $B$,(B generic $B$G$J$$$H7W;;$,%(%i!<$GDd;_$9$k(B.
                   1116: @item F $B$*$h$S(B G $B$r(B @var{f} $B$H(B  @var{g} $B$=$l$>$l$N2r$H$9$k(B.
                   1117: $BD>4QE*$K$$$($P(B, 0 $B<!$N%F%s%=%k@Q$O(B $B4X?t(B FG $B$N$_$?$9HyJ,J}Dx<07O$G$"$k(B.
                   1118: @item $BF~NO(B @var{f}, @var{g} $B$,(B D $B$N:8%$%G%"%k$G$"$C$F$b(B,
                   1119: $B0lHL$K(B, $B=PNO$O<+M32C72(B D^r $B$NItJ,2C72$G$"$k(B.
                   1120: @end itemize
                   1121: */
                   1122: /*&C-texi
                   1123: @example
1.8       takayama 1124: [258]  sm1.wTensor0([[x*dx -1, y*dy -4],[dx+dy,dx-dy^2],[x,y],[1,2]]);
1.1       takayama 1125: [[-y*x*dx-y*x*dy+4*x+y],[5*x*dx^2+5*x*dx+2*y*dy^2+(-2*y-6)*dy+3],
                   1126:  [-25*x*dx+(-5*y*x-2*y^2)*dy^2+((5*y+15)*x+2*y^2+16*y)*dy-20*x-8*y-15],
                   1127:  [y^2*dy^2+(-y^2-8*y)*dy+4*y+20]]
                   1128: @end example
                   1129: */
                   1130:
                   1131:
                   1132:
                   1133: /*&eg-texi
1.8       takayama 1134: @c sort-sm1.reduction
                   1135: @node sm1.reduction,,, SM1 Functions
                   1136: @subsection @code{sm1.reduction}
                   1137: @findex sm1.reduction
1.1       takayama 1138: @table @t
1.8       takayama 1139: @item sm1.reduction([@var{f},@var{g},@var{v},@var{w}]|proc=@var{p})
1.1       takayama 1140: ::
                   1141: @end table
                   1142:
                   1143: @table @var
                   1144: @item return
                   1145: List
                   1146: @item f
                   1147: Polynomial
                   1148: @item g, v, w
                   1149: List
                   1150: @item p
                   1151: Number  (the process number of ox_sm1)
                   1152: @end table
                   1153:
                   1154: @itemize @bullet
                   1155: @item  It reduces @var{f} by the set of polynomial @var{g}
                   1156: in the homogenized Weyl algebra; it applies the
                   1157: division algorithm to @var{f}. The set of variables is @var{v} and
                   1158: @var{w} is weight vectors to determine the order, which can be ommited.
1.8       takayama 1159: @code{sm1.reduction_noH} is for the Weyl algebra.
1.1       takayama 1160: @item The return value is of the form
                   1161: [r,c0,[c1,...,cm],[g1,...gm]] where @var{g}=[g1, ..., gm] and
1.7       takayama 1162: c0 f + c1 g1 + ... + cm gm = r.
1.1       takayama 1163: r/c0 is the normal form.
                   1164: @item The function reduction reduces reducible terms that appear
                   1165: in lower order terms.
                   1166: @item  The functions
1.8       takayama 1167: sm1.reduction_d(P,F,G) and sm1.reduction_noH_d(P,F,G)
1.1       takayama 1168: are for distributed polynomials.
                   1169: @end itemize
                   1170: */
                   1171: /*&jp-texi
1.8       takayama 1172: @node sm1.reduction,,, SM1 Functions
                   1173: @subsection @code{sm1.reduction}
                   1174: @findex sm1.reduction
1.1       takayama 1175: @table @t
1.8       takayama 1176: @item sm1.reduction([@var{f},@var{g},@var{v},@var{w}]|proc=@var{p})
1.1       takayama 1177: ::
                   1178: @end table
                   1179:
                   1180: @table @var
                   1181: @item return
                   1182: $B%j%9%H(B
                   1183: @item f
                   1184: $BB?9`<0(B
                   1185: @item g, v, w
                   1186: $B%j%9%H(B
                   1187: @item p
                   1188: $B?t(B  (ox_sm1 $B$N%W%m%;%9HV9f(B)
                   1189: @end table
                   1190:
                   1191: @itemize @bullet
                   1192: @item  $B$3$NH!?t$O(B @var{f} $B$r(B homogenized $B%o%$%kBe?t$K$*$$$F(B,
                   1193: $BB?9`<0=89g(B @var{g} $B$G4JC12=(B (reduce) $B$9$k(B; $B$D$^$j(B,
                   1194: $B$3$NH!?t$O(B, @var{f} $B$K3d;;%"%k%4%j%:%`$rE,MQ$9$k(B.
                   1195: $BJQ?t=89g$O(B @var{v} $B$G;XDj$9$k(B.
                   1196: @var{w} $B$O=g=x$r;XDj$9$k$?$a$N(B $B%&%(%$%H%Y%/%H%k$G$"$j(B,
                   1197: $B>JN,$7$F$b$h$$(B.
1.8       takayama 1198: @code{sm1.reduction_noH} $B$O(B, Weyl algebra $BMQ(B.
1.1       takayama 1199: @item $BLa$jCM$O<!$N7A$r$7$F$$$k(B:
1.7       takayama 1200: [r,c0,[c1,...,cm],g] $B$3$3$G(B @var{g}=[g1, ..., gm] $B$G$"$j(B,
                   1201: c0 f + c1 g1 + ... + cm gm = r
1.1       takayama 1202: $B$,$J$j$?$D(B.
                   1203: r/c0 $B$,(B normal form $B$G$"$k(B.
                   1204: @item $B$3$NH!?t$O(B, $BDc<!9`$K$"$i$o$l$k(B reducible $B$J9`$b4JC12=$9$k(B.
                   1205: @item  $BH!?t(B
1.8       takayama 1206: sm1.reduction_d(P,F,G) $B$*$h$S(B sm1.reduction_noH_d(P,F,G)
1.1       takayama 1207: $B$O(B, $BJ,;6B?9`<0MQ$G$"$k(B.
                   1208: @end itemize
                   1209: */
                   1210: /*&C-texi
                   1211: @example
1.8       takayama 1212: [259] sm1.reduction([x^2+y^2-4,[y^4-4*y^2+1,x+y^3-4*y],[x,y]]);
1.7       takayama 1213: [x^2+y^2-4,1,[0,0],[y^4-4*y^2+1,x+y^3-4*y]]
1.8       takayama 1214: [260] sm1.reduction([x^2+y^2-4,[y^4-4*y^2+1,x+y^3-4*y],[x,y],[[x,1]]]);
1.7       takayama 1215: [0,1,[-y^2+4,-x+y^3-4*y],[y^4-4*y^2+1,x+y^3-4*y]]
1.1       takayama 1216: @end example
                   1217: */
                   1218: /*&eg-texi
                   1219: @table @t
                   1220: @item Reference
1.10    ! takayama 1221:     @code{sm1.start}, @code{d_true_nf}
1.1       takayama 1222: @end table
                   1223: */
                   1224: /*&jp-texi
                   1225: @table @t
                   1226: @item $B;2>H(B
1.10    ! takayama 1227:     @code{sm1.start}, @code{d_true_nf}
1.1       takayama 1228: @end table
                   1229: */
                   1230:
                   1231:
                   1232: /*&eg-texi
1.8       takayama 1233: @node sm1.xml_tree_to_prefix_string,,, SM1 Functions
                   1234: @subsection @code{sm1.xml_tree_to_prefix_string}
                   1235: @findex sm1.xml_tree_to_prefix_string
1.1       takayama 1236: @table @t
1.8       takayama 1237: @item sm1.xml_tree_to_prefix_string(@var{s}|proc=@var{p})
1.1       takayama 1238: :: Translate OpenMath Tree Expression @var{s} in XML to a prefix notation.
                   1239: @end table
                   1240:
                   1241: @table @var
                   1242: @item return
                   1243: String
                   1244: @item p
                   1245: Number
                   1246: @item s
                   1247: String
                   1248: @end table
                   1249:
                   1250: @itemize @bullet
                   1251: @item  It translate OpenMath Tree Expression @var{s} in XML to a prefix notation.
                   1252: @item This function should be moved to om_* in a future.
                   1253: @item @code{om_xml_to_cmo(OpenMath Tree Expression)} returns CMO_TREE.
                   1254: asir has not yet understood this CMO.
                   1255: @item @code{java} execution environment is required.
                   1256: (For example, @code{/usr/local/jdk1.1.8/bin} should be in the
                   1257: command search path.)
                   1258: @end itemize
                   1259: */
                   1260: /*&jp-texi
1.8       takayama 1261: @node sm1.xml_tree_to_prefix_string,,, SM1 Functions
                   1262: @subsection @code{sm1.xml_tree_to_prefix_string}
                   1263: @findex sm1.xml_tree_to_prefix_string
1.1       takayama 1264: @table @t
1.8       takayama 1265: @item sm1.xml_tree_to_prefix_string(@var{s}|proc=@var{p})
1.1       takayama 1266: :: XML $B$G=q$+$l$?(B OpenMath $B$NLZI=8=(B @var{s} $B$rA0CV5-K!$K$J$*$9(B.
                   1267: @end table
                   1268:
                   1269: @table @var
                   1270: @item return
                   1271: String
                   1272: @item p
                   1273: Number
                   1274: @item s
                   1275: String
                   1276: @end table
                   1277:
                   1278: @itemize @bullet
                   1279: @item XML $B$G=q$+$l$?(B OpenMath $B$NLZI=8=(B @var{s} $B$rA0CV5-K!$K$J$*$9(B.
                   1280: @item $B$3$NH!?t$O(B om_* $B$K>-Mh0\$9$Y$-$G$"$k(B.
                   1281: @item @code{om_xml_to_cmo(OpenMath Tree Expression)} $B$O(B CMO_TREE
                   1282: $B$rLa$9(B. @code{asir} $B$O$3$N(B CMO $B$r$^$@%5%]!<%H$7$F$$$J$$(B.
                   1283: @item @code{java} $B$N<B9T4D6-$,I,MW(B.
                   1284: ($B$?$H$($P(B, /usr/local/jdk1.1.8/bin $B$r%3%^%s%I%5!<%A%Q%9$KF~$l$k$J$I(B.)
                   1285: @end itemize
                   1286: */
                   1287: /*&C-texi
                   1288: @example
                   1289: [263] load("om");
                   1290: 1
                   1291: [270] F=om_xml(x^4-1);
                   1292: control: wait OX
                   1293: Trying to connect to the server... Done.
                   1294: <OMOBJ><OMA><OMS name="plus" cd="basic"/><OMA>
                   1295: <OMS name="times" cd="basic"/><OMA>
                   1296: <OMS name="power" cd="basic"/><OMV name="x"/><OMI>4</OMI></OMA>
                   1297: <OMI>1</OMI></OMA><OMA><OMS name="times" cd="basic"/><OMA>
                   1298: <OMS name="power" cd="basic"/><OMV name="x"/><OMI>0</OMI></OMA>
                   1299: <OMI>-1</OMI></OMA></OMA></OMOBJ>
1.8       takayama 1300: [271] sm1.xml_tree_to_prefix_string(F);
1.1       takayama 1301: basic_plus(basic_times(basic_power(x,4),1),basic_times(basic_power(x,0),-1))
                   1302: @end example
                   1303: */
                   1304: /*&eg-texi
                   1305: @table @t
                   1306: @item Reference
                   1307:     @code{om_*}, @code{OpenXM/src/OpenMath}, @code{eval_str}
                   1308: @end table
                   1309: */
                   1310: /*&jp-texi
                   1311: @table @t
                   1312: @item $B;2>H(B
                   1313:     @code{om_*}, @code{OpenXM/src/OpenMath},  @code{eval_str}
                   1314: @end table
                   1315: */
                   1316:
                   1317:
                   1318:
                   1319:
                   1320: /*&eg-texi
1.8       takayama 1321: @c sort-sm1.syz
                   1322: @node sm1.syz,,, SM1 Functions
                   1323: @node sm1.syz_d,,, SM1 Functions
                   1324: @subsection @code{sm1.syz}
                   1325: @findex sm1.syz
                   1326: @findex sm1.syz_d
1.1       takayama 1327: @table @t
1.8       takayama 1328: @item sm1.syz([@var{f},@var{v},@var{w}]|proc=@var{p})
1.1       takayama 1329: ::  computes the syzygy of @var{f} in the ring of differential
                   1330: operators with the variable @var{v}.
                   1331: @end table
                   1332:
                   1333: @table @var
                   1334: @item return
                   1335: List
                   1336: @item p
                   1337: Number
                   1338: @item f, v, w
                   1339: List
                   1340: @end table
                   1341:
                   1342: @itemize @bullet
                   1343: @item
                   1344: The return values is of the form
                   1345: [@var{s},[@var{g}, @var{m}, @var{t}]].
                   1346: Here @var{s} is the syzygy of @var{f} in the ring of differential
                   1347: operators with the variable @var{v}.
                   1348: @var{g} is a Groebner basis of @var{f} with the weight vector @var{w},
                   1349: and @var{m} is a matrix that translates the input matrix @var{f} to the Gr\"obner
                   1350: basis @var {g}.
                   1351: @var{t} is the syzygy of the Gr\"obner basis @var{g}.
                   1352: In summary, @var{g} = @var{m} @var{f} and
                   1353: @var{s} @var{f} = 0 hold as matrices.
                   1354: @item
                   1355:    The weight vectors are given by @var{w}, which can be omitted.
                   1356:     If @var{w} is not given,
                   1357:     the graded reverse lexicographic order will be used to compute Grobner basis.
                   1358: @item
                   1359:    When a non-term order is given, the Grobner basis is computed in
                   1360:    the homogenized Weyl algebra  (See Section 1.2 of the book of SST).
                   1361:    The homogenization variable h is automatically added.
                   1362: @end itemize
                   1363: */
                   1364: /*&jp-texi
1.8       takayama 1365: @c sort-sm1.syz
                   1366: @node sm1.syz,,, SM1 Functions
                   1367: @node sm1.syz_d,,, SM1 Functions
                   1368: @subsection @code{sm1.syz}
                   1369: @findex sm1.syz
                   1370: @findex sm1.syz_d
1.1       takayama 1371: @table @t
1.8       takayama 1372: @item sm1.syz([@var{f},@var{v},@var{w}]|proc=@var{p})
1.1       takayama 1373: ::  @var{v} $B>e$NHyJ,:nMQAG4D$K$*$$$F(B @var{f} $B$N(B syzygy $B$r7W;;$9$k(B.
                   1374: @end table
                   1375:
                   1376: @table @var
                   1377: @item return
                   1378: $B%j%9%H(B
                   1379: @item p
                   1380: $B?t(B
                   1381: @item f, v, w
                   1382: $B%j%9%H(B
                   1383: @end table
                   1384:
                   1385: @itemize @bullet
                   1386: @item
                   1387: $BLa$jCM$O<!$N7A$r$7$F$$$k(B:
                   1388: [@var{s},[@var{g}, @var{m}, @var{t}]].
                   1389: $B$3$3$G(B @var{s} $B$O(B @var{f} $B$N(B @var{v} $B$rJQ?t$H$9$kHyJ,:nMQAG4D$K$*$1$k(B
                   1390: syzygy $B$G$"$k(B.
                   1391: @var{g} $B$O(B @var{f} $B$N(B weight vector @var{w} $B$K4X$9$k%0%l%V%J4pDl$G$"$k(B.
                   1392: @var{m} $B$OF~NO9TNs(B @var{f} $B$r%0%l%V%J4pDl(B
                   1393: @var{g} $B$XJQ49$9$k9TNs$G$"$k(B.
                   1394: @var{t} $B$O%0%l%V%J4pDl(B @var{g} $B$N(B syzygy $B$G$"$k(B.
                   1395: $B$^$H$a$k$H(B, $B<!$NEy<0$,$J$j$?$D(B:
                   1396: @var{g} = @var{m} @var{f} ,
                   1397: @var{s} @var{f} = 0.
                   1398: @item
                   1399:    Weight $B%Y%/%H%k(B @var{w} $B$O>JN,$7$F$h$$(B.
                   1400:    $B>JN,$7$?>l9g(B, graded reverse lexicographic order $B$r$D$+$C$F(B
                   1401:    $B%V%l%V%J4pDl$r7W;;$9$k(B.
                   1402: @item
                   1403:    Term order $B$G$J$$=g=x$,M?$($i$l$?>l9g$O(B, $BF1<!2=%o%$%kBe?t$G%0%l%V%J4pDl$,7W;;$5$l$k(B (SST $B$NK\$N(B Section 1.2 $B$r8+$h(B).
                   1404: $BF1<!2=JQ?t(B @code{h} $B$,7k2L$K2C$o$k(B.
                   1405: @end itemize
                   1406: */
                   1407: /*&C-texi
                   1408: @example
1.8       takayama 1409: [293] sm1.syz([[x*dx+y*dy-1,x*y*dx*dy-2],[x,y]]);
1.1       takayama 1410: [[[y*x*dy*dx-2,-x*dx-y*dy+1]],    generators of the syzygy
                   1411:  [[[x*dx+y*dy-1],[y^2*dy^2+2]],   grobner basis
                   1412:   [[1,0],[y*dy,-1]],              transformation matrix
                   1413:  [[y*x*dy*dx-2,-x*dx-y*dy+1]]]]
                   1414: @end example
                   1415: */
                   1416: /*&C-texi
                   1417: @example
1.8       takayama 1418: [294]sm1.syz([[x^2*dx^2+x*dx+y^2*dy^2+y*dy-4,x*y*dx*dy-1],[x,y],[[dx,-1,x,1]]]);
1.1       takayama 1419: [[[y*x*dy*dx-1,-x^2*dx^2-x*dx-y^2*dy^2-y*dy+4]], generators of the syzygy
                   1420:  [[[x^2*dx^2+h^2*x*dx+y^2*dy^2+h^2*y*dy-4*h^4],[y*x*dy*dx-h^4], GB
                   1421:   [h^4*x*dx+y^3*dy^3+3*h^2*y^2*dy^2-3*h^4*y*dy]],
                   1422:  [[1,0],[0,1],[y*dy,-x*dx]],     transformation matrix
                   1423:  [[y*x*dy*dx-h^4,-x^2*dx^2-h^2*x*dx-y^2*dy^2-h^2*y*dy+4*h^4]]]]
                   1424: @end example
                   1425: */
                   1426:
                   1427:
                   1428:
                   1429: /*&eg-texi
1.8       takayama 1430: @node sm1.mul,,, SM1 Functions
                   1431: @subsection @code{sm1.mul}
                   1432: @findex sm1.mul
1.1       takayama 1433: @table @t
1.8       takayama 1434: @item sm1.mul(@var{f},@var{g},@var{v}|proc=@var{p})
1.1       takayama 1435: ::  ask the sm1 server to multiply @var{f} and @var{g} in the ring of differential operators over @var{v}.
                   1436: @end table
                   1437:
                   1438: @table @var
                   1439: @item return
                   1440: Polynomial or List
                   1441: @item p
                   1442: Number
                   1443: @item f, g
                   1444: Polynomial or List
                   1445: @item v
                   1446: List
                   1447: @end table
                   1448:
                   1449: @itemize @bullet
                   1450: @item Ask the sm1 server to multiply @var{f} and @var{g} in the ring of differential operators over @var{v}.
1.8       takayama 1451: @item @code{sm1.mul_h} is for homogenized Weyl algebra.
1.1       takayama 1452: @end itemize
                   1453: */
                   1454:
                   1455: /*&jp-texi
1.8       takayama 1456: @node sm1.mul,,, SM1 Functions
                   1457: @subsection @code{sm1.mul}
                   1458: @findex sm1.mul
1.1       takayama 1459: @table @t
1.8       takayama 1460: @item sm1.mul(@var{f},@var{g},@var{v}|proc=@var{p})
1.1       takayama 1461: ::  sm1$B%5!<%P(B $B$K(B @var{f} $B$+$1$k(B @var{g} $B$r(B @var{v}
                   1462: $B>e$NHyJ,:nMQAG4D$G$d$C$F$/$l$k$h$&$KMj$`(B.
                   1463: @end table
                   1464:
                   1465: @table @var
                   1466: @item return
                   1467: $BB?9`<0$^$?$O%j%9%H(B
                   1468: @item p
                   1469: $B?t(B
                   1470: @item f, g
                   1471: $BB?9`<0$^$?$O%j%9%H(B
                   1472: @item v
                   1473: $B%j%9%H(B
                   1474: @end table
                   1475:
                   1476: @itemize @bullet
                   1477: @item   sm1$B%5!<%P(B $B$K(B @var{f} $B$+$1$k(B @var{g} $B$r(B @var{v}
                   1478: $B>e$NHyJ,:nMQAG4D$G$d$C$F$/$l$k$h$&$KMj$`(B.
1.8       takayama 1479: @item @code{sm1.mul_h} $B$O(B homogenized Weyl $BBe?tMQ(B.
1.1       takayama 1480: @end itemize
                   1481: */
                   1482:
                   1483: /*&C-texi
                   1484:
                   1485: @example
1.8       takayama 1486: [277] sm1.mul(dx,x,[x]);
1.1       takayama 1487: x*dx+1
1.8       takayama 1488: [278] sm1.mul([x,y],[1,2],[x,y]);
1.1       takayama 1489: x+2*y
1.8       takayama 1490: [279] sm1.mul([[1,2],[3,4]],[[x,y],[1,2]],[x,y]);
1.1       takayama 1491: [[x+2,y+4],[3*x+4,3*y+8]]
                   1492: @end example
                   1493:
                   1494: */
                   1495:
                   1496:
                   1497:
                   1498:
                   1499: /*&eg-texi
1.8       takayama 1500: @node sm1.distraction,,, SM1 Functions
                   1501: @subsection @code{sm1.distraction}
                   1502: @findex sm1.distraction
1.1       takayama 1503: @table @t
1.8       takayama 1504: @item sm1.distraction([@var{f},@var{v},@var{x},@var{d},@var{s}]|proc=@var{p})
1.1       takayama 1505: ::  ask the @code{sm1} server to compute the distraction of @var{f}.
                   1506: @end table
                   1507:
                   1508: @table @var
                   1509: @item return
                   1510: List
                   1511: @item p
                   1512: Number
                   1513: @item f
                   1514: Polynomial
                   1515: @item v,x,d,s
                   1516: List
                   1517: @end table
                   1518:
                   1519: @itemize @bullet
                   1520: @item  It asks the @code{sm1} server of the descriptor number @var{p}
                   1521: to compute the distraction of  @var{f} in the ring of differential
                   1522: operators with variables @var{v}.
                   1523: @item @var{x} is a list of x-variables and @var{d} is that of d-variables
                   1524: to be distracted. @var{s} is a list of variables to express the distracted @var{f}.
                   1525: @item Distraction is roughly speaking to replace x*dx by a single variable x.
                   1526: See Saito, Sturmfels, Takayama : Grobner Deformations of Hypergeometric Differential Equations at page 68 for details.
                   1527: @end itemize
                   1528: */
                   1529:
                   1530: /*&jp-texi
1.8       takayama 1531: @node sm1.distraction,,, SM1 Functions
1.1       takayama 1532:
1.8       takayama 1533: @subsection @code{sm1.distraction}
                   1534: @findex sm1.distraction
1.1       takayama 1535: @table @t
1.8       takayama 1536: @item sm1.distraction([@var{f},@var{v},@var{x},@var{d},@var{s}]|proc=@var{p})
1.1       takayama 1537: ::  @code{sm1} $B$K(B @var{f} $B$N(B distraction $B$r7W;;$7$F$b$i$&(B.
                   1538: @end table
                   1539:
                   1540: @table @var
                   1541: @item return
                   1542: $B%j%9%H(B
                   1543: @item p
                   1544: $B?t(B
                   1545: @item f
                   1546: $BB?9`<0(B
                   1547: @item v,x,d,s
                   1548: $B%j%9%H(B
                   1549: @end table
                   1550:
                   1551: @itemize @bullet
                   1552: @item  $B<1JL;R(B @var{p}  $B$N(B @code{sm1}  $B%5!<%P$K(B,
                   1553: @var{f} $B$N(B distraction $B$r(B @var{v} $B>e$NHyJ,:nMQAG4D$G7W;;$7$F$b$i$&(B.
                   1554: @item @var{x} , @var{d} $B$O(B, $B$=$l$>$l(B, distract $B$9$Y$-(B x $BJQ?t(B, d $BJQ?t$N(B
                   1555: $B%j%9%H(B.  Distraction $B$7$?$i(B, @var{s} $B$rJQ?t$H$7$F7k2L$rI=$9(B.
                   1556: @item Distraction $B$H$$$&$N$O(B x*dx $B$r(B x $B$GCV$-49$($k$3$H$G$"$k(B.
                   1557: $B>\$7$/$O(B Saito, Sturmfels, Takayama : Grobner Deformations of Hypergeometric Differential Equations $B$N(B page 68 $B$r8+$h(B.
                   1558: @end itemize
                   1559: */
                   1560:
                   1561: /*&C-texi
                   1562:
                   1563: @example
1.8       takayama 1564: [280] sm1.distraction([x*dx,[x],[x],[dx],[x]]);
1.1       takayama 1565: x
1.8       takayama 1566: [281] sm1.distraction([dx^2,[x],[x],[dx],[x]]);
1.1       takayama 1567: x^2-x
1.8       takayama 1568: [282] sm1.distraction([x^2,[x],[x],[dx],[x]]);
1.1       takayama 1569: x^2+3*x+2
                   1570: [283] fctr(@@);
                   1571: [[1,1],[x+1,1],[x+2,1]]
1.8       takayama 1572: [284] sm1.distraction([x*dx*y+x^2*dx^2*dy,[x,y],[x],[dx],[x]]);
1.1       takayama 1573: (x^2-x)*dy+x*y
                   1574: @end example
                   1575: */
                   1576:
                   1577: /*&eg-texi
                   1578: @table @t
                   1579: @item Reference
                   1580:     @code{distraction2(sm1)},
                   1581: @end table
                   1582: */
                   1583:
                   1584: /*&jp-texi
                   1585: @table @t
                   1586: @item $B;2>H(B
                   1587:     @code{distraction2(sm1)},
                   1588: @end table
                   1589: */
                   1590:
                   1591:
                   1592:
                   1593: /*&eg-texi
1.8       takayama 1594: @node sm1.gkz,,, SM1 Functions
                   1595: @subsection @code{sm1.gkz}
                   1596: @findex sm1.gkz
1.1       takayama 1597: @table @t
1.8       takayama 1598: @item sm1.gkz([@var{A},@var{B}]|proc=@var{p})
1.1       takayama 1599: ::  Returns the GKZ system (A-hypergeometric system) associated to the matrix
                   1600: @var{A} with the parameter vector @var{B}.
                   1601: @end table
                   1602:
                   1603: @table @var
                   1604: @item return
                   1605: List
                   1606: @item p
                   1607: Number
                   1608: @item A, B
                   1609: List
                   1610: @end table
                   1611:
                   1612: @itemize @bullet
                   1613: @item Returns the GKZ hypergeometric system
                   1614: (A-hypergeometric system) associated to the matrix
                   1615: @end itemize
                   1616: */
                   1617:
                   1618: /*&jp-texi
1.8       takayama 1619: @node sm1.gkz,,, SM1 Functions
                   1620: @subsection @code{sm1.gkz}
                   1621: @findex sm1.gkz
1.1       takayama 1622: @table @t
1.8       takayama 1623: @item sm1.gkz([@var{A},@var{B}]|proc=@var{p})
1.1       takayama 1624: ::  $B9TNs(B @var{A} $B$H%Q%i%a!<%?(B @var{B} $B$KIU?o$7$?(B GKZ $B7O(B (A-hypergeometric system) $B$r$b$I$9(B.
                   1625: @end table
                   1626:
                   1627: @table @var
                   1628: @item return
                   1629: $B%j%9%H(B
                   1630: @item p
                   1631: $B?t(B
                   1632: @item A, B
                   1633: $B%j%9%H(B
                   1634: @end table
                   1635:
                   1636: @itemize @bullet
                   1637: @item  $B9TNs(B @var{A} $B$H%Q%i%a!<%?(B @var{B} $B$KIU?o$7$?(B GKZ $B7O(B (A-hypergeometric system) $B$r$b$I$9(B.
                   1638: @end itemize
                   1639: */
                   1640:
                   1641: /*&C-texi
                   1642:
                   1643: @example
                   1644:
1.8       takayama 1645: [280] sm1.gkz([  [[1,1,1,1],[0,1,3,4]],  [0,2] ]);
1.1       takayama 1646: [[x4*dx4+x3*dx3+x2*dx2+x1*dx1,4*x4*dx4+3*x3*dx3+x2*dx2-2,
                   1647:  -dx1*dx4+dx2*dx3,-dx2^2*dx4+dx1*dx3^2,dx1^2*dx3-dx2^3,-dx2*dx4^2+dx3^3],
                   1648:  [x1,x2,x3,x4]]
                   1649:
                   1650: @end example
                   1651:
                   1652: */
                   1653:
                   1654:
                   1655:
                   1656:
                   1657: /*&eg-texi
1.8       takayama 1658: @node sm1.appell1,,, SM1 Functions
                   1659: @subsection @code{sm1.appell1}
                   1660: @findex sm1.appell1
1.1       takayama 1661: @table @t
1.8       takayama 1662: @item sm1.appell1(@var{a}|proc=@var{p})
1.1       takayama 1663: ::  Returns the Appell hypergeometric system F_1 or F_D.
                   1664: @end table
                   1665:
                   1666: @table @var
                   1667: @item return
                   1668: List
                   1669: @item p
                   1670: Number
                   1671: @item a
                   1672: List
                   1673: @end table
                   1674:
                   1675: @itemize @bullet
                   1676: @item Returns the hypergeometric system for the Lauricella function
                   1677: F_D(a,b1,b2,...,bn,c;x1,...,xn)
                   1678: where @var{a} =(a,c,b1,...,bn).
                   1679: When n=2, the Lauricella function is called the Appell function F_1.
                   1680: The parameters a, c, b1, ..., bn may be rational numbers.
                   1681: @end itemize
                   1682: */
                   1683:
                   1684: /*&jp-texi
1.8       takayama 1685: @node sm1.appell1,,, SM1 Functions
                   1686: @subsection @code{sm1.appell1}
                   1687: @findex sm1.appell1
1.1       takayama 1688: @table @t
1.8       takayama 1689: @item sm1.appell1(@var{a}|proc=@var{p})
1.1       takayama 1690: :: F_1 $B$^$?$O(B F_D $B$KBP1~$9$kJ}Dx<07O$rLa$9(B.
                   1691: @end table
                   1692:
                   1693: @table @var
                   1694: @item return
                   1695: $B%j%9%H(B
                   1696: @item p
                   1697: $B?t(B
                   1698: @item a
                   1699: $B%j%9%H(B
                   1700: @end table
                   1701:
                   1702: @itemize @bullet
                   1703: @item Appell $B$N4X?t(B F_1 $B$*$h$S(B $B$=$N(B n $BJQ?t2=$G$"$k(B Lauricella $B$N4X?t(B
                   1704: F_D(a,b1,b2,...,bn,c;x1,...,xn)
                   1705: $B$N$_$?$9HyJ,J}Dx<07O$rLa$9(B. $B$3$3$G(B,
                   1706: @var{a} =(a,c,b1,...,bn).
                   1707: $B%Q%i%a!<%?$OM-M}?t$G$b$h$$(B.
                   1708: @end itemize
                   1709: */
                   1710:
                   1711: /*&C-texi
                   1712:
                   1713: @example
                   1714:
1.8       takayama 1715: [281] sm1.appell1([1,2,3,4]);
1.1       takayama 1716: [[((-x1+1)*x2*dx1-3*x2)*dx2+(-x1^2+x1)*dx1^2+(-5*x1+2)*dx1-3,
                   1717:   (-x2^2+x2)*dx2^2+((-x1*x2+x1)*dx1-6*x2+2)*dx2-4*x1*dx1-4,
                   1718:   ((-x2+x1)*dx1+3)*dx2-4*dx1],       equations
                   1719:  [x1,x2]]                            the list of variables
                   1720:
1.8       takayama 1721: [282] sm1.gb(@@);
1.1       takayama 1722: [[((-x2+x1)*dx1+3)*dx2-4*dx1,((-x1+1)*x2*dx1-3*x2)*dx2+(-x1^2+x1)*dx1^2
                   1723:   +(-5*x1+2)*dx1-3,(-x2^2+x2)*dx2^2+((-x2^2+x1)*dx1-3*x2+2)*dx2
                   1724:   +(-4*x2-4*x1)*dx1-4,
                   1725:   (x2^3+(-x1-1)*x2^2+x1*x2)*dx2^2+((-x1*x2+x1^2)*dx1+6*x2^2
                   1726:  +(-3*x1-2)*x2+2*x1)*dx2-4*x1^2*dx1+4*x2-4*x1],
                   1727:  [x1*dx1*dx2,-x1^2*dx1^2,-x2^2*dx1*dx2,-x1*x2^2*dx2^2]]
                   1728:
1.8       takayama 1729: [283] sm1.rank(sm1.appell1([1/2,3,5,-1/3]));
1.1       takayama 1730: 1
                   1731:
                   1732: [285] Mu=2$ Beta = 1/3$
1.8       takayama 1733: [287] sm1.rank(sm1.appell1([Mu+Beta,Mu+1,Beta,Beta,Beta]));
1.1       takayama 1734: 4
                   1735:
                   1736:
                   1737: @end example
                   1738:
                   1739: */
                   1740:
                   1741: /*&eg-texi
1.8       takayama 1742: @node sm1.appell4,,, SM1 Functions
                   1743: @subsection @code{sm1.appell4}
                   1744: @findex sm1.appell4
1.1       takayama 1745: @table @t
1.8       takayama 1746: @item sm1.appell4(@var{a}|proc=@var{p})
1.1       takayama 1747: ::  Returns the Appell hypergeometric system F_4 or F_C.
                   1748: @end table
                   1749:
                   1750: @table @var
                   1751: @item return
                   1752: List
                   1753: @item p
                   1754: Number
                   1755: @item a
                   1756: List
                   1757: @end table
                   1758:
                   1759: @itemize @bullet
                   1760: @item Returns the hypergeometric system for the Lauricella function
                   1761: F_4(a,b,c1,c2,...,cn;x1,...,xn)
                   1762: where @var{a} =(a,b,c1,...,cn).
                   1763: When n=2, the Lauricella function is called the Appell function F_4.
                   1764: The parameters a, b, c1, ..., cn may be rational numbers.
                   1765: @end itemize
                   1766: */
                   1767:
                   1768: /*&jp-texi
1.8       takayama 1769: @node sm1.appell4,,, SM1 Functions
                   1770: @subsection @code{sm1.appell4}
                   1771: @findex sm1.appell4
1.1       takayama 1772: @table @t
1.8       takayama 1773: @item sm1.appell4(@var{a}|proc=@var{p})
1.1       takayama 1774: :: F_4 $B$^$?$O(B F_C $B$KBP1~$9$kJ}Dx<07O$rLa$9(B.
                   1775: @end table
                   1776:
                   1777: @table @var
                   1778: @item return
                   1779: $B%j%9%H(B
                   1780: @item p
                   1781: $B?t(B
                   1782: @item a
                   1783: $B%j%9%H(B
                   1784: @end table
                   1785:
                   1786: @itemize @bullet
                   1787: @item Appell $B$N4X?t(B F_4 $B$*$h$S(B $B$=$N(B n $BJQ?t2=$G$"$k(B Lauricella $B$N4X?t(B
                   1788: F_C(a,b,c1,c2,...,cn;x1,...,xn)
                   1789: $B$N$_$?$9HyJ,J}Dx<07O$rLa$9(B. $B$3$3$G(B,
                   1790: @var{a} =(a,b,c1,...,cn).
                   1791: $B%Q%i%a!<%?$OM-M}?t$G$b$h$$(B.
                   1792: @end itemize
                   1793: */
                   1794:
                   1795: /*&C-texi
                   1796:
                   1797: @example
                   1798:
1.8       takayama 1799: [281] sm1.appell4([1,2,3,4]);
1.1       takayama 1800:   [[-x2^2*dx2^2+(-2*x1*x2*dx1-4*x2)*dx2+(-x1^2+x1)*dx1^2+(-4*x1+3)*dx1-2,
                   1801:   (-x2^2+x2)*dx2^2+(-2*x1*x2*dx1-4*x2+4)*dx2-x1^2*dx1^2-4*x1*dx1-2],
                   1802:                                                               equations
                   1803:     [x1,x2]]                                      the list of variables
                   1804:
1.8       takayama 1805: [282] sm1.rank(@@);
1.1       takayama 1806: 4
                   1807:
                   1808: @end example
                   1809:
                   1810: */
                   1811:
                   1812:
                   1813:
                   1814:
                   1815: /*&eg-texi
1.8       takayama 1816: @node sm1.rank,,, SM1 Functions
                   1817: @subsection @code{sm1.rank}
                   1818: @findex sm1.rank
1.1       takayama 1819: @table @t
1.8       takayama 1820: @item sm1.rank(@var{a}|proc=@var{p})
1.1       takayama 1821: ::  Returns the holonomic rank of the system of differential equations @var{a}.
                   1822: @end table
                   1823:
                   1824: @table @var
                   1825: @item return
                   1826: Number
                   1827: @item p
                   1828: Number
                   1829: @item a
                   1830: List
                   1831: @end table
                   1832:
                   1833: @itemize @bullet
                   1834: @item It evaluates the dimension of the space of holomorphic solutions
                   1835: at a generic point of the system of differential equations @var{a}.
                   1836: The dimension is called the holonomic rank.
                   1837: @item @var{a} is a list consisting of a list of differential equations and
                   1838: a list of variables.
1.8       takayama 1839: @item @code{sm1.rrank} returns the holonomic rank when @var{a} is regular
                   1840: holonomic. It is generally faster than @code{sm1.rank}.
1.1       takayama 1841: @end itemize
                   1842: */
                   1843:
                   1844: /*&jp-texi
1.8       takayama 1845: @node sm1.rank,,, SM1 Functions
                   1846: @subsection @code{sm1.rank}
                   1847: @findex sm1.rank
1.1       takayama 1848: @table @t
1.8       takayama 1849: @item sm1.rank(@var{a}|proc=@var{p})
1.1       takayama 1850: ::  $BHyJ,J}Dx<07O(B @var{a} $B$N(B holonomic rank $B$rLa$9(B.
                   1851: @end table
                   1852:
                   1853: @table @var
                   1854: @item return
                   1855: $B?t(B
                   1856: @item p
                   1857: $B?t(B
                   1858: @item a
                   1859: $B%j%9%H(B
                   1860: @end table
                   1861:
                   1862: @itemize @bullet
                   1863: @item $BHyJ,J}Dx<07O(B @var{a} $B$N(B, generic point $B$G$N@5B'2r$N<!85$r(B
                   1864: $BLa$9(B. $B$3$N<!85$r(B, holonomic rank $B$H8F$V(B.
                   1865: @item @var{a} $B$OHyJ,:nMQAG$N%j%9%H$HJQ?t$N%j%9%H$h$j$J$k(B.
1.8       takayama 1866: @item  @var{a} $B$,(B regular holonomic $B$N$H$-$O(B @code{sm1.rrank}
1.1       takayama 1867: $B$b(B holonomic rank $B$rLa$9(B.
1.8       takayama 1868: $B$$$C$Q$s$K$3$N4X?t$NJ}$,(B @code{sm1.rank} $B$h$jAa$$(B.
1.1       takayama 1869: @end itemize
                   1870: */
                   1871:
                   1872: /*&C-texi
                   1873:
                   1874: @example
                   1875:
1.8       takayama 1876: [284]  sm1.gkz([  [[1,1,1,1],[0,1,3,4]],  [0,2] ]);
1.1       takayama 1877: [[x4*dx4+x3*dx3+x2*dx2+x1*dx1,4*x4*dx4+3*x3*dx3+x2*dx2-2,
                   1878:   -dx1*dx4+dx2*dx3, -dx2^2*dx4+dx1*dx3^2,dx1^2*dx3-dx2^3,-dx2*dx4^2+dx3^3],
                   1879:  [x1,x2,x3,x4]]
1.8       takayama 1880: [285] sm1.rrank(@@);
1.1       takayama 1881: 4
                   1882:
1.8       takayama 1883: [286]  sm1.gkz([  [[1,1,1,1],[0,1,3,4]],  [1,2]]);
1.1       takayama 1884: [[x4*dx4+x3*dx3+x2*dx2+x1*dx1-1,4*x4*dx4+3*x3*dx3+x2*dx2-2,
                   1885:  -dx1*dx4+dx2*dx3,-dx2^2*dx4+dx1*dx3^2,dx1^2*dx3-dx2^3,-dx2*dx4^2+dx3^3],
                   1886:  [x1,x2,x3,x4]]
1.8       takayama 1887: [287] sm1.rrank(@@);
1.1       takayama 1888: 5
                   1889:
                   1890: @end example
                   1891:
                   1892: */
                   1893:
                   1894:
                   1895: /*&eg-texi
1.8       takayama 1896: @node sm1.auto_reduce,,, SM1 Functions
                   1897: @subsection @code{sm1.auto_reduce}
                   1898: @findex sm1.auto_reduce
1.1       takayama 1899: @table @t
1.8       takayama 1900: @item sm1.auto_reduce(@var{s}|proc=@var{p})
1.1       takayama 1901: ::  Set the flag "AutoReduce" to @var{s}.
                   1902: @end table
                   1903:
                   1904: @table @var
                   1905: @item return
                   1906: Number
                   1907: @item p
                   1908: Number
                   1909: @item s
                   1910: Number
                   1911: @end table
                   1912:
                   1913: @itemize @bullet
                   1914: @item  If @var{s} is 1, then all Grobner bases to be computed
                   1915: will be the reduced Grobner bases.
                   1916: @item If @var{s} is 0, then Grobner bases are not necessarily the reduced
                   1917: Grobner bases.  This is the default.
                   1918: @end itemize
                   1919: */
                   1920:
                   1921: /*&jp-texi
1.8       takayama 1922: @node sm1.auto_reduce,,, SM1 Functions
                   1923: @subsection @code{sm1.auto_reduce}
                   1924: @findex sm1.auto_reduce
1.1       takayama 1925: @table @t
1.8       takayama 1926: @item sm1.auto_reduce(@var{s}|proc=@var{p})
1.1       takayama 1927: ::  $B%U%i%0(B "AutoReduce" $B$r(B @var{s} $B$K@_Dj(B.
                   1928: @end table
                   1929:
                   1930: @table @var
                   1931: @item $BLa$jCM(B
                   1932: $B?t(B
                   1933: @item p
                   1934: $B?t(B
                   1935: @item s
                   1936: $B?t(B
                   1937: @end table
                   1938:
                   1939: @itemize @bullet
                   1940: @item  @var{s} $B$,(B 1 $B$N$H$-(B, $B0J8e7W;;$5$l$k%0%l%V%J4pDl$O$9$Y$F(B,
                   1941: reduced $B%0%l%V%J4pDl$H$J$k(B.
                   1942: @item  @var{s} $B$,(B 0 $B$N$H$-(B, $B7W;;$5$l$k%0%l%V%J4pDl$O(B
                   1943: reduced $B%0%l%V%J4pDl$H$O$+$.$i$J$$(B. $B$3$A$i$,%G%U%)!<%k%H(B.
                   1944: @end itemize
                   1945: */
                   1946:
                   1947:
                   1948:
                   1949: /*&eg-texi
1.8       takayama 1950: @node sm1.slope,,, SM1 Functions
                   1951: @subsection @code{sm1.slope}
                   1952: @findex sm1.slope
1.1       takayama 1953: @table @t
1.8       takayama 1954: @item sm1.slope(@var{ii},@var{v},@var{f_filtration},@var{v_filtration}|proc=@var{p})
1.1       takayama 1955: ::  Returns the slopes of differential equations @var{ii}.
                   1956: @end table
                   1957:
                   1958: @table @var
                   1959: @item return
                   1960: List
                   1961: @item p
                   1962: Number
                   1963: @item ii
                   1964: List  (equations)
                   1965: @item v
                   1966: List  (variables)
                   1967: @item f_filtration
                   1968: List  (weight vector)
                   1969: @item v_filtration
                   1970: List (weight vector)
                   1971: @end table
                   1972:
                   1973: @itemize @bullet
1.8       takayama 1974: @item @code{sm1.slope} returns the (geometric) slopes
1.1       takayama 1975: of the system of differential equations @var{ii}
                   1976: along the hyperplane specified by
                   1977: the V filtration @var{v_filtration}.
                   1978: @item @var{v} is a list of variables.
                   1979: @item The return value is a list of lists.
                   1980: The first entry of each list is the slope and the second entry
                   1981: is the weight vector for which the microcharacteristic variety is
                   1982: not bihomogeneous.
                   1983: @end itemize
1.5       takayama 1984:
                   1985: @noindent
                   1986: Algorithm:
                   1987: see "A.Assi, F.J.Castro-Jimenez and J.M.Granger,
                   1988: How to calculate the slopes of a D-module, Compositio Math, 104, 1-17, 1996"
                   1989: Note that the signs of the slopes are negative, but the absolute values
                   1990: of the slopes are returned.
                   1991:
1.1       takayama 1992: */
                   1993:
                   1994: /*&jp-texi
1.8       takayama 1995: @node sm1.slope,,, SM1 Functions
                   1996: @subsection @code{sm1.slope}
                   1997: @findex sm1.slope
1.1       takayama 1998: @table @t
1.8       takayama 1999: @item sm1.slope(@var{ii},@var{v},@var{f_filtration},@var{v_filtration}|proc=@var{p})
1.1       takayama 2000: ::  $BHyJ,J}Dx<07O(B @var{ii} $B$N(B slope $B$rLa$9(B.
                   2001: @end table
                   2002:
                   2003: @table @var
                   2004: @item return
                   2005: $B?t(B
                   2006: @item p
                   2007: $B?t(B
                   2008: @item ii
                   2009: $B%j%9%H(B  ($BJ}Dx<0(B)
                   2010: @item v
                   2011: $B%j%9%H(B ($BJQ?t(B)
                   2012: @item f_filtration
                   2013: $B%j%9%H(B  (weight vector)
                   2014: @item v_filtration
                   2015: $B%j%9%H(B (weight vector)
                   2016: @end table
                   2017:
                   2018: @itemize @bullet
1.8       takayama 2019: @item @code{sm1.slope} $B$O(B
1.1       takayama 2020: $BHyJ,J}Dx<07O(B @var{ii} $B$N(B V filtration  @var{v_filtration}
                   2021: $B$G;XDj$9$kD6J?LL$K1h$C$F$N(B (geomeric) slope $B$r7W;;$9$k(B.
                   2022: @item @var{v} $B$OJQ?t$N%j%9%H(B.
1.5       takayama 2023: @item $BLa$jCM$O(B, $B%j%9%H$r@.J,$H$9$k%j%9%H$G$"$k(B.
                   2024: $B@.J,%j%9%H$NBh(B 1 $BMWAG$,(B slope, $BBh(B 2 $BMWAG$O(B, $B$=$N(B weight vector $B$KBP1~$9$k(B
                   2025: microcharacteristic variety $B$,(B bihomogeneous $B$G$J$$(B.
                   2026: @end itemize
                   2027:
                   2028: @noindent
                   2029: Algorithm:
1.1       takayama 2030: "A.Assi, F.J.Castro-Jimenez and J.M.Granger,
                   2031: How to calculate the slopes of a D-module, Compositio Math, 104, 1-17, 1996"
                   2032: $B$r$_$h(B.
                   2033: Slope $B$NK\Mh$NDj5A$G$O(B, $BId9f$,Ii$H$J$k$,(B, $B$3$N%W%m%0%i%`$O(B,
                   2034: Slope $B$N@dBPCM$rLa$9(B.
                   2035: */
                   2036:
                   2037: /*&C-texi
                   2038:
                   2039: @example
                   2040:
1.8       takayama 2041: [284] A= sm1.gkz([  [[1,2,3]],  [-3] ]);
1.1       takayama 2042:
                   2043:
1.8       takayama 2044: [285] sm1.slope(A[0],A[1],[0,0,0,1,1,1],[0,0,-1,0,0,1]);
1.1       takayama 2045:
1.8       takayama 2046: [286] A2 = sm1.gkz([ [[1,1,1,0],[2,-3,1,-3]], [1,0]]);
1.1       takayama 2047:      (* This is an interesting example given by Laura Matusevich,
                   2048:         June 9, 2001 *)
                   2049:
1.8       takayama 2050: [287] sm1.slope(A2[0],A2[1],[0,0,0,0,1,1,1,1],[0,0,0,-1,0,0,0,1]);
1.1       takayama 2051:
                   2052:
                   2053: @end example
                   2054:
                   2055: */
                   2056: /*&eg-texi
                   2057: @table @t
                   2058: @item Reference
1.10    ! takayama 2059:     @code{sm.gb}
1.1       takayama 2060: @end table
                   2061: */
                   2062: /*&jp-texi
                   2063: @table @t
                   2064: @item $B;2>H(B
1.10    ! takayama 2065:     @code{sm.gb}
1.1       takayama 2066: @end table
1.4       takayama 2067: */
                   2068:
                   2069:
                   2070: /*&eg-texi
                   2071: @include sm1-auto-en.texi
                   2072: */
                   2073:
                   2074: /*&jp-texi
                   2075: @include sm1-auto-ja.texi
1.1       takayama 2076: */
                   2077:
                   2078:
                   2079: end$
                   2080:

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