Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#979 product(sum(f(i),i,1,inf),j,1,inf) => inf (wrong)

closed
nobody
5
2006-09-17
2006-09-05
Stavros Macrakis
No

product(sum(f(i),i,1,inf),j,1,inf) simplifies to inf

This is wrong. The simplest counterexample is f(i):=0,
where the product = 0.

If you want to get fancier, consider f(i):=2^-i;
product = 1.

5.9.3 Windows GCL

Discussion

    • labels: --> Lisp Core - Simplification
     
  • Robert Dodier
    Robert Dodier
    2006-09-16

    Logged In: YES
    user_id=501686

    Changing the two instances of MGRP to MGREATERP in SIMPPROD1
    (src/asum.lisp) makes this problem go away.

    MEVALP routes ((MGREATERP) ...) to the function MGRP
    (src/compar.lisp). I speculate the presence of MGRP (instead
    of MGREATERP) in SIMPPROD1 is an optimization. (MEVALP
    '((MGRP) ((%SUM) (($F) $I) $I 1 $INF) 1)) returns T, which
    is spurious, and which then leads SIMPPROD1 to conclude the
    product is infinite. MGRP refers to special variables ODDS
    and EVENS which is probably part of the problem. However, I
    confess that I don't fully understand what is going on.

    Grepping for MGRP, it looks like MGRP is called elsewhere.
    Maybe we should review the use of MGRP and friends.

     
  • Robert Dodier
    Robert Dodier
    2006-09-17

    • status: open --> closed
     
  • Robert Dodier
    Robert Dodier
    2006-09-17

    Logged In: YES
    user_id=501686

    Change MGRP to MGREATERP in SIMPPROD1 (committed as r1.15
    src/asum.lisp) and add a test case (committed as r1.6
    tests/rtestsum.mac). Closing this report as fixed.

    Although MGRP is called in other files, I didn't change any
    other use of MGRP.