library(clpb) is currently available in SICStus (original version), and SWI (by mat). Let me come to the essence quite rapidly:
?- X = 1+1, sat(X), X = 1+1.
X = 1+1.
?- sat(X), X = 1+1.
false.
So this is a similar problem as it exists in the default state of library(clpfd).
What to do in such a situation?
Update: In library(clpfd) of mat, there is now the functor # /1 for this purpose. Ideally, accompanied with an operator declaration op(150,fx,#), we now can write:
?- X = 1+1, #X #= Y.
ERROR: Type error: `integer' expected, found `1+1' (a compound)
To ensure full algebraic properties one has to declare:
:- set_prolog_flag(clpfd_monotonic, true).
Now, variables that are left ambiguous (thus, being either integers only, or expressions) produce instantiation errors:
?- 1 + 1 #= Y.
ERROR: Arguments are not sufficiently instantiated
?- 1 + 1 #= #Y.
Y = 2.
In the meantime, also
library(clpb)ensures monotonicity similar tolibrary(clpz)/library(clfd). Within this execution mode, explicit variables have to be decorated with(v)/1.In Scryer, say: