[PPL-devel] [Xsb-development] Arithmetic evaluation bug in the CVS HEAD version of XSB
Bart Demoen
Bart.Demoen at cs.kuleuven.ac.be
Sun Sep 23 20:40:38 CEST 2007
> Do you agree with me that the
> behavior I indicated witnesses a (big) XSB bug?
It is more of an inconsistency than a bug: XSB has chosen not to
evaluate variables on the right side of is/2 - Quintus used to do the
same. Long ago, I didn't understand that there are good reasons for
this choice. Now I think that Prolog would be better of without this
feature.
Terry, why does the following not work as a fix in the compiler ? At
compile time, replace X is Y by
(number(Y) ->
X = Y
;
throw(appropriate error)
)
That would give consistent behaviour, no ? Even though not ISO.
You don't have to do such a thing for </2 (and friends) because of the
rest of XSB's compilation schema for arithmetic ... which has its more
important problems of course:
| ?- -2147483648 < 2147483647 .
++Error[XSB]: [Runtime/C] Overflow in integer, returning MAX_INT
no
| ?- -2147483648 < 1 .
++Error[XSB]: [Runtime/C] Overflow in integer, returning MAX_INT
yes
| ?- -2 < 2147483647 .
no
All the above in XSB Version 3.0.1 (Sagres) of August 7, 2006
Cheers
Bart Demoen
More information about the PPL-devel
mailing list