Go to the first, previous, next, last section, table of contents.


nqt_match_rewrite

nqt_match_rewrite(Expr,Rule,Mode)
:: ExprRule に従い書き換える.
return
quote型
Expr
quote型
Rule
[Pattern,Action] かまたは [Pattern,Condition,Action]. これらの要素はすべて quote型.
Mode
整数
ctrl("print_quote",2);
nqt_match_rewrite(`x*y*z,[`X*Y,`X+Y],1);
   出力: (x)+((y)*(z))
A=`x*x;
nqt_match_rewrite(A,[`X*Y,`X+Y],1);
   出力: x^2   (マッチしていない)
nqt_match_rewrite(A,[`X*Y,`X+Y],2);
   出力: 2*x

適合についてのモードの違いを理解するために次の例および fnode標準形(qt_normalize) を参照.
quotetolist(qt_normalize(`x*x,0));
    出力:  [b_op,^,[internal,x],[internal,2]]
quotetolist(qt_normalize(`x*x,1));
    出力:  [b_op,^,[internal,x],[internal,2]]
quotetolist(qt_normalize(`x*x,2));
    出力:  [n_op,*,[internal,x],[internal,x]]
参照
section nqt_match, section qt_rewrite, section qt_normalize

ChangeLog


Go to the first, previous, next, last section, table of contents.