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

Close

#1319 hgfred([7],[-1], x) --/--> error

closed
nobody
None
4
2008-01-04
2007-12-27
Barton Willis
No

Although hgfred([7],[-1], x) is undefined, Maxima
returns a noun form for this case.

(%i1) hgfred([7],[-1],x);
(%o1) %f[1,1]([7],[-1],x)

All the logic for detecting this is in place, but
it is ignored. In hgfsimp-exec there is

(not (atom (res))).

Should the 'not' be removed and the one
reference to 'undef be changed to '$und?

(defun hgfsimp-exec (arg-l1 arg-l2 arg)
(let* ((l1 (copy-tree arg-l1))
(l2 (copy-tree arg-l2))
($exponentialize nil)
(res (hgfsimp l1 l2 arg)))
(if (or (numberp res) (atom res)) ;; <---change
res
(fpqform l1 l2 arg))))

This change makes

(%i3) hgfred([7],[-1],x);
(%o3) und

Maybe hgfsimp returns other atoms that aren't correct
(that need to be caught by (not (atom res)). I don't know.

Discussion

  • Raymond Toy
    Raymond Toy
    2008-01-02

    Logged In: YES
    user_id=28849
    Originator: NO

    The code has been changed a bit. I'll make the corresponding change shortly.

     
  • Raymond Toy
    Raymond Toy
    2008-01-02

    • status: open --> closed
     
  • Raymond Toy
    Raymond Toy
    2008-01-02

    Logged In: YES
    user_id=28849
    Originator: NO

    Fixed as suggested in hyp.lisp, rev 1.88

     
  • Raymond Toy
    Raymond Toy
    2008-01-03

    Logged In: YES
    user_id=28849
    Originator: NO

    Reopening, because of some test case failures.

    With the new code hgfred([a,b],[0],x) returns und. But what if a (or b) were actually 0. Then we would have hgfred([0,b],[0],x) which could be simplified to hgfred([b],[],x).

    Perhaps returning %f[2,1]([a,b],[0],x) would be better in cases like this? Perhaps und should be returned only if all the parameters are numbers?

     
  • Raymond Toy
    Raymond Toy
    2008-01-03

    • status: closed --> open
     
  • Barton Willis
    Barton Willis
    2008-01-03

    Logged In: YES
    user_id=895922
    Originator: YES

    Yes, I think returning %f[2,1]([a,b],[0],x) is better than an error.
    So if hgfred signals an error only when when all the parmeters are
    integers, that's OK. I suppose you could argue that hgfred([7],[-1], x)
    shouldn't signal an error either becuase hgfred([7],[-1], 0) = 1.

     
  • Raymond Toy
    Raymond Toy
    2008-01-03

    Logged In: YES
    user_id=28849
    Originator: NO

    I've made the changes so hgfred([a,b],[0],x) returns %f[2,1]([a,b],[0],x). And hgfred([7],[-1],x) returns und.

    I'll check this in, unless there are other issues.

     
  • Raymond Toy
    Raymond Toy
    2008-01-04

    Logged In: YES
    user_id=28849
    Originator: NO

    Fixed in hyp.lisp, 1.90.

     
  • Raymond Toy
    Raymond Toy
    2008-01-04

    • status: open --> closed