File: fcl_conjunto.mli

package info (click to toggle)
facile 1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 656 kB
  • ctags: 1,283
  • sloc: ml: 6,848; makefile: 127; sh: 21
file content (70 lines) | stat: -rw-r--r-- 3,591 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
(***********************************************************************)
(*                                                                     *)
(*                           FaCiLe                                    *)
(*                 A Functional Constraint Library                     *)
(*                                                                     *)
(*            Nicolas Barnier, Pascal Brisset, LOG, CENA               *)
(*                                                                     *)
(* Copyright 2004 CENA. All rights reserved. This file is distributed  *)
(* under the terms of the GNU Lesser General Public License.           *)
(***********************************************************************)
(* $Id: fcl_conjunto.mli,v 1.9 2004/08/09 14:45:41 barnier Exp $ *)

(** Constraints on Finite Sets *)

val subset : Fcl_var.SetFd.t -> Fcl_var.SetFd.t -> Fcl_cstr.t
(** [subset v1 v2] ensures that [v1] is a subset of [v2]. Not reifiable. *)

val cardinal : Fcl_var.SetFd.t -> Fcl_var.Fd.t
(** [cardinal v] returns the cardinal (an integer variable) of the set [v]. Not reifiable. *)

val smallest : Fcl_var.SetFd.t -> Fcl_var.Fd.t
(** [smallest v] returns the smallest element (an integer variable) of [v]. *)

val union : Fcl_var.SetFd.t -> Fcl_var.SetFd.t -> Fcl_var.SetFd.t
val inter : Fcl_var.SetFd.t -> Fcl_var.SetFd.t -> Fcl_var.SetFd.t
(** Operations on sets. *)

val all_disjoint : Fcl_var.SetFd.t array -> Fcl_cstr.t
(** [all_disjoint vars] ensures that all the set variables of array [vars]
   are pairwise disjoint. Not reifiable. *)

val disjoint : Fcl_var.SetFd.t -> Fcl_var.SetFd.t -> Fcl_cstr.t
(** [disjoint v1 v2] defined by [all_disjoint [|v1; v2|]]. Not reifiable. *)

val inside : int -> Fcl_var.SetFd.t -> unit
val outside : int -> Fcl_var.SetFd.t -> unit
(** Basic refinements for labeling. *)

val mem : Fcl_var.Fd.t -> Fcl_var.SetFd.t -> Fcl_cstr.t
(** [mem x v] states that [x] belongs to [v]. *)

val inf_min : Fcl_var.SetFd.t -> Fcl_var.SetFd.t -> Fcl_cstr.t
(** [inf_min v1 v2] ensures that the minimal element
   of [v1] is less than or equal to the minimal element of [v2]. The empty set
   is smaller than any other set. Useful to break permutation symmetries for
   a set of set variables. Not reifiable. *)

val order : Fcl_var.SetFd.t -> Fcl_var.SetFd.t -> Fcl_cstr.t
(** [order v1 v2] ensures that [v1] is less than or equal to [v2]
   according to [Domain.compare] {% (see~\ref{val:Domain.compare})%}.
   Caution: [order] builds the cardinal
   variables of [v1] and [v2]; if they are already available, please use
   [order_with_card]. Not reifiable. *)

val order_with_card : Fcl_var.SetFd.t -> Fcl_var.Fd.t -> Fcl_var.SetFd.t -> Fcl_var.Fd.t -> Fcl_cstr.t
(** [order_with_card v1 card1 v2 card2] is equivalent to [order] but the cardinals
   of the variables must be provided too. Useful to sort a set of variables. *)

val member : Fcl_var.SetFd.t -> Fcl_setDomain.elt list -> Fcl_cstr.t
(** [member v l] ensures that [v] will have a value in [l]. Not reifiable. *)

val sum_weight : Fcl_var.SetFd.t -> (int * int) list -> Fcl_var.Fd.t
(** [sum_weight v weights] returns an integer variable equal to the sum
   of the weights associated with the value in [v]. [weights] must be a
   list of pairs [value, weight)] that associates a unique weight to each
   value possibly in [v]. All the weights must be positive integers. *)

(**/**)
val atmost1 : Fcl_var.SetFd.t array -> int -> unit
(* [atmost1 sets card] states that [sets] must have cardinality [card] and must intersect pairwise in atmost one element *)