Open josd opened 4 months ago
Excellent catch!
I have reduced this to the following test case:
:- use_module(library(debug)). p([X], Y) :- $Y is X.
Yielding:
?- p("e", R). call:(A is e). exception:error(type_error(evaluable,e),(is)/2):(A is e). error(type_error(evaluable,e),(is)/2), unexpected.
On the other hand, querying the traced goal in isolation works as expected:
?- A is e. A = 2.718281828459045. % expected
I think this is even shorter:
?- [X] = "e", _ is X.
Surprisingly it works for pi:
?- [X] = [pi], _ is X.
It looks suspiciously like yet another issue due to the currently only partially finished partial string representation (#24).
Makes sense, also this
?- [X,Y] = [e,foo], Z is X.
X = e, Y = foo, Z = 2.718281828459045.
works fine whereas this
?- [X,Y] = [e,f], Z is X.
error(type_error(evaluable,e),(is)/2).
is not working fine.
The case is now moved to https://github.com/eyereasoner/euler/blob/main/cases/complex.pl
The problem got worse with rebis-dev
:
?- _ is e. error(type_error(evaluable,e),(is)/2), unexpected. true. % expected; works in master
I found a workaround so that you can at least continue for the time being if you want to use it:
?- X is 0 + e. X = 2.718281828459045.
Thanks @triska and this now works fine in https://github.com/eyereasoner/euler/blob/574fcec024bfd86e0c035de1210a891ed390dc66/cases/complex.pl
The following case https://github.com/eyereasoner/eye/blob/1ea6435149beb4d4a483ddb761eae85def65db16/see/temp/complex.pl gives
whereas we expect
The irrational number pi seems to be understood correctly. This is also fine