trealla: clpb missing a solution

The only example from the clpb.pl doc that is out-right wrong (so far)…

~/trealla (devel) $ tpl
Trealla Prolog (c) Infradig 2020-2023, v2.27.20-1-gc049-dirty
?- use_module(library(clpb)).
   true.
?- sat(X*Y + X*Z), labeling([X,Y,Z]).
   X = 1, Y = X, Z = 0
;  X = 1, Y = X, Z = X
;  false.
?- 

The first solution is missing, as per below…

~/trealla (devel) $ scryer-prolog
?- use_module(library(clpb)).
   true.
?- sat(X*Y + X*Z), labeling([X,Y,Z]).
   X = 1, Y = 0, Z = 1
;  X = 1, Y = 1, Z = 0
;  X = 1, Y = 1, Z = 1.
?- 

About this issue

  • Original URL
  • State: open
  • Created 9 months ago
  • Comments: 18 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Ok, I think all the issues above are resolved excpet the original problem, which is back to missing one solution…

~/trealla (devel) $ tpl Trealla Prolog © Infradig 2020-2023, v2.29.7 ?- use_module(library(clpb)). true. ?- sat(XY + XZ), labeling([X,Y,Z]). X = 1, Y = X, Z = 0 ; X = 1, Y = X, Z = X. ?-

Well there’s something that interacts badly with TCO because -O0 just disables that.

On Mon, 9 Oct 2023, 07:25 Markus Triska, @.***> wrote:

Here is the full interaction, using the code I posted in #338 (comment) https://github.com/trealla-prolog/trealla/issues/338#issuecomment-1747544829 :

$ ./tpl Trealla Prolog © Infradig 2020-2023, v2.29.2 ?- [user]. sat_rewrite(V, V) :- var(V), !. sat_rewrite(P0Q0, PQ) :- sat_rewrite(P0, P), sat_rewrite(Q0, Q). sat_rewrite(P0+Q0, P+Q) :- sat_rewrite(P0, P), sat_rewrite(Q0, Q).% Ctrl+d true.?- sat_rewrite(XY + XZ, Sat). Sat = X+Z.

No attributes occur in this example! This is really basic code, it would be ridiculous to try to tackle library(clpz) as long as such elementary errors are present in the engine.

I can confirm that the problem is not present when I invoke Trealla with -O0.

— Reply to this email directly, view it on GitHub https://github.com/trealla-prolog/trealla/issues/338#issuecomment-1752166014, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNKSEVVSNXZB2IQT5IIKVLX6MK5VAVCNFSM6AAAAAA43KOP42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJSGE3DMMBRGQ . You are receiving this because you authored the thread.Message ID: @.***>