Module Bigraph.Fun
Standard map operations
Additional functions
val inverse : t -> Rel.tReturn 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 lreturns a function in which the numbers from0ton - 1(withnthe length ofl) are mapped to the elements ofl, in the given order. Example:parse [0;0;3;1;2] = [(0,0);(1,0);(2,3);(3,1);(4,2)].
val to_string : t -> stringReturn the string representation of a function. Example:
{(1, 2), (2, 3), (3, 3)}
val pp : Stdlib.Format.formatter -> t -> unitPretty printer.
val apply : t -> int -> int optionapply f xreturnsf(x).
val transform : iso_dom:Iso.t -> iso_codom:Iso.t -> t -> ttransform ~iso_dom ~iso_codom freturns the function obtained by applyingiso_domandiso_codomto the domain and codomain off, respectively.
val is_total : int -> t -> boolis_total n freturnstrueif functionfis total over domain0,...,n-1,falseotherwise.
val is_surj : int -> t -> boolis_surj n freturnstrueif functionfis surjective over codomain0,...,n-1,falseotherwise.
val is_id : t -> boolis_id freturnstrueiff(i) = ifor eachi,falseotherwise.
val check_codom : int -> t -> boolcheck_codom n freturnstrueif the codomain offis in the range[0, n-1].