Bigraph.FunImplementation of finite functions over integers.
val pp :
Ppx_deriving_runtime.Format.formatter ->
t ->
Ppx_deriving_runtime.unitval show : t -> Ppx_deriving_runtime.stringval to_yojson : t -> Yojson.Safe.tval of_yojson : Yojson.Safe.t -> t Ppx_deriving_yojson_runtime.error_orThese follow the standard Map module conventions.
add i j f adds a new pair (i, j) to function f. Both i and j must be non negative.
val empty : tval fold : (int -> int -> 'b -> 'b) -> t -> 'b -> 'bval iter : (int -> int -> unit) -> t -> unitReturn the inverse of a function. Note that the inverse of a function is, in the general case, a binary relation.
val to_list : t -> (int * int) listReturn the list of pairs defined by a function.
val of_list : (int * int) list -> tInverse of Fun.to_list. Note that in case of clashing pairs only the right-most is used.
val parse : int list -> tparse l returns a function in which the numbers from 0 to n - 1 (with n the length of l) are mapped to the elements of l, in the given order. Example:
parse [0; 0; 3; 1; 2] = [(0, 0); (1, 0); (2, 3); (3, 1); (4, 2)].
val apply : t -> int -> int optionapply f x returns f x.
transform ~iso_dom ~iso_codom f returns the function obtained by applying iso_dom and iso_codom to the domain and codomain of f, respectively.
val is_total : int -> t -> boolis_total n f returns true if function f is total over domain 0, ..., n - 1, false otherwise. n must be non negative.
val is_surj : int -> t -> boolis_surj n f returns true if function f is surjective over codomain 0, ..., n - 1, false otherwise. n must be non negative.
val is_id : t -> boolis_id f returns true if f i = i for each i, false otherwise.
val check_codom : int -> t -> boolcheck_codom n f returns true if the codomain of f is in the range [0, n - 1]. n must be non negative.