10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-12-23 04:43:32 +01:00
QCaml/common/lib/zkey.mli

62 lines
1.3 KiB
OCaml

(** Types *)
type t
type kind =
| Three of Powers.t
| Four of (int * int * int * int)
| Six of (Powers.t * Powers.t)
| Nine of (Powers.t * Powers.t * Powers.t)
| Twelve of (Powers.t * Powers.t * Powers.t * Powers.t)
(** Conversions *)
val of_powers_three : Powers.t -> t
(** Create from a ~Powers.t~ *)
val of_powers_six : Powers.t -> Powers.t -> t
(** Create from two ~Powers.t~ *)
val of_powers_nine : Powers.t -> Powers.t -> Powers.t -> t
(** Create from three ~Powers.t~ *)
val of_powers_twelve : Powers.t -> Powers.t -> Powers.t -> Powers.t -> t
(** Create from four ~Powers.t~ *)
val of_powers : kind -> t
(** Create using the ~kind~ type *)
val of_int_array : int array -> t
(** Convert from an ~int~ array *)
val of_int_four : int -> int -> int -> int -> t
(** Create from four ~ints~ *)
val to_int_array : t -> int array
(** Convert to an ~int~ array *)
val to_powers : t -> kind
(** Convert to an ~Powers.t~ array *)
val to_string : t -> string
(** Pretty printing *)
(** Functions for hash tables *)
val hash : t -> int
(** Associates a nonnegative integer to any Zkey *)
val equal : t -> t -> bool
(** The equal function. True if two Zkeys are equal *)
val compare : t -> t -> int
(** Comparison function, used for sorting *)
(** Printers *)
val pp : Format.formatter -> t -> unit