Re: tellsimp, tellsimpafter



On 1/20/06, Richard Fateman <fateman at cs.berkeley.edu> wrote:

> They are similar.  They differ in the ordering of rule application, but
> there is also an issue of re-simplification. That is, you don't want
> to get into a recursion because the argument to a rule is first
> simplified.  (calling the rule ... etc).  The situation with tellsimpafter
> requires a different trick.  But otherwise I think the code generated
> is the same.  (At least that is what I recall from when I wrote this
> stuff in 1969 or so...)

well, something that's relevant to the example involving interval
objects is that tellsimpafter generates code to call PART+  and PART*
which carry out the argument sweep-up matching for + and *.
tellsimp doesn't; the effect is that tellsimp matches a substantially
smaller set of patterns for + and * than tellsimpafter.

it's not clear to me what is the reason for the difference in matching
logic between tellsimp and tellsimpafter. i wonder if we should try
to unify the two. the preamble for the matching functions probably
needs to be different, but the matching logic itself could be the same,
i'm guessing.

matchdeclare (aa, integerp, bb, symbolp);
tellsimp (aa + bb, FOO (aa, bb));
tellsimpafter (aa + bb, BAR (aa, bb));
:lisp (symbol-function '&+rule1)
:lisp (symbol-function '&+rule2)

sheds some light on this topic.

fwiw
robert dodier