Bigraph.BigBigraph operations.
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_ortype nodes_t = Nodes.tThe type of node collections.
Build a bigraph starting from its components. Note, no validity check is performed.
type inter = | Inter of int * Face.tInter (i, n) creates an interface with ordinal i and name-face n.
The type of interfaces.
val pp_inter :
Ppx_deriving_runtime.Format.formatter ->
inter ->
Ppx_deriving_runtime.unitval show_inter : inter -> Ppx_deriving_runtime.stringval inter_to_yojson : inter -> Yojson.Safe.tval inter_of_yojson :
Yojson.Safe.t ->
inter Ppx_deriving_yojson_runtime.error_orexception CTRL_ERROR of int * Face.tRaised when a control's arity does not match a face's size. The first element is the arity, the second is the mismatching face.
Raised when an isomorphism is not total. The first element is the expected domain size, the second is the actual number of mapped elements.
val ord_of_inter : inter -> intCompute the ordinal of an interface.
val to_dot : t -> string -> stringto_dot b n computes the DOT string for bigraph b named n.
Ground control parameter expressions that reference a name in the given list, within the given environment (see Ctrl.ground_exprs).
placing l r f computes a placing with r regions by parsing list l. The format of l is the same as the input for Place.parse_placing. The link graph is the identity over face f.
val size : t -> intCompute the size of a bigraph as the number of nodes plus the number of edges (edges are counted with multiplicity).
val id_eps : tThe empty identity.
val merge : int -> tBigraph consisting of one region and n sites.
val split : int -> tBigraph consisting of one site and n regions.
val one : tElementary bigraph consisting of one region.
val zero : tElementary bigraph consisting of one site.
ion ns c computes an ion of control c. Its outer names are ns. No arity check is performed.
Same as Big.ion_chk but without the site.
sub inner outer computes a substitution where inner and outer are the inner and outer faces, respectively.
intro f computes an empty bigraph providing a fresh set of names f. This function is the dual of Big.closure.
close f b closes names in f of bigraph b. Names in the outer face of b but not in f are propagated by an implicit identity.
comp a b computes the composition of bigraphs a and b, a \circ b using the algebraic notation.
comp_of_list bs computes the composition of all the bigraphs in list bs.
comp_seq ~start ~stop f computes the composition f(start) * ... * f(stop - 1).
nest a b computes the bigraph resulting from nesting bigraph b in bigraph a. Names in the outer face of b that also appear in a are shared. Names in the outer face of b but not in a are propagated by an implicit identity.
par a b computes the merge product of bigraphs a and b, a \mid b using the algebraic notation.
par_of_list bs computes the merge product of all the bigraphs in list bs.
par_seq ~start ~stop f computes the merge product f(start) | ... | f(stop - 1).
ppar a b computes the parallel product of bigraphs a and b, a \parallel b using the algebraic notation.
ppar_of_list bs computes the parallel product of all the bigraphs in list bs.
ppar_seq ~start ~stop f computes the parallel product f(start) || ... || f(stop - 1).
rename ~inner ~outer b renames names in inner to names in outer. Outer names in b not in inner are propagated by an implicit identity.
share f psi g computes the bigraphs obtained by sharing bigraph f in bigraph g by using placing psi.
tens a b computes the tensor product of bigraphs a and b, a \otimes b using the algebraic notation.
tens_of_list bs computes the tensor product of all the bigraphs in list bs.
tens_seq ~start ~stop f computes the tensor product f(start) + ... + f(stop - 1).
val is_id : t -> boolis_id b returns true if bigraph b is an identity, false otherwise.
val is_plc : t -> boolis_plc b returns true if bigraph b is a placing, false otherwise.
val is_wir : t -> boolis_wir b returns true if bigraph b is a wiring, false otherwise.
val is_epi : t -> boolis_epi b returns true if bigraph b is epimorphic, false otherwise. A bigraph is epimorphic if both its place graph and link graph are epimorphic. See Place.is_epi and Link.is_epi.
val is_mono : t -> boolis_mono b returns true if bigraph b is monomorphic, false otherwise. A bigraph is monomorphic if both its place graph and link graph are monomorphic. See Place.is_mono and Link.is_mono.
val is_guard : t -> boolis_guard b returns true if bigraph b is guarded, false otherwise. A bigraph is guarded if both its place graph and link graph are guarded. See Place.is_guard and Link.is_guard.
val is_solid : t -> boolis_solid b returns true if bigraph b is solid, false otherwise. A bigraph is solid if it is epimorphic, monomorphic, and guarded. See Big.is_epi, Big.is_mono, and Big.is_guard.
val is_ground : t -> boolis_ground b returns true if bigraph b is ground, false otherwise. A bigraph is ground if its place graph and link graph are both ground. See Place.is_ground and Link.is_ground.
decomp t p i_n i_e f_e computes the decomposition of target t given pattern p, node isomorphism i_n and edge isomorphism i_e. The isomorphism are from p to t. The elements in the result are the context, the parameter and the identity of the decomposition. Argument f_e is a total function from links in the pattern to links in the target.
val rewrite :
(Iso.t * Iso.t * Fun.t) ->
s:t ->
r0:t ->
r1:t ->
?decomp':(t * t * t) ->
Fun.t option ->
trewrite o ~s ~r0 ~r1 eta computes a bigraph obtained by replacing the occurrence of ~r0 (specified by occurrence o) in ~s with eta ~r1, where eta is a valid (no check performed) instantiation map.
When ?decomp' is provided, it is used as the precomputed decomposition (context, parameter, identity), avoiding recomputation.