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

labeling(+Vars)

Instantiates all variables in a collection to elements of their domains.
Vars
A collection (a la collection_to_list/2) of integer IC variables or integers

Description

Simple predicate for instantiating a collection of GFD domain variables to elements of their domains. (Integers are also allowed in the collection; they are effectively ignored.) The variables are instantiated in the order in which they appear in the collection; the implementation is essentially:

	labeling(Vars) :-
		collection_to_list(Vars, List),
                gfd_update,
		( foreach(Var,List) do
		    indomain(Var,min)
		).

Note that labeling performs the search in ECLiPSe, but it uses indomain/2 with min, which is optimised for use with Gecode, and a gfd_update before the labeling starts to ensure that no recomputation will not be done for events before the labeling starts.

Modes and Determinism

See Also

gfd_search : indomain / 2, ic : labeling / 1, sd : labeling / 1, fd : labeling / 1, eclipse_6 : collection_to_list / 2, lists : collection_to_list / 2