From: Robert D. <rob...@us...> - 2005-10-31 15:40:35
|
Update of /cvsroot/maxima/maxima/doc/info In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14763 Modified Files: Rules.texi Log Message: Updated and clarified description of remrule, added examples. Index: Rules.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/Rules.texi,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Rules.texi 16 Jun 2005 17:05:36 -0000 1.19 +++ Rules.texi 31 Oct 2005 15:40:16 -0000 1.20 @@ -609,16 +609,64 @@ @deffn {Function} remrule (@var{op}, @var{rulename}) @deffnx {Function} remrule (@var{op}, all) -Removes rules defined by @code{defrule}, @code{defmatch}, @code{tellsimp}, or @code{tellsimpafter}. +Removes rules defined by @code{tellsimp} or @code{tellsimpafter}. @code{remrule (@var{op}, @var{rulename})} removes the rule with the name @code{rulename} from the operator @var{op}. +When @var{op} is a built-in or user-defined operator +(as defined by @code{infix}, @code{prefix}, etc.), +@var{op} and @var{rulename} must be enclosed in double quote marks. -@code{remrule (@var{function}, all)} removes all rules for the operator @var{op}. +@code{remrule (@var{op}, all)} removes all rules for the operator @var{op}. See also @code{remlet}, which removes a rule defined by @code{let}. -@c NEEDS EXAMPLES +Examples: + +@c ===beg=== +@c tellsimp (foo (aa, bb), bb - aa); +@c tellsimpafter (aa + bb, special_add (aa, bb)); +@c infix ("@@"); +@c tellsimp (aa @@ bb, bb/aa); +@c tellsimpafter (quux (%pi, %e), %pi - %e); +@c tellsimpafter (quux (%e, %pi), %pi + %e); +@c [foo (aa, bb), aa + bb, aa @@ bb, quux (%pi, %e), quux (%e, %pi)]; +@c remrule (foo, foorule1); +@c remrule ("+", "+rule1"); +@c remrule ("@@", "@@rule1"); +@c remrule (quux, all); +@c [foo (aa, bb), aa + bb, aa @@ bb, quux (%pi, %e), quux (%e, %pi)]; +@c ===end=== +@example +(%i1) tellsimp (foo (aa, bb), bb - aa); +(%o1) [foorule1, false] +(%i2) tellsimpafter (aa + bb, special_add (aa, bb)); +(%o2) [+rule1, simplus] +(%i3) infix ("@@"); +(%o3) @@ +(%i4) tellsimp (aa @@ bb, bb/aa); +(%o4) [@@rule1, false] +(%i5) tellsimpafter (quux (%pi, %e), %pi - %e); +(%o5) [quuxrule1, false] +(%i6) tellsimpafter (quux (%e, %pi), %pi + %e); +(%o6) [quuxrule2, quuxrule1, false] +(%i7) [foo (aa, bb), aa + bb, aa @@ bb, quux (%pi, %e), quux (%e, %pi)]; + bb +(%o7) [bb - aa, special_add(aa, bb), --, %pi - %e, %pi + %e] + aa +(%i8) remrule (foo, foorule1); +(%o8) foo +(%i9) remrule ("+", "+rule1"); +(%o9) + +(%i10) remrule ("@@", "@@rule1"); +(%o10) @@ +(%i11) remrule (quux, all); +(%o11) quux +(%i12) [foo (aa, bb), aa + bb, aa @@ bb, quux (%pi, %e), quux (%e, %pi)]; +(%o12) [foo(aa, bb), bb + aa, aa @@ bb, quux(%pi, %e), + quux(%e, %pi)] +@end example + @end deffn @c NEEDS EXPANSION OR MAYBE JUST APPROPRIATE REFS TO tellsimpafter |