scryer-prolog: Unexpected failure
To reproduce this issue, please download:
campels.plfrom https://www.metalevel.at/various/colgen/camels.plv3.plfrom https://www.metalevel.at/various/colgen/v3.pl
Place camels.pl and v3.pl in the same directory, and then invoke Scryer with:
$ scryer-prolog -g camels camels.pl v3.pl
With Scryer Prolog 0.9.0 up to at least v0.9.1-422-gb6a81c51, I get the expected output:
% initial patterns: [2,0,0]. [0,2,0]. [0,0,2]. % generated packing patterns: [0,2,1]. [1,1,1]. % solution vector (coefficient of each pattern): [0,0,1,0,13].
But starting with v0.9.1-515-gbbf92f27 (and potentially even earlier) up to the current release v0.9.2, I unexpectedly get:
% initial patterns: [2,0,0]. [0,2,0]. [0,0,2]. % generated packing patterns: Warning: initialization failed for: camels
So, between v0.9.1-422 and v0.9.1-515, a regression was introduced that causes Scryer to now unexpectedly fail in this example.
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Comments: 16 (16 by maintainers)
@cmpute Absolutely, comment away.
r.is_integer()forRBigisn’t correctly implemented. It returns true whenris1 rdiv 2.I will raise another PR soon with the changes suggested by @cmpute.
fayeed already created an PR: https://github.com/cmpute/dashu/pull/35. However, I’m afraid that most of the modifications will not be accepted, as most of them are due to improper usage rather than the lack of functionalities. Is it okay for me to comment on the code of this side
@fayeed Thanks. The issue isn’t fixed in scryer, though… the version of dashu being pushed from the coasys repository appears to use an older version of dashu-ratio (0.3.1) but the updated one has version number 0.3.2.
@mthom Pushed a fix.
@triska It is. The main repo
RBigimpl doesn’t have anis_integerfunction.@fayeed @lucksus can you correct the bug in the dashu fork please? this and #1983. this implementation appears to be work:
assuming that the
RBigimplementation is always reduced, of course.@triska I’ve verified that using the above implementation of
is_integerfixes the regression.Prior to introduction of dashu (v0.9.1-460-g762e6d3b), the program works correctly.
I’ve narrowed down one unexpected failure to:
I will try to narrow it down further.