Tentative value implementation of approximate integrality constraint.
The violatedness of the constraint is 0 if X's value is within tolerance Epsilon of the nearest integers, 1 otherwise.
The following declaration is in effect, meaning that integral_t/3 is used whenever integral/2 is added to a constraint set:
:- integral_t/3 tent_implements integral/2.
?- X tent_set 3.2, CS :~ integral(X, 0.1). X = X{3.2 -> 0} CS = constraint_set(TotalVio{1 -> 0}, ...) There is 1 delayed goal. Yes (0.00s cpu) ?- X tent_set 3.2, CS :~ integral(X, 0.1), X tent_set 3.01. X = X{3.01 -> 0} CS = constraint_set(TotalVio{0 -> 0}, ...) There is 1 delayed goal. Yes (0.00s cpu)