#166 Defint doesn't clean up asksign db

closed
nobody
5
2012-12-04
2002-10-21
No

>> integrate(x^n,x,1,inf);
<< Is n positive, negative, or zero?
>> pos;
<< Integral is divergent

So far, so good. Now:

>> asksign(n);
<< pos;

That is, the asksign database still contains the fact that
n>0. This should have been removed when defint
exited. This problem doesn't happen when the integral
is convergent.

Discussion

  • Alexander VIDYBIDA

    Logged In: YES
    user_id=927510

    The obsolete info, which have to be removed after estimated
    a divergent integral, can be kicked out by "IS" oporator:

    (%i1) integrate(EXP(-la*t)*la,t,0,INF);

    Is la positive, negative, or zero?

    n;
    Integral is divergent
    -- an error. Quitting. To debug this try DEBUGMODE(TRUE);
    (%i2) integrate(EXP(-la*t)*la,t,0,INF);

    Integral is divergent
    -- an error. Quitting. To debug this try DEBUGMODE(TRUE);
    HOW DOES IT KNOW ?
    (%i3) is(la<0);

    MACSYMA was unable to evaluate the predicate:
    la < 0
    -- an error. Quitting. To debug this try DEBUGMODE(TRUE);
    (%i4) integrate(EXP(-la*t)*la,t,0,INF);

    Integral is divergent
    -- an error. Quitting. To debug this try DEBUGMODE(TRUE);
    HOW DOES IT KNOW ?
    (%i5) is(la>0);

    MACSYMA was unable to evaluate the predicate:
    la > 0
    -- an error. Quitting. To debug this try DEBUGMODE(TRUE);
    (%i6) integrate(EXP(-la*t)*la,t,0,INF);

    Integral is divergent
    -- an error. Quitting. To debug this try DEBUGMODE(TRUE);
    HOW DOES IT KNOW ?
    (%i7) is(la=0);

    (%o7) FALSE
    NOW THE INFO IS KICKED OUT
    (%i8) integrate(EXP(-la*t)*la,t,0,INF);

    Is la positive, negative, or zero?

    p;
    (%o8) 1

     
  • Robert Dodier

    Robert Dodier - 2005-08-22

    Logged In: YES
    user_id=501686

    The problem is one or both of 2 things: (1) defint calls
    merror instead of returning inf; (2) defint doesn't clean up
    the assumption in case of an error.

    I'd rather see defint return inf or und or ind instead of
    calling merror here. But also defint should trap merror
    (don't know how to do that) and cleanup.

    Either one of those changes would fix the particular problem
    mentioned here, but I think we should fix both.

     
  • Robert Dodier

    Robert Dodier - 2005-08-22
    • labels: --> 460522
     
  • Robert Dodier

    Robert Dodier - 2006-04-09
    • labels: 460522 --> 840495
     
  • Robert Dodier

    Robert Dodier - 2006-07-07

    Logged In: YES
    user_id=501686

    This is an example of a more general problem which is that
    the asksign database is not cleaned up in case of an error.
    Although it could be fixed in this specific case by making
    defint catch the error and clean up the database, that
    doesn't do anything for other situations. A general solution
    to this problem would be useful. Recategorizing to "Lisp
    Core - Assume" accordingly.

     
  • Robert Dodier

    Robert Dodier - 2006-07-07
    • labels: 840495 --> Lisp Core - Assume
     
  • Dieter Kaiser

    Dieter Kaiser - 2009-05-27
    • milestone: --> Includes_proposed_fix
     
  • Dieter Kaiser

    Dieter Kaiser - 2009-05-27

    To get a general solution I have removed almost all calls to the function diverg which throws the Maxima Error. These calls are replaced by returning the value 'divergent. Only the calls which throws 'divergent are still present in the code.

    With this change defint gives the result 'divergent, when the integral is divergent. We can return this symbol or a noun form. This technique seems to work well. The testsuite has no problems, but we have no systematic tests for divergent integrals.

    Because we no longer throw a Maxima error, we have no longer problems with the assume database.

    Perhaps this could be a solution to the problem. By the way a noun form or a result 'divergent seems to me more useful. A similar technique is used by the funcion $specint.

    Dieter Kaiser

     
  • Dieter Kaiser

    Dieter Kaiser - 2009-11-03

    The underlying problem is that clearsign is not called when meval* ends not normally. This has been fixed in suprv1.lisp revision 1.85.
    Closing this bug report as fixed.
    Dieter Kaiser

     
  • Dieter Kaiser

    Dieter Kaiser - 2009-11-03
    • status: open --> closed
     

Log in to post a comment.