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

deleteff(?Var, +List, -Rest)

Select from List the variable Var which has the smallest domain and return the rest of the list.
-Var
A variable.
-Rest
A term unifying with a list of domain variables or integers.
+List
A list of domain variables or integers.

Description

This predicate is used in the labeling procedures. When we look for the instantiation of a list of domain variables which is consistent with a set of constraints, it is better to start with instantiations which are most likely to fail, because this will cut down the size of the search space considerably.

The predicate deleteff/3 selects the variable with the smallest domain. If there are several variables with the same domain size, the leftmost one in the list is taken. Constants are treated like variables of domain size one. The list Rest is the same as List except that the selected element is missing. In particular, any existing list order is preserved.

Fail Conditions

Fails if List is nil.

Resatisfiable

No.

See Also

deleteffc / 3, indomain / 1, fd_search : search / 6