=================================================================== RCS file: /home/cvs/OpenXM/src/asir-contrib/packages/doc/Attic/sm1.oxweave,v retrieving revision 1.1 retrieving revision 1.15 diff -u -p -r1.1 -r1.15 --- OpenXM/src/asir-contrib/packages/doc/Attic/sm1.oxweave 2001/07/11 01:00:23 1.1 +++ OpenXM/src/asir-contrib/packages/doc/Attic/sm1.oxweave 2004/03/05 15:56:40 1.15 @@ -1,10 +1,13 @@ -/*$OpenXM$ */ +/*$OpenXM: OpenXM/src/asir-contrib/packages/doc/sm1.oxweave,v 1.14 2004/03/05 15:30:50 ohara Exp $ */ -/*&C-texi +/*&C @c DO NOT EDIT THIS FILE oxphc.texi */ -/*&jp-texi -@node SM1 $BH!?t(B,,, Top +/*&C +@node SM1 Functions,,, Top + +*/ +/*&ja @chapter SM1 $BH!?t(B $B$3$N@a$G$O(B sm1 $B$N(B ox $B%5!<%P(B @code{ox_sm1_forAsir} @@ -30,8 +33,7 @@ $X$ $B$OJ?LL$KFs$D$N7j$r$"$1$?6u4V$G$"$k$N$G(B, $BE $BH(B - @code{ox_launch}, @code{sm1_push_int0}, @code{sm1_push_poly0}, + @code{ox_launch}, @code{sm1.push_int0}, @code{sm1.push_poly0}, @code{ord} @end table */ -def sm1_start() { - extern Sm1_lib; - extern Xm_noX; - extern Sm1_proc; - if (Xm_noX) { - P = ox_launch_nox(0,Sm1_lib+"/bin/ox_sm1_forAsir"); - }else{ - P = ox_launch(0,Sm1_lib+"/bin/ox_sm1_forAsir"); - } - if (Xm_noX) { - sm1(P," oxNoX "); - } - ox_check_errors(P); - Sm1_proc = P; - return(P); -} - -/* ox_sm1 */ -/* P is the process number */ -def sm1flush(P) { - ox_execute_string(P,"[(flush)] extension pop"); -} - -def sm1push(P,F) { - G = ox_ptod(F); - ox_push_cmo(P,G); -} - -/*&eg-texi +/*&en @c sort-sm1 -@menu -* sm1:: -@end menu -@node sm1,,, SM1 Functions -@subsection @code{sm1} -@findex sm1 +@node sm1.sm1,,, SM1 Functions +@subsection @code{sm1.sm1} +@findex sm1.sm1 @table @t -@item sm1(@var{p},@var{s}) +@item sm1.sm1(@var{p},@var{s}) :: ask the @code{sm1} server to execute the command string @var{s}. @end table @@ -360,17 +334,15 @@ String @itemize @bullet @item It asks the @code{sm1} server of the descriptor number @var{p} to execute the command string @var{s}. +(In the next example, the descriptor number is 0.) @end itemize */ -/*&jp-texi -@menu -* sm1:: -@end menu -@node sm1,,, SM1 $BH!?t(B -@subsection @code{sm1} -@findex sm1 +/*&ja +@node sm1.sm1,,, SM1 Functions +@subsection @code{sm1.sm1} +@findex sm1.sm1 @table @t -@item sm1(@var{p},@var{s}) +@item sm1.sm1(@var{p},@var{s}) :: $B%5!<%P(B @code{sm1} $B$K%3%^%s%INs(B @var{s} $B$rH(B - @code{sm1_start}, @code{ox_push_int0}, @code{sm1_push_poly0}. + @code{sm1.start}, @code{ox_push_int0}, @code{sm1.push_poly0}, @code{sm1.get_Sm1_proc()}. @end table */ -/*&eg-texi +/*&en @table @t @item Reference - @code{sm1_start}, @code{ox_push_int0}, @code{sm1_push_poly0}. + @code{sm1.start}, @code{ox_push_int0}, @code{sm1.push_poly0}, @code{sm1.get_Sm1_proc()}. @end table */ -def sm1pop(P) { - return(ox_pop_cmo(P)); -} -def sm1_to_asir_form(V) { return(toAsirForm(V)); } -def toAsirForm(V) { - extern ToAsirForm_V; /* for debug */ - if (type(V) == 4) { /* list */ - if((length(V) == 3) && (V[0] == "sm1_dp")) { - /* For debugging. */ - if (ToAsir_Debug != 0) { - ToAsirForm_V = V; - print(map(type,V[1])); - print(V); - } - /* */ - Vlist = map(strtov,V[1]); - return(dp_dtop(V[2],Vlist)); - } else { - return(map(toAsirForm,V)); - } - }else{ - return(V); - } -} - -def sm1_toOrdered(V) { - if (type(V) == 4) { /* list */ - if((length(V) == 3) && (V[0] == "sm1_dp")) { - Vlist = map(strtov,V[1]); - Ans = ""; - F = V[2]; - while (F != 0) { - G = dp_hm(F); - F = dp_rest(F); - if (dp_hc(G)>0) { - Ans += "+"; - } - Ans += rtostr(dp_dtop(G,Vlist)); - } - return Ans; - } else { - return(map(sm1_toOrdered,V)); - } - }else{ - return(V); - } -} - - -def sm1_push_poly0_R(A,P,Vlist) { - return(sm1_push_poly0(P,A,Vlist)); -} -def sm1_push_poly0(P,A,Vlist) { - if (type(Vlist[0]) == 4) { - Vlist = Vlist[2]; - } - /* if Vlist=[[e,x,y,H,E,Dx,Dy,h],[e,x,y,hH,eE,dx,dy,h],[e,x,y,hH,eE,dx,dy,h]] - list of str (sm1) list of str (asir) list of var (asir) - then we execute the code above. - */ - if (type(A) == 2 || type(A) == 1) { /* recursive poly or number*/ - A = dp_ptod(A,Vlist); - ox_push_cmo(P,A); - return; - } - if (type(A) == 0) { /* zero */ - sm1(P," (0). "); - return; - } - if (type(A) == 4) { /* list */ - ox_execute_string(P," [ "); - map(sm1_push_poly0_R,A,P,Vlist); - ox_execute_string(P," ] "); - return; - } - ox_push_cmo(P,A); - ox_check_errors2(P); - return; -} -/* sm1_push_poly0(0,[0,1,x+y,["Hello",y^3]],[x,y]); */ - -def sm1_pop_poly0(P,Vlist) { - if (type(Vlist[0]) == 4) { - Vlist = Vlist[2]; - } - A = ox_pop_cmo(P); - return(sm1_pop_poly0_0(P,A,Vlist)); -} -def sm1_pop_poly0_0_R(A,P,Vlist) { - return(sm1_pop_poly0_0(P,A,Vlist)); -} -def sm1_pop_poly0_0(P,A,Vlist) { - if (type(A) == 4) { - return(map(sm1_pop_poly0_0_R,A,P,Vlist)); - } - if (type(A)== 9) {return(dp_dtop(A,Vlist));} - return(A); -} - -def sm1_push_int0_R(A,P) { - return(sm1_push_int0(P,A)); -} - -/*&eg-texi -@c sort-sm1_push_int0 -@menu -* sm1_push_int0:: -@end menu -@node sm1_push_int0,,, SM1 Functions -@subsection @code{sm1_push_int0} -@findex sm1_push_int0 +/*&en +@c sort-sm1.push_int0 +@node sm1.push_int0,,, SM1 Functions +@subsection @code{sm1.push_int0} +@findex sm1.push_int0 @table @t -@item sm1_push_int0(@var{p},@var{f}) +@item sm1.push_int0(@var{p},@var{f}) :: push the object @var{f} to the server with the descriptor number @var{p}. @end table @@ -562,16 +426,13 @@ Note that @code{ox_push_cmo(@var{p},1234)} send the bi @item In other cases, @code{ox_push_cmo} is called without data conversion. @end itemize */ -/*&jp-texi -@c sort-sm1_push_int0 -@menu -* sm1_push_int0:: -@end menu -@node sm1_push_int0,,, SM1 $BH!?t(B -@subsection @code{sm1_push_int0} -@findex sm1_push_int0 +/*&ja +@c sort-sm1.push_int0 +@node sm1.push_int0,,, SM1 Functions +@subsection @code{sm1.push_int0} +@findex sm1.push_int0 @table @t -@item sm1_push_int0(@var{p},@var{f}) +@item sm1.push_int0(@var{p},@var{f}) :: $B%*%V%8%'%/%H(B @var{f} $B$r<1JL;R(B @var{p} $B$N%5!<%P$XAw$k(B. @end table @@ -602,9 +463,9 @@ Note that @code{ox_push_cmo(@var{p},1234)} send the bi */ /*&C @example -[219] P=sm1_start(); +[219] P=sm1.start(); 0 -[220] sm1_push_int0(P,x*dx+1); +[220] sm1.push_int0(P,x*dx+1); 0 [221] A=ox_pop_cmo(P); x*dx+1 @@ -613,7 +474,7 @@ x*dx+1 @end example @example -[271] sm1_push_int0(0,[x*(x-1),[x]]); +[271] sm1.push_int0(0,[x*(x-1),[x]]); 0 [272] ox_execute_string(0," deRham "); 0 @@ -621,13 +482,13 @@ x*dx+1 [1,2] @end example */ -/*&eg-texi +/*&en @table @t @item Reference @code{ox_push_cmo} @end table */ -/*&jp-texi +/*&ja @table @t @item Reference @code{ox_push_cmo} @@ -635,143 +496,18 @@ x*dx+1 */ -def sm1_push_int0(P,A) { - if (type(A) == 1 || type(A) == 0) { - /* recursive poly or number or 0*/ - A = rtostr(A); - ox_push_cmo(P,A); - sm1(P," . (integer) dc "); - return; - } - if (type(A) == 2) { - A = rtostr(A); ox_push_cmo(P,A); - return; - } - if (type(A) == 4) { /* list */ - ox_execute_string(P," [ "); - map(sm1_push_int0_R,A,P); - ox_execute_string(P," ] "); - return; - } - ox_push_cmo(P,A); - return; -} -def sm1_push_0_R(A,P) { - return(sm1_push_0(P,A)); -} -def sm1_push_0(P,A) { - if (type(A) == 0) { - /* 0 */ - A = rtostr(A); - ox_push_cmo(P,A); - sm1(P," .. "); - return; - } - if (type(A) == 2) { - /* Vlist = vars(A); One should check Vlist is a subset of Vlist3. */ - Vlist2 = sm1_vlist(P); - Vlist3 = map(strtov,Vlist2[1]); - B = dp_ptod(A,Vlist3); - ox_push_cmo(P,B); - return; - } - if (type(A) == 4) { /* list */ - ox_execute_string(P," [ "); - map(sm1_push_0_R,A,P); - ox_execute_string(P," ] "); - return; - } - ox_push_cmo(P,A); - return; -} - -def sm1_push(P,A) { - sm1_push_0(P,A); -} - - -def sm1_pop(P) { - extern V_sm1_pop; - sm1(P," toAsirForm "); - V_sm1_pop = ox_pop_cmo(P); - return(toAsirForm(V_sm1_pop)); -} - -def sm1_pop2(P) { - extern V_sm1_pop; - sm1(P," toAsirForm "); - V_sm1_pop = ox_pop_cmo(P); - return([toAsirForm(V_sm1_pop),V_sm1_pop]); -} - -def sm1_check_arg_gb(A,Fname) { - /* A = [[x^2+y^2-1,x*y],[x,y],[[x,-1,y,-1]]] */ - if (type(A) != 4) { - error(Fname+" : argument should be a list."); - } - if (length(A) < 2) { - error(Fname+" : argument should be a list of 2 or 3 elements."); - } - if (type(A[0]) != 4) { - error(Fname+" : example: [[dx^2+dy^2-4,dx*dy-1]<== it should be a list,[x,y]]"); - } - if (!sm1_isListOfPoly(A[0])) { - error(Fname+" : example: [[dx^2+dy^2-4,dx*dy-1]<== it should be a list of polynomials or strings,[x,y]]"); - } - if (!sm1_isListOfVar(A[1])) { - error(Fname+" : example: [[dx^2+dy^2-4,dx*dy-1],[x,y]<== list of variables or \"x,y\"]"); - } - if (length(A) >= 3) { - if (type(A[2]) != 4) { - error(Fname+" : example:[[dx^2+dy^2-4,dx*dy-1],[x,y],[[x,-1,dx,1]]<== a list of weights]"); - } - if (type(A[2][0]) != 4) { - error(Fname+" : example:[[dx^2+dy^2-4,dx*dy-1],[x,y],[[x,-1,dx,1],[dy,1]]<== a list of lists of weight]"); - } - } - return(1); -} - -def sm1_isListOfPoly(A) { - if (type(A) !=4 ) return(0); - N = length(A); - for (I=0; Ie$NHyJ,:nMQAG4D$K$*$$$F(B @var{f} $B$N%0%l%V%J4pDl$r7W;;$9$k(B. -@item sm1_gb_d([@var{f},@var{v},@var{w}]|proc=@var{p}) +@item sm1.gb_d([@var{f},@var{v},@var{w}]|proc=@var{p}) :: @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. @end table @table @var @item return $B%j%9%H(B -@item p +@item p, q, r $B?t(B @item f, v, w $B%j%9%H(B @@ -844,11 +584,11 @@ List $B>JN,$7$?>l9g(B, graded reverse lexicographic order $B$r$D$+$C$F(B $B%V%l%V%J4pDl$r7W;;$9$k(B. @item - @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 + @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 ( @var{w} $B$,$J$$$H$-(B ) $B$^$?$O(B $B%$%K%7%!%kB?9`<0(B ( @var{w} $B$,M?$($i$?$H$-(B) $B$N%j%9%H$G$"$k(B. @item - @code{sm1_gb_d} $B$O7k2L$rJ,;6B?9`<0$N%j%9%H$GLa$9(B. + @code{sm1.gb_d} $B$O7k2L$rJ,;6B?9`<0$N%j%9%H$GLa$9(B. $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. $BLa$jCM$O(B [$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] @@ -856,15 +596,21 @@ List @item Term order $B$G$J$$=g=x$,M?$($i$l$?>l9g$O(B, $BF1e$NNc$K$*$$$F(B, @tex $B=89g(B $\{ x \partial_x + y \partial_y -1, y^2 \partial_y^2+2\}$ @@ -887,13 +633,13 @@ graded reverse lexicographic order $B$K4X$9$k%0%l%V%J $BBP$9$k(B leading monomial (initial monomial) $B$G$"$k(B. @end tex */ -/*&C-texi +/*&C @example -[294] sm1_gb([[dx^2+dy^2-4,dx*dy-1],[x,y],[[dx,50,dy,2,x,1]]]); +[294] sm1.gb([[dx^2+dy^2-4,dx*dy-1],[x,y],[[dx,50,dy,2,x,1]]]); [[dx+dy^3-4*dy,-dy^4+4*dy^2-1],[dx,-dy^4]] @end example */ -/*&eg-texi +/*&en In the example above, two monomials @tex $m = x^a y^b \partial_x^c \partial_y^d$ and @@ -906,7 +652,7 @@ compared by the reverse lexicographic order (i.e., if $50c+2d+a = 50c'+2d'+a'$, then use the reverse lexicogrpahic order). @end tex */ -/*&jp-texi +/*&ja $B>e$NNc$K$*$$$FFs$D$N%b%N%_%"%k(B @tex $m = x^a y^b \partial_x^c \partial_y^d$ $B$*$h$S(B @@ -920,17 +666,24 @@ $m' = x^{a'} y^{b'} \partial_x^{c'} \partial_y^{d'}$ $B$5$l$k(B). @end tex */ -/*&C-texi +/*&C @example +[294] F=sm1.gb([[dx^2+dy^2-4,dx*dy-1],[x,y],[[dx,50,dy,2,x,1]]]|sorted=1); + map(print,F[2][0])$ + map(print,F[2][1])$ +@end example +*/ +/*&C +@example [595] - sm1_gb([["dx*(x*dx +y*dy-2)-1","dy*(x*dx + y*dy -2)-1"], + sm1.gb([["dx*(x*dx +y*dy-2)-1","dy*(x*dx + y*dy -2)-1"], [x,y],[[dx,1,x,-1],[dy,1]]]); [[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], [x*dx^2+(y*dy-h^2)*dx,x*dy*dx+y*dy^2-h^2*dy-h^3,h^3*dx]] [596] - sm1_gb_d([["dx (x dx +y dy-2)-1","dy (x dx + y dy -2)-1"], + sm1.gb_d([["dx (x dx +y dy-2)-1","dy (x dx + y dy -2)-1"], "x,y",[[dx,1,x,-1],[dy,1]]]); [[[e0,x,y,H,E,dx,dy,h], [[0,-1,0,0,0,1,0,0],[0,0,0,0,0,0,1,0],[1,0,0,0,0,0,0,0], @@ -947,64 +700,28 @@ $m' = x^{a'} y^{b'} \partial_x^{c'} \partial_y^{d'}$ @end example */ -/*&eg-texi +/*&en @table @t @item Reference - @code{sm1_reduction}, @code{sm1_rat_to_p} + @code{sm1.reduction}, @code{sm1.rat_to_p} @end table */ -/*&jp-texi +/*&ja @table @t @item $B;2>H(B - @code{sm1_reduction}, @code{sm1_rat_to_p} + @code{sm1.reduction}, @code{sm1.rat_to_p} @end table */ -def sm1_gb(A) { - SM1_FIND_PROC(P); - P = sm1_check_server(P); - sm1_check_arg_gb(A,"Error in sm1_gb"); - sm1_push_int0(P,A); - sm1(P," gb "); - T = sm1_pop2(P); - return(append(T[0],[sm1_toOrdered(T[1])])); -} -def sm1_gb_d(A) { - SM1_FIND_PROC(P); - P = sm1_check_server(P); - sm1_check_arg_gb(A,"Error in sm1_gb_d"); - sm1_push_int0(P,A); - sm1(P," gb /gb.tmp1 set "); - sm1(P," gb.tmp1 getOrderMatrix {{(universalNumber) dc} map } map /gb.tmp2 set "); - sm1(P," gb.tmp1 0 get 0 get getvNamesCR { [(class) (indeterminate)] dc } map /gb.tmp3 set "); - sm1(P," gb.tmp1 getRing ring_def "); /* Change the current ring! */ - sm1(P,"[[ gb.tmp3 gb.tmp2] gb.tmp1] "); - return(ox_pop_cmo(P)); -} -def sm1_pgb(A) { - SM1_FIND_PROC(P); - P = sm1_check_server(P); - sm1_check_arg_gb(A,"Error in sm1_pgb"); - sm1(P," set_timer "); - sm1_push_int0(P,A); - sm1(P," pgb "); - B = sm1_pop(P); - sm1(P," set_timer "); - return(B); -} - -/*&eg-texi -@c sort-sm1_deRham -@menu -* sm1_deRham:: -@end menu -@node sm1_deRham,,, SM1 Functions -@subsection @code{sm1_deRham} -@findex sm1_deRham +/*&en +@c sort-sm1.deRham +@node sm1.deRham,,, SM1 Functions +@subsection @code{sm1.deRham} +@findex sm1.deRham @table @t -@item sm1_deRham([@var{f},@var{v}]|proc=@var{p}) +@item sm1.deRham([@var{f},@var{v}]|proc=@var{p}) :: ask the server to evaluate the dimensions of the de Rham cohomology groups of C^n - (the zero set of @var{f}=0). @end table @@ -1027,8 +744,8 @@ List [dim H^0(X,C), dim H^1(X,C), dim H^2(X,C), ..., dim H^n(X,C)]. @item @var{v} is a list of variables. n = @code{length(@var{v})}. @item - @code{sm1_deRham} requires huge computer resources. - For example, @code{sm1_deRham(0,[x*y*z*(x+y+z-1)*(x-y),[x,y,z]])} + @code{sm1.deRham} requires huge computer resources. + For example, @code{sm1.deRham(0,[x*y*z*(x+y+z-1)*(x-y),[x,y,z]])} is already very hard. @item To efficiently analyze the roots of b-function, @code{ox_asir} should be used @@ -1037,22 +754,19 @@ List by the command @* @code{sm1(0,"[(parse) (oxasir.sm1) pushfile] extension");} This command is automatically executed when @code{ox_sm1_forAsir} is started. -@item If you make an interruption to the function @code{sm1_deRham} -by @code{ox_reset(Sm1_proc);}, the server might get out of the standard +@item If you make an interruption to the function @code{sm1.deRham} +by @code{ox_reset(sm1.get_Sm1_proc());}, the server might get out of the standard mode. So, it is strongly recommended to execute the command -@code{ox_shutdown(Sm1_proc);} to interrupt and restart the server. +@code{ox_shutdown(sm1.get_Sm1_proc());} to interrupt and restart the server. @end itemize */ -/*&jp-texi -@c sort-sm1_deRham -@menu -* sm1_deRham:: -@end menu -@node sm1_deRham,,, SM1 $BH!?t(B -@subsection @code{sm1_deRham} -@findex sm1_deRham +/*&ja +@c sort-sm1.deRham +@node sm1.deRham,,, SM1 Functions +@subsection @code{sm1.deRham} +@findex sm1.deRham @table @t -@item sm1_deRham([@var{f},@var{v}]|proc=@var{p}) +@item sm1.deRham([@var{f},@var{v}]|proc=@var{p}) :: $B6u4V(B C^n - (the zero set of @var{f}=0) $B$N%I%i!<%`%3%[%b%m%872$No$KBgJQ$G$"$k(B. @item b-$B4X?t$N:,$r8zN($h$/2r@O$9$k$K$O(B, @code{ox_asir} $B$,(B @code{ox_sm1_forAsir} @@ -1084,35 +798,35 @@ mode. So, it is strongly recommended to execute the co $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. $B$3$N%3%^%s%I$O(B @code{ox_asir_forAsir} $B$N%9%?!<%H;~$K<+F0E*$Kl9g(B - $B$,$"$k$N$G(B, $B%3%^%s%I(B @code{ox_shutdown(Sm1_proc);} $B$G(B, @code{ox_sm1_forAsir} + $B$,$"$k$N$G(B, $B%3%^%s%I(B @code{ox_shutdown(sm1.get_Sm1_proc());} $B$G(B, @code{ox_sm1_forAsir} $B$r0l;~(B shutdown $B$7$F%j%9%?!<%H$7$?J}$,0BA4$G$"$k(B. @end itemize */ -/*&C-texi +/*&C @example -[332] sm1_deRham([x^3-y^2,[x,y]]); +[332] sm1.deRham([x^3-y^2,[x,y]]); [1,1,0] -[333] sm1_deRham([x*(x-1),[x]]); +[333] sm1.deRham([x*(x-1),[x]]); [1,2] @end example */ -/*&eg-texi +/*&en @table @t @item Reference - @code{sm1_start}, @code{deRham} (sm1 command) -@item Reference paper + @code{sm1.start}, @code{deRham} (sm1 command) +@item Algorithm: Oaku, Takayama, An algorithm for de Rham cohomology groups of the complement of an affine variety via D-module computation, Journal of pure and applied algebra 139 (1999), 201--233. @end table */ -/*&jp-texi +/*&ja @table @t @item $B;2>H(B - @code{sm1_start}, @code{deRham} (sm1 command) -@item $B;29MO@J8(B + @code{sm1.start}, @code{deRham} (sm1 command) +@item Algorithm: Oaku, Takayama, An algorithm for de Rham cohomology groups of the complement of an affine variety via D-module computation, Journal of pure and applied algebra 139 (1999), 201--233. @@ -1120,118 +834,16 @@ mode. So, it is strongly recommended to execute the co */ -def sm1_deRham(A) { - SM1_FIND_PROC(P); - P = sm1_check_server(P); - sm1(P," set_timer "); - sm1_push_int0(P,A); - sm1(P," deRham "); - B = sm1_pop(P); - sm1(P," set_timer "); - ox_check_errors2(P); - return(B); -} -def sm1_vlist(P) { - sm1(P," getvNamesC "); - B=ox_pop_cmo(P); - sm1(P," getvNamesC toAsirVar "); - C=ox_pop_cmo(P); - return([B,C,map(strtov,C)]); -} -/* [ sm1 names(string), asir names(string), asir names(var)] */ -/* Vlist = sm1_vlist(P); - sm1_push_poly0( x + 20*x, Vlist[2]); - sm1_pop_poly0(Vlist[2]); -*/ -/* ring of Differential operators */ -def sm1_ringD(V,W) { - SM1_FIND_PROC(P); - sm1(P," [ "); - if (type(V) == 7) { /* string */ - ox_push_cmo(P,V); - }else if (type(V) == 4) {/* list */ - V = map(rtostr,V); - ox_push_cmo(P,V); - sm1(P," from_records "); - }else { printf("Error: sm1_ringD"); return(-1); } - sm1(P," ring_of_differential_operators "); - if (type(W) != 0) { - sm1_push_int0(P,W); sm1(P," weight_vector "); - } - sm1(P," pstack "); - sm1(P," 0 ] define_ring getOrderMatrix {{(universalNumber) dc}map}map "); - ox_check_errors2(P); - M = ox_pop_cmo(P); - return([sm1_vlist(P)[2],M]); -} - -def sm1_expand_d(F) { - SM1_FIND_PROC(P); - ox_push_cmo(P,F); - sm1(P, " expand "); - return(ox_pop_cmo(P)); -} - -def sm1_mul_d(A,B) { - SM1_FIND_PROC(P); - ox_push_cmo(P,A); - ox_push_cmo(P,B); - sm1(P," mul "); - return(ox_pop_cmo(P)); -} - -def sm1_dehomogenize_d(A) { - SM1_FIND_PROC(P); - ox_push_cmo(P,A); - sm1(P," dehomogenize "); - return(ox_pop_cmo(P)); -} - -def sm1_homogenize_d(A) { - SM1_FIND_PROC(P); - ox_push_cmo(P,A); - sm1(P," homogenize "); - return(ox_pop_cmo(P)); -} - -def sm1_groebner_d(A) { - SM1_FIND_PROC(P); - ox_push_cmo(P,A); - sm1(P," groebner "); - return(ox_pop_cmo(P)); -} - -def sm1_reduction_d(F,G) { - SM1_FIND_PROC(P); - ox_push_cmo(P,F); - ox_push_cmo(P,G); - sm1(P," reduction "); - return(ox_pop_cmo(P)); -} - -def sm1_reduction_noH_d(F,G) { - SM1_FIND_PROC(P); - ox_push_cmo(P,F); - ox_push_cmo(P,G); - sm1(P," reduction-noH "); - return(ox_pop_cmo(P)); -} - - -/*&eg-texi -@c sort-sm1_hilbert -@menu -* sm1_hilbert:: -* hilbert_polynomial:: -@end menu -@node sm1_hilbert,,, SM1 Functions -@subsection @code{sm1_hilbert} -@findex sm1_hilbert +/*&en +@c sort-sm1.hilbert +@node sm1.hilbert,,, SM1 Functions +@subsection @code{sm1.hilbert} +@findex sm1.hilbert @findex hilbert_polynomial @table @t -@item sm1_hilbert([@var{f},@var{v}]|proc=@var{p}) +@item sm1.hilbert([@var{f},@var{v}]|proc=@var{p}) :: ask the server to compute the Hilbert polynomial for the set of polynomials @var{f}. @item hilbert_polynomial(@var{f},@var{v}) :: ask the server to compute the Hilbert polynomial for the set of polynomials @var{f}. @@ -1255,7 +867,7 @@ List degree is less than or equal to k and I is the ideal generated by the set of polynomials @var{f}. @item - Note for sm1_hilbert: + Note for sm1.hilbert: For an efficient computation, it is preferable that the set of polynomials @var{f} is a set of monomials. In fact, this function firstly compute a Grobner basis of @var{f}, and then @@ -1266,18 +878,14 @@ List polynomials in @code{sm1} is slower than in @code{asir}. @end itemize */ -/*&jp-texi -@c sort-sm1_hilbert -@menu -* sm1_hilbert:: -* hilbert_polynomial:: -@end menu -@node sm1_hilbert,,, SM1 $BH!?t(B -@subsection @code{sm1_hilbert} -@findex sm1_hilbert +/*&ja +@c sort-sm1.hilbert +@node sm1.hilbert,,, SM1 Functions +@subsection @code{sm1.hilbert} +@findex sm1.hilbert @findex hilbert_polynomial @table @t -@item sm1_hilbert([@var{f},@var{v}]|proc=@var{p}) +@item sm1.hilbert([@var{f},@var{v}]|proc=@var{p}) :: $BB?9`<0$N=89g(B @var{f} $B$N%R%k%Y%k%HB?9`<0$r7W;;$9$k(B. @item hilbert_polynomial(@var{f},@var{v}) :: $BB?9`<0$N=89g(B @var{f} $B$N%R%k%Y%k%HB?9`<0$r7W;;$9$k(B. @@ -1299,7 +907,7 @@ List h(k) = dim_Q F_k/I \cap F_k $B$3$3$G(B F_k $B$OH(B - @code{sm1_start}, @code{sm1_gb}, @code{longname} + @code{sm1.start}, @code{sm1.gb}, @code{longname} @end table */ -def sm1_hilbert(A) { - SM1_FIND_PROC(P); - P = sm1_check_server(P); - sm1(P,"[ "); - sm1_push_int0(P,A[0]); - sm1_push_int0(P,A[1]); - sm1(P," ] pgb /sm1_hilbert.gb set "); - sm1(P," sm1_hilbert.gb 0 get { init toString } map "); - sm1_push_int0(P,A[1]); - sm1(P, " hilbert "); - B = sm1_pop(P); - return(B[1]/fac(B[0])); -} -/*&eg-texi -@c sort-sm1_genericAnn -@menu -* sm1_genericAnn:: -@end menu -@node sm1_genericAnn,,, SM1 Functions -@subsection @code{sm1_genericAnn} -@findex sm1_genericAnn +/*&en +@c sort-sm1.genericAnn +@node sm1.genericAnn,,, SM1 Functions +@subsection @code{sm1.genericAnn} +@findex sm1.genericAnn @table @t -@item sm1_genericAnn([@var{f},@var{v}]|proc=@var{p}) +@item sm1.genericAnn([@var{f},@var{v}]|proc=@var{p}) :: It computes the annihilating ideal for @var{f}^s. @var{v} is the list of variables. Here, s is @var{v}[0] and @var{f} is a polynomial in the variables @code{rest}(@var{v}). @@ -1398,16 +990,13 @@ List @var{f} is a polynomial in the variables @code{rest}(@var{v}). @end itemize */ -/*&jp-texi -@c sort-sm1_genericAnn -@menu -* sm1_genericAnn:: -@end menu -@node sm1_genericAnn,,, SM1 $BH!?t(B -@subsection @code{sm1_genericAnn} -@findex sm1_genericAnn +/*&ja +@c sort-sm1.genericAnn +@node sm1.genericAnn,,, SM1 Functions +@subsection @code{sm1.genericAnn} +@findex sm1.genericAnn @table @t -@item sm1_genericAnn([@var{f},@var{v}]|proc=@var{p}) +@item sm1.genericAnn([@var{f},@var{v}]|proc=@var{p}) :: @var{f}^s $B$N$_$?$9HyJ,J}Dx<0A4BN$r$b$H$a$k(B. @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, @var{f} $B$OJQ?t(B @code{rest}(@var{v}) $B>e$NB?9`<0$G$"$k(B. @@ -1431,53 +1020,34 @@ List @var{f} $B$OJQ?t(B @code{rest}(@var{v}) $B>e$NB?9`<0$G$"$k(B. @end itemize */ -/*&C-texi +/*&C @example -[595] sm1_genericAnn([x^3+y^3+z^3,[s,x,y,z]]); +[595] sm1.genericAnn([x^3+y^3+z^3,[s,x,y,z]]); [-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] @end example */ -/*&eg-texi +/*&en @table @t @item Reference - @code{sm1_start} + @code{sm1.start} @end table */ -/*&jp-texi +/*&ja @table @t @item $B;2>H(B - @code{sm1_start} + @code{sm1.start} @end table */ -def sm1_genericAnn(F) { - SM1_FIND_PROC(P); - sm1_push_int0(P,F[0]); - sm1_push_int0(P,F[1]); - sm1(P, " genericAnn "); - B = sm1_pop(P); - return(B); -} -def sm1_tensor0(F) { - SM1_FIND_PROC(P); - sm1_push_int0(P,F); - sm1(P, " tensor0 "); - B = sm1_pop(P); - return(B); -} - -/*&eg-texi -@c sort-sm1_wTensor0 -@menu -* sm1_wTensor0:: -@end menu -@node sm1_wTensor0,,, SM1 Functions -@subsection @code{sm1_wTensor0} -@findex sm1_wTensor0 +/*&en +@c sort-sm1.wTensor0 +@node sm1.wTensor0,,, SM1 Functions +@subsection @code{sm1.wTensor0} +@findex sm1.wTensor0 @table @t -@item sm1_wTensor0([@var{f},@var{g},@var{v},@var{w}]|proc=@var{p}) +@item sm1.wTensor0([@var{f},@var{g},@var{v},@var{w}]|proc=@var{p}) :: It computes the D-module theoretic 0-th tensor product of @var{f} and @var{g}. @end table @@ -1500,7 +1070,7 @@ List @var{w} is a list of weights. The integer @var{w}[i] is the weight of the variable @var{v}[i]. @item - @code{sm1_wTensor0} calls @code{wRestriction0} of @code{ox_sm1}, + @code{sm1.wTensor0} calls @code{wRestriction0} of @code{ox_sm1}, which requires a generic weight vector @var{w} to compute the restriction. If @var{w} is not generic, the computation fails. @@ -1512,16 +1082,13 @@ the inputs @var{f} and @var{g} are left ideals of D. @end itemize */ -/*&jp-texi -@c sort-sm1_wTensor0 -@menu -* sm1_wTensor0:: -@end menu -@node sm1_wTensor0,,, SM1 $BH!?t(B -@subsection @code{sm1_wTensor0} -@findex sm1_wTensor0 +/*&ja +@c sort-sm1.wTensor0 +@node sm1.wTensor0,,, SM1 Functions +@subsection @code{sm1.wTensor0} +@findex sm1.wTensor0 @table @t -@item sm1_wTensor0([@var{f},@var{g},@var{v},@var{w}]|proc=@var{p}) +@item sm1.wTensor0([@var{f},@var{g},@var{v},@var{w}]|proc=@var{p}) :: @var{f} $B$H(B @var{g} $B$N(B D-module $B$H$7$F$N(B 0 $BJN,$7$F$b$h$$(B. -@code{sm1_reduction_noH} $B$O(B, Weyl algebra $BMQ(B. +@code{sm1.reduction_noH} $B$O(B, Weyl algebra $BMQ(B. @item $BLa$jCM$OH(B - @code{sm1_start}, @code{sm1_find_proc}, @code{d_true_nf} + @code{sm1.start}, @code{d_true_nf} @end table */ -def sm1_reduction(A) { - /* Example: sm1_reduction(A|proc=10) */ - SM1_FIND_PROC(P); - /* check the arguments */ - if (type(A) != 4) { - error("sm1_reduction(A|proc=p): A must be a list."); - } - AA = [rtostr(A[0])]; - AA = append(AA,[ map(rtostr,A[1]) ]); - AA = append(AA, cdr(cdr(A))); - sm1(P," /reduction*.noH 0 def "); - sm1_push_int0(P,AA); - sm1(P," reduction* "); - ox_check_errors2(P); - return(sm1_pop(P)); -} -def sm1_reduction_noH(A) { - /* Example: sm1_reduction(A|proc=10) */ - SM1_FIND_PROC(P); - /* check the arguments */ - if (type(A) != 4) { - error("sm1_reduction_noH(A|proc=p): A must be a list."); - } - AA = [rtostr(A[0])]; - AA = append(AA,[ map(rtostr,A[1]) ]); - AA = append(AA, cdr(cdr(A))); - sm1(P," /reduction*.noH 1 def "); - sm1_push_int0(P,AA); - sm1(P," reduction* "); - ox_check_errors2(P); - return(sm1_pop(P)); -} - -/*&eg-texi -@menu -* sm1_xml_tree_to_prefix_string:: -@end menu -@node sm1_xml_tree_to_prefix_string,,, SM1 Functions -@subsection @code{sm1_xml_tree_to_prefix_string} -@findex sm1_xml_tree_to_prefix_string +/*&en +@node sm1.xml_tree_to_prefix_string,,, SM1 Functions +@subsection @code{sm1.xml_tree_to_prefix_string} +@findex sm1.xml_tree_to_prefix_string @table @t -@item sm1_xml_tree_to_prefix_string(@var{s}|proc=@var{p}) +@item sm1.xml_tree_to_prefix_string(@var{s}|proc=@var{p}) :: Translate OpenMath Tree Expression @var{s} in XML to a prefix notation. @end table @@ -1743,15 +1260,12 @@ asir has not yet understood this CMO. command search path.) @end itemize */ -/*&jp-texi -@menu -* sm1_xml_tree_to_prefix_string:: -@end menu -@node sm1_xml_tree_to_prefix_string,,, SM1 $BH!?t(B -@subsection @code{sm1_xml_tree_to_prefix_string} -@findex sm1_xml_tree_to_prefix_string +/*&ja +@node sm1.xml_tree_to_prefix_string,,, SM1 Functions +@subsection @code{sm1.xml_tree_to_prefix_string} +@findex sm1.xml_tree_to_prefix_string @table @t -@item sm1_xml_tree_to_prefix_string(@var{s}|proc=@var{p}) +@item sm1.xml_tree_to_prefix_string(@var{s}|proc=@var{p}) :: XML $B$G=q$+$l$?(B OpenMath $B$NLZI=8=(B @var{s} $B$rA0CV5-K!$K$J$*$9(B. @end table @@ -1773,7 +1287,7 @@ String ($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.) @end itemize */ -/*&C-texi +/*&C @example [263] load("om"); 1 @@ -1786,17 +1300,17 @@ Trying to connect to the server... Done. 1 0 -1 -[271] sm1_xml_tree_to_prefix_string(F); +[271] sm1.xml_tree_to_prefix_string(F); basic_plus(basic_times(basic_power(x,4),1),basic_times(basic_power(x,0),-1)) @end example */ -/*&eg-texi +/*&en @table @t @item Reference @code{om_*}, @code{OpenXM/src/OpenMath}, @code{eval_str} @end table */ -/*&jp-texi +/*&ja @table @t @item $B;2>H(B @code{om_*}, @code{OpenXM/src/OpenMath}, @code{eval_str} @@ -1804,82 +1318,16 @@ basic_plus(basic_times(basic_power(x,4),1),basic_times */ -def sm1_xml_tree_to_prefix_string(A) { - SM1_FIND_PROC(P); - /* check the arguments */ - if (type(A) != 7) { - error("sm1_xml_tree_to_prefix_string(A|proc=p): A must be a string."); - } - ox_push_cmo(P,A); - sm1(P," xml_tree_to_prefix_string "); - ox_check_errors2(P); - return(ox_pop_cmo(P)); -} -def sm1_wbf(A) { - SM1_FIND_PROC(P); - /* check the arguments */ - if (type(A) != 4) { - error("sm1_wbf(A): A must be a list."); - } - if (length(A) != 3) { - error("sm1_wbf(A): A must be a list of the length 3."); - } - if (type(A[0]) != 4 || type(A[1]) != 4 || type(A[2]) != 4) { - error("sm1_wbf([A,B,C]): A, B, C must be a list."); - } - if (! (type(A[2][0]) == 7 || type(A[2][0]) == 2)) { - error("sm1_wbf([A,B,C]): C must be of a form [v-name, v-weight, ...]"); - } - sm1_push_int0(P,A); - sm1(P," wbf "); - ox_check_errors2(P); - return(sm1_pop(P)); -} -def sm1_wbfRoots(A) { - SM1_FIND_PROC(P); - /* check the arguments */ - if (type(A) != 4) { - error("sm1_wbfRoots(A): A must be a list."); - } - if (length(A) != 3) { - error("sm1_wbfRoots(A): A must be a list of the length 3."); - } - if (type(A[0]) != 4 || type(A[1]) != 4 || type(A[2]) != 4) { - error("sm1_wbfRoots([A,B,C]): A, B, C must be a list."); - } - if (! (type(A[2][0]) == 7 || type(A[2][0]) == 2)) { - error("sm1_wbfRoots([A,B,C]): C must be of a form [v-name, v-weight, ...]"); - } - sm1_push_int0(P,A); - sm1(P," wbfRoots "); - ox_check_errors2(P); - return(sm1_pop(P)); -} - - -def sm1_res_div(A) { - SM1_FIND_PROC(P); - sm1_push_int0(P,[[A[0],A[1]],A[2]]); - sm1(P," res*div "); - ox_check_errors2(P); - return(sm1_pop(P)); -} - - -/*&eg-texi -@c sort-sm1_syz -@menu -* sm1_syz:: -@end menu -@node sm1_syz,,, SM1 Functions -@node sm1_syz_d,,, SM1 Functions -@subsection @code{sm1_syz} -@findex sm1_syz -@findex sm1_syz_d +/*&en +@c sort-sm1.syz +@node sm1.syz,,, SM1 Functions +@subsection @code{sm1.syz} +@findex sm1.syz +@findex sm1.syz_d @table @t -@item sm1_syz([@var{f},@var{v},@var{w}]|proc=@var{p}) +@item sm1.syz([@var{f},@var{v},@var{w}]|proc=@var{p}) :: computes the syzygy of @var{f} in the ring of differential operators with the variable @var{v}. @end table @@ -1901,7 +1349,7 @@ Here @var{s} is the syzygy of @var{f} in the ring of d operators with the variable @var{v}. @var{g} is a Groebner basis of @var{f} with the weight vector @var{w}, and @var{m} is a matrix that translates the input matrix @var{f} to the Gr\"obner -basis @var {g}. +basis @var{g}. @var{t} is the syzygy of the Gr\"obner basis @var{g}. In summary, @var{g} = @var{m} @var{f} and @var{s} @var{f} = 0 hold as matrices. @@ -1915,18 +1363,14 @@ In summary, @var{g} = @var{m} @var{f} and The homogenization variable h is automatically added. @end itemize */ -/*&jp-texi -@c sort-sm1_syz -@menu -* sm1_syz:: -@end menu -@node sm1_syz,,, SM1 $BH!?t(B -@node sm1_syz_d,,, SM1 $BH!?t(B -@subsection @code{sm1_syz} -@findex sm1_syz -@findex sm1_syz_d +/*&ja +@c sort-sm1.syz +@node sm1.syz,,, SM1 Functions +@subsection @code{sm1.syz} +@findex sm1.syz +@findex sm1.syz_d @table @t -@item sm1_syz([@var{f},@var{v},@var{w}]|proc=@var{p}) +@item sm1.syz([@var{f},@var{v},@var{w}]|proc=@var{p}) :: @var{v} $B>e$NHyJ,:nMQAG4D$K$*$$$F(B @var{f} $B$N(B syzygy $B$r7W;;$9$k(B. @end table @@ -1961,18 +1405,18 @@ syzygy $B$G$"$k(B. $BF1e$NHyJ,:nMQAG4D$G$d$C$F$/$l$k$h$&$KMj$`(B. @end table @@ -2071,18 +1477,18 @@ List @itemize @bullet @item sm1$B%5!<%P(B $B$K(B @var{f} $B$+$1$k(B @var{g} $B$r(B @var{v} $B>e$NHyJ,:nMQAG4D$G$d$C$F$/$l$k$h$&$KMj$`(B. -@item @code{sm1_mul_h} $B$O(B homogenized Weyl $BBe?tMQ(B. +@item @code{sm1.mul_h} $B$O(B homogenized Weyl $BBe?tMQ(B. @end itemize */ -/*&C-texi +/*&C @example -[277] sm1_mul(dx,x,[x]); +[277] sm1.mul(dx,x,[x]); x*dx+1 -[278] sm1_mul([x,y],[1,2],[x,y]); +[278] sm1.mul([x,y],[1,2],[x,y]); x+2*y -[279] sm1_mul([[1,2],[3,4]],[[x,y],[1,2]],[x,y]); +[279] sm1.mul([[1,2],[3,4]],[[x,y],[1,2]],[x,y]); [[x+2,y+4],[3*x+4,3*y+8]] @end example @@ -2090,136 +1496,13 @@ x+2*y -def sm1_mul_h(A,B,V) { - SM1_FIND_PROC(P); - sm1_push_int0(P,[[A,B],V]); - sm1(P," res*mul*h "); - ox_check_errors2(P); - return(sm1_pop(P)); -} -def sm1_adjoint(A,V) { - SM1_FIND_PROC(P); - sm1_push_int0(P,[A,V]); - sm1(P," res*adjoint "); - ox_check_errors2(P); - return(sm1_pop(P)); -} - -def transpose(A) { - if (type(A) == 4) { - N = length(A); M = length(A[0]); - B = newmat(N,M,A); - C = newmat(M,N); - for (I=0; IH(B @code{distraction2(sm1)}, @end table */ -/* Temporary functions */ -/* Use this function for a while to wait a fix of asir. */ -def sm1_ntoint32(I) { /* Fixed */ - SM1_FIND_PROC(P); - if (I >= 0) return(ntoint32(I)); - sm1(P," "+rtostr(I)+" "); - return(ox_pop_cmo(P)); -} -def sm1_to_ascii_array(S) { /* Use strtoascii */ - SM1_FIND_PROC(P); - ox_push_cmo(P,S); - sm1(P," (array) dc { (universalNumber) dc } map "); - return(ox_pop_cmo(P)); -} -def sm1_from_ascii_array(S) { /* Use asciitostr */ - SM1_FIND_PROC(P); - ox_push_cmo(P,S); - sm1(P," { (integer) dc (string) dc } map cat "); - return(ox_pop_cmo(P)); -} -/* -[288] sm1_to_ascii_array("Hello"); -[72,101,108,108,111] -[289] sm1_from_ascii_array(@@); -Hello -*/ -/* end of temporary functions */ - -def sm1_gkz(S) { - SM1_FIND_PROC(P); - A = S[0]; - B = S[1]; - AA = [ ]; - BB = [ ]; - for (I=0; IH(B - @code{sm_gb} + @code{sm.gb} @end table +*/ + + +/*&en +@include sm1-auto-en.texi +*/ + +/*&ja +@include sm1-auto-ja.texi */