Module Bigraph.Ports

Operations on Ports.

type t

The type of port multisets.

val pp : Ppx_deriving_runtime.Format.formatter -> t -> Ppx_deriving_runtime.unit
val show : t -> Ppx_deriving_runtime.string
val to_yojson : t -> Yojson.Safe.t
val of_yojson : Yojson.Safe.t -> t Ppx_deriving_yojson_runtime.error_or

Standard operations on maps

val choose : t -> int * int
val compare : (int -> int -> int) -> t -> t -> int

compare cmp p1 p2 compares port multisets p1 and p2 using cmp to order node identifiers. The multiplicity values are not directly compared -- they determine the number of entries for each node in the comparison sequence.

val empty : t

compare cmp p1 p2 compares port multisets p1 and p2 using cmp to order node identifiers. The multiplicity values are not directly compared -- they determine the number of entries for each node in the comparison sequence.

val filter : (int -> int -> bool) -> t -> t
val fold : (int -> int -> 'b -> 'b) -> t -> 'b -> 'b
val is_empty : t -> bool
val iter : (int -> int -> unit) -> t -> unit
val max_binding : t -> int * int
val min_binding : t -> int * int
val min_binding_opt : t -> (int * int) option
val for_all : (int -> int -> bool) -> t -> bool
val bindings : t -> (int * int) list
val binding_count : t -> int

Number of port nodes (bindings), without allocating a list.

Additional functions

val add : int -> t -> t

Add a node to the port multiset, incrementing its multiplicity.

val apply : Iso.t -> t -> t

apply i p applies isomorphism i to port multiset p. Elements of p not in the domain of i are dropped.

val arity : t -> int -> int option

Return the arity (multiplicity) of a node in the port multiset.

val offset : t -> int -> t

Add an offset to every node identifier in the port multiset.

val cardinal : t -> int

Return the number of distinct nodes in the port multiset.

val sum : t -> t -> t

Merge two port multisets, adding multiplicities.

val to_IntSet : t -> IntSet.t

to_IntSet ps returns the set of node identifiers of port multiset ps.