You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
?- use_module(library(freeze)).
true.
?- [user].
:- module(b, [b/0]).
b:b.
?- freeze(X,(Y=Z)), freeze(Y,b:P), bagof(Y=Y,X=Y,[Z=Z]), P=b, X=true. % notice P=b
error(instantiation_error,call/1).
?- freeze(X,(Y=Z,P=b)), freeze(Y,b:P), bagof(Y=Y,X=Y,[Z=Z]), X=true. % now P=b 'freeze-shifted'
error(instantiation_error,call/1).
?- freeze(X,(Y=Z,P=b)), freeze(Y,b:P), bagof(Y=Y,X=Y,[Z=Z]), P=b, X=true. % both in place and it works, why?
X = true, Y = true, Z = true, P = b.
?-
A problem I see is that b:b is called twice:
?- [user].
:- module(b, [b/0]).
b:b :- write(trace),nl.
?- freeze(X,(Y=Z,P=b)), freeze(Y,b:P), bagof(Y=Y,X=Y,[Z=Z]), P=b, X=true.
trace
trace
X = true, Y = true, Z = true, P = b.
% Four are better than two
?- freeze(X,(Y=Z,P=b)), freeze(Y,(P:P,P:P)), bagof(Y=Y,X=Y,[Z=Z]), P=b, X=true.
trace
trace
trace
trace
X = true, Y = true, Z = true, P = b.
?-
The text was updated successfully, but these errors were encountered:
?- freeze(X,a),freeze(Y,b),X=Y.
X = Y, freeze:freeze(X,(a,b)) % fine, one possible answer
| X = Y, freeze:freeze(X,a), freeze:freeze(X, b). % another possible answer
?- freeze(X,a),freeze(Y,b), bagof(t,X=Y,_).
X = Y, freeze:freeze(X,((a,a,b),b)), unexpected.
?- freeze(X,a),freeze(Y,b), setof(t,X=Y,_).
X = Y, freeze:freeze(X,((a,a,b),b)), unexpected.
The text was updated successfully, but these errors were encountered: