[ library(tentative_constraints) | The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]

integral_t(?X, ?Epsilon, +MC)

Tentative value implementation of approximate integrality
X
Tentative variables
Epsilon
Allowed deviation from integrality
MC
A monitored_constraint descriptor

Description

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 alldifferent/1 is added to a constraint set:

	:- integral_t/3 tent_implements integral/2.
	

Modes and Determinism

Examples

    ?- 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)
    

See Also

eq_t / 3, neq_t / 3, tentative : tent_implements / 2