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

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

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