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

# gfd_vars_exclude_range(+Vars, ++Lo, ++Hi)

Exclude the elements Lo..Hi from the domains of Vars.

Vars
  Collection of existing domain variable or integer
Lo
  Integer lower bound of range to exclude
Hi
  Integer upper bound of range to exclude

## Description

Primitive for excluding the integers between Lo and Hi (inclusive) from the domains of variables in Vars.

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, this predicate 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.

This predicate is specific to lib(gfd), and is more efficient than using multiple exclude_range/2 for updating each variable in Vars, because this is implementing as one rather than multiple events.