-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhset.mli
83 lines (52 loc) · 2.53 KB
/
hset.mli
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
71
72
73
74
75
76
77
78
79
80
81
82
83
(**************************************************************************)
(* *)
(* Copyright (C) Jean-Christophe Filliatre *)
(* *)
(* This software is free software; you can redistribute it and/or *)
(* modify it under the terms of the GNU Library General Public *)
(* License version 2.1, with the special exception on linking *)
(* described in file LICENSE. *)
(* *)
(* This software is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *)
(* *)
(**************************************************************************)
(*s Sets of hash-consed values, implemented as Patricia trees.
See the modules [Hashcons] and [Ptset]. *)
type 'a t
type 'a elt = 'a Hashcons.hash_consed
val empty : 'a t
val is_empty : 'a t -> bool
val is_singleton : 'a t -> bool
val mem : 'a elt -> 'a t -> bool
val add : 'a elt -> 'a t -> 'a t
val singleton : 'a elt -> 'a t
val remove : 'a elt -> 'a t -> 'a t
val union : 'a t -> 'a t -> 'a t
val subset : 'a t -> 'a t -> bool
val inter : 'a t -> 'a t -> 'a t
val diff : 'a t -> 'a t -> 'a t
val equal : 'a t -> 'a t -> bool
val compare : 'a t -> 'a t -> int
val elements : 'a t -> 'a elt list
val choose : 'a t -> 'a elt
val cardinal : 'a t -> int
val iter : ('a elt -> unit) -> 'a t -> unit
val fold : ('a elt -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : ('a elt -> bool) -> 'a t -> bool
val exists : ('a elt -> bool) -> 'a t -> bool
val filter : ('a elt -> bool) -> 'a t -> 'a t
val partition : ('a elt -> bool) -> 'a t -> 'a t * 'a t
val map : ('a elt -> 'b elt) -> 'a t -> 'b t
(*s Warning: [min_elt] and [max_elt] are linear w.r.t. the size of the
set. In other words, [min_elt t] is barely more efficient than [fold
min t (choose t)]. *)
val min_elt : 'a t -> 'a elt
val max_elt : 'a t -> 'a elt
(*s Additional functions not appearing in the signature [Set.S] from ocaml
standard library. *)
(* [intersect u v] determines if sets [u] and [v] have a non-empty
intersection. *)
val intersect : 'a t -> 'a t -> bool
val of_list : 'a elt list -> 'a t