Annotation of OpenXM/src/asir-contrib/testing/tr-ja.oxt, Revision 1.1
1.1 ! takayama 1: /*&generate-prologue
! 2: */
! 3: $Id: tr.oxt,v 1.1 2005/04/01 08:07:19 taka Exp $
! 4: $OpenXM$
! 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:
! 11: @c --------------------------------------------------------------------
! 12: @section quote $B$KBP$9$k4pK\4X?t(B
! 13:
! 14: /*&usage begin: qt_node(Q)
! 15: quote $B%G!<%?(B {Q} $B$N(B node $B$r<h$j=P$9(B.
! 16: example: qt_node(quote(1+2*3))
! 17: end: */
! 18:
! 19:
! 20: /*&usage begin: qt_nchild(Q)
! 21: quote $B%G!<%?(B {Q} $B$N(B $B;R6!$N?t$rLa$9(B.
! 22: example: qt_nchild(quote(1+2*3)) 2 $B$rLa$9(B.
! 23: end: */
! 24:
! 25:
! 26: /*&usage begin: qt_child(Q,K)
! 27: quote $B%G!<%?(B {Q} $B$N(B {K} $BHVL\$N;R6!$rLa$9(B.
! 28: example: qt_child(quote(1+2*3),1) quote(2*3) $B$rLa$9(B.
! 29: end: */
! 30:
! 31: @c --------------------------------------------------------------------
! 32: @subsection quote $B$KBP$9$k=R8l(B
! 33:
! 34: /*&usage begin: qt_is_integer(Q)
! 35: quote $B%G!<%?(B {Q} $B$,@0?t$J$i(B 1
! 36: example: qt_is_integer(quote(0))
! 37: end: */
! 38:
! 39: /*&usage begin: qt_depend(Q,x)
! 40: quote $B%G!<%?(B {Q} $B$,ITDj85(B {x} $B$r4^$`$H(B 1, $B4^$^$J$$$H(B 0.
! 41: example: qt_depend(quote(1+1/x),x)
! 42: end: */
! 43:
! 44: @c --------------------------------------------------------------------
! 45: @subsection quote $B$KBP$9$k%3%s%9%H%i%/%?(B
! 46:
! 47: /*&usage begin: qt_zero()
! 48: quote 0 $B$rLa$9(B.
! 49: end: */
! 50:
! 51: /*&usage begin: qt_id(Qobj)
! 52: quote object {Qobj} $B$r$=$N$^$^La$9(B.
! 53: end: */
! 54:
! 55: /*&usage begin: qt_replace(Qobj,[[x,Valuex],[y,Valuey],...])
! 56: quote object {Qobj} $B$NCf$N(B x $B$r(B Valuex, y $B$r(B Valuey, ... $B$KCV$-49$($?(B
! 57: quote object $B$rLa$9(B.
! 58: end: */
! 59:
! 60: /*&usage begin: qt_parenthesis(Qobj)
! 61: quote object {Qobj} $B$NCf$N3g8L$,B-$j$J$$$H$-$K$OJd$$(B, $BB?$$$H$-$K$O<h$j5n$C$?(B
! 62: quote object $B$r:n$k(B.
! 63: +, *, /, ^, - $BEy$K$D$$$F$N(B asir $B$NJ8K!$G$N1i;;;R$N6/$5$r2>Dj$9$k(B.
! 64: end: */
! 65:
! 66:
! 67: @c --------------------------------------------------------------------
! 68: @section tr (term rewriting) $B$N%H%C%W%l%Y%k$N4X?t(B
! 69:
! 70: /*&usage begin: tr_match0(Qobj,P)
! 71: 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
! 72: $B$rLa$9(B.
! 73: example: tr_match0(quote(1+2*3),quote(pn(x)+pn(y)))
! 74: tr_match0(quote(1+2*3),quote(pn(x)+pn(y,qt_is_integer,x)))
! 75: end: */
! 76:
! 77: 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.
! 78: tr_match0(quote(1+2*3),quote(pn(x)+pn(y))) $B$O(B 1 $B$rLa$9$,(B,
! 79: 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.
! 80: 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
! 81: $B$,(B 0 $B$rLa$9$?$a(B.
! 82:
! 83: /*&usage begin: tr_match1(Qobj,P,Act)
! 84: 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.
! 85: $B%Q%?!<%s(B {P} $B$K%^%C%A$7$J$$$H$-$O(B 0.
! 86:
! 87: example: tr_match1(quote(1+2*3),quote(pn(x)+pn(y)),[myadd,x,y])
! 88: end: */
! 89:
! 90: /*&usage begin: tr_or_match1(Qobj,Rules)
! 91: end: */
! 92:
! 93: /*&usage begin: tr_apply_rule1(Qobj,P,Act)
! 94: quote $B%G!<%?(B {Qobj} $B$NLZ$rI}M%@hC5:w$7(B,
! 95: $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.
! 96: $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
! 97: tr_apply_rule1 $B$rE,MQ$9$k(B ($B$3$3$,(B tr_match1 $B$H$O0[$J$k(B).
! 98: $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).
! 99:
! 100: example: tr_apply_rule1(quote(1+sin(2*@pi)),quote(sin(pn(x)*@pi)),[sin_int,x])
! 101: end: */
! 102:
! 103: $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
! 104: $B$h$$(B.
! 105:
! 106: /*&usage begin: tr_apply_or_rules(Qobj,Rules)
! 107: end: */
! 108:
! 109: @c ---------------------------------------------------------
! 110: @section $BJQ?t%Q%?!<%s$H4X?t%Q%?!<%s(B
! 111:
! 112: $BNc(B:
! 113: pn(x)
! 114: pn(x,qt_is_integer(x))
! 115: fn(f)
! 116: fn(f,x,y)
! 117:
! 118: @c ---------------------------------------------------------
! 119: @section $B%Q%?!<%s(B
! 120:
! 121: $B%Q%?!<%s$O(B quote $B$GM?$($k(B.
! 122: $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.
! 123: $B$?$H$($P(B
! 124: quote(tr_and(pn(x,qt_is_integer),pn(x,qt_is_non_negative)))
! 125: $B$O(B x $B$,(B $B@0?t$G(B - $B$,@hF,$K$D$$$F$$$J$$>l9g%^%C%A$9$k(B.
! 126:
! 127: @c ---------------------------------------------------------
! 128: @section $BNcBj(B sin($B@0?t(B*@pi) $B$r(B 0 $B$K(B.
! 129:
! 130:
! 131: @c ---------------------------------------------------------
! 132: @section $BNcBj(B $BITDj@QJ,(B
! 133:
! 134: @c ---------------------------------------------------------
! 135: @section $BNcBj(B $B4JC1$J9=J82r@O(B
! 136:
! 137:
! 138: @c ---------------------------------------------------------
! 139: @section $BNcBj(B $BHs2D494D$N4JC1$J9=J82r@O(B
! 140:
! 141:
! 142:
! 143:
! 144:
! 145: /*&generate-epilogue
! 146: */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>