Difference in interactivity with two sums



On 2012-11-16, Robert Dodier <robert.dodier at gmail.com> wrote:
> On 2012-11-16, Karl-Dieter Crisman <kcrisman at gmail.com> wrote:
>
>> At http://trac.sagemath.org/sage_trac/ticket/11990, the question is
>> raised about the discrepancy in behavior below.
>
>> (%i3) simplify_sum(sum(m,m,0,inf));
>> Is  m  positive, negative, or zero?
>
> That seems to be a bug -- it should report "divergent" without asking
> about the sign of m.

I've pushed commit 07a0c810ea which fixes the problem noted here.

best,

Robert Dodier

PS.
$ git show 07a0c810ea
commit 07a0c810eade1d26565e477ab17aa2a6121f875e
Author: robert_dodier <robert_dodier at users.sourceforge.net>
Date:   Mon Nov 26 16:48:12 2012 -0700

    In ISUM1, correct test for a constant summand.
    A test case (not suitable for test suite since expected behavior does not
    include a return value): ev(sum(m, m, 0, inf), simpsum=true) which should immediately
    print the error message "sum is divergent".
    Previously, the summand test treated the summation index as a constant and asksign was called.
    Fixes bug reported to mailing list 2012-11-16: "Difference in interactivity with two sums"

diff --git a/src/combin.lisp b/src/combin.lisp
index 51b006e..1858861 100644
--- a/src/combin.lisp
+++ b/src/combin.lisp
@@ -1143,7 +1143,7 @@
         (merror (intl:gettext "sum: sum is divergent.")))))
 
 (defun isum1 (e lo)
-  (cond ((or (free e *var*) (atom e))
+  (cond ((free e *var*)
         (unless (eq (asksign e) '$zero)
           (throw 'isumout 'divergent)))
        ((ratp e *var*)