1
(***********************************************************************)
4
(* A Functional Constraint Library *)
6
(* Nicolas Barnier, Pascal Brisset, LOG, CENA *)
8
(* Copyright 2004 CENA. All rights reserved. This file is distributed *)
9
(* under the terms of the GNU Lesser General Public License. *)
10
(***********************************************************************)
11
(* $Id: fcl_gcc.mli,v 1.15 2004/07/23 16:37:34 barnier Exp $ *)
13
(** Global Cardinality Constraint *)
15
type level = Basic | Medium | High
16
val cstr : ?level:level -> Fcl_var.Fd.t array -> (Fcl_var.Fd.t * int) array -> Fcl_cstr.t
17
(** [cstr (?level:High) vars distribution] returns a constraint ensuring
18
that for each pair [(c,v)] of cardinal variable [c] and integer
19
value [v] in the list [distribution], [c] variables in the array
20
[vars] will be instantiated to [v], i.e. [card \{vi = v | vi in vars\} = c].
21
All values [v] in [distribution] must be different otherwise the exception
22
[Invalid_argument] is raised. Three levels of propagation are provided :
23
[Basic] is the quickest, [High] performs the highest amount of propagation.
24
[level] default value is [High].
25
The constraint posts the redundant constraint stating that the sum of the
26
cardinals is equal to the number of variables. This constraint is also
27
known as the "distribute" constraint.