Module Bigraph.Link
Faces
module Face : sig ... endThis module provides set operations for faces.
Ports
module Ports : sig ... endThis module implements multisets of nodes as maps.
Link graphs
module Lg : sig ... endThis module provides set operations for link graphs.
val parse_face : string list -> Face.tparse_face nscomputes a face starting from list of string namesns.
val string_of_face : Face.t -> stringstring_of_face fcomputes the string representation of facef.
val pp_face : Stdlib.Format.formatter -> Face.t -> unitPretty printer.
val to_string : Lg.t -> stringto_string lcomputes the string representation of link graphl.
val pp : Stdlib.Format.formatter -> Lg.t -> unitPretty printer.
val of_string : string -> Lg.tOpposite of
Link.to_string.- raises Invalid_argument
if the input cannot be parsed.
val get_dot : Lg.t -> string * string * string * stringget_dot lcomputes a four-elements tuple encoding the dot representation of link graphl. The first two elements represent inner and outer names shape declarations. The third element represent the hyperedges shape declarations. The fourth element specifies the adjacency matrix.
Elementary link graphs
val elementary_sub : inner:Face.t -> outer:Face.t -> Lg.telementary_sub inner outercomputes a substitution consisting of a single edge in whichinnerandouterare the inner and outer face, respectively.
val elementary_id : Face.t -> Lg.telementary_id fcomputes the identity over facef, i.e. one edge for each name inf.
val id_empty : Lg.tid_emptyis the empty link graph.
Operations on link graphs
exceptionNAMES_ALREADY_DEFINED of Face.t * Face.tRaised when the tensor product between two incompatible link graphs cannot be performed. The first element is the set of inner common names while the second is the set of outer common names.
exceptionFACES_MISMATCH of Face.t * Face.tRaised when a composition between two incompatible link graphs cannot be performed.
val tens : Lg.t -> Lg.t -> int -> Lg.ttens a b ncomputes the tensor product of link graphsaandb. Argumentnis the number of nodes ofa.- raises NAMES_ALREADY_DEFINED
when there are shared names.
Predicates
val is_id : Lg.t -> boolis_id listrueif link graphlis an identity,falseotherwise.
val is_mono : Lg.t -> boolis_mono listrueif link graphlis monomorphic,falseotherwise. A link graph is monomorphic if every edge has at most one inner name.
val is_epi : Lg.t -> boolis_epi listrueif link graphlis epimorphic,falseotherwise. A link graph is epimorphic if no outer name is idle.
val is_ground : Lg.t -> boolis_ground listrueif link graphlhas no inner names,falseotherwise.
val is_guard : Lg.t -> boolis_guard listrueif no edges in link graphlhave both inner and outer names,falseotherwise.
val max_ports : Lg.t -> intCompute the maximum number of ports in one edge of a link graph.
val cardinal_ports : Lg.t -> int listCompute a sorted list with the cardinalities of the port sets.
val closed_edges : Lg.t -> intCompute the number of closed edges.
Decompositions
val norm : Lg.t -> Lg.t * Lg.tNormalise link graph
las follows:l = omega o l'whereomegais a linking andl'is the same aslbut with all links open.
val decomp : target:Lg.t -> pattern:Lg.t -> i_e:Iso.t -> i_c:Iso.t -> i_d:Iso.t -> Fun.t -> Lg.t * Lg.t * Lg.tdecomp target pattern i_e i_c i_d f_ecomputes the decomposition oftargetgivenpattern, isoi_e, and isos from nodes intto nodes ofcandd, respectively. Argumentf_eis a total function from links in the pattern to links in the target. Patternpis assumed epi and mono andi_eis from edges inpto edges int. Isosi_candi_dare obtained byPlace.decomp. The results are link graphc,dandid.
val prime_components : Lg.t -> Iso.t list -> Lg.t listCompute the prime components of a link graph. See
Place.decomp.