Reputation: 522
I have the following Prolog code which is using clpfd:
:- use_module(library(clpfd)).
:- use_module(library(fdbg)).
go( X , Y ) :-
X = [X1,X2],
X1 in 0..10,
X2 in 0..10,
Y in -1..1,
X1 #= X2 #<=> IsNoChange,
X1 #> X2 #<=> IsDown,
X1 #< X2 #<=> IsUp,
( (IsNoChange #=1 #/\ Y #=0) #\/ (IsDown #=1 #/\ Y #= -1) #\/ (IsUp #=1 #/\ Y #=1) ),
labeling([], X).
If I run the go/2 predicate it works as expected:
| ?- go([1,2],Y).
Y = 1 ?
yes
| ?- go([3,2],Y).
Y = -1 ?
yes
| ?-
| ?- go(X,Y).
X = [0,0],
Y = 0 ?
yes
| ?-
But if I now enable the fdbg-debugger I don't get values for Y:
| ?- fdbg_on([file('fdbg.log',write) ]).
% The clp(fd) debugger is switched on
yes
% advice
| ?- go(X,Y).
X = [0,0],
Y in-1..1 ?
yes
% advice
Is this a bug in the fdbg-library or am I doing something wrong?
Upvotes: 1
Views: 168
Reputation: 1426
It's a bug in library(fdbg). It has been fixed for the upcoming SICStus 4.3.
Upvotes: 1