[ library(sd) | The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]
deleteff(-Min, +List, -Rest)
Pick minimum domain size element from a list (first fail principle)
- Smallest list element in terms of domain size
- List of domain variables or constants
- Remaining list without smallest element
Extracts from a list of domain variables (or constants) the first
element with the smallest domain. This element is returned as Min,
and the remaining list without this element is returned as Rest.
This predicate is useful for implementing the first-fail-principle
in a search procedure, i.e. labeling the variable with the smallest
domain first. E.g.
( deleteff(X, List, Rest) ->
List is empty
get_domain_size / 2