#1179 reflection rule code

closed
nobody
5
2007-11-07
2007-04-29
No

Consider:

(%i1) tellsimp(sin(x),0);
(%o1) [sinrule1,simp-%sin]

(%i3) sin(-x);
(%o3) -sin(x)

Oops! %o3 should be 0. To fully simplify, we need
an expand (or ratsimp)

(%i4) expand(%);
(%o4) 0

I think there are cases where this reflection rule
bug causes problems *without* a tellsimp rule.

Also, I think the test suite uses ratsimp to test for
equality. This makes these kind of bugs difficult
to detect in the test suite.

Discussion

  • Stavros Macrakis

    Logged In: YES
    user_id=588346
    Originator: NO

    This is because (take '(%sin) ...) goes directly to simpsin rather than to simplifya.
    I am currently testing new code for take which calls simplifya (and will replace opcons and the like).

     
  • Robert Dodier

    Robert Dodier - 2007-05-06
    • labels: 460522 --> Lisp Core - Simplification
     
  • Robert Dodier

    Robert Dodier - 2007-05-06

    Logged In: YES
    user_id=501686
    Originator: NO

    Seems to have been fixed in cvs head.

    tellsimp (sin(x), 0);
    sin(-x);
    => 0

    Also (in a fresh session)

    tellsimpafter (sin(x), 0);
    sin(-x);
    => 0

    About ratsimp, I think (without looking) that ALIKE1 calls ratsimp so that's how it comes into play in the testsuite.

     
  • Stavros Macrakis

    Logged In: YES
    user_id=588346
    Originator: NO

    > I think (without looking) that ALIKE1 calls ratsimp so
    > that's how it comes into play in the testsuite.

    No, alike1 is the Maxima equivalent of equal; it tests for strictly syntactic equality, ignoring all flags (like simp) except arr.

    The test suite cannot use ratsimp to test for correctness because that would ignore changes of *form* which don't change meaning, e.g. factor, factorsum, expand, partfrac, etc.

    -s

     
  • Dan Gildea

    Dan Gildea - 2007-10-23
    • status: open --> pending
     
  • SourceForge Robot

    • status: pending --> closed
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks