[eclipse-clp-users] findall + gfd strange behaviuor

From: Sergii Dymchenko <kit1980_at_...6...>
Date: Mon, 30 Dec 2013 12:57:17 -0800
Hi,

Consider this:

main :-
    (for(N, 4, 6), fromto(0, Sprev, Scurr, S) do
        findall(X, (model(N, X, Digits), find(X, Digits)), Sols),
        eclipse_language:sum(Sols, Si),
        Scurr is Sprev + Si),
    writeln(S).

My understanding that this is equivalent to the case when model/3 is called
outside of findall, because findall undoes all changes:

main :-
    (for(N, 4, 6), fromto(0, Sprev, Scurr, S) do
        model(N, X, Digits),
        findall(X, find(X, Digits), Sols),
        eclipse_language:sum(Sols, Si),
        Scurr is Sprev + Si),
    writeln(S).

And these two mains give the same results when I use lib(ic) for my models.
But results are different when I use lib(gfd).

Could it be a bug in lib(gfd) or I missed something? My current ECLiPSe
version is 6.1 #174 (x86_64_linux).

I've attached the whole program.

Sergey.



Received on Mon Dec 30 2013 - 20:57:24 CET

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:20 CEST