Open rtoy opened 3 months ago
Imported from SourceForge on 2024-07-06 18:12:12 Created by robert_dodier on 2024-04-09 04:57:12 Original: https://sourceforge.net/p/maxima/bugs/4283/#b8eb
ARRAY-MEQP calls MEQP, and MEQP is the one saying it doesn't know if NIL is equal to 5.
(%i16) is(equal(false,5));
0: (MAXIMA::MEQP NIL 5)
0: MEQP returned (($EQUAL) NIL 5)
(%o16) unknown
(%i17) is(equal(a,b));
0: (MAXIMA::MEQP #(NIL NIL 3 NIL) #(NIL 5 NIL NIL))
1: (MAXIMA::ARRAY-MEQP #(NIL NIL 3 NIL) #(NIL 5 NIL NIL))
2: (MAXIMA::MEQP NIL NIL)
2: MEQP returned T
2: (MAXIMA::MEQP NIL 5)
2: MEQP returned (($EQUAL) NIL 5)
1: ARRAY-MEQP returned (($EQUAL) #(NIL NIL 3 NIL) #(NIL 5 NIL NIL))
0: MEQP returned (($EQUAL) #(NIL NIL 3 NIL) #(NIL 5 NIL NIL))
(%o17) unknown
So from what I can tell the bug is in MEQP.
I'm kind of confused by the comments. The problem isn't in ALIKE1, right? ALIKE1 correctly returns true
or false
. "Evidence that the array comparison in alike1 isn't used anywhere" ... what?? I don't get it. If it's incorrect we should fix it. But anyway ALIKE1 is correct in this case.
Imported from SourceForge on 2024-07-06 18:12:15 Created by macrakis on 2024-04-09 14:30:56 Original: https://sourceforge.net/p/maxima/bugs/4283/#2909
Diff:
--- old
+++ new
@@ -12,5 +12,3 @@
is(equal(qq,rr)) => unknown << should be false
alike1
correctly returns T and NIL in these cases, but array-meqp
messes up.-This seems like good evidence that the array comparison in alike1 is not used anywhere!
Imported from SourceForge on 2024-07-06 18:12:19 Created by macrakis on 2024-04-09 14:30:56 Original: https://sourceforge.net/p/maxima/bugs/4283/#090f
You're right. I've removed the incorrect comment.
Imported from SourceForge on 2024-07-06 18:12:22 Created by robert_dodier on 2024-04-14 05:31:07 Original: https://sourceforge.net/p/maxima/bugs/4283/#ae8c
I think I can fix this if we figure out what's the correct result for comparisons to true
and false
.
Considering is(equal(x, b))
where b
is a Boolean value (true
or false
) and x
is anything other than a Boolean value, I guess we want that to be true
if and only if x
is known to be equal to b
(via assume(equal(x, true))
or assume(equal(x, false))
, unless I've overlooked another way to declare a value), false
if and only if x
is known to be not equal to b
(either by its assume
value or because x
is known to be a non-Boolean value), and undetermined otherwise. Does that sound right?
Imported from SourceForge on 2024-07-06 18:12:11 Created by macrakis on 2024-04-08 13:57:39 Original: https://sourceforge.net/p/maxima/bugs/4283
alike1
correctly returns T and NIL in these cases, butarray-meqp
messes up.