Menu

#3210 ALGSYS does not return (regression)

None
closed
nobody
None
5
2016-10-05
2016-09-11
No

I have run the contrib_ode testsuite with git HEAD. I last ran it in mid-2015. Some problems that call odelin() don't return. I have reduced this to an issue with algsys.

A reduced test case is

eqns:[
 4*y*(y^2-28),
 8*y*(y^2-28)*z,
 -16*y*(y^2-23)*z,
 8*y*(y^2-10)*z,
 32*y*(z-y),
 32*y*(z+y),
 4*y*(y^2-28),
 8*y*(y^2-28)*z,
 -16*y*(y^2-23)*z,
 8*y*(y^2-10)*z,
 y*((4*y^2-112)*z^2-8*y^4+(185-4*x^2)*y^2),
 -2*y*((4*y^2-92)*z^2-2*y^4+(21-4*x^2)*y^2),
 y*((4*y^2-40)*z^2+(1-4*x^2)*y^2)
];
vars:[x,y,z];
algsys(eqns,vars);

With maxima 5.36.1 this returns [[x = %r1, y = 0, z = %r2]].

With HEAD it doesn't return.

I try to identify the commit that introduced the problem.

Related

Bugs: #3212

Discussion

  • David Billinghurst

    As background, the share/diffequations/tests (contrib_ode) testsuite cases that suffer from this problem have been commented out. Grep for "2016-09" to find them.

    The test case above was generated with the following commands

    load(contrib_ode);
    trace(algsys);
    display2d:false;
    odelin('diff(y,x,2) = (-((2*x^5+6*x^3)*'diff(y,x,1)+(6*x^2-28)*y))/(x^6-x^4),y,x);
    

    The arguments of last call to algsys were copied from the screen and shortened variable names substituted. This case was the simplest of around 10 that I looked at.

     

    Last edit: David Billinghurst 2016-09-12
  • David Billinghurst

    The commit that breaks this testcase is [a158b1]

    commit a158b1547118ac74da546ec1b0e16c0cc6b44a77
    Author: Rupert Swarbrick rswarbrick@gmail.com
    Date: Thu Jan 15 20:33:37 2015 +0000

    Document and slightly refactor the guts of DISTREP
    
    This patch deletes two functions called CONDENSEY and CONDENSESUBLIST,
    which were only used by DISTREP. Squinting a bit, you see that the
    combination was just
    
      (defun condensesublist (lol)
        (mapcar (lambda (lst)
                  (delete-duplicates (reverse lst) :test #'alike1))
                lol))
    
    CONDENSESUBLIST was only called on the result of COMBINEY, which
    contains code to make sure that its results contain no duplicates (as
    compared by #'EQUAL, rather than #'ALIKE1). Since COMBINEY is also only
    called from DISTREP, I've changed that to discard duplicates using
    ALIKE1 and thus can get rid of CONDENSEY and CONDENSESUBLIST completely,
    replacing them with just a call to REVERSE.
    
    I don't really understand the reversal stage here, but things break
    if I remove it, so I'll leave it in for now and hopefully things will
    become more clear when I've read some more of the code...
    
     

    Related

    Commit: [a158b1]


    Last edit: David Billinghurst 2016-09-28
  • David Billinghurst

    Same commit caused [bugs:#3212]

     

    Related

    Bugs: #3212


    Last edit: David Billinghurst 2016-09-28
  • David Billinghurst

    The problem is the change to algsys.mac:combiney1. Reverting this fixes the test case.

     (defun combiney1 (listofl)
       (cond ((null listofl) (list nil))
            (t (mapcan #'(lambda (r)
    
    -                      (if (intersection (car listofl) r :test #'equal)
    +                      (if (intersection (car listofl) r :test #'alike1)
                               (list r)
                               (mapcar #'(lambda (q) (cons q r)) (car listofl))))
                       (combiney1 (cdr listofl))))))
    

    I didn't try to understand the issue, but just reverted the patch to each function. I will see what happens when I revert this in HEAD.

     
  • David Billinghurst

    I have committed patch [a5873b] to restore previous behaviour.

    commit a5873ba00e901e22f8c51af5bb8964270fef235b
    Author: David Billinghurst <dbmaxima@gmail.com>
    Date:   Tue Sep 13 12:43:53 2016 +1000
    
        SF bugs 3210 and 3212.  Fix algsys regressions.
    
        Revert part of commit a158b1547, which broke algsys.  I suspect there
        is a deeper problem, as the logic of the original commit seems sound
        at first glance, and works for many cases.
    
        Change test in combiney1 back to #'equal from #'alike1.
    
        I don't understand algsys internals, but reverting this fixed approx
        40 regressions in the share/contrib_ode testsuite, (and didn't introduce
        any new ones).
    
        Two test cases from bug reports added to rtest8.mac.
    
     

    Related

    Commit: [a5873b]


    Last edit: David Billinghurst 2016-09-28
  • Rupert Swarbrick

    Thanks for tracking this down. I'm sorry that I hadn't run the contrib_ode testsuite. I'm going to do some more digging to see exactly why what I wrote didn't work (I still don't understand!)

     
  • David Billinghurst

    • status: open --> closed
     
  • David Billinghurst

    Closing this. Bug is fixed and.

     

Log in to post a comment.

MongoDB Logo MongoDB