package kappa-library

  1. Overview
  2. Docs
Public internals of the Kappa tool suite. Use this package to use kappa as a lib

Install

Dune Dependency

Authors

Maintainers

Sources

v4.1.3.tar.gz
md5=1c9a8a0d79f085757817f90834e166f5
sha512=13ac40442940ba6e72d7dc5bf952e67443872f7bff63e9c76a3a699a6904c88696047fe04519b7ec6546371642f6ee7b0983117be302694aca15500b0df40de3

doc/kappa-library.runtime/Kappa_runtime/Instances/index.html

Module Kappa_runtime.InstancesSource

include Instances_sig.S
Sourcetype t
Sourcetype message
Sourceval receive_message : message -> t -> t
Sourceval debug_print : Format.formatter -> t -> unit

Updating the roots

Sourceval incorporate_extra_pattern : t -> Kappa_terms.Pattern.id -> Kappa_data_structures.IntCollection.t -> unit
Sourceval break_apart_cc : t -> Kappa_site_graphs.Edges.t -> ?mod_connectivity_store:Roots.mod_ccs_cache -> (int * int) option -> unit
Sourceval merge_cc : t -> ?mod_connectivity_store:Roots.mod_ccs_cache -> (int * int) option -> unit

Checking instances

Sourceval is_valid : t -> Kappa_terms.Pattern.id -> int -> bool

Counting instances

Sourceval number_of_instances : ?rule_id:int -> t -> Kappa_terms.Pattern.id array -> int

number_of_instances ?rule_id state patterns

Sourceval number_of_unary_instances_in_cc : ?rule_id:int -> t -> (Kappa_terms.Pattern.id * Kappa_terms.Pattern.id) -> int -> int

number_of_unary_instances_in_cc ?rule_id state (pat1, pat2) cc

Picking instances

Sourceval pick_unary_instance_in_cc : ?rule_id:int -> t -> Random.State.t -> (Kappa_terms.Pattern.id * Kappa_terms.Pattern.id) -> int -> int * int

pick_unary_instance_in_cc state random_state (pat1, pat2) cc Returns a pair of roots corresponding to pat1 and pat2 respectively. Optimized for currying before the cc argument. In case of failure, one of the resulting roots is set to (-1).

Sourceval fold_picked_instance : ?rule_id:int -> t -> Random.State.t -> Kappa_terms.Pattern.id array -> init:'a -> (int -> Kappa_terms.Pattern.id -> int -> 'a -> 'a option) -> 'a option

fold_picked_instances state random_state patterns ~init f with f pat_id_in_array pat corresponding_root acc. Monadic fold function that calls f for every root of a random embedding from patterns in the mixture. This function is lazy in the sense it stops to draw roots when the accumulator besomes `None`.

Enumerating instances

Sourceval fold_instances : ?rule_id:int -> ?excp:(Kappa_terms.Pattern.id * int) -> t -> Kappa_terms.Pattern.id array -> init:'a -> (int array -> 'a -> 'a) -> 'a

fold_enumerated_instances state patterns ~init f with f roots acc. Folds through every rectangular instance of an array of patterns.

Sourceval fold_unary_instances : ?rule_id:int -> t -> (Kappa_terms.Pattern.id * Kappa_terms.Pattern.id) -> init:'a -> ((int * int) -> 'a -> 'a) -> 'a

fold_unary_instances state (pat1, pat2) ~init f with f (root1, root2) acc.

OCaml

Innovation. Community. Security.