$asksign might need its own context



Am Dienstag, den 23.02.2010, 11:07 -0500 schrieb Stavros Macrakis:
> Maxima's intended behavior is that every %i/%o interaction is an
> asksign domain.  If you want isolated environments within that, you
> need to create them explicitly.


I think this comment is correct and the main point. It is the design of
the functions meval*, clearsign, locals, ...

The context for asksign is created with the function meval* which is
called for every line of Maxima code.

We had one bug in meval* which destroyed this behavior. Every time we
have a "leak", which means the facts are not cleared after one
evaluation with meval*, we have a bug.

Furthermore, every time meval* is called within a Lisp functions we
might generate a bug too, because we destroy the expected context.

I think the creation of local contexts should not destroy this concept
too.


> On Tue, Feb 23, 2010 at 8:28 AM, Raymond Toy <toy.raymond at gmail.com>
> wrote:
>         On 2/22/10 5:01 PM, Dieter Kaiser wrote:
>         > We have the bug report ID: 932095 - ode2 redundant asksign.
>         >
>         > At first a more simple example to show the problem:
>         >
>         > (%i3) integrate(x^a,x)+integrate(x^(a-1),x);
>         >
>         > Is  a+1  zero or nonzero?
>         > z;
>         >
>         > Is  a  zero or nonzero?
>         > n;
>         >
>         > (%o3) log(x)+x^a/a
>         >
>         > The problem is that Maxima loses the fact that a+1 = 0.
>         >
>         >
>         >
>         
>         [snip implementation details] 
>         > With this changes we get for the example from above:
>         >
>         > (%i5) integrate(x^a,x)+integrate(x^(a-1),x);
>         >
>         > Is  a+1  zero or nonzero?
>         > z;
>         >
>         > (%o5) log(x)+x^a/a
>         >
>         >
>         
>         Is this really what we want?  Granted, for this example it
>         produces the
>         desired result, assuming that the a in both integrals really
>         are the
>         same a.  I'm not sure this is always true.


The behavior of Maxima should be predictable for equivalent expressions.
There is no reason to distinguish integrate(x^a,x)+integrate(x^(a-1),x);
from integrate(x^a+x^(a-1),x); or integrate(x^(a-1)*(x+1),x);


>         I recall when working on hgfred that sometimes hgfred would
>         remember
>         certain facts when it asked questions.  And these facts would
>         be
>         remembered so that I could no longer get hgfred to ask the
>         same question
>         so I could select a different answer.  I didn't know where the
>         info was
>         stored so I ended up using new variables all the time.


I have observed problems with the code of hgfred too. I think these
problems are caused by a second independent implementation of global
context with the function checksigntm. This function creates its own
global list of facts. The code in hyp.lisp uses both schemes, the call
of checksigntm and the call of asksign. This might cause the observed
problems.


Dieter Kaiser