#434 a < b or 1 < 2 wrong

closed
nobody
Lisp Core (471)
5
2010-03-08
2003-11-03
No

Assume nothing is known about a and b.

prederror:true
just making sure it is set to the default for the test
avoid ev in case ev complicates matters

a&lt;b or 1&lt;2 =&gt; error !
is(a&lt;b or 1&lt;2) =&gt; error !
if (a&lt;b or 1&lt;2) then 5 =&gt; error !

prederror:false

a&lt;b or 1&lt;2 =&gt; unknown !
is(a&lt;b or 1&lt;2) =&gt; true (OK)
if a&lt;b or 1&lt;2 then 5 =&gt; 5 (OK)

I believe that (a&lt;b or 1&lt;2) should be returning true in all
these cases.

Maxima 5.9.0 gcl 2.5.0 Windows 2000

Discussion

  • Stavros Macrakis

    Logged In: YES
    user_id=588346

    Same problem for

    xxx or true

     
  • Robert Dodier

    Robert Dodier - 2006-07-10
    • labels: --> Lisp Core
    • summary: a<b or 1<2 wrong --> a < b or 1 < 2 wrong
     
  • Robert Dodier

    Robert Dodier - 2006-07-10

    Logged In: YES
    user_id=501686

    Code for unevaluated conditionals (share/contrib/boolsimp/)
    handles a < or 1 < 2 (also xxx or true, example given below)
    as expected when prederror = false (which is boolsimp's
    default mode). Same problems are observed when boolsimp =
    true, because I wrote boolsimp to have the same behavior as
    current code when prederror = true. I'd rather just be rid
    of prederror altogether and have the code always yield what
    is now yielded when prederror = false.

     
  • Dieter Kaiser

    Dieter Kaiser - 2010-02-21

    With prederror:false (the default value) the examples of this bug report work as expected:

    (%i1) prederror;
    (%o1) false
    (%i2) a<b or 1<2;
    (%o2) true
    (%i3) is(a<b or 1<2);
    (%o3) true
    (%i4) if (a<b or 1<2) then 5;
    (%o4) 5

    When we set prederror to true we get the following:

    (%i11) prederror:true;
    (%o11) true

    (%i12) a<b or 1<2;
    Unable to evaluate predicate a < b
    -- an error. To debug this try: debugmode(true);

    (%i13) is(a<b or 1<2);
    Unable to evaluate predicate a < b
    -- an error. To debug this try: debugmode(true);

    (%i14) if (a<b or 1<2) then 5;
    Unable to evaluate predicate a < b
    -- an error. To debug this try: debugmode(true);

    I think this is the expected and documented behaviour of the option variable prederror.

    It might be arguable that an error should be given only if the whole predicate can not be evaluated to be true or false. But the error message is clear.

    At this point we might close this bug report, because the default behaviour works as expected and the case prederror:false is documented.

    Setting the status to pending and the resolution to "works for me".

    Dieter Kaiser

     
  • Dieter Kaiser

    Dieter Kaiser - 2010-02-21
    • status: open --> pending
     
  • SourceForge Robot

    • status: pending --> closed
     
  • SourceForge Robot

    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:

JavaScript is required for this form.





No, thanks