I was playing around with the prolog-coroutining predicates freeze/2
and frozen/2
:
?- freeze(X,a=a), frozen(X,Goal).
?- freeze(X,a=a), freeze(Y,b=b), X=Y, frozen(X,Goal).
sicstus-prolog (version 4.5.1 for x86_64) gave these answers:
| ?- freeze(X,a=a), frozen(X,Goal). Goal = prolog:freeze(X,user:(a=a)), prolog:freeze(X,user:(a=a)) ? ; no | ?- freeze(X,a=a), freeze(Y,b=b), X=Y, frozen(X,Goal). Y = X, Goal = (user:(a=a),prolog:freeze(X,user:(b=b))), prolog:freeze(X,user:(a=a)), prolog:freeze(X,user:(b=b)) ? ; no
Now Goal = prolog:freeze(X,user:(a=a))
I did not expect!
What I did expect were answers like the ones given by swi-prolog version 8.0.3:
?- freeze(X,a=a), frozen(X,Goal). Goal = user:(a=a), freeze(X, a=a). ?- freeze(X,a=a), freeze(Y,b=b), X=Y, frozen(X,Goal). X = Y, Goal = (user:(a=a), user:(b=b)), freeze(Y, a=a), freeze(Y, b=b).
Arguably, both the SICStus answers and the SWI answers are correct...
But is there a deeper reason for the somewhat peculiar answer(s) given by SICStus?
prolog:
in place of nothing (as shown by SWI) – Carlinfreeze/2
goals. – Carlinprolog:
is the module for builtins. in SWI is no such module – Lavinesystem
module. Just saygit grep system:
in the sources. – Carlin