version 1.8, 2005/05/04 05:47:03 |
version 1.9, 2005/05/11 06:40:10 |
|
|
$Id$ |
$Id$ |
$OpenXM: OpenXM/src/asir-contrib/testing/tr-ja.oxt,v 1.7 2005/04/21 10:54:50 takayama Exp $ |
$OpenXM: OpenXM/src/asir-contrib/testing/tr-ja.oxt,v 1.8 2005/05/04 05:47:03 takayama Exp $ |
|
|
$BCm0U(B: testing/tr.rr $B$G$O(B quote $B$r(B quotetolist $B$G(B list $B$KJQ49$7$F07$&$?$a(B, |
$BCm0U(B: testing/tr.rr $B$G$O(B quote $B$r(B quotetolist $B$G(B list $B$KJQ49$7$F07$&$?$a(B, |
$B2<$N;EMM$H$O$3$H$J$j(B, list $B7?$G%G!<%?$rLa$9>l9g$bB?$$(B. |
$B2<$N;EMM$H$O$3$H$J$j(B, list $B7?$G%G!<%?$rLa$9>l9g$bB?$$(B. |
Line 13 nkf -e tr.oxt | oxgentexi --noSorting --title 'Term re |
|
Line 13 nkf -e tr.oxt | oxgentexi --noSorting --title 'Term re |
|
|
|
begin: AAA01| |
begin: AAA01| |
|
|
|
$B8=:_$N%5%s%W%k<BAu$K$O(B bug $B$,Bt;3$G$+$D(B, |
|
$B%5%s%W%k<BAu$O8zN($b0-$$(B. |
|
$B$4Cm0U(B! |
|
|
@c --------------------------------------------------------- |
@c --------------------------------------------------------- |
@section $BJQ?t%Q%?!<%s$H4X?t%Q%?!<%s(B |
@section $BJQ?t%Q%?!<%s$H4X?t%Q%?!<%s(B |
|
|
|
|
$BJQ?t%Q%?!<%s(B |
$BJQ?t%Q%?!<%s(B |
|
@itemize @bullet |
|
@item pn(x), $BG$0U$N$b$N$K%^%C%A(B. $B%^%C%A$7$?$b$N$r(B x $B$K(B bind. |
|
@item pn(x,qt.is_integer(x)), x $B$,(B @code{qt.is_integer(x)} $B$r$_$?$;$P%^%C%A(B. |
|
|
pn(x) $BG$0U$N$b$N$K%^%C%A(B. $B%^%C%A$7$?$b$N$r(B x $B$K(B bind. |
@item Todo; $B4X?t$K%^%C%A$9$k(B fn $B$OB?J,$$$i$J$$(B. qt.is_function(x) $B$G(B OK. |
pn(x,qt_is_integer(x)) |
@end itemize |
|
|
Todo; fn $B$OB?J,$$$i$J$$(B. qt_is_function(x) $B$G(B OK. |
|
fn(f) $BG$0U$N4X?t$K%^%C%A(B. $B%^%C%A$7$?4X?tL>$r(B f $B$K(B bind. |
|
fn(f,pn(x),pn(y)) $BG$0U$N4X?t$K%^%C%A(B. $B%^%C%A$7$?4X?tL>$r(B f $B$K(B bind. |
|
f $B$N0z?t$r(B x, y $B$K(B bind |
|
|
|
|
|
$B%Q%?!<%s$O(B quote $B$GM?$($k(B. |
$B%Q%?!<%s$O(B quote $B$GM?$($k(B. |
$BM=Ls8l(B tr.and, tr.or, tr.not $B$O%Q%?!<%s$N%^%C%A$K4X$7$FO@M}1i;;$r$*$3$J$&(B. |
$BM=Ls8l(B tr.and, tr.or, tr.not $B$O%Q%?!<%s$N%^%C%A$K4X$7$FO@M}1i;;$r$*$3$J$&(B. |
$B$?$H$($P(B |
$B$?$H$($P(B |
quote(tr.and(pn(x,"qt.is_integer"),pn(x,"qt.is_non_negative",x))) |
quote(tr.and(pn(x,qt.is_integer(x)),pn(x,qt.is_non_negative(x))) |
$B$O(B x $B$,(B $B@0?t$G(B - $B$,@hF,$K$D$$$F$$$J$$>l9g%^%C%A$9$k(B. |
$B$O(B x $B$,(B $B@0?t$G(B - $B$,@hF,$K$D$$$F$$$J$$>l9g%^%C%A$9$k(B. |
|
|
end: |
end: |
|
|
@section $B<BAu$N$?$a$NJd=u4X?t(B |
@section $B<BAu$N$?$a$NJd=u4X?t(B |
|
|
@itemize @bullet |
@itemize @bullet |
@item @code{quotetolist}, @code{listtoquote}, @code{listtoquote_str} |
@item @code{quotetolist}, @code{listtoquote}, @code{listtoquote_str} ; |
quote $B$H(B list $B$N4V$NJQ49(B. |
quote $B$H(B list $B$N4V$NJQ49(B. |
@item @code{quote_to_funargs}, @code{funargs_to_quote}, @code{get_function_name} |
@item @code{quote_to_funargs}, @code{funargs_to_quote}, @code{get_function_name} ; |
quote $B$H(B funarg $B7A<0$NJQ49(B. $B<B83E*4X?t$N%^%K%e%"%k$r;2>H(B. |
quote $B$H(B funarg $B7A<0$NJQ49(B. $B<B83E*4X?t$N%^%K%e%"%k$r;2>H(B. |
@item @code{quotetoobj}, @code{eval_quote} |
@item @code{quotetoobj}, @code{eval_quote} ; |
quote $B$H(B object $B$N4V$NJQ49(B. |
quote $B$H(B object $B$N4V$NJQ49(B. |
@item @code{quote_input_form}, @code{ctrl("print_quote",1)}, |
@item @code{quote_input_form}, @code{ctrl("print_quote",1)} ; |
quote $B$HJ8;zNs$N4V$NJQ49(B. |
quote $B$HJ8;zNs$N4V$NJQ49(B. |
@item @code{quote_flatten} |
@item @code{quote_flatten} ; |
$B<B83E*4X?t$N%^%K%e%"%k$r;2>H(B. |
$B:87k9gE*$K:n$jJQ$($k(B. $B<B83E*4X?t$N%^%K%e%"%k$r;2>H(B. |
@end itemize |
@end itemize |
|
|
end: |
end: |
|
|
begin: qt.is_rational(Q) |
begin: qt.is_rational(Q) |
quote $B%G!<%?(B {Q} $B$,7A<0E*$KM-M}?t$N;~(B 1. |
quote $B%G!<%?(B {Q} $B$,7A<0E*$KM-M}?t$N;~(B 1. |
example: qt.is_rational(quote(1/2)); |
example: qt.is_rational(quote(1/2)); |
|
example: |
|
[1321] qt.is_rational(quote(1/2+4)); |
|
1 |
ref: qt.cancel_number |
ref: qt.cancel_number |
end: |
end: |
|
|
Line 147 begin: qt.parenthesis(Qobj) |
|
Line 151 begin: qt.parenthesis(Qobj) |
|
description: |
description: |
$B;29M(B; |
$B;29M(B; |
@itemize |
@itemize |
@item $B$^$@=q$$$F$J$$(B. |
@item $B$^$@<BAu$7$F$J$$(B. |
@item noro_simplify.rr $B$N(B @code{noro_simplify.remove_paren()} |
@item noro_simplify.rr $B$N(B @code{noro_simplify.remove_paren()} |
$B$,$9$G$K<B8=$E$_(B? |
$B$,$9$G$K<B8=$E$_(B? |
($B2C$($kJ}$O$@$a$_$?$$(B) |
($B2C$($kJ}$O$@$a$_$?$$(B) |
|
|
|
|
begin: qt.cancel_number(Q) |
begin: qt.cancel_number(Q) |
Quote {Q} $B$NCf$GM-M}?t$,$"$l$PDLJ,$9$k(B. |
Quote {Q} $B$NCf$GM-M}?t$,$"$l$PDLJ,$9$k(B. |
ref: qt.is_rational |
example: |
|
[1320] qt.cancel_number(quote(2/4)); |
|
quote(1/2) |
|
changelog: |
|
@itemize @bullet |
|
@item 2005.05.04, the initial version. Taylor $BE83+$N78?t$N4JLs$N$?$a$K:n@=(B. |
|
@end itemize |
|
ref: qt.is_rational |
end: |
end: |
|
|
begin: qt.add_paren(Q) |
begin: qt.add_paren(Q) |
Line 183 begin: qt.add_paren(Q) |
|
Line 194 begin: qt.add_paren(Q) |
|
end: |
end: |
|
|
begin: qt.add_paren0(Q) |
begin: qt.add_paren0(Q) |
$BL5>r7o$K(B {Q} $B$r(B ( ) $B$9$k(B. |
$BL5>r7o$K(B {Q} $B$r(B ({Q}) $B$K$9$k(B. |
end: |
end: |
|
|
|
begin: qt.map_arg(F,Q) |
|
$B4X?t(B F $B$r(B quote $B%G!<%?(B {Q} $B$N(B $B$9$Y$F$N%N!<%I$K:F5"E*$K(B |
|
apply $B$7$?(B quote $B%G!<%?$rLa$9(B. |
|
example: qt.map_arg(nn,quote(sin(@pi)+2/3)) |
|
nn(nn(sin(nn(@pi)))+nn(nn(2)/nn(3))) |
|
end: |
|
|
|
begin: qt.sin_int(Q) |
|
{Q} $B$,@0?t$J$i(B quote(0) $B$rLa$9(B. |
|
{Q} $B$,@0?t$G$J$$$J$i(B quote(sin(Q*@@pi)) $B$rLa$9(B. |
|
description: |
|
@itemize @bullet |
|
@item $B=q$-49$(5,B'$N1&JUMQ$N4X?t(B. |
|
@item tr.simp_sin (sin$B$r4^$`<0$N4JC12=$N%5%s%W%k<BAu(B)$B$d(B |
|
$BNc$N%W%m%0%i%`$GMxMQ$5$l$F$$$k(B. |
|
@end itemize |
|
changelog: |
|
@itemize @bullet |
|
@item 2005.04.02 $B$N=i4|HG$+$iB8:_$9$k4X?t$J$N$G;EMM$,8E$$(B. list $B$rLa$9(B. |
|
@item 2005.05.08 quote $B$rLa$9$h$&$K=q$-49$($?(B. $BL>A0$b$h$/$J$$$+$b(B, $B$7$+$7(B |
|
$B$H$j$"$($:$3$N$^$^(B. |
|
@end itemize |
|
ref: tr.simp_sin |
|
end: |
|
|
|
begin: qt.sin_int2(Q) |
|
ref: qt.sin_int |
|
end: |
|
|
|
begin: qt0021| |
|
@c -------------------------------------------------------------------- |
|
@section qt, quote $B$rJL$N$b$N$KJQ49$9$k(B. |
|
end: |
|
|
|
begin: qt.input_form(Q) |
|
{Q} $B$rJ8;zNs$KJQ49$9$k(B. |
|
{Q} $B$,%j%9%H(B, $B%Y%/%H%k(B, $B9TNs$N>l9g$K$O$=$NMWAG$rJ8;zNs$KJQ49$9$k(B. |
|
changelog: |
|
@itemize @bullet |
|
@item 2005.05.08, the initial version. |
|
qt.hc_etov $B$N7k2LI=<($K(B. quote_input_form $B$O(B Q $B$,%j%9%H$N>l9gITJX(B. |
|
@end itemize |
|
ref: quote_input_form, |
|
qt.hc_etov |
|
end: |
|
|
|
|
begin: qt003| |
begin: qt003| |
@c -------------------------------------------------------------------- |
@c -------------------------------------------------------------------- |
@section tr $B$=$NB>(B |
@section qt, quote $B$GJ,;6B?9`<0(B, $BQQ5i?t$r<B8=$9$k$?$a$NJd=u4X?t(B. |
end: |
end: |
|
|
|
begin: qt.gtlex(f,g) |
|
{f} $B$O(B {g} $B$h$j(B quote tree $B$N(B lex order $B$GBg$-$$(B. |
|
description: |
|
quote tree $B$N(B lex order $B$O<!$N$h$&$K7h$a$k(B. |
|
@itemize @bullet |
|
@item Todo; $B$^$@<BAu$7$F$J$$(B. |
|
@c 4/15 $BLk(B. $B<BAu$OL@F|9V5A$N=`Hw$N=*N;8e$+(B? |
|
@item $BITDj85$OITDj85$N=g=x(B. |
|
@item $BITDj85$h$j(B +, - , *, /, ^ $BEy$N(B node $B$OBg$-$$(B. |
|
$B$?$H$($P(B x < power(x,2) (power(x,2) $B$O(B x^2 $B$N0UL#(B) |
|
@item $B$"$H$O:F5"E*(B. times(x,y) < power(x,y) $B$@$,(B, |
|
times(x,y) $B$H(B times(p,q) $B$O(B x $B$H(B p $B$NHf3S(B, $B$3$l$G$-$^$i$J$$$J$i(B, |
|
y, q $B$NHf3S(B. |
|
@end itemize |
|
|
|
end: |
|
|
|
begin: qt.dtoq(F,V) |
|
$BJ,;6I=8=B?9`<0(B {F} $B$r(B quote $B$KJQ49$9$k(B. |
|
{V} $B$OJQ?t%j%9%H(B. |
|
description: |
|
@itemize @bullet |
|
@item $BJQ?t%j%9%H$,6u$N$H$-$O(B x_1, x_2, ... $B$rMQ$$$k(B. |
|
@end itemize |
|
example: |
|
F=dp_ptod((x-y-z)^3,[x,y]); |
|
qt.dtoq(F,[]); |
|
quote(x_1^3+(-3)*x_1^2*x_2+3*x_1*x_2^2+(-1)*x_2^3+(-3*z)*x_1^2 |
|
+6*z*x_1*x_2+(-3*z)*x_2^2+3*z^2*x_1+(-3*z^2)*x_2+(-z^3)) |
|
changelog: |
|
@itemize @bullet |
|
@item 2005/4/21, the initial version. |
|
@end itemize |
|
ref: qt.qtod |
|
end: |
|
|
|
begin: qt.qtod(F,V) |
|
quote {F} $B$r(B $BJ,;6I=8=B?9`<0$KJQ49$9$k(B. |
|
{V} $B$OJQ?t%j%9%H(B. |
|
description: |
|
@itemize @bullet |
|
@item $BJQ?t%j%9%H$,6u$N$H$-$O(B x_1, x_2, ... $B$rMQ$$$k(B. |
|
@item $B$^$@<BAu$7$F$J$$(B. |
|
@end itemize |
|
ref: qt.qtod |
|
end: |
|
|
|
|
begin: qt.vars(Q) |
begin: qt.vars(Q) |
{Q} $B$K8=$l$kJQ?t$rLa$9(B. |
{Q} $B$K8=$l$kJQ?t$rLa$9(B. |
description: @code{vars(Obj)} $B$N(B qt $BHG(B. |
description: @code{vars(Obj)} $B$N(B qt $BHG(B. |
Line 204 begin: qt.etov_pair(Q) |
|
Line 309 begin: qt.etov_pair(Q) |
|
{Q} $B$K(B p^q $B$N7A$N85$rC5$7$F(B [p,q] $B$r%j%9%H$K$7$FLa$9(B. |
{Q} $B$K(B p^q $B$N7A$N85$rC5$7$F(B [p,q] $B$r%j%9%H$K$7$FLa$9(B. |
description: |
description: |
@itemize @bullet |
@itemize @bullet |
@item @code{dp_etov} $B$NN`;w$r:n$k$?$a$N=`Hw(B(2005/05/04). |
@item $B$3$N4X?t$OLZ9=B$$NCf$N(B p^q $B$N7A$N85$r$9$Y$FC5:w$9$k(B. |
@end itemize |
@end itemize |
example: |
example: |
[2410] ctrl("print_quote",1); |
[2410] ctrl("print_quote",1); |
1 |
1 |
[2411] qt.etov_pair(quote(3*x^4*y^(-3))); |
[2411] qt.etov_pair(quote(3*x^4*y^(-3))); |
[[[internal,y],[u_op,(),[u_op,-,[internal,3]]]],[[internal,x],[internal,4]]] |
[[[internal,y],[u_op,(),[u_op,-,[internal,3]]]],[[internal,x],[internal,4]]] |
|
changelog: |
|
@itemize @bullet |
|
@item 2005.05.04, dp_etov $B$K;w$?4X?t$r(B qt $B$G:n$k$?$a$N=`Hw(B. |
|
@end itemize |
|
ref: qt.vars |
end: |
end: |
|
|
|
begin: qt.hm(Q) |
|
{Q} $B$NF,9`$rLa$9(B. |
|
example: |
|
[1314] Q=qt.dtoq(-4/3*<<1,4,5>>,[x,y,z]); |
|
quote((-4/3)*x*y^4*z^5) |
|
[1315] qt.hm(Q); |
|
quote((-4/3)) |
|
[1316] qt.hop(Q); |
|
* |
|
[1317] QQ=qt.rest(Q); |
|
quote(x*y^4*z^5) |
|
[1318] qt.hm(QQ); |
|
quote(x) |
|
[1319] qt.rest(QQ); |
|
quote(y^4*z^5) |
|
[1320] qt.hm(qt.rest(QQ)); |
|
quote(y^4) |
|
ref: qt.rest, qt.hop |
|
end: |
|
|
|
begin: qt.rest(Q) |
|
{Q}$B$,(B a+b+c+... $B$N;~(B b+c+...$B$rLa$9(B. dp_rest $B$N$^$M(B. |
|
description: |
|
@itemize @bullet |
|
@item I_BOP $B$N;~$KBh#20z?t$r(B flatten_quote $B$7$F$+$iLa$9(B. |
|
@end itemize |
|
example: |
|
[1667] load("taka_series.rr")$ |
|
[1668] Q=tkseries.expand1(cos(x),x,0,5); |
|
quote(1+(-1/2)*x^2+1/24*x^4+oO(x, 6)) |
|
[1769] qt.hm(qt.rest(Q)); |
|
quote((-1/2)*x^2) |
|
[1770] QQ=qt.rest(Q); |
|
quote((-1/2)*x^2+1/24*x^4+oO(x, 6)) |
|
changelog: |
|
@itemize @bullet |
|
@item 2005.05.04, tkseries.expand $B$N7k2L$KBP$7$F(B, |
|
$BKh2s(B flatten_quote $B$r$d$i$J$$$H:87k9gE*$K$J$i$J$$$N$O2?8N$+(B? |
|
BUG $B0BDjE*$KF0:n$9$k$+$I$&$+IT0B(B. |
|
@item 2005.05.04, $B$$$h$$$h(B $B78?t$H(B exponet $B%Y%/%H%k$N<h$j=P$7$r=q$/=`Hw$,40N;(B. |
|
@item 2005.05.05, Q=a*b $B$J$i(B qt.rest(Q) = b $B$H$J$k$h$&$KJQ99(B. |
|
$B78?t$N<h$j=P$7(B, exponent $B%Y%/%H%k$N<h$j=P$7$K$O$3$l$,JXMx(B. |
|
@end itemize |
|
ref: qt.hm, qt.hop, qt.dtoq, dp_hm, dp_rest |
|
end: |
|
|
|
begin: qt.hop(Q) |
|
{Q} $B$NF,@a$,(B binary operator (I_BOP) $B$N;~(B binary operator $B$NL>A0$rLa$9(B. |
|
changelog: |
|
@itemize @bullet |
|
@item 2005.05.05, $B;O$a$F$NHG(B. |
|
@end itemize |
|
end: |
|
|
|
begin: hc_etov(Q,V) |
|
quote {Q} $B$rJQ?t%j%9%H(B {V} $B$N%b%N%_%"%k$H$_$F(B, hc (leading coefficient) |
|
$B$H(B exponet $B%Y%/%H%k$r(B quote $B7?$GLa$9(B. |
|
description: |
|
Q = hc*p1*p2* ... $B$J$k7A$r2>Dj(B. $B$3$l0J30$N7A$G$OF0:nJ]>Z$J$7(B. |
|
example: |
|
[1967] R=qt.hc_etov(quote(-3/2*x*z^3),[x,y,z]); |
|
[<...quoted...>,[ <...quoted...> 0 <...quoted...> ]] |
|
[1968] qt.input_form(R); |
|
[quote(1*(-1)*3/2),[ quote(1) 0 quote(3) ]] |
|
changelog: |
|
@itemize @bullet |
|
@item 2005.05.05, |
|
qt.hc_etov(quote(-3/2*x*z^3),[x,y,z]); $B$G%F%9%H$9$k$b$^$@F0:n$X$s(B. |
|
@item if (A[0] == I_MINUS) $B$NItJ,$r$D$1$F2r7h(B. 05 $BLk(B. |
|
$B$^$@(B bug $B$,;D$k$+$b$7$l$:(B. |
|
@item Todo; qtodl (distributed poly in quote $B$r(B list $B7A<0$G(B). |
|
@item Todo; quote $B$N(B distributed poly $B$NHf3S(B. |
|
@item Todo; $BB?JQ?t$N%F%$%i!<E83+(B. $B%F%$%i!<E83+$N@Q(B. |
|
@item Todo; Asir $B%I%j%k$N(B 10 $B9T(B Buchberger $B%"%k%4%j%:%`$N<BAu$r$3$3$G(B |
|
$BDj5A$7$?(B quote $B4X?t$G=q$/(B. |
|
@end itemize |
|
end: |
|
|
|
|
begin: tr| |
begin: tr| |
|
|
@c -------------------------------------------------------------------- |
@c -------------------------------------------------------------------- |
Line 225 begin: tr.match0(Qobj,P) |
|
Line 414 begin: tr.match0(Qobj,P) |
|
$B$rLa$9(B. |
$B$rLa$9(B. |
example: tr.match0(quote(1+2*3),quote(pn(x)+pn(y))) |
example: tr.match0(quote(1+2*3),quote(pn(x)+pn(y))) |
x $B$K(B quote(1), y $B$K(B quote(2*3) |
x $B$K(B quote(1), y $B$K(B quote(2*3) |
tr.match0(quote(1+2*3),quote(pn(x)+pn(y,"qt.is_integer",y))) |
tr.match0(quote(1+2*3),quote(pn(x)+pn(y,qt.is_integer(y)))); |
qt.is_integer(2*3) $B$O(B 0 $B$J$N$G(B y $B$K$O%^%C%A$7$J$$(B. |
qt.is_integer(quote(2*3)) $B$O(B 0 $B$J$N$G(B y $B$K$O%^%C%A$7$J$$(B. |
|
example: |
|
[2991] tr.match0(quote(1),quote(pn(c,qt.is_dependent(c,x)))); |
|
0 |
|
[2992] tr.match0(quote(x^3+1),quote(pn(c,qt.is_dependent(c,x)))); |
|
1 |
end: |
end: |
|
|
begin: pn(X) |
begin: pn(X) |
pn(x) $B$OG$0U$N(B quote object $B$K%^%C%A$7(B, $BL>A0(B x $B$r$D$1$k(B. |
pn(x) $B$OG$0U$N(B quote object $B$K%^%C%A$7(B, $BL>A0(B x $B$r$D$1$k(B. |
|
quote $B$NCf$G;H$&FCJL$J4X?t5-9f(B. |
|
pn $B$O(B variable PatterN ($BJQ?t%Q%?!<%s(B)$B$NN,(B. |
description: |
description: |
tr.match0(quote(1+2*3),quote(pn(x)+pn(y))) $B$O(B 1 $B$rLa$9$,(B, |
tr.match0(quote(1+2*3),quote(pn(x)+pn(y))) $B$O(B 1 $B$rLa$9$,(B, |
tr.match0(quote(1+2*3),quote(pn(x)+pn(y,tr.is_integer,x))) $B$O(B 0 $B$r$b$I$9(B. |
tr.match0(quote(1+2*3),quote(pn(x)+pn(y,tr.is_integer(y)))) $B$O(B 0 $B$r$b$I$9(B. |
2*3 $B$O(B integer $B$+$i:n$i$l$?(B fnode $B$G$O$"$k$,(B integer $B$G$O$J$$$N$G(B qt.is_integer |
2*3 $B$O(B integer $B$+$i:n$i$l$?(B fnode $B$G$O$"$k$,(B integer $B$G$O$J$$$N$G(B qt.is_integer |
$B$,(B 0 $B$rLa$9$?$a(B. |
$B$,(B 0 $B$rLa$9$?$a(B. |
end: |
end: |
|
|
begin: tr.match0_act(Qobj,P,Act) |
|
quote $B%G!<%?(B {Qobj} $B$,(B $B%Q%?!<%s(B {P} $B$KE,9g$9$l$P(B {Act} $B$r8F$S=P$7$=$NCM$rLa$9(B. |
|
$B%Q%?!<%s(B {P} $B$K%^%C%A$7$J$$$H$-$O(B 0. |
|
|
|
example: tr.match0_act(quote(1+2*3),quote(pn(x)+pn(y)),[myadd,x,y]) |
|
end: |
|
|
|
begin: tr.or_match0_act(Qobj,Rules) |
|
end: |
|
|
|
begin: tr.apply_rule1(Qobj,P,Act) |
begin: tr.apply_rule1(Qobj,P,Act) |
quote $B%G!<%?(B {Qobj} $B$NLZ$rI}M%@hC5:w$7(B, |
quote $B%G!<%?(B {Qobj} $B$NLZ$rI}M%@hC5:w$7(B, |
$B%Q%?!<%s(B {P} $B$KE,9g$9$k$b$N$,$"$k$H$-$O(B {Act} $B$r8F$S=P$7$=$NCM$rLa$9(B. |
$B%Q%?!<%s(B {P} $B$KE,9g$9$k$b$N$,$"$k$H$-$O(B {Act} $B$r8F$S=P$7$=$NCM$rLa$9(B. |
Line 256 begin: tr.apply_rule1(Qobj,P,Act) |
|
Line 443 begin: tr.apply_rule1(Qobj,P,Act) |
|
$B%^%C%A$7$J$$>l9g$O(B Qobj $B$r$=$N$^$^La$9(B ($B$3$l$,:F5"E*$KE,MQ$5$l$k(B). |
$B%^%C%A$7$J$$>l9g$O(B Qobj $B$r$=$N$^$^La$9(B ($B$3$l$,:F5"E*$KE,MQ$5$l$k(B). |
|
|
description: |
description: |
$B$3$3$G(B sin_int(X) $B$O(B X $B$,(B integer $B$N;~$O(B quote(0) $B$rLa$7(B, |
$B$3$3$G(B qt.sin_int(X) $B$O(B X $B$,(B integer $B$N;~$O(B quote(0) $B$rLa$7(B, |
$B$=$&$G$J$$$H$-$O(B quote(sin(X*@@pi)) $B$rLa$9(B. |
$B$=$&$G$J$$$H$-$O(B quote(sin(X*@@pi)) $B$rLa$9(B. |
$B?<$5M%@h$G=q$-49$($r$9$k$K$O(B $B4X?t(B sin_int $B$NCf$G$^$?(B tr.apply_rule1 $B$r8F$S=P$;$P(B |
$B?<$5M%@h$G=q$-49$($r$9$k$K$O(B $B4X?t(B qt.sin_int $B$NCf$G$^$?(B |
$B$h$$(B. |
tr.apply_rule1 $B$r8F$S=P$;$P$h$$(B. |
|
|
example: tr.apply_rule1(quote(1+sin(2*@pi)),quote(sin(pn(x)*@pi)),[sin_int,x]) |
example: |
|
[2215] tr.apply_rule1(quote(1+sin(2*@pi)),quote(sin(pn(x)*@pi)), |
|
["qt.sin_int",x]); |
|
|
|
quote(1+0) |
end: |
end: |
|
|
|
|
|
|
begin: tr.make_binding(Qobj,P) |
begin: tr.make_binding(Qobj,P) |
end: |
end: |
|
|
|
begin: hoge41| |
|
@section tr $B4JC12=4X?t$N%5%s%W%k<BAu(B |
|
|
|
@itemize @bullet |
|
@item 2005.05.08 $B4JC12=4X?t$OCm0U?<$/<BAu$7$J$$$H(B, $BL58B%k!<%W$K$*$A$$$C$?$j(B, |
|
$B4JC12=$N$d$j$N$3$7$,$G$?$j$9$k(B. |
|
$B$H$j$"$($:$^$H$a$F$*$/$,(B, $B$3$l$i$N<BAu$O$^$@$^$@$G$"$k(B. |
|
@end itemize |
|
|
|
end: |
|
|
|
begin: tr.simp_zero(Q) |
|
$B<0(B {Q} $B$NCf$+$i(B 0 $B$d(B 1 $B$r$1$9(B. $B$?$H$($P(B 1*x $B$O(B x $B$X(B. 0*1 $B$O(B 0 $B$X(B. |
|
x+0 $B$O(B 0 $B$X(B. |
|
changelog: |
|
@itemize @bullet |
|
@item 2005.04 $B$N$*$o$j$K(B initial version? tkseries.expand1 $BMQ(B. |
|
@end itemize |
|
end: |
|
|
|
begin: tr.simp_unary(Q) |
|
"-"$B$r>C$9$h$&$K$9$k(B. $B$?$H$($P(B +-x $B$O(B -x $B$X(B. -(-x) $B$O(B x $B$X(B. |
|
changelog: |
|
@itemize @bullet |
|
@item 2005.04 $B$N$*$o$j$K(B initial version? tkseries.expand1 $BMQ(B. |
|
@end itemize |
|
end: |
|
|
|
begin: tr.simp_sin(Q) |
|
$B<0(B {Q} $B$NCf$N(B sin($B@0?t(B @@pi) $B$r(B 0 $B$K$9$k(B. |
|
example: |
|
[2217] tr.simp_sin(quote(sin(2*@pi)+sin(@pi/2))); |
|
quote(sin(@pi()/2)) |
|
changelog: |
|
@itemize @bullet |
|
@item 2005.04 $B$N$*$o$j$K(B initial version? tkseries.expand1 $BMQ(B. |
|
@item 2005.05.08 tr.simp_sin(quote(sin(2*sin((1/2)*@@pi)))); $B$OL58B%k!<%W(B bug. |
|
$B$^$@D>$7$F$J$$(B. |
|
@end itemize |
|
end: |
|
|
begin: zzz00| |
begin: zzz00| |
|
|
@section $BNcBj(B |
@section $BNcBj(B |
|
|
/* $B=`Hw(B */ |
/* $B=`Hw(B */ |
extern P,A; |
extern P,A; |
P=quote(sin(pn(x)*@pi)); /* $B%Q%?!<%s(B */ |
P=quote(sin(pn(x)*@pi)); /* $B%Q%?!<%s(B */ |
A=[sin_int,x] /* action, action $B4X?t(B */ |
A=["sin_int",x]; /* action, action $B4X?t(B */ |
def sin_int(X) { |
def sin_int(X) { |
X = tr.apply_rule1(X,P,A); /* $B;R6!$K(B [P,A] $B$r:F5"E*$KE,MQ(B */ |
X = tr.apply_rule1(X,P,A); /* $B;R6!$K(B [P,A] $B$r:F5"E*$KE,MQ(B */ |
if (qt.is_integer(X)) return qt.zero(); |
if (qt.is_integer(X)) return qt.zero(); |
else qt.replace(sin(y*@pi),[[y,X]]); /* sin(x*@pi) $B$r$=$N$^$^La$9(B.*/ |
else qt.replace(quote(sin(y*@pi)),[[y,X]]); |
|
/* sin(x*@pi) $B$r$=$N$^$^La$9(B.*/ |
} |
} |
|
|
/* $B7W;;(B */ |
/* $B7W;;(B */ |
Qobj=quote(1+sin(sin(2*@pi)*@pi)*sin((1/2)*@pi)); |
Qobj=quote(1+sin(sin(2*@pi)*@pi)*sin((1/2)*@pi)); |
tr.apply_rule1(Qobj,P,A); |
tr.apply_rule1(Qobj,P,A); |
|
example_description: |
|
$B%U%!%$%k$K%;!<%V$7$F<B9T$N$3$H(B. @code{Debug=1;} $B$H$9$k$HJQ7A$NMM;R$,$o$+$k(B. |
end: |
end: |
|
|
@c ------------------------------------------------------ |
@c ------------------------------------------------------ |
|
|
} |
} |
|
|
/* integral(c*f) => c*integral(f) */ |
/* integral(c*f) => c*integral(f) */ |
def qt.independent(F,X) { return !qt.dependent(F,X); } |
def is_independent(F,X) { return !qt.is_dependent(F,X); } |
S2=[quote(integral(pn(c,"qt.independent",c,x))*f)), |
S2=[quote(integral(pn(c,is_independent(c,x))*f)), |
[int_linear2,c,f]]; |
[int_linear2,c,f]]; |
def int_linear2(X,Y) { |
def int_linear2(X,Y) { |
return qt.replace(quote(c*integral(f)),[[c,X],[f,Y]]); |
return qt.replace(quote(c*integral(f)),[[c,X],[f,Y]]); |
} |
} |
|
|
apply_or_rules(quote(integral(a*x^2+x+2/x)),[S1,S2]); |
tr.apply_or_rules(quote(integral(a*x^2+x+2/x)),[S1,S2]); |
$B$3$l$r$3$l0J>e=q$-49$($,5/$-$J$$$^$G7+$jJV$9(B. |
$B$3$l$r$3$l0J>e=q$-49$($,5/$-$J$$$^$G7+$jJV$9(B. |
$B$3$N%k!<%k$N>l9gEz$($O(B |
$B$3$N%k!<%k$N>l9gEz$($O(B |
a*integral(x^2)+integral(x)+integral(2/x); |
a*integral(x^2)+integral(x)+integral(2/x); |
|
|
quote(integral(x^pn(n))) --> x^(n+1)/(n+1) or log(x) $B$r=q$/(B. |
quote(integral(x^pn(n))) --> x^(n+1)/(n+1) or log(x) $B$r=q$/(B. |
|
example: |
|
tr.match0(quote(c*x),quote(pn(c,is_independent(c,x))*f)); |
|
example_description: |
|
2005.05.08, Todo; Bug. $B$3$NNc$,@5$7$/F0$$$F$/$l$J$$(B. |
|
|
end: |
end: |
|
|
@c --------------------------------------------------------- |
@c --------------------------------------------------------- |
|
|
|
|
begin: zzz04|sortKey: zzz04 |
begin: zzz04|sortKey: zzz04 |
description: |
description: |
|
--------------------- 5/8 $B$3$3$^$G=$@5(B. ---------------------- |
|
|
$BNcBj(B $B4JC1$J9=J82r@O(B |
$BNcBj(B $B4JC1$J9=J82r@O(B |
|
|
example: |
example: |
|
todo; $B$3$NNc$O$^$@%A%'%C%/$7$F$J$$(B. |
$B<0(B(expression) $B$O(B $B<0(B+$B<0(B | $B<0(B*$B<0(B | ($B<0(B) | $B@0?t(B |
$B<0(B(expression) $B$O(B $B<0(B+$B<0(B | $B<0(B*$B<0(B | ($B<0(B) | $B@0?t(B |
|
|
extern R1,R2,R3,R4,S1,S2,S3,S4; |
extern R1,R2,R3,R4,S1,S2,S3,S4; |
|
|
|
|
end: |
end: |
|
|
|
begin: hoge001| |
|
@section Talor $BE83+(B (taka_series.rr $B$N2r@b(B) |
|
|
|
end: |
|
|
|
begin: tkseries.expand1(Q,X,A,N) |
|
{Q} $B$r(B $BJQ?t(B {X} $B$K4X$7$F(B, {X}={A} $B$N6aK5$G(B {N} $B<!$^$G(B |
|
Taylor $BE83+$9$k(B. |
|
|
|
description: |
|
@itemize @bullet |
|
@item qt $B%Q%C%1!<%8$H(B tr $B%Q%C%1!<%8$NNcBj$H$7$F=q$$$F$$$k(B. |
|
@item Bug $B$@$i$1$G$9(B. |
|
@item Todo; $BB?JQ?t$N(B Taylor $BE83+(B. |
|
@end itemize |
|
|
|
example: |
|
[1258] load("tr.rr"); |
|
1 |
|
[1359] load("taka_series.rr"); |
|
1 |
|
[1373] tkseries.expand1(cos(x),x,0,6); |
|
quote(1+(-1/2)*x^2+1/24*x^4+(-1/720)*x^6+oO(x, 7)) |
|
example_description: |
|
cos $B$NCM$N7W;;$K(B tr.simp_sin $B$rMQ$$$F$$$k(B. |
|
Bug; $B$3$N4X?t$OIT40A4$J$N$G(B, $B78?t$N7W;;$O$&$^$/9T$+$J$$>l9g$bB?$$(B. |
|
|
|
example: |
|
[1374] tkseries.expand1(quote(f(x)),x,0,3); |
|
quote(f(0)+calc_diff(f(0), 0)/1*x^1 |
|
+calc_diff(calc_diff(f(0), 0), 0)/2*x^2 |
|
+calc_diff(calc_diff(calc_diff(f(0), 0), 0), 0)/6*x^3+oO(x, 4)) |
|
example_description: |
|
Todo; f $B$NHyJ,$K(B 0$B$rBeF~$7$?$b$N$O(B f(0), f_1(0), f_2(0), ... |
|
($B$=$l$>$l(B f(0), f'(0), f''(0), ... $B$N0UL#(B) |
|
$B$H$7$?J}$,$$$$$@$m$&(B. |
|
|
|
changelog: |
|
@itemize @bullet |
|
@item 2005.04 $B$O$8$a$F$NHG(B. |
|
@end itemize |
|
|
|
end: |
|
|
|
begin: hoge002| |
|
|
|
@section $B5-9fHyJ,(B (taka_qtdiff.rr $B$N2r@b(B) |
|
|
|
$B$^$@<BAu$7$F$J$$(B. |
|
|
|
end: |
|
|
begin: exp| |
begin: exp| |
|
|
@c ------------------------------------------------ |
@c ------------------------------------------------ |
|
|
|
|
end: |
end: |
|
|
begin: qt.map_arg(F,Q) |
|
$B4X?t(B F $B$r(B quote $B%G!<%?(B {Q} $B$N(B $B$9$Y$F$N%N!<%I$K:F5"E*$K(B |
|
apply $B$7$?(B quote $B%G!<%?$rLa$9(B. |
|
example: qt.map_arg(nn,quote(sin(@pi)+2/3)) |
|
nn(nn(sin(nn(@pi)))+nn(nn(2)/nn(3))) |
|
end: |
|
|
|
begin: todo| |
begin: todo| |
|
|
Line 533 begin: powerSeries| |
|
Line 820 begin: powerSeries| |
|
|
|
$B6R5i?t$N<h07(B, dp $B$N(B pretty print $B$N$?$a(B. |
$B6R5i?t$N<h07(B, dp $B$N(B pretty print $B$N$?$a(B. |
qt.qttodp(Qobj | vlist, order?) quote $B$+$i(B dp $B$r:n$k(B. |
qt.qttodp(Qobj | vlist, order?) quote $B$+$i(B dp $B$r:n$k(B. |
exponent $B$,?t$G$J$$$H:n$l$:(B. |
exponent $B$,?t$G$J$$$H:n$l$:(B. |
qt.dptoqt(Qobj | vlist) dp $B$+$i(B quote $B$r:n$k(B. vlist $B$OB0@-$GBP1~(B? |
|
|
|
qt.expand, qt.sort, qt.ht, qt.rest, qt.mtov $B$b4pAC4X?t$H$7$FM_$7$$(B. |
qt.expand, qt.sort, qt.ht, qt.rest, qt.mtov $B$b4pAC4X?t$H$7$FM_$7$$(B. |
|
|
end: |
end: |
|
|
begin: MonomialSimplifier| |
begin: monomialSimplifier00| |
|
|
@subsection $B%b%N%_%"%k$rI8=`7A$X(B (builtin$B$G(B?) |
@section $B%b%N%_%"%k$rI8=`7A$X(B (builtin$B$G(B? Monomial $B$N(B simplifier) |
|
|
example: |
changelog; |
|
@quotation |
|
Monomial simplifier $B$rDL$7$F$+$i(B, |
|
$B%Q%?!<%s%^%C%A$r$7$J$$$H>l9g$o$1$,B?$9$.$k(B. |
|
$B$3$l$OI,?\$@$m$&(B. |
|
@end quotation |
|
|
|
Example; |
|
@example |
x^1 --> x |
x^1 --> x |
(x*y)*(z*t) --> x*y*z*t |
(x*y)*(z*t) --> x*y*z*t |
x*2*y*4 --> 8*x*y ($B;XDj$7$?JQ?t0J30$O2D49$H$9$k(B) |
x*2*y*4 --> 8*x*y ($B;XDj$7$?JQ?t0J30$O2D49$H$9$k(B) |
x*x^3 --> x^4 |
x*x^3 --> x^4 |
x*(-y)*z --> -x*y*z |
x*(-y)*z --> -x*y*z |
((x)) --> x $B$3$l$O(B noro_simplify.rr noro_simplify.remove_paren() $B$,BP1~(B |
((x)) --> x $B$3$l$O(B noro_simplify.rr noro_simplify.remove_paren() $B$,BP1~(B |
|
@end example |
|
|
end: |
end: |
|
|
4/15 $BLk(B. $B<BAu$OL@F|9V5A$N=`Hw$N=*N;8e$+(B? |
|
begin: qt.gtlex(f,g) |
|
{f} $B$O(B {g} $B$h$j(B quote tree $B$N(B lex order $B$GBg$-$$(B. |
|
description: |
|
quote tree $B$N(B lex order $B$O<!$N$h$&$K7h$a$k(B. |
|
@itemize |
|
@item $BITDj85$OITDj85$N=g=x(B. |
|
@item $BITDj85$h$j(B +, - , *, /, ^ $BEy$N(B node $B$OBg$-$$(B. |
|
$B$?$H$($P(B x < power(x,2) (power(x,2) $B$O(B x^2 $B$N0UL#(B) |
|
@item $B$"$H$O:F5"E*(B. times(x,y) < power(x,y) $B$@$,(B, |
|
times(x,y) $B$H(B times(p,q) $B$O(B x $B$H(B p $B$NHf3S(B, $B$3$l$G$-$^$i$J$$$J$i(B, |
|
y, q $B$NHf3S(B. |
|
@end itemize |
|
|
|
end: |
|
|
|
begin: qt.dtoq(F,V) |
|
$BJ,;6I=8=B?9`<0(B {F} $B$r(B quote $B$KJQ49$9$k(B. |
|
{V} $B$OJQ?t%j%9%H(B. |
|
description: |
|
@itemize @bullet |
|
@item $BJQ?t%j%9%H$,6u$N$H$-$O(B x_1, x_2, ... $B$rMQ$$$k(B. |
|
@item Changelog. 2005/4/21 |
|
@end itemize |
|
example: |
|
F=dp_ptod((x-y-z)^3,[x,y]); |
|
qt.dtoq(F,[]); |
|
quote(x_1^3+(-3)*x_1^2*x_2+3*x_1*x_2^2+(-1)*x_2^3+(-3*z)*x_1^2 |
|
+6*z*x_1*x_2+(-3*z)*x_2^2+3*z^2*x_1+(-3*z^2)*x_2+(-z^3)) |
|
ref: qt.qtod |
|
end: |
|
|
|
begin: qt.qtod(F,V) |
|
quote {F} $B$r(B $BJ,;6I=8=B?9`<0$KJQ49$9$k(B. |
|
{V} $B$OJQ?t%j%9%H(B. |
|
description: |
|
$BJQ?t%j%9%H$,6u$N$H$-$O(B x_1, x_2, ... $B$rMQ$$$k(B. |
|
ref: qt.qtod |
|
end: |
|