Bigraph.LinkOperations on link graphs.
val pp_edg :
Ppx_deriving_runtime.Format.formatter ->
edg ->
Ppx_deriving_runtime.unitval show_edg : edg -> Ppx_deriving_runtime.stringval edg_to_yojson : edg -> Yojson.Safe.tval edg_of_yojson : Yojson.Safe.t -> edg Ppx_deriving_yojson_runtime.error_orThe port multiset of an edge. Ports are tracked as a multiset: each occurrence of a link name in the edge counts separately, so multiplicities matter for pattern matching.
Total order on edges by inner face, outer face, and then port multiset; 0 exactly when the two edges are structurally equal, that is, when struct_equal holds.
struct_equal e1 e2 is true when the two edges have the same inner face, outer face, and port multiset.
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_orMultiset operations for link graphs.
val empty : tThe empty link graph.
val is_empty : t -> boolReturn true if the link graph is empty.
Fold over the edges of a link graph, in elements order.
val cardinal : t -> intReturn the number of edges.
Return the list of edges, sorted ascending by edge_compare with structurally-equal edges in insertion order. The position of an edge in this list is its index in the SAT closed-edge encoding and in the SBC edge generators, so the order is part of the observable behaviour.
val outer_names_of : t -> (string * int) listouter_names_of l = the outer names of l as (name, node) pairs, sorted by name: the node is the smallest port node the name touches, or -1 when the name's link is portless. Big.to_dot seats the names in the top interface row with these.
val hub_lefts : int array -> int list array -> t -> (string * int * int) listhub_lefts depths par_above l = for each outer name of a port-carrying hub edge, (name, node, pos): the node the edge's hub is chained beside (the median left node of its densest projected port group), pos = 0 when the hub stands on the node's left (single-node hub with an odd edge index), 2 on the right. Big.to_dot seats the name at that position.
val inner_names_of : t -> string listinner_names_of l = the inner names of l, sorted.
val to_dot :
depths:int array ->
par_above:int list array ->
top_par:int array ->
names:(string * (int * int)) list ->
t ->
string * string * string * stringto_dot ~depths ~par_above ~top_par ~names l computes a four-elements tuple encoding the dot representation of link graph l: depths is the place depth per node (see Place.depths), par_above the node parents in the rank above each node (see Place.parents_above), top_par the root region directly containing each depth-1 node, else -1 (the region whose place arrow lands on the node), and names maps each outer name to (own row position, home region's row position) in the top interface row (see Big.to_dot). The first two elements represent inner and outer names shape declarations, the third the hyperedge (hub) shape declarations and the fourth the adjacency. Green edges carry compass-point anchors so that lines leaving one node fan out instead of overlapping, and hubs are pinned to the place rank of their densest same-depth port group, so they render beside the nodes they link, not in the interface rows. The node row order is the node-id order.
elementary_sub inner outer computes a substitution consisting of a single edge in which inner and outer are the inner and outer face, respectively.
elementary_id f computes the identity over face f, that is, one edge for each name in f.
val id_empty : tid_empty is the empty link graph.
Raised 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.
Raised when a composition between two incompatible link graphs cannot be performed.
tens a b n computes the tensor product of link graphs a and b. Argument n is the number of nodes of a.
ppar a b n computes the parallel composition of link graphs a and b. n is the number of nodes of a.
comp a b n computes the composition of link graphs a and b. Argument n is the number of nodes of a.
val is_id : t -> boolis_id l is true if link graph l is an identity, false otherwise.
val is_mono : t -> boolis_mono l is true if link graph l is monomorphic, false otherwise. A link graph is monomorphic if every edge has at most one inner name.
val is_epi : t -> boolis_epi l is true if link graph l is epimorphic, false otherwise. A link graph is epimorphic if no outer name is idle.
val is_ground : t -> boolis_ground l is true if link graph l has no inner names, false otherwise.
val is_guard : t -> boolis_guard l is true if no edges in link graph l have both inner and outer names, false otherwise.
val max_ports : t -> intCompute the maximum number of ports in one edge of a link graph.
val closed_edges : t -> intCompute the number of closed edges.
filter_iso p l filters link graph l keeping only the edges satisfying predicate p. The computed isomorphism maps edge indices of the filtered link graph to indices of edges in l.
closed_edges_iso l computes the closed edges of link graph l. The computed isomorphism maps edge indices of the new link graph to indices of edges in l.
Normalise link graph l as follows: l = omega o l' where omega is a linking and l' is the same as l but with all links open.
decomp target pattern i_e i_c i_d f_e computes the decomposition of target given pattern, iso i_e, and isos from nodes in t to nodes of c and d, respectively. Argument f_e is a total function from links in the pattern to links in the target. Pattern p is assumed epi and mono and i_e is from edges in p to edges in t. Isos i_c and i_d are obtained by Place.decomp. The results are link graph c, d and id.
Compute the prime components of a link graph. See Place.decomp.