[ library(gfd) | Reference Manual | Alphabetic Index ]

impose_min(?Var, ++Bound)

Update (if required) the lower bound of Var.
Var
(Domain) variable or integer
Bound
Lower bound (integer)

Description

This predicate is provided mainly for compatibility with IC solver. If you intend to impose the same minimum on multiple variables, it is more efficient to use the lib(gfd) specific gfd_vars_impose_min/2.

Primitive for updating the lower bound of Var so that it is at least Bound. A bound update on a variable may fail (when the update empties the domain), succeed (possibly updating the variable's bounds), or instantiate the variable (in the case where the domain gets restricted to a singleton value).

Note that this predicate is intended for use only in implementing co-operation with other solvers and constraint propagators at the ECLiPSe level, and should not be called from ordinary user code. It differs from the usual constraint in that the propagation is not performed immediately. Normally, propagation in gecode is performed by a suspended goal that is scheduled and woken after each constraint is posted. However, impose_min/2 does not call the woken goal scheduler (wake/0), so the propagation goal may not be executed immediately. (It is possible that under some circumstances the goal will be executed, if wake/0 is called indirectly - one example would be by the unify handler if the variable becomes ground - but this should not be relied upon.) To ensure that the goals are eventually executed, the caller should arrange for wake/0 to be called at some appropriate point in the subsequent execution. Please see the "Advanced Control Features" section of the User Manual for more information about woken goal management.

See Also

impose_max / 2, impose_bounds / 3, impose_domain / 2, exclude / 2, exclude_range / 3