next up previous index
Next: Cumulative Constraint and Resource Up: Additional Finite Domain Constraints Previous: Additional Finite Domain Constraints   Index

Various Constraints on Lists

The library fd_global implements a number of constraints over lists of finite domain variables. It is loaded using one of

:- use_module(library(fd_global)).
:- lib(fd_global).

The following predicates are provided

minlist(+List, ?Min)

Min is the minimum of the values in List. Operationally: Min gets updated to reflect the current range of the minimum of variables and values in List. Likewise, the list elements get constrained to the minimum given.

maxlist(+List, ?Max)

Max is the maximum of the values in List. Operationally: Max gets updated to reflect the current range of the maximum of variables and values in List. Likewise, the list elements get constrained to the maximum given.

ordered(++Relation, +List)

Constrains List to be ordered according to Relation. Relation is one of the atoms <, =<, >, >=, = .

occurrences(++Value, +List, ?N)

The value Value occurs in List N times. Operationally: N gets updated to reflect the number of possible occurrences in the List. List elements may get instantiated to Value, or Value may be removed from their domain if required by N.

sumlist(+List, ?Sum)

The sum of the list elements is Sum. This constraint is more efficient than the general fd-arithmetic constraint if the list is long and Sum is not constrained frequently.


next up previous index
Next: Cumulative Constraint and Resource Up: Additional Finite Domain Constraints Previous: Additional Finite Domain Constraints   Index

1999-08-06