]> matita.cs.unibo.it Git - pkg-cerco/acc.git/blob - src/utilities/bijection.mli
first version of the package
[pkg-cerco/acc.git] / src / utilities / bijection.mli
1 (** This module implements a bi-directional finite map. 
2 *)
3
4 module type OrderedType = sig
5   type t
6   val compare : t -> t -> int
7 end
8
9 module type S = sig
10
11   type a
12   type b
13   type t
14
15   val empty : t
16   val is_empty : t -> bool
17
18   val add1 : a -> b -> t -> t
19   val add2 : b -> a -> t -> t
20
21   val find1 : a -> t -> b
22   val find2 : b -> t -> a
23
24   val remove1 : a -> t -> t
25   val remove2 : b -> t -> t
26
27   val mem1 : a -> t -> bool
28   val mem2 : b -> t -> bool
29
30   val iter1 : (a -> b -> unit) -> t -> unit
31   val iter2 : (b -> a -> unit) -> t -> unit
32
33   val fold1 : (a -> b -> 'c -> 'c) -> t -> 'c -> 'c
34   val fold2 : (b -> a -> 'c -> 'c) -> t -> 'c -> 'c
35
36   val compare1 : (b -> b -> int) -> t -> t -> int
37   val compare2 : (a -> a -> int) -> t -> t -> int
38
39   val equal1 : (b -> b -> bool) -> t -> t -> bool
40   val equal2 : (a -> a -> bool) -> t -> t -> bool
41
42 end
43
44 module Make (O1 : OrderedType) (O2 : OrderedType) : S with type a = O1.t and
45                                                            type b = O2.t