Module Bigraph.Iso
Standard map operations
Additional functions
val add : int -> int -> t -> t
add i j iso
adds a new pair(i, j)
to isomorphismiso
. Ifi
orj
are already bound iniso
,iso
is returned unmodified.
val to_list : t -> (int * int) list
Return the list of pairs defined by an isomorphism.
val of_list : (int * int) list -> t
of_list l
returns an isomorphism with the elements in listl
. In case of conflicting pairs, the left-most is added to the isomorphism.
val to_string : t -> string
Return the string representation of an isomorphism. Example:
{(1, 1), (2, 3), (5, 2)}
val pp : Stdlib.Format.formatter -> t -> unit
Pretty printer.
val equal_up_to : t -> t -> t list -> bool
equal_up_to i i' autos
checks whetheri
andi'
are equal up to isomorphism.autos
is a list of ismorphisms overi
.
val apply : t -> int -> int option
apply iso i
returns the value associated toi
by isomorphismiso
.
val transform : iso_dom:t -> iso_codom:t -> t -> t
transform ~iso_dom ~iso_codom i
returns the isomorphism obtained by applyingiso_dom
andiso_codom
to the domain and co-domain ofi
, respectively. Entries ini
that cannot be mapped by eitheriso_dom
oriso_codom
are ignored.
val gen_isos : t -> t list -> t list
gen_isos iso autos
generates the symmetric isomorphisms ofiso
by usingautos
, a list of automorphisms over the domain ofiso
. Entries iniso
not mapped by an automorphism are ignored.
val is_id : t -> bool
Returns
true
if an isomorphism is an identity,false
otherwise.