Module Bigraph.Iso

Implementation of finite isomorphisms over non negative integers.

type t

Type of isomorphisms over integers.

val pp : Ppx_deriving_runtime.Format.formatter -> t -> Ppx_deriving_runtime.unit
val show : t -> Ppx_deriving_runtime.string
val to_yojson : t -> Yojson.Safe.t
val of_yojson : Yojson.Safe.t -> t Ppx_deriving_yojson_runtime.error_or

Standard map operations

These follow the standard Map module conventions.

val cardinal : t -> int
val empty : t
val fold : (int -> int -> 'b -> 'b) -> t -> 'b -> 'b
val mem : int -> t -> bool
val for_all : (int -> int -> bool) -> t -> bool

Additional functions

val inverse : t -> t

Return the inverse of an isomorphism.

val add : int -> int -> t -> t

add i j iso adds a new pair (i, j) to isomorphism iso. If i or j are already bound in iso, iso is returned unmodified. Both i and j must be non negative.

val of_list : (int * int) list -> t

of_list l returns an isomorphism with the elements in list l. In case of conflicting pairs, the left-most is added to the isomorphism.

val equal : t -> t -> bool

Equality between isomorphisms.

val compare : t -> t -> int

Comparison between isomorphisms.

val apply : t -> int -> int option

apply iso i returns the value associated to i by isomorphism iso.

val transform : iso_dom:t -> iso_codom:t -> t -> t

transform ~iso_dom ~iso_codom i returns the isomorphism obtained by applying iso_dom and iso_codom to the domain and co-domain of i, respectively. An entry of i whose domain key is not in iso_dom or whose value is not in iso_codom is dropped.

val is_id : t -> bool

Returns true if an isomorphism is an identity, false otherwise.