ciao-lang / ciao

Ciao is a modern Prolog implementation that builds up from a logic-based simple kernel designed to be portable, extensible, and modular.
https://ciao-lang.org
GNU Lesser General Public License v3.0
268 stars 20 forks source link

Compatibility issue evaluable function (^)/2 missing #72

Open Jean-Luc-Picard-2021 opened 1 year ago

Jean-Luc-Picard-2021 commented 1 year ago

Now I get:

?- X is 33^10.
{ERROR: No handle found for thrown exception error(type_error(evaluable,33^10),'arithmetic:is'/2-2)}

But this function is listed here:

DRAFT TECHNICAL CORRIGENDUM 2 https://www.complang.tuwien.ac.at/ulrich/iso-prolog/dtc2#pow

Jean-Luc-Picard-2021 commented 1 year ago

An interesting test case would be, in case (^)/2 arrives in Ciao Prolog, what the outcome of this here is. Currently a disagreement between SWI-Prolog and ECLiPSe Prolog, possibly caused by float/1:

/* SWI-Prolog 8.5.17 */
?- X is float(51^10).
X = 1.19042423827613e+17.

/* ECLiPSe Prolog 7.0.61 */
?- X is float(51^10).
X = 1.1904242382761301e+17

The problem is related to this ticket here, but the later ticket mentions (**)/2 and not (^)/2. So the test cases are different.

Jean-Luc-Picard-2021 commented 9 months ago

How do I run tests in Ciao Prolog that are written in ISO including Corr.1 and Corr.2. I cannot run my SAT Solver tests:

?- time(suite_quiet).
{ERROR: arithmetic:is/2, arg 2 - expected an arithmetically
evaluable expression, found ^(2,18)}

The error still persists in release 1.22.0 of Ciao Prolog. When do these gaps get filled?

Jean-Luc-Picard-2021 commented 9 months ago

For exampe SWI-Prolog has a very fast (^)/2 because of GMP support. You can even try this one:

/* SWI-Prolog 9.1.17 */
?- time(_ is 9^(9^9)).
% -1 inferences, 6.063 CPU in 6.308 seconds (96% CPU, 0 Lips)
true.

All these things get nowhere tested for Ciao Prolog, since it doesn’t exist. Subsequently also not covered by benchmarks.