the argument simp:false



On Mon, Aug 31, 2009 at 5:22 PM, Alejandro Jakubi<jakubi at df.uba.ar> wrote:

> The examples for 'tellsimp' in the manual include the statement
>
> ev (tellsimp (0^0, 1), simp: false);

That example unnecessarily introduces a question about ev,
which is something of a mess ... it would be simpler to understand
like this:

(%i2) simp:false;
(%o2)                                false
(%i3)  tellsimp (0^0, 1);
(%o3)                         [^rule1, simpexpt]
(%i4) simp:true;
(%o4)                                true
(%i5) 0^0;
(%o5)                                  1

It's often necessary to bind simp to false when constructing
simplification rules. Otherwise the existing rules can interfere
with the one you are trying to define.

> "simp causes expr to be simplified regardless of the setting of the switch simp
> which inhibits simplification if false."
>
> and I interpret this sentence as describing a situation like:
>
> (%i2) simp : false$
> (%i3) ev(1 + 1, simp);
> (%o3) ? ? ? ? 2
>
> rather than the previous one.

Yes, you're right.

> So, I wonder whether this argument "simp: false" is undocumented.

Well, ev(expr, foo:bar) or equivalently ev(expr, foo=bar) just means
to evaluate expr while foo is temporarily bound to bar.

Some flags (the so-called evflags; ? evflag tells about that) have the
property that ev(expr, foo) is equivalent to ev(expr, foo=true).

ev has accumulated a lot of disparate functionality over the years.

best

Robert Dodier