Scope, assumptions, asksign, context. Was Re: Bug in Maxima 5.30.0



On 2013-09-03, Stavros Macrakis <macrakis at alum.mit.edu> wrote:

> I don't think it's hard with fixed variables.  The fun starts when you have
> arguments which are expressions which may contain variables.

Yes, it is more fun that way for sure. Does it help to separate the
the scope of symbols from the scope of assumptions? In particular, if
an expression contains some variables, then in the absence of any
indication of symbol scope, assumptions inside a limited assumption
scope must apply to the same symbols as are found outside. Perhaps you
have some other problems in mind too.

> For example, how would you write a function with_posval(expr,varlist) which
> evaluates expr with var assumed positive?  (And of course doesn't let the
> assumption leak out of its scope.) Do you have to do the explicit
> manipulation of environments that you have to do in say R?  Getting that
> sort of thing right is far from trivial.

I know something about R but I wonder to what you're referring about
explicit environment manipulation.

About a with_posval construct, I wonder if any assumptions should be
made in addition to existing ones or possibly superseding them. E.g.
what if we have (assume(x < 0), with_posval(foo(x), x)) ? I can see
arguments both ways.

best

Robert Dodier