Module Bigraph.Place
type m= Sparse.tThe type of boolean matrices.
type t={r : int;Number of regions
n : int;Number of nodes
s : int;Number of sites
rn : m;Boolean adjacency matrix regions X nodes
rs : m;Boolean adjacency matrix regions X sites
nn : m;Boolean adjacency matrix nodes X nodes
ns : m;Boolean adjacency matrix nodes X sites
}The type of place graphs.
val to_string : t -> stringto_string preturns a string representation of place graphp.
val pp : Stdlib.Format.formatter -> t -> unitPretty printer.
val edges : m -> (int * int) listComputes the representation of a boolean matrix as a list of edges.
val size : t -> intCompute the number of edges in the DAG.
val parse : regions:int -> nodes:int -> sites:int -> string list -> tparse r n s linescomputes a place graph withrregions,nnodes andssites. Each element inlinesis a string in the same format of the output ofto_string.- raises Invalid_argument
if the arguments do not specify a valid place graph.
val get_dot : t -> string * string * string * stringget_dot preturns three strings expressing place graphpin dot format. The first two elements encode regions and sites shapes, the third encodes the node ranks and the fourth represents the adjacency matrix.
val parse_placing : int list list -> int -> tparse_placing l rreturns the placing withrregions defined by listlin which each element is a site's parent set.
Elementary place graphs
val elementary_id : int -> telementary_id mcomputes a place graph in the form of an identity ofm.
val id0 : tid0is the empty place graph.
val elementary_merge : int -> telementary_merge mcomputes an elementary place graph formed by one region containingmsites.
val elementary_split : int -> telementary_split mcomputes an elementary place graph formed by one site shared bymregions.
val zero : tzerois the place graph formed by an orphaned site.
val one : toneis the place graph formed by an idle region.
val elementary_sym : int -> int -> telementary_sym m ncomputes an place graph consisting of a symmetry betweenmandn.
val elementary_ion : tAn ion.
Comparison
Operations
Predicates
val is_id : t -> boolis_id preturnstrueif place graphpis an identity,falseotherwise.
val is_plc : t -> boolTest for the absence of nodes.
val is_ground : t -> boolis_ground pistrueif place graphphas no sites,falseotherwise.
val is_mono : t -> boolis_mono pistrueif place graphpis monomorphic,falseotherwise. A place graph is monomorphic if no two sites are siblings and no site is an orphan.
val is_epi : t -> boolis_epi pistrueif place graphpis epimorphic,falseotherwise. A place graph is epimorphic if no region is idle and no two regions are partners.
val is_guard : t -> boolis_guard pistrueif place graphpis guarded,falseotherwise. A place graph is guarded if no region has sites as children.
Decompositions
val decomp : target:t -> pattern:t -> Iso.t -> t * t * t * Iso.t * Iso.tdecomp t p icomputes the decomposition of targettgiven patternpand node isomorphismifromptot. Patternpis assumed epi and mono. The result tuple(c, id, d, iso_c, iso_d)is formed by contextc, identityid, parameterd, and nodes incanddexpressed as rows oft. The decomposition is with respect to the minimal parameter
exceptionNOT_PRIMERaised when a place graph cannot be decomposed into prime components. The first element is a set of shared nodes and the second a set of shared sites.
val prime_components : t -> (t * Iso.t) listCompute the prime components (i.e. place graphs with one region) of a place graph. The original node numbering is returned in the form of an isomorphism.
- raises NOT_PRIME
when some region is shared