\documentclass{jarticle}
%\usepackage[FVerb,theorem]{rims02}
\topmargin -0.5in
\oddsidemargin -0in
\evensidemargin -0in
\textheight 9.5in
\textwidth 6in
\IfFileExists{my.sty}{\usepackage{my}}{}
\IfFileExists{graphicx.sty}{\usepackage{graphicx}}{}
\IfFileExists{epsfig.sty}{\usepackage{epsfig}}{}
\newtheorem{definition}{$BDj5A(B}
\newtheorem{example}{$BNc(B}
\newtheorem{proposition}{$BL?Bj(B}
\newtheorem{remark}{$BCm0U(B}
\title{Risa/Asir $B$K$*$1$k?7$7$$7A<0$N?t<0$N<h$j07$$$K$D$$$F(B}
\author{$BLnO$(B $B@59T(B, $B9b;3?.5#(B \\ ($B?@8MBgM}(B)}
\date{}
\begin{document}
\maketitle
\def\gr{Gr\"obner $B4pDl(B}
\def\st{\, s.t. \,}
\def\noi{\noindent} 
\def\Q{{\bf Q}}
\def\Z{{\bf Z}}
\def\NF{{\rm NF}}
\def\ini{{\rm in}}
\def\FN{{\tt FNODE}}
\def\QT{{\tt QUOTE}}
\def\ve{\vfill\eject} 
\newcommand{\tmred}[1]{\smash{\mathop{\hbox{\rightarrowfill}}\limits_{\scriptstyle #1}\limits^{\scriptstyle *}}}

\begin{abstract}
Risa/Asir $B$K$*$1$k=@Fp$J?t<0$N<h$j07$$$r<B8=$9$k$?$a(B,
$BLZ9=B$$GI=8=$5$l$??t<0$G$"$k(B \FN $B9=B$BN$rJ];}$9$k(B \QT $B7?$r07$($k$h$&(B
$B$K$7$?(B. $BI8=`2=$r$O$8$a$H$9$k(B \QT $B$KBP$9$k<o!9$NA`:n(B, $B$*$h$S(B
$B%Q%?!<%s%^%C%A%s%0$K$h$k=q$-49$($r<BAu$7$?(B. $B$3$l$i$rMQ$$$?(B
$B$$$/$D$+$NNc$r<($9(B. $B$^$?(B, weight $B$rMQ$$$?(B
$BHs2D49Be?t$K$*$1$k=q$-49$($N2DG=@-$K$D$$$F=R$Y$k(B.
\end{abstract}

\section{Risa/Asir $B$K$*$1$k?t<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$\partial/\partial x$ $B$N0UL#$K;H$*$&$H;W$C$F$b(B
\begin{verbatim}
[0] x*dx;
dx*x;
[1] dx*x;
dx*x;
\end{verbatim}
$B$N$h$&$K(B, $B>!<j$K=g=x$,JQ$($i$l$F$7$^$&(B.
\end{example}
$B$^$?(B, $B0JA0$+$i;XE&$5$l$F$$$k(B, Risa/Asir $B$K<0$N4JC12=5!G=$,7gG!$7$F$$$kE@(B
$B$K$D$$$F$b(B, $B$"$i$f$k$b$N$rB?9`<0$KJQ49$7$F$+$i4JC12=$9$k$N$OIT<+A3$G$"$k(B.

$B$3$N$h$&$J(B, $B?t<0$N=@Fp$J<h$j07$$$O(B, Maxima, Maple, Mathematica $B$J$I(B
$B$NF@0U$H$9$k$H$3$m$G$"$j(B, $B$3$l$^$G$O(B, Risa/Asir $B$NL\;X$9$H$3$m$O(B, $BB?9`<0(B
$B1i;;$N9bB.=hM}$G$"$k$H$7$F(B, $BFC$K$3$N$h$&$JJ}8~$N3+H/$O?J$a$F$3$J$+$C$?(B.
$B$7$+$7(B, $B;H$o$lJ}$,B?MM2=$7$?7k2L(B, $B$h$jB?MM$J?t<0$N<h$j07$$$,I,MW$H$J$k(B
$B>lLL$,B?$/$J$C$F$-$?$?$a(B, $B$h$j0lHL$N?t<0$N1i;;$*$h$S4JC12=(B, $B=q$-49$(5,B'$K$h$k(B
$B=q$-49$($N<BAu$KCe<j$7$?(B.

\section{\QT $B7?(B}

$BA0@a$G=R$Y$?$h$&$K(B, Risa/Asir $B$K$*$$$F$O(B, $BF~NO$5$l$??t<0$O(B, 
Risa $B%*%V%8%'%/%H$KJQ49$5$l$kA0$K(B, \FN $B$H8F$P$l$kLZ9=B$$GJ];}$5$l$F$$$k(B.
$B$3$N(B \FN $B$r%\%G%#It$K;}$D(B Risa $B%*%V%8%'%/%H$G$"$k(B \QT $B7?$r(B
$BDj5A$7$?(B. $B$3$l$K$h$j(B, $BI>2AA0$NLZ9=B$$rJ];}$G$-$k(B. 

\subsection{\QT $B$NF~NO(B, $B4pK\A`:n(B}

\QT $B7?$KBP$9$k;MB'1i;;$J$I$N4pK\1i;;$O(B, $BLZ$KBP$9$kA`:n$H$7$FDj5A$9$k(B. $B$5$i$K(B,
$BLZ$KBP$9$k0lHLE*$JA`:n(B ($BB0@-(B, $B;R$N<h$j=P$7(B, $BLZ$N:F9=@.$J$I(B) $B$r(B Asir
$B$N4X?t$H$7$FM?$($k$3$H$G(B, $B%f!<%6$K$h$k?t<0$NA`:n$,2DG=$H$J$k(B.
\QT $B7?$KBP$9$kA`:n$O(B, $B<B:]$K$O(B \FN $B$KBP$9$kA`:n$G$"$k(B.
\FN $B$O(B
\begin{center}
($id$ $arg_0$ $arg_1$ $\ldots$) 
\end{center}
$B$H$$$&%j%9%H$GI=8=$5$l(B, $arg_i$ $B$N8D?t(B, $B7?$O(B $id$ $B$K$h$j$5$^$6$^$G$"$k(B.
\QT $B$NF~NO(B, $BJQ49$J$I$N4pK\A`:n$O<!$NDL$j$G$"$k(B.

\begin{itemize}
\item \QT $B$NF~NO(B

\QT $B$O(B {\tt quote}($Expr$) $B$^$?$O(B {\tt `}$Expr$ ($B%P%C%/%/%)!<%H$D$-(B)
$B$K$h$jF~NO$G$-$k(B.

\item \QT $B$H(B Risa $B%*%V%8%'%/%H$NAj8_JQ49(B

Risa $B%*%V%8%'%/%H$+$i(B \QT $B$r@8@.$9$k$N$O(B {\tt objtoquote}($Obj$),
$B5U$K(B \QT $B$rI>2A$7$F(B Risa $B%*%V%8%'%/%H$r@8@.$9$k$N$O(B {\tt eval\_quote}($Expr$)
$B$G9T$&(B.

\item \QT $B$NJ,2r(B, $B9g@.(B

{\tt quote\_to\_funargs}($Expr$) $B$O(B
\QT $Expr$ $B$N(B \FN $B$N<1JL;R(B, $B0z?t$r%j%9%H$H$7$FJV$9(B.

{\tt funargs\_to\_quote}($List$) $B$O(B, $B$=$N5U$G$"$k(B.
\end{itemize}

\subsection{\FN $B$NI8=`7A(B}
\FN $B$KBP$9$k%Q%?!<%s%^%C%A%s%0(B, $B=q$-49$($rMF0W$K9T$&$?$a$K(B,
\FN $B$KBP$9$kI8=`7A$rDj5A$7$?(B. $BI8=`7A$N7W;;$O(B {\tt qt\_normalize}($Expr$[,$Mode$])
$B$G9T$&(B. $Mode$ $B$O8e=R$9$kE83+%b!<%I;XDj$G$"$k(B.

\begin{tabbing}
AAAAAAAAAAA \= \kill
$nf$ \> : $formula$ $|$ $functor$ ($nf$ [, $\ldots$]) $|$ $sum\_of\_monom$\\
$sum\_of\_monom$ \>: $monom$ [$+$ $\cdots$]\\
$monom$ \>: [$formula$ $*$ ] $nfpow$ [$*$ $\cdots$]\\
$nfpow$ \>: $nf$ $|$ $nf^{nf}$\\
$formula$ \>: Risa object
\end{tabbing}
$B$*$*$6$C$Q$K$$$($P(B, $BI8=`7A(B $nf$ $B$H$O(B, $BI8=`7A$N%Y%-@Q$N(B Risa $B%*%V%8%'%/%H(B
$B78?t$D$-$NOB$G$"$k(B.
$B$3$3$G(B, $BOB$O(B \FN $B$H$7$F$O(B, n$B9`OB$H$7$FI=8=$5$l(B, $BOB$r9=@.$9$kC19`<0(B
$B$O(B, $B$"$kA4=g=x$K$h$j@0Ns$5$l$k(B. $B$^$?(B, $B@Q$b(B n$B9`@Q$H$7$FI=8=$5$l$k(B. 
$B$9$J$o$A(B, $BI8=`7A$O(B, $BF~NO$5$l$??t<0$,(B, Risa $B%*%V%8%'%/%H$r78?t4D$H$9$k(B
$B7k9gBe?t$N85$G$"$k$H8+$J$7(B, $BOB$N2D49@-(B, $B@Q$N7k9g@-$K$h$j%U%i%C%H$K(B
$B@0M}$7$J$*$7$?$b$N$G$"$k(B. 
\begin{example}
\begin{verbatim}

[278] ctrl("print_quote",1)$    /* FNODE $B$r%j%9%H$GI=<((B */
[279] `(x+y+z);                
[u_op,(),[b_op,+,[b_op,+,[internal,x],[internal,y]],[internal,z]]]
[280] qt_normalize(`(x+y+z));
[n_op,+,[internal,x],[internal,y],[internal,z]]
\end{verbatim}
2 $B9`1i;;$GI=8=$5$l$?<0$,(B, $BI8=`7A$G$O(B n $B9`OB$GI=8=$5$l$F$$$k$3$H$,J,$+$k(B.
\end{example}

$B$3$l$O(B, Mathematica $B$K$*$1$kI8=`7A(B \cite{MMA}
$B$H4pK\E*$KF1$8$G$"$k$,(B, $B@Q$N2D49@-$r2>Dj$7$F$$$J$$$3$H(B, $B$*$h$S(B, $B78?t(B
$B4D$r$h$j0lHLE*$K$7$F$"$kE@$G0[$J$C$F$$$k(B 
\footnote{Mathematica $B$K$*$$$F@Q$N(B {\tt Orderless} $BB0@-$r30$9$3$H$G(B,
$B@Q$rHs2D49$K$G$-$k$,(B, $B4JC12=$K$*$$$F0[>o$J5sF0$r<($9$h$&$K$J$k(B (Ver. 4).
Ver. 5 $B$G$O(B, $B78?t$^$GHs2D49$K$J$k(B.}.
$B$5$i$K(B, $BI8=`7A$X$NJQ49;~$K(B, $B@Q$K4X$9$kJ,G[B'$rMxMQ$7$FE83+$5$l$?I8=`7A(B
$B$rF@$k$3$H$b$G$-$k(B. 

\begin{example}
\begin{verbatim}

[289] ctrl("print_quote",2)$    /* FNODE $B$r<0$GI=<((B */
ctrl(``print_quote'',2)$
[290] qt_normalize(`(x+y)^2);  
((x)+(y))^(2)
[291] qt_normalize(`(x+y)^2,1);
((x)^(2))+((x)*(y))+((y)*(x))+((y)^(2))
\end{verbatim}
\end{example}

\subsection{$B9`=g=x$*$h$S78?t4D$N@_Dj(B}

$BC19`<0=g=x$*$h$S78?t4D$O2DJQ$G$"$j(B, $B$=$l$>$l<!$N$h$&$J4X?t$,MQ0U$5$l$F$$$k(B.

\begin{itemize}
\item $BC19`<0=g=x$N@_Dj(B

$BI8=`7ACf$NC19`<0=g=x$O(B, $B;XDj$,$J$$>l9g$K$O(B, $B%7%9%F%`$,7h$a$kITDj85(B
$B$*$h$S4X?t;R$N=g=x$+$iM6F3$5$l$k<-=q<0=g=x$,E,MQ$5$l$k(B. $B$=$N:](B, $B4X?t8F$S=P$7$O(B,
$BC1$J$kITDj85$h$j=g=x$,>e$G(B, $B4X?t;R$,Ey$7$$>l9g$K$O0z?t$,<-=q<0$KHf3S$5$l$k(B.
{\tt qt\_set\_ord}($VarList$) $B$K$h$j(B, $VarList$ $B$K8=$l$kITDj85$r@hF,(B
$B$H$7(B, $B$N$3$j$r%7%9%F%`$,7h$a$k$H$$$&=g=x$,@_Dj$5$l$k(B.

%$BNc(B

\item $B78?t4D$N@_Dj(B

$B%G%U%)%k%H$G$O78?t4D$O?t$N$_$+$i$J$k$,(B, $B$$$/$D$+$N%Q%i%a%?$r78?t4D$N85(B
$B$H$7$F07$$$?$$>l9g(B, {\tt qt\_set\_coef}($ParamList$) $B$K$h$j;XDj$G$-$k(B.
$ParamList$ $B$K;XDj$5$l$?%Q%i%a%?$O(B, $B78?t4D$G$"$k2D49$JM-M}4X?tBN$NITDj85(B
$B$H$7$F07$o$l$k(B.

\end{itemize}
\begin{example}
\begin{verbatim}

[304] qt_normalize(`(b*x+a*y)*b*y,1);
((a)*(y)*(b)*(y))+((b)*(x)*(b)*(y))
[305] qt_set_coef([a,b])$
[306] qt_normalize(`(b*x+a*y)*b*y,1);
((b^2)*(x)*(y))+((b*a)*((y)^(2)))   /* a,b $B$,78?t4D$KF~$C$?(B; x*y > y^2 */
[307] qt_set_ord([y,x])$
[308] qt_normalize(`(b*x+a*y)*b*y,1);
((b*a)*((y)^(2)))+((b^2)*(x)*(y))   /* y^2 > x*y */
\end{verbatim}
\end{example}


\section{$B%Q%?!<%s%^%C%A%s%0$K$h$k=q$-49$((B}

Risa/Asir $B$K$*$$$F$O(B, $BITDj85$H%W%m%0%i%`JQ?t$OL@3N$K6hJL$5$l$F$$$k(B.
$B$=$3$G(B, $B%Q%?!<%sJQ?t$H$7$F%W%m%0%i%`JQ?t$rMQ$$$k$3$H$K$7$?(B.
$B$9$J$o$A%Q%?!<%s$H$O(B, $B%W%m%0%i%`JQ?t$r4^$s$G$b$h$$(B \QT $B$G$"$k(B. $B$3$l(B
$B$KBP$7(B, $B$$$/$D$+$N=q$-49$(4X?t$rMQ0U$7$?(B. 
\begin{itemize}
\item {\tt nqt\_match}($Expr$,$Patten$[,$Mode$])

\QT $B<0(B $Expr$ $B$H%Q%?!<%s(B $Pattern$ $B$,%^%C%A$7$?$i(B 1 $B$rJV$9(B. $B$5$i$K(B,
$Pattern$ $BCf$K4^$^$l$k%W%m%0%i%`JQ?t$K%^%C%A$7$?CM$,<B:]$KBeF~$5$l$k(B.

\item {\tt nqt\_match\_rewrite}($Expr$,$Rule$,$Mode$)

$Rule$ $B$O(B [$Pattern$,$Action$] $B$^$?$O(B [$Pattern$,$Condition$,$Action$] $B$G(B
$B$"$k(B. $B$3$N4X?t$O(B, $Expr$ $B$,(B $Pattern$ $B$K%^%C%A$7$?$i(B, $Action$ $B$,I>2A(B
$B$5$l(B, $B$=$NCM$,JV$5$l$k(B. 
$B$=$N:](B, $Action$ $BCf$N%Q%?!<%sJQ?t$,(B, $B%^%C%A$7$?CM$KCV$-49$($i$l$k(B.
$Condition$ $B$,;XDj$5$l$F$$$k>l9g$K$O(B, $Condition$ $BCf$N%Q%?!<%sJQ?t$,F1MM(B
$B$KCV$-49$($i$lI>2A$5$l(B, 0 $B$G$J$$>l9g$K(B $Action$ $B$,I>2A$5$l$k(B. $B%^%C%A$7$J$$(B
$B>l9g$K$O(B $Expr$ $B$=$N$b$N$,JV$5$l$k(B.
\end{itemize}
\begin{example}
\begin{verbatim}

[318] nqt_match(`x*y*z-3*u,`X*Y+Z);
1
[319] [X,Y,Z];
[x,(y)*(z),(-3)*(u)]
[320] nqt_match_rewrite(`x*y*z,[`X*Y,`X+Y],1);
((y)*(z))+(x)
\end{verbatim}
\end{example}

$B$$$:$l$b<B9TA0$K0z?t$,I8=`7A$KJQ49$5$l$k$,(B, $Mode$ $B$O$=$N:]$KE83+$r9T$&$+(B
$B$I$&$+$r;X<($9$k(B. $B%^%C%A%s%0$K$*$$$F$O(B, $B:G=i$K%^%C%A$7$?;~E@$N>pJs$,JV$5$l$k(B
\footnote{$B8=>u$G$O<BAu$,IT40A4$G$"$j(B, $BF10l%Q%?!<%sJQ?t$,J#?t8=$l$k%Q%?!<%s(B
$B$KBP$7$F$O%^%C%A%s%0$K<:GT$9$k>l9g$,$"$k(B.}.
$Condition$ $B$*$h$S(B $Action$ $B$K$O%f!<%6Dj5A4X?t$r4^$a$k$3$H$,$G$-$k(B. 
$B$3$l$K$h$j(B, $BJ#;($J=q$-49$(5,B'$r=q$/$3$H$,$G$-(B, $B$^$?=q$-49$(5,B'$N?t$r>/$J$/2!$($k(B
$B$3$H$,$G$-$k(B.
$B8=>u$G$O(B, Mathematica $B$G2DG=$J(B, $B%Q%?!<%sJQ?t$K%^%C%A$9$k7?$N;XDj$,$G$-(B
$B$J$$$?$a(B, $Condition$ $B$K$*$$$F7?H=Dj$r9T$&$3$H$K$J$k(B. $B$3$N$?$a(B, \QT $B$K(B
$BBP$9$k$$$/$D$+$N7?H=Dj4X?t$rMQ0U$7$?(B. $B$3$l$i$rMQ$$$F(B, $B=q$-49$(5,B'=89g$r(B
$BM?$($F(B, $B=q$-49$(5,B'$,E,MQ$G$-$J$k$J$k$^$G=q$-49$($rB3$1$k4X?t(B 
{\tt qt\_rewrite}($Expr$,$Rules$,$Mode$) $B$r%f!<%64X?t$H$7$F5-=R$7$?(B.

\begin{example}[$sl_2$$B$NE83+4D(B]
\begin{verbatim}

[336] Rsl=[[`h*e,`e*h+2*e],[`h*f,`f*h-2*f],[`e*f,`f*e+h]]$
0sec(7e-06sec)
[337] qt_rewrite(`e*f^2,Rsl,2);                           
((f)*(f)*(e))+((2)*(f)*(h))+((-2)*(f))
1.776e-15sec(0.008608sec)
[338] qt_rewrite(`h*e^3,Rsl,2);
((e)*(e)*(e)*(h))+((6)*(e)*(e)*(e))
\end{verbatim}
\end{example}


\section{\FN $B$N=g=x$E$1(B}

$B:#2s$N<BAu$NL\E*$O(B, $B%f!<%6$,5$7Z$K=q$-49$(5,B'$rM?$($F(B,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$O9T$+$J$$$,(B, 
$B=q$-49$($NJ}8~@-$r<($9$b$N$H$7$FA4=g=x$rM?$($k$3$H$OM-8z$G$"$m$&(B.
$B$h$C$F(B, $B=q$-49$(5,B'$K1~$8$F(B, $BA4=g=x$r$I$&A*$V$+$,LdBj$G$"$k(B.

\subsection{\FN $B$N(B weight$B$H=q$-49$((B}

$B0lHL$K(B \FN $f$ $B$N(B weight $w(f)$ $B$r(B
\begin{enumerate}
\item $f$ $B$,(B leaf $B$N>l9g(B, $BE,Ev$JCM$rM?$($k(B. $BFC$K78?t$N(B weight $B$O(B 0.
\item $f$ $B$,(B node $B$N>l9g(B,  $f$ $B$N;R$N(B weight $BCM$r0z?t$H$7(B,
$B<1JL;R$G7h$a$i$l$?4X?t$r7W;;$7$F$=$NCM$r$H$k(B.
\end{enumerate}
$B$K$h$j:F5"E*$K7h$a$k$3$H$,$G$-$k(B. $BOB$KBP$7$F$O(B $\max()$,
$B@Q$KBP$7$F$OOB(B, $B%Y%-$KBP$7$F$O@Q$rMQ$$$k$H(B, $B<!$N$h$&$K$J$k(B.
\begin{enumerate}
\item $w(f+g)=\max(w(f),w(g))$
\item $w(fg) = w(f)+w(g)$
\item $w(f^n)=nw(f)$
\end{enumerate}
% $B$h$C$F(B, $BM?$($i$l$?=q$-49$(5,B'=89g$KBP$7(B, $B$3$N$h(B
%$B$&$J(B weight $B$r8+$D$1$k(B, $B$9$J$o$A(B leaf $B$NCM$rE,@Z$K@_Dj$9$k$3$H$,=EMW$G(B
%$B$"$k(B. $B$3$N$h$&$J(B weight $B$,:n$l$k%/%i(B
%$B%9$rM?$($k$3$H(B, $B$*$h$S$=$N$h$&$J%/%i%9$KB0$9$k=q$-49$(5,B'=89g$KBP$7(B, $B>e$N(B
%$B@-<A$rK~$?$9(B weight $B$rA4$FM?$($k$3$H$O6=L#?<$$LdBj$G$"$k(B.
%\subsection{$B<+M37k9gBe?t$K$*$1$kF1<!=q$-49$(5,B'(B}

$B0J2<$G$O(B, $B$3$N$h$&$J(B weight $B$rM-8B@8@.$N<+M37k9gBe?t$KBP$9$k=q$-49$((B
$B$K1~MQ$9$k$3$H$r9M$($k(B.

$B78?t4D$r(B $K$ $B$N>e$G(B $ z_1, \ldots, z_n, h $
$B$G@8@.$5$l$k<+M37k9gBe?t(B $A$ $B$r(B
$$ K \langle z_1, \ldots, z_n, h \rangle  $$
$B$H=q$/(B.
$h$ $B$rI,MW$K1~$8$F(B $z_{n+1}$ $B$H=q$/$3$H$b$"$k(B.
\begin{definition}\rm
$A$ $B$G$N=q$-49$(5,B'(B($B$^$?$O4X78<0(B, $B:8JU$OI,$:C19`<0(B)
$$ L_1 \rightarrow R_1, \ldots,  L_m \rightarrow R_m  $$
$B$,(B, $BF1<!2=(B weight $B%Y%/%H%k(B $H$ $B$K$D$$$F(B,
$BF1<!E*=q$-49$(5,B'$G$"$k$H$O(B, 
$R_i$ $B$,(B $0$ $B$G$"$k$+$^$?$O(B,
$$ {\rm deg}_H(L_i) = {\rm deg}_H(R_i \mbox{$B$NG$0U$N9`(B}) $$
$B$,@.N)$9$k$3$H$G$"$k(B.
\end{definition}
$B$3$3$G(B ${\rm deg}_H(\prod z_i^{e_i})$ $B$O(B
$\prod z_i^{e_i}$ $B$N(B weight $H$ $B$K$D$$$F$N(B($BHs2D49@-$rL5;k$7$?(B)$B<!?t$G$"$k(B.
$B$D$^$j(B
$${\rm deg}_H(\prod z_i^{e_i}) = \sum e_i H_i $$
$B$HDj5A$9$k(B ($i$ $B$O=EJ#$7$F$"$i$o$l$k$3$H$b$"$k(B).  

\begin{example} \rm
$$ z_2 z_1 \rightarrow z_1 z_2 + h^2 , 
 h z_i \rightarrow z_i h
$$
$B$O(B $H=(1,1,1)$ $B$K$D$$$F$NF1<!E*=q$-49$(5,B'$G$"$k(B. 
$B$3$NNc$O(B $x=z_1, \partial = z_2$ $B$H$7$?(B
1 $BJQ?t$NF1<!2=(B Weyl $BBe?t$K$[$+$J$i$J$$(B.
\end{example}

$B0J2<(B $H$ $B$N$9$Y$F$N@.J,$O@5$G$"$k$H2>Dj$78GDj$9$k(B.
$B$^$?(B$x_1, \ldots, x_n, h $ $B$+$i$J$k%o!<%I$KBP$9$k(B
well order $\succ$ $B$r0J2<$R$H$D8GDj$9$k(B.
$B=P8=$9$k=q$-49$(5,B'$O$H$/$K$3$H$o$i$J$$8B$jA4$F(B$H$ $B$K$D$$$FF1<!E*=q$-49$(5,B'(B
$B$G$"$k(B.

\begin{example} \rm
$BA0$NNc$N=q$-49$(5,B'(B
$$ z_2 z_1 \rightarrow z_1 z_2 + h^2 , 
 h z_i \rightarrow z_i h
$$
$B$K$5$i$K(B
$$ z_2^{p+1} \rightarrow 0, z_1 z_2 \rightarrow p h^2 $$
$B$r2C$($?5,B'$N=89g$r(B $R_p$ $B$H=q$/(B. $B$3$3$G(B $p$ $B$O<+A3?t$G$"$k(B.
$R_p$  $B$O(B $H=(1,1,1)$ $B$K$D$$$F$NF1<!E*=q$-49$(5,B'$G$"$k(B.
\end{example}

\begin{definition} \rm
$n$ $B<!85$N(B weight $B%Y%/%H%k(B $w \in {\bf R}^n $
$B$,F1<!E*=q$-49$(5,B'(B
$ \{ L_i \rightarrow R_i \} $
$B$*$h$S(B $\succ$ $B$K$D$$$F(B
$BM-8z(B weight $B%Y%/%H%k(B(admissible weight vector) $B$G$"$k$H$O<!$N>r7o$r$_$?$9(B
$B$3$H$G$"$k(B.  
$B0J2<(B $\tilde w = (w,0) $ ($h$ $B$KBP$9$k(B weight $B$r(B 0 $B$K$7$?$b$N(B)
$B$H$*$/(B.
\begin{enumerate}
\item  ${\rm deg}_{\tilde w}(L_i) \geq {\rm deg}_{\tilde w}(R_i)$
\item  $B:8JU$H1&JU$,F1$8(B $w$-$B<!?t$r$b$D$H$-$O(B $B1&JU$G:8JU$HF1$8(B $w$-weight $B$r;}$D(B
$B9`$?$A$O=g=x(B $\succ$ $B$G$+$J$i$:>.$5$$(B.
\end{enumerate}
\end{definition}
%% z_2 z_1 --> z_1 z_2 + z_2 z_1  $BNc(B. z_1 > z_2 (lex) $B$H$9$k(B. $B$3$l$O$@$a(B.
$B=q$-49$(5,B'$,$"$k@5?t%Y%/%H%k(B $H$ $B$K$D$$$FF1<!E*$G$"$k$3$H$+$i(B, 
$B$3$l$i$N>r7o$K$h$j=q$-49$($,Dd;_@-$r$b$D$3$H$,J,$+$k(B. $B$5$i$K(B
$B<!$NL?Bj$,@.$jN)$D(B.
%%<hyperlink|G-algebra|http://www.singular.uni-kl.de/Manual/latest/sing_407.htm>
\begin{proposition}\rm
G-algebra \cite{LEV} $B$N>r7o$N$&$A(B, 
well order $B$NB8:_>r7o$r2>Dj$7$J$/$F$b(B,
$BE,Ev$JF1<!2=(Bweight$B%Y%/%H%k(B, $BM-8z(B weight $B%Y%/%H%k$,B8:_$9$k$J$i$P(B,
$h$ $B$r2C$($k@F<!2=(B,
$h$ $B$r(B $1$ $B$H$*$/$3$H$K$h$kHs@F2=$K$h$j(B,
$B%0%l%V%J!<4pDl$r7W;;$G$-$k$h$&$K$J$k(B.
\end{proposition}

$B$3$N1~MQ$K:]$7$F$O(B, $BM?$($i$l$?=q$-49$(5,B'$KBP$7(B, $BM-8z(B weight $B%Y%/%H%k(B
$w$ $B$r8+$D$1$kI,MW$,$"$k(B. 
$B$?$H$($P0lJQ?t%o%$%kBe?t$N>l9g(B  $w_1 + w_2 \geq 0$ $B$N>r7o$r$_$?$5$J$$$H(B
$BM-8z(B weight $B%Y%/%H%k$H$J$i$J$$(B.
$B$3$N$H$-F1;~2=(B weight $B%Y%/%H%k$rMQ$$$F=q$-49$(5,B'$N1&JU$r@F<!2=(B
$B$9$l$P(B, $BF1<!E*=q$-49$(5,B'$,F@$i$l$k(B. 

$B8=:_$N<BAu$K$*$$$F$O(B, weight $B%Y%/%H%k$,@_Dj$5$l$J$$8B$j(B, weight $B$K(B
$B$h$kHf3S$O9T$o$J$$(B. 
$B4X?t(B {\tt qt\_set\_weight()} $B$K$h$j(B
$B0lIt$NITDj85$KBP$7$F(B weight $B$,@_Dj$5$l$k$H(B, 
$BB>$NITDj85$N(B weight $B$O<+F0E*$K(B 0 $B$H$J$k(B.
$B$3$N(B weight $B$rMQ$$$?(B $B<!?t$NHf3S8e$K8=:_@_Dj(B
$B$5$l$F$$$kC19`<0=g=x$,E,MQ$5$l$k(B. 

\begin{example}
\begin{verbatim}

[300] qt_set_ord([z1,z2,h])$
[301] qt_set_weight([[z1,-1],[z2,1]])$
[302] Rule1=[[`h*z1,`z1*h], [`h*z2,`z2*h], [`z2*z1,`z1*z2+h^2]] $
[303] Rule2=[[`z2*z2,`0], [`z1*z2,`h^2]]$
[304] F=`z2^2*(h^2+z1^2)$
[305] qt_rewrite(F,Rule1,2);
((z2)*(z2)*(h)*(h))+((z1)*(z1)*(z2)*(z2))+((4)*(z1)*(z2)*(h)*(h))+((2)*(h)*(h)*(h)*(h))
\end{verbatim}
\end{example}

\begin{remark}
$BM-8z(B weight $B%Y%/%H%k$,Ii$N@.J,$r$b$D$HHs@F<!2=$7$?$"$H$N(B
reduction $B$NDd;_@-$O$$$($J$$(B.
\end{remark}


\section{$B=q$-49$(5,B'$NNc(B}

$B0J2<$K(B, $B=q$-49$(5,B'$NNc$r$$$/$D$+>R2p$9$k(B. 

\begin{example}[$B2D49@-(B]
\begin{verbatim}

[246] qt_normalize(`(x+y-z)^2,1);
((x)^(2))+((x)*(y))+((-1)*(x)*(z))+((y)*(x))+((y)^(2))+((-1)*(y)*(z))
+((-1)*(z)*(x))+((-1)*(z)*(y))+((z)^(2))
[247] Rcomm=[[`X*Y,`nqt_comp(Y*X,X*Y)>0,`Y*X]]$
[248] qt_rewrite(`(x+y-z)^2,Rcomm,1);
((x)^(2))+((2)*(x)*(y))+((-2)*(x)*(z))+((y)^(2))+((-2)*(y)*(z))+((z)^(2))
\end{verbatim}
{\tt nqt\_comp()} $B$OHf3S4X?t$G$"$k(B.
\end{example}

\begin{example}[$B30@QBe?t(B]
\begin{verbatim}

[249] Rext0=[`X*Y,`qt_is_var(X) && qt_is_var(Y) && nqt_comp(Y,X)>0,`-Y*X]$
[250] Rext1=[`X^N,`eval_quote(N)>=2,`0]$
[251] Rext2=[`X*X,`0]$
[252] Rext=[Rext0,Rext1,Rext2]$
[253] qt_set_coef([a,b,c])$
[254] qt_rewrite(`(a*x+b*y+c*z)*(b*x+c*y+a*z)*(c*x+a*y+b*z),Rext,1);
(-a^3+3*c*b*a-b^3-c^3)*(x)*(y)*(z)
\end{verbatim}
$B9TNs<0$N7W;;$KAjEv$9$k(B. $BJQ?t$N@Q$r8rBeE*$K=q$-49$($k5,B'$rDj5A$7$F$$$k(B.
\end{example}

\begin{example}[$BHyJ,(B]
\begin{verbatim}

[255] qt_set_coef([a])$
[256] Rd1=[`d(X+Y),`d(X)+d(Y)]$
[257] Rd2=[`d(X*Y),`d(X)*Y+X*d(Y)]$
[258] Rd3=[`d(N),`qt_is_coef(N),`0]$
[259] Rd=[Rd1,Rd2,Rd3]$
[260] qt_rewrite(`d((x+a*y)^2),Rd,1);
(d((x)^(2)))+((a)*(d(x))*(y))+((a^2)*(d((y)^(2))))+((a)*(d(y))*(x))
+((a)*(x)*(d(y)))+((a)*(y)*(d(x)))
\end{verbatim}
\end{example}

\begin{example}[Weyl $BBe?t(B]

\begin{verbatim}
def member(V,L) {
  for ( I = 0; L != [] && V != car(L); L = cdr(L), I++ );
  return L==[] ? -1 : I;
}
def qt_weyl_vmul(X,K,Y,L) {
  extern WeylV, WeylDV;
  if ( member(X,WeylV) >= 0 || member(Y,WeylDV) >= 0 ) return Y^L*X^K;
  if ( WeylV[I=member(X,WeylDV)] != Y ) return Y^L*X^K;
  else {
    K = eval_quote(K); L = eval_quote(L); M = K>L?L:K;
    for ( T = 1, I = 0; I <= M; T = idiv(T*K*L,I+1), I++, L--, L--  )
      R += T*Y^L*X^K;
    return R;
  }
}

[256] WeylV=[`x,`y,`z]$
[257] WeylDV=[`dx,`dy,`dz]$
[258] qt_set_ord(map(eval_quote,append(WeylV,WeylDV)))$
[259] Rweyl=[[`X^K*Y^L,`qt_is_var(X)&&qt_is_var(Y)&&nqt_comp(Y,X)>0,
	`qt_weyl_vmul(X,K,Y,L)]]$
[260] qt_rewrite(`((x*dy+y*dx)^2),Rweyl,1);                         
(((x)^(2))*((dy)^(2)))+((2)*(x)*(y)*(dx)*(dy))+((x)*(dx))
+(((y)^(2))*((dx)^(2)))+((y)*(dy))
\end{verbatim}
$Action$ $B$K%f!<%6Dj5A4X?t$rMQ$$$k$3$H$K$h$j(B, Weyl $BBe?t$N=q$-49$(5,B'$r0l$D(B
$B$K$^$H$a$F$$$k(B.
\end{example}

\section{$B$^$H$a(B}

Risa/Asir $B$K$*$1$k?t<0$NCf4VE*I=8=$G$"$k(B \FN $B$r%f!<%68@8l$+$iA`:n(B
$B$9$k$?$a$N%$%s%?%U%'!<%9$r<BAu$7$?(B. $B$3$l$K$h$j(B, $B%f!<%6$,Dj5A$9$k(B
$B=q$-49$(5,B'$K$h$k?t<0$N=q$-49$($,2DG=$H$J$C$?(B. $B=q$-49$($N8zN($K$D$$$F$O(B
$B$[$H$s$I9MN8$G$-$F$$$J$$(B. $BFC$K(B, $BI8=`7A$X$NJQ49$H=q$-49$($rJB9T$7$F(B
$B9T$&$3$H$,I,MW$H9M$($F$*$j(B, $B:#8e$N2]Bj$N0l$D$G$"$k(B. $B$^$?(B, $B%Q%?!<%s(B
$B%^%C%A%s%0<+BN$b$^$@40A4$J$b$N$H$O$$$($:(B, $B2~NI$9$Y$-E@$,B?$/$"$k(B.
$BL\E*$K1~$8$?I8=`E*$J=q$-49$(5,B'=89g$r%G%U%)%k%H$GDs6!$9$k$3$H$b(B
$BI,MW$G$"$k(B.

$B$3$N=q$-49$($H(Bweight $B%Y%/%H%k$K$h$kC19`<0Hf3S$rAH$_9g$o$;$k$3$H$K$h$j(B, 
$B<+M37k9gBe?t$K$*$1$k0lHLE*$J%0%l%V%J4pDl$N7W;;$rO@$8$?(B.
$B$3$3$GDs0F$7$?0lHL2=$O(B Weyl $BBe?t$NF1<!2=$NM}O@$r4^$`(B.  Risa/Asir $B$G?7(B
$B$7$/F3F~$7$?(B, \QT $B$KBP$9$k0lHLE*$J(B weight $B%Y%/%H%k$N%a%+%K%:%`(B
\verb@ qt_set_weight @ $B$K$h$j$o$l$o$l$NM}O@$H%"%k%4%j%:%`$N%W%m%H%?%$(B
$B%W$rMF0W$K;n$9$3$H$,2DG=$G$"$k(B.  V. Levandovskyy \cite{LEV} $B$O(B 
$G$-algebra $B$N35G0$rF3F~$7$F(B, Singular $B$K<BAu$7$?$,(B, $B$o$l$o$l$N35G0$O(B
$BF1<!2=$r$H$*$7$F(B, well order $B$G$J$$>l9g$K$bE,MQ$G$-$k(B.  
$B$o$l$o$l$N%"%W%m!<%A$K$h$j(B, 
$G$-algebra $B$h$j9-$$HO0O$N(B algebra $B$r07$&$3$H$,2DG=$H$J$k(B.  
$B0lHLE*$JOHAH$_$N1~MQ$H$7$F(B, $B>-MhE*$K$O(B $D$-$B2C72$N%"%k%4%j%:%`$r3HD%$7(B,
Calderon-Moreno $BEy$NF3F~$7$?(B algebra $B$r6I=jE*$K07$&$J$I$N1~MQ$,8+9~$^(B
$B$l$k(B.


\begin{thebibliography}{99}
\bibitem{MMA}
S. Wolfram, The MATHEMATICA Book, Fourth Edition. Cambridge University Press (1999).

\bibitem{LEV}
%V. Levandovskyy, H. Sch\"onemann: 
%PLURAL - a Computer Algebra System for Noncommutative Polynomial Algebras.
%In Proc. ISSAC 2003, ACM Press (2003).
V. Levandovskyy, Non-commutative Computer Algebra for Polynomial Algebras:
Gr\"obner Bases, Applications and Implementation.
Dissertation, Universit\"at Kaiserslautern (2005).

\end{thebibliography}
\end{document}

