type t
type instance
type result = Clash | Corrected | Blocked | Success of t

val value_alg : Counter.t -> t -> Primitives.alg_expr -> Nbr.t

val empty :
  outputs:(Data.t -> unit) ->
  with_trace:bool ->
  Random.State.t ->
  Kappa_terms.Model.t ->
  Counter.t ->
  t

val force_rule :
  debug_mode:bool ->
  outputs:(Data.t -> unit) ->
  Model.t ->
  Counter.t ->
  t ->
  Trace.event_kind ->
  ?rule_id:int ->
  Primitives.elementary_rule ->
  t option

val update_outdated_activities :
  debug_mode:bool ->
  (int -> float -> float -> unit) ->
  Model.t ->
  Counter.t ->
  t ->
  int list ->
  t * int list

val overwrite_var : int -> Counter.t -> t -> Primitives.alg_expr -> t

val snapshot :
  debug_mode:bool -> raw:bool -> Model.t -> Counter.t -> t -> Data.snapshot

val add_tracked :
  outputs:(Data.t -> unit) ->
  Pattern.id array ->
  string ->
  Instantiation.abstract Instantiation.test list list ->
  t ->
  t

val remove_tracked : Pattern.id array -> string option -> t -> t

val add_tracked_species :
  Pattern.id array ->
  string ->
  Instantiation.abstract Instantiation.test list list ->
  t ->
  t

val remove_tracked_species : string -> t -> t

val value_bool :
  Counter.t -> t -> (Pattern.id array list, int) Alg_expr.bool -> bool

val apply_given_rule :
  debug_mode:bool ->
  outputs:(Data.t -> unit) ->
  ?rule_id:int ->
  Model.t ->
  Counter.t ->
  t ->
  Trace.event_kind ->
  Primitives.elementary_rule ->
  result

val incorporate_extra_pattern :
  debug_mode:bool -> Pattern.Env.t -> t -> Pattern.id -> t

val activity : t -> float

val apply_instance :
  debug_mode:bool ->
  outputs:(Data.t -> unit) ->
  ?maxConsecutiveBlocked:int ->
  maxConsecutiveClash:int ->
  Model.t ->
  Counter.t ->
  t ->
  instance ->
  int option * bool * t

val apply_concrete_positive_transformation :
  Signature.s ->
  ?mod_connectivity_store:Roots.mod_ccs_cache ->
  Instances.t ->
  Edges.t ->
  Instantiation.concrete Primitives.Transformation.t ->
  Edges.t

val print : Model.t -> Format.formatter -> t -> unit
val pick_an_instance : debug_mode:bool -> Kappa_terms.Model.t -> t -> instance
val is_correct_instance : Kappa_terms.Model.t -> t -> instance -> bool
val get_random_state : t -> Random.State.t

val obs_from_transformations :
  debug_mode:bool ->
  Kappa_terms.Pattern.Env.t ->
  Kappa_site_graphs.Edges.t ->
  Instantiation.concrete Primitives.Transformation.t list ->
  (Kappa_terms.Pattern.id * Instantiation.concrete) list
  * Kappa_data_structures.Operator.DepSet.t

val print_stats : Format.formatter -> t -> unit

val apply_negative_transformation :
  ?mod_connectivity_store:Roots.mod_ccs_cache ->
  Instances.t ->
  Agent.t Instantiation.site list * Kappa_site_graphs.Edges.t ->
  Agent.t Primitives.Transformation.t ->
  Agent.t Instantiation.site list * Kappa_site_graphs.Edges.t

val apply_positive_transformation :
  debug_mode:bool ->
  Kappa_site_graphs.Signature.s ->
  ?mod_connectivity_store:Roots.mod_ccs_cache ->
  Instances.t ->
  (Kappa_terms.Matching.t * int Kappa_data_structures.Mods.IntMap.t)
  * Agent.t Instantiation.site list
  * Kappa_site_graphs.Edges.t ->
  Instantiation.abstract Primitives.Transformation.t ->
  ((Kappa_terms.Matching.t * int Kappa_data_structures.Mods.IntMap.t)
  * Agent.t Instantiation.site list
  * Kappa_site_graphs.Edges.t)
  * Agent.t Primitives.Transformation.t
