[BACK]Return to tr-ja.oxt CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-contrib / testing

Annotation of OpenXM/src/asir-contrib/testing/tr-ja.oxt, Revision 1.5

1.1       takayama    1: /*&generate-prologue
                      2: */
1.5     ! takayama    3: $Id: tr.oxt,v 1.17 2005/04/06 08:52:38 taka Exp $
        !             4: $OpenXM: OpenXM/src/asir-contrib/testing/tr-ja.oxt,v 1.4 2005/04/03 11:05:21 takayama Exp $
1.1       takayama    5:
                      6: $BCm0U(B: testing/tr.rr $B$G$O(B quote $B$r(B quotetolist $B$G(B list $B$KJQ49$7$F07$&$?$a(B,
                      7:       $B2<$N;EMM$H$O$3$H$J$j(B, list $B7?$G%G!<%?$rLa$9>l9g$bB?$$(B.
                      8:       $B%f!<%68@8l$G=q$$$F$$$k4X78>e(B pn(x) $B$r(B pn("x") $B$H$7$F$$$k(B.
                      9:       $BB>$K$bF1MM$J4X?t$,$"$j(B.
                     10:
1.5     ! takayama   11: $B$3$N%U%!%$%k$+$i(B texi $B%U%!%$%k$r:n@.$9$k$K$O0J2<$N$h$&$KF~NO$7$F2<$5$$(B.
        !            12: oxgentexi $B$O(B OpenXM/src/util $B$N2<$K$"$j$^$9(B.
        !            13:
        !            14: nkf -e tr.oxt | oxgentexi --noSorting --title 'Term rewriting functions for Risa/Asir' --author 'Nobuki Takayama' >t.texi
        !            15:
        !            16: begin: AAA01|
        !            17:
        !            18: @c ---------------------------------------------------------
        !            19: @section $BJQ?t%Q%?!<%s$H4X?t%Q%?!<%s(B
        !            20:
        !            21:
        !            22: $BJQ?t%Q%?!<%s(B
        !            23:
        !            24: pn(x)                    $BG$0U$N$b$N$K%^%C%A(B. $B%^%C%A$7$?$b$N$r(B x $B$K(B bind.
        !            25: pn(x,qt_is_integer(x))
        !            26:
        !            27: Todo; fn $B$OB?J,$$$i$J$$(B. qt_is_function(x) $B$G(B OK.
        !            28: fn(f)                    $BG$0U$N4X?t$K%^%C%A(B. $B%^%C%A$7$?4X?tL>$r(B f $B$K(B bind.
        !            29: 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.
        !            30:                          f $B$N0z?t$r(B x, y $B$K(B bind
        !            31:
        !            32:
        !            33: $B%Q%?!<%s$O(B quote $B$GM?$($k(B.
        !            34: $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.
        !            35: $B$?$H$($P(B
        !            36: quote(tr_and(pn(x,qt_is_integer),pn(x,qt_is_non_negative(x))))
        !            37: $B$O(B x $B$,(B $B@0?t$G(B - $B$,@hF,$K$D$$$F$$$J$$>l9g%^%C%A$9$k(B.
        !            38:
        !            39: end:
        !            40:
        !            41: begin: AAA02|
1.4       takayama   42:
1.1       takayama   43: @section quote $B$KBP$9$k4pK\4X?t(B
                     44:
1.5     ! takayama   45: end:
        !            46:
        !            47:
1.4       takayama   48: begin: qt_node(Q)
1.1       takayama   49:  quote $B%G!<%?(B {Q} $B$N(B node $B$r<h$j=P$9(B.
                     50:  example: qt_node(quote(1+2*3))
1.4       takayama   51: end:
1.1       takayama   52:
                     53:
1.4       takayama   54: begin: qt_nchild(Q)
1.1       takayama   55:  quote $B%G!<%?(B {Q} $B$N(B $B;R6!$N?t$rLa$9(B.
                     56:  example: qt_nchild(quote(1+2*3))     2 $B$rLa$9(B.
1.4       takayama   57: end:
1.1       takayama   58:
                     59:
1.4       takayama   60: begin: qt_child(Q,K)
1.1       takayama   61:  quote $B%G!<%?(B {Q} $B$N(B {K} $BHVL\$N;R6!$rLa$9(B.
                     62:  example: qt_child(quote(1+2*3),1)     quote(2*3) $B$rLa$9(B.
1.3       takayama   63:  example: qt_child(quote(1+2*3),0)     quote(1) $B$rLa$9(B.
1.4       takayama   64: end:
1.1       takayama   65:
                     66: @c --------------------------------------------------------------------
                     67: @subsection quote $B$KBP$9$k=R8l(B
                     68:
1.4       takayama   69: begin: qt_is_integer(Q)
1.1       takayama   70:  quote $B%G!<%?(B {Q} $B$,@0?t$J$i(B 1
                     71:  example: qt_is_integer(quote(0))
1.4       takayama   72: end:
1.1       takayama   73:
1.4       takayama   74: begin: qt_depend(Q,x)
1.1       takayama   75:  quote $B%G!<%?(B {Q} $B$,ITDj85(B {x} $B$r4^$`$H(B 1, $B4^$^$J$$$H(B 0.
                     76:  example: qt_depend(quote(1+1/x),x)
1.4       takayama   77: end:
                     78:
                     79: begin: qt_is_function(Q)
                     80:  quote $B%G!<%?(B {Q} $B$,4X?t$N$H$-(B 1, $B$=$&$G$J$$$H$-(B 0.
                     81:  example: qt_is_function(f(x,y));
                     82: end:
1.1       takayama   83:
                     84: @c --------------------------------------------------------------------
                     85: @subsection quote $B$KBP$9$k%3%s%9%H%i%/%?(B
                     86:
1.4       takayama   87: begin: qt_zero()
1.1       takayama   88:  quote 0 $B$rLa$9(B.
1.4       takayama   89: end:
1.1       takayama   90:
1.4       takayama   91: begin: qt_id(Qobj)
1.1       takayama   92:  quote object {Qobj} $B$r$=$N$^$^La$9(B.
1.4       takayama   93: end:
1.1       takayama   94:
1.4       takayama   95: begin: qt_replace(Qobj,[[x,Valuex],[y,Valuey],...])
1.1       takayama   96:    quote object {Qobj} $B$NCf$N(B x $B$r(B Valuex, y $B$r(B Valuey, ... $B$KCV$-49$($?(B
                     97:    quote object $B$rLa$9(B.
1.5     ! takayama   98:    description:
        !            99:     $B2]Bj(B; x, y $B$OBgJ8;z$b5v$9$+(B? @var{Qobj} $B$b85!94^$^$l$F$$$kBgJ8;z$rI>2A$7$FCV$-49$($k(B
        !           100:     $B4X?t$bI,MW$+(B?
        !           101:
1.3       takayama  102:    example: qt_replace(quote(sin(x*@pi)), [[x,quote( (2*t+3) )]])
1.4       takayama  103: end:
1.1       takayama  104:
1.3       takayama  105:    qt_replace $B$O(B asir-contrib $B$N(B base_replace $B$H;w$?5!G=(B.
                    106:    quote $B$NFbIt$KBgJ8;z$G$O$8$^$kJQ?t(B($BI>2A$9$k(B)$B$,=q$1$J$$$?$a(B.
                    107:
1.4       takayama  108: begin: qt_parenthesis(Qobj)
1.1       takayama  109:    quote object {Qobj} $B$NCf$N3g8L$,B-$j$J$$$H$-$K$OJd$$(B, $BB?$$$H$-$K$O<h$j5n$C$?(B
                    110:    quote object $B$r:n$k(B.
1.3       takayama  111:    +, *, /, ^, - $BEy$K$D$$$F(B asir $B$NJ8K!$G$N1i;;;R$N6/$5$r2>Dj$9$k(B.
1.5     ! takayama  112:   description:
        !           113:   $B;29M(B;
        !           114:    noro_simplify.rr  $B$N(B @code{remove_paren()} $B$,$9$G$K<B8=$E$_(B?
        !           115:    @code{flatten()} $B$d(B @code{quote_to_funargs()} $B$rMxMQ$7$F$kLOMM(B.
        !           116:
1.4       takayama  117: end:
1.1       takayama  118:
1.4       takayama  119: begin: qt_eval(Qobj,type)
1.2       takayama  120:    Qobj $B$r(B asir $B$NB>$N(B object $B$KJQ49(B.
1.5     ! takayama  121:   description:
        !           122:    @code{eval_quote()} $B$,$9$G$K<B8=$E$_(B.
        !           123:
1.4       takayama  124: end:
1.2       takayama  125:
1.4       takayama  126: begin: qt_(Obj)
1.2       takayama  127:    asir $B$N(B Obj $B$r(B quote $B7?$KJQ49(B.
1.5     ! takayama  128:    description:
        !           129:      @code{objtoquote()} $B$,$9$G$K<B8=$E$_(B.
        !           130:
1.4       takayama  131: end:
1.2       takayama  132:
1.1       takayama  133:
1.5     ! takayama  134: begin: tr|
        !           135:
1.1       takayama  136: @c --------------------------------------------------------------------
                    137: @section tr (term rewriting) $B$N%H%C%W%l%Y%k$N4X?t(B
                    138:
1.5     ! takayama  139: end:
        !           140:
1.4       takayama  141: begin: tr_match0(Qobj,P)
1.1       takayama  142:  quote $B%G!<%?(B {Qobj} $B$,(B $B%Q%?!<%s(B {P} $B$KE,9g$9$l$P(B 1 $B$rLa$7(B, $B$=$&$G$J$1$l$P(B 0
                    143:  $B$rLa$9(B.
1.3       takayama  144:  example: tr_match0(quote(1+2*3),quote(pn(x)+pn(y)))
                    145:                  x $B$K(B quote(1), y $B$K(B quote(2*3)
                    146:           tr_match0(quote(1+2*3),quote(pn(x)+pn(y,qt_is_integer,y)))
                    147:                  qt_is_integer(2*3) $B$O(B 0 $B$J$N$G(B y $B$K$O%^%C%A$7$J$$(B.
1.4       takayama  148: end:
1.1       takayama  149:
1.4       takayama  150: begin: pn(X)
                    151:   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.
                    152: description:
                    153:   tr_match0(quote(1+2*3),quote(pn(x)+pn(y)))  $B$O(B 1 $B$rLa$9$,(B,
                    154:   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.
                    155:   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
                    156:   $B$,(B 0 $B$rLa$9$?$a(B.
                    157: end:
1.1       takayama  158:
1.4       takayama  159: begin: tr_match0_act(Qobj,P,Act)
1.1       takayama  160:  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.
                    161:  $B%Q%?!<%s(B {P} $B$K%^%C%A$7$J$$$H$-$O(B 0.
                    162:
1.4       takayama  163:  example: tr_match0_act(quote(1+2*3),quote(pn(x)+pn(y)),[myadd,x,y])
                    164: end:
1.1       takayama  165:
1.4       takayama  166: begin: tr_or_match0_act(Qobj,Rules)
                    167: end:
1.1       takayama  168:
1.4       takayama  169: begin: tr_apply_rule1(Qobj,P,Act)
1.1       takayama  170:  quote $B%G!<%?(B {Qobj} $B$NLZ$rI}M%@hC5:w$7(B,
                    171:  $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.
                    172:  $B$D$^$j(B top node $B$,(B {P} $B$KE,9g$9$k$+D4$Y(B, $BE,9g$7$J$$>l9g$O$=$N;R6!$K(B
1.3       takayama  173:   tr_apply_rule1 $B$rE,MQ$9$k(B ($B$3$3$,(B tr_match_act $B$H$O0[$J$k(B).
1.1       takayama  174:  $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).
                    175:
1.4       takayama  176: description:
1.3       takayama  177:  $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,
1.5     ! takayama  178:  $B$=$&$G$J$$$H$-$O(B quote(sin(X*@@pi)) $B$rLa$9(B.
1.1       takayama  179:  $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
                    180:  $B$h$$(B.
                    181:
1.4       takayama  182:  example: tr_apply_rule1(quote(1+sin(2*@pi)),quote(sin(pn(x)*@pi)),[sin_int,x])
                    183: end:
                    184:
                    185:
                    186: begin: tr_apply_or_rules(Qobj,Rules)
                    187: end:
1.1       takayama  188:
1.2       takayama  189: @subsection $BFbIt4X?t(B
                    190:
1.4       takayama  191: begin: tr_apply_function0(Qobj,BindingTable)
                    192: end:
1.2       takayama  193:
1.4       takayama  194: begin: tr_rp(Qobj,P,A)
                    195: end:
1.2       takayama  196:
1.4       takayama  197: begin: tr_make_binding(Qobj,P)
                    198: end:
1.2       takayama  199:
1.1       takayama  200:
1.5     ! takayama  201: begin: zzz00|
1.4       takayama  202:
1.5     ! takayama  203: @section $BNcBj(B
1.1       takayama  204:
1.4       takayama  205: end:
1.1       takayama  206:
1.5     ! takayama  207: begin: zzz01|
        !           208: $BNcBj(B  sin($B@0?t(B*@@pi) $B$r(B 0 $B$K(B.
1.4       takayama  209: example:
1.2       takayama  210:    /* $B=`Hw(B */
                    211:    extern P,A;
                    212:    P=quote(sin(pn(x)*@pi));  /* $B%Q%?!<%s(B */
                    213:    A=[sin_int,x]             /* action, action $B4X?t(B */
                    214:    def sin_int(X) {
                    215:      X = tr_apply_rule1(X,P,A); /* $B;R6!$K(B [P,A] $B$r:F5"E*$KE,MQ(B */
                    216:      if (qt_is_integer(X)) return qt_zero();
                    217:      else qt_replace(sin(y*@pi),[[y,X]]);  /* sin(x*@pi) $B$r$=$N$^$^La$9(B.*/
                    218:    }
                    219:
                    220:    /* $B7W;;(B */
                    221:    Qobj=quote(1+sin(sin(2*@pi)*@pi)*sin((1/2)*@pi));
                    222:    tr_apply_rule1(Qobj,P,A);
1.4       takayama  223: end:
1.2       takayama  224:
1.4       takayama  225: @c ------------------------------------------------------
                    226: @section $BNcBj(B Mathematica $B$N(B N[ ] $BAjEv$N4X?t$r%f!<%6$,=q$1$k$h$&$K(B.
                    227:
1.5     ! takayama  228: begin: zzz02|
1.4       takayama  229: $BNcBj(B Mathematica $B$N(B N[ ] $BAjEv$N4X?t$r%f!<%6$,=q$1$k$h$&$K(B.
                    230: example:
                    231:     nn(sin(cos(@pi)+sqrt(2)))
                    232:     --> nn(sin(nn(cos(nn(@pi)))+nn(sqrt(nn(2)))))
                    233:    Prog; test1-tr.rr $B$N(B test4().
                    234:
                    235:   qt_map_arg $B4X?t$rMQ$$$k(B.
                    236:   def test4() {
                    237:     Rule=[quote(nn(pn(f))),[qt_map_arg,nn,f]];
                    238:     /* nn $B$G0O$^$l$?$b$N$,$"$l$P(B, nn $B$r$=$NFbIt$K:F5"E*$K(B apply $B$9$k(B */
                    239:     R0 = quote(nn(sin(1/2)*cos(1/3)));
                    240:     print(print_input_form(R0));
                    241:     R=tr_apply_rule1(R0,Rule[0],Rule[1]);
                    242:     return R;
                    243:   }
                    244:
                    245: end:
1.1       takayama  246:
                    247: @c ---------------------------------------------------------
                    248: @section $BNcBj(B  $BITDj@QJ,(B
                    249:
1.5     ! takayama  250: begin: zzz03|
1.4       takayama  251: $BNcBj(B  $BITDj@QJ,(B
                    252: example:
1.2       takayama  253:    /* integral(f+g) => integral(f)+integral(g) */
                    254:    S1=[quote(integral(pn(f)+pn(g))),
                    255:        [int_linear1,f,g]];
                    256:    def int_linear1(X,Y) {
                    257:       return qt_replace(quote(integral(f)+integral(g)),[[f,X],[g,Y]]);
                    258:    }
                    259:
                    260:    /* integral(c*f) => c*integral(f) */
                    261:    def qt_independent(F,X) { return !qt_dependent(F,X); }
                    262:    S2=[quote(integral(pn(c,qt_independent(c,x))*f)),
                    263:        [int_linear2,c,f]];
                    264:    def int_linear2(X,Y) {
                    265:       return qt_replace(quote(c*integral(f)),[[c,X],[f,Y]]);
                    266:    }
                    267:
                    268:    apply_or_rules(quote(integral(a*x^2+x+2/x)),[S1,S2]);
                    269:    $B$3$l$r$3$l0J>e=q$-49$($,5/$-$J$$$^$G7+$jJV$9(B.
                    270:    $B$3$N%k!<%k$N>l9gEz$($O(B
                    271:    a*integral(x^2)+integral(x)+integral(2/x);
                    272:
                    273:    quote(integral(x^pn(n))) --> x^(n+1)/(n+1) or log(x) $B$r=q$/(B.
1.4       takayama  274: end:
1.2       takayama  275:
1.1       takayama  276: @c ---------------------------------------------------------
                    277: @section $BNcBj(B  $B4JC1$J9=J82r@O(B
                    278:
1.5     ! takayama  279: begin: zzz04|sortKey: zzz04
        !           280: description:
        !           281:
1.4       takayama  282: $BNcBj(B  $B4JC1$J9=J82r@O(B
1.5     ! takayama  283:
1.4       takayama  284: example:
1.2       takayama  285:    $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
                    286:
                    287:    extern R1,R2,R3,R4,S1,S2,S3,S4;
                    288:    /* $BJ8K!$rK~$?$9$+$I$&$+$N(B check $BMQ(B. Action $BIt$O(B 1 $B$+(B 0 */
                    289:    R1=[quote(pn(x,is_expression(x))+pn(y,is_expression(y))), 1];
                    290:    R2=[quote(pn(x,is_expression(x))*pn(y,is_expression(y))), 1];
                    291:    R3=[quote((pn(x,is_expression(x)))), 1];
                    292:    R4=[quote(pn(x,qt_is_integer(x))), 1];
                    293:    def is_expression(Qobj) {
                    294:      R = [R1,R2,R3,R4];
                    295:      A = apply_or_match0(Qobj,R);
                    296:      if (A == 0) return 0; else return 1;
                    297:    }
                    298:
                    299:    /* $B7W;;MQ(B. R1,R2,R3,R4 $B$H:8$O6&DL(B. */
                    300:    S1=[quote(pn(x,is_expression(x))+pn(y,is_expression(y))), [myadd,x,y]];
                    301:    S2=[quote(pn(x,is_expression(x))*pn(y,is_expression(y))), [mymul,x,y]];
                    302:    S3=[quote((pn(x,is_expression(x)))), [qt_id,x]];
                    303:    S4=[quote(pn(x,qt_is_integer(x))), [qt_id,x]];
                    304:
                    305:    def eval_expression(Qobj) {
                    306:      S = [S1,S2,S3,S4];
                    307:      return apply_or_rules(Qobj,S);
                    308:    }
                    309:
                    310:    def myadd(X,Y) {
                    311:      return qt_(qt_eval(X,1)+qt_eval(Y,1));
                    312:    }
                    313:
                    314:    def mymul(X,Y) {
                    315:      return qt_(qt_eval(X,1)*qt_eval(Y,1));
                    316:    }
                    317:
                    318:    /* $B7W;;(B */
                    319:    tr_eval_expression(quote(1+2*(3+15)));
1.4       takayama  320: end:
1.1       takayama  321:
1.5     ! takayama  322: begin: misc|
        !           323:
        !           324: @section $B9M$(J}$K$D$$$F$N35@b(B
        !           325:
        !           326:  $B%H%C%W%l%Y%k$N4X?tC#(B.  (stylesheet $B$N9M$($K;w$F$k(B.)
        !           327:
        !           328:   iterator $B$N0l<o(B.
        !           329:
        !           330:   yacc $B$K;w$F$k(B.
        !           331:
        !           332: @section $B%G%P%C%,!<(B
        !           333:
        !           334:   $BA*Br$9$Y$-%k!<%k$,Bt;3$"$k$H$-$O(B, $B7Y9p$9$k5!G=(B.
        !           335:
        !           336:   $BL58B%k!<%W$N(B|$B8!=P(B.
        !           337:
        !           338: end:
        !           339:
        !           340: begin: exp|
        !           341:
        !           342: @c ------------------------------------------------
        !           343: @section $B<B83E*4X?t(B
        !           344:
        !           345: end:
        !           346:
        !           347: begin: qt_map_arg(F,Q)
        !           348:  $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
        !           349:  apply $B$7$?(B quote $B%G!<%?$rLa$9(B.
        !           350:  example: qt_map_arg(nn,quote(sin(@pi)+2/3))
        !           351:            nn(nn(sin(nn(@pi)))+nn(nn(2)/nn(3)))
        !           352: end:
        !           353:
        !           354: begin: todo|
        !           355:
        !           356: @section  Todo
        !           357:
        !           358: @subsection $B%f!<%6Dj5A$NCfCV1i;;;R(B
        !           359:
        !           360:    tfb $B$N=q$-J}$rF3F~(B.
1.1       takayama  361:
1.5     ! takayama  362: @subsection $B?t3X$h$j$NNcBj(B
1.1       takayama  363:
1.5     ! takayama  364: $B?t3XE*$K$*$b$7$m$$NcBj$r$J$k$Y$/Bt;3MQ0U$9$k(B.
        !           365: $B$3$l$i$NNcBj$KBP$7$F(B tr $B$,;n:nIJ$r:n$k$N$KM-8z$G$"$k$H$$$&$3$H$r$$$&(B.
1.1       takayama  366:
1.5     ! takayama  367:  $BNc(B; gcd $B7W;;$NB?9`<0(B reduction $B$r(B tr $B$G<B8=(B.
1.3       takayama  368:
1.4       takayama  369:  $BNc(B; $BQQ5i?t$N7W;;$r(B quote $B$G<B8=(B.
1.3       takayama  370:         sort $B$d(B expand $B$OAH$_9~$_$G(B.
                    371:
1.4       takayama  372:  $BNc(B; Mathematica $B$N(B Expand[], Toghether[] $BAjEv$N$b$N(B.
1.3       takayama  373:
1.4       takayama  374:  $BNc(B; D $B$N3]$1;;$r(B $B%Q%?!<%s%^%C%A$G<B8=(B.
1.5     ! takayama  375:     holonomic $B4X?t$r78?t$H$9$kHyJ,:nMQAG4D$G$N7W;;(B.
1.3       takayama  376:
1.4       takayama  377:  $BNc(B; (x^(1/n))^n --> x $BEy(B.
1.3       takayama  378:
1.4       takayama  379:  $BNc(B; $B5-9fHyJ,$HHyJ,4D$G$N7W;;(B.
                    380:        y''+xy=0,  y''=y^2+x $BEy(B.  index $BIU$-$NJQ?t@8@.$,I,MW(B. idxtov
1.3       takayama  381:
1.4       takayama  382:  $BNc(B; QE, $BO@M}<0(B.
1.3       takayama  383:
1.5     ! takayama  384:  $BNc(B; $B30@QBe?t(B.
        !           385:
        !           386:  $BNc(B; $B4dGH(B, $B1~MQ?t3X(B, $B?@J]$N%=%j%H%s$NK\$K$"$k$h$&$J(B fermion $BEy$NNc(B.
1.3       takayama  387:
                    388:
1.5     ! takayama  389:  $BNc(B;
        !           390:    Bergman, George M.
        !           391:    The diamond lemma for ring theory.
        !           392:    Advances in Math. 29 (1978), no. 2, 178--218.
        !           393:    $B$K$"$k$h$&$JHs2D49Be?t$NNc(B.
1.4       takayama  394:
                    395: end:
                    396:
1.5     ! takayama  397: begin: new-functions|
        !           398:
1.3       takayama  399: @section   $B$^$@%9%1%C%A$N$_$N4X?t;EMM(B
                    400:
1.5     ! takayama  401:   qt_ltor, qt_rtol ; $BLZ$N9=B$$NJQ49(B; $BNc(B (x*y)*z --> x*(y*z)
        !           402:
        !           403:
        !           404: @subsection Index $B$D$-JQ?t(B
1.3       takayama  405:
                    406:   idxtov(x,i)  x_i $B$r@8@.(B.  x_i $B$N(B index (idx) $BB0@-(B $B$r(B i $B$K(B.
                    407:                                     base_name $BB0@-$r(B  x $B$K(B.
                    408:   idxtov(x,[i,j])  x_i_j $B$r@8@.(B.  x_i_i $B$N(B index (idx) $BB0@-(B $B$r(B [i,j] $B$K(B.
                    409:   vtoidx(x_i) $B$O(B i $B$rLa$9(B. $BB0@-$N8!:w$J$N$G9bB.(B. idx $BB0@-$,L5$$>l9g$O(B i $B$r@_Dj(B.
                    410:
                    411:   idxtov $B4X?t$O(B $B4X?tL>$K$b;H$($k$h$&$K$9$k(B --> $BHyJ,4DBP1~(B.
                    412:
                    413:   qt_function($BL>A0(B, $B0z?t(B) --> quote($BL>A0(B($B0z?t(B)) $B$r@8@.(B.
                    414:    index $BIU$-4X?t$OHyJ,4D$N<h07$KI,MW(B.
                    415:
1.5     ! takayama  416: @subsection $BQQ5i?t(B, dp $B$N(B pretty print.
        !           417:
1.3       takayama  418:   $B6R5i?t$N<h07(B, dp $B$N(B pretty print $B$N$?$a(B.
                    419:   qt_qttodp(Qobj | vlist,  order?)  quote $B$+$i(B dp $B$r:n$k(B.
                    420:        exponent $B$,?t$G$J$$$H:n$l$:(B.
                    421:   qt_dptoqt(Qobj | vlist)  dp $B$+$i(B quote $B$r:n$k(B.  vlist $B$OB0@-$GBP1~(B?
1.1       takayama  422:
1.3       takayama  423:   qt_expand, qt_sort, qt_ht, qt_rest, qt_mtov $B$b4pAC4X?t$H$7$FM_$7$$(B.
1.5     ! takayama  424:
        !           425: end:
1.1       takayama  426:
                    427: /*&generate-epilogue
                    428: */

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