Skip to content

Commit

Permalink
refactored assemble_rule and name_and_purify_rule
Browse files Browse the repository at this point in the history
  • Loading branch information
gikiam committed Nov 9, 2023
1 parent d9f23e5 commit 064e776
Show file tree
Hide file tree
Showing 4 changed files with 213 additions and 125 deletions.
2 changes: 1 addition & 1 deletion core/grammar/ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ type ('agent, 'pattern, 'mixture, 'id, 'rule) compil = {
or kinetic rate *)
signatures: 'agent list; (** agent signature declaration *)
rules: (string Locality.annoted option * 'rule Locality.annoted) list;
(** rules (possibly named) *)
(** rules (possibly named): [name_option * rule_definition] *)
observables: ('pattern, 'id) Alg_expr.e Locality.annoted list;
(** list of patterns to plot *)
init: ('pattern, 'mixture, 'id) init_statment list;
Expand Down
2 changes: 1 addition & 1 deletion core/grammar/counters_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
(* |_|\_\ * GNU Lesser General Public License Version 3 *)
(******************************************************************************)

type 'a rule_agent_counters = {
type 'a with_ra_counters = {
ra: 'a;
ra_counters: (Ast.counter * LKappa.switching) option array;
}
Expand Down
14 changes: 7 additions & 7 deletions core/grammar/counters_compiler.mli
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
(* |_|\_\ * GNU Lesser General Public License Version 3 *)
(******************************************************************************)

type 'a rule_agent_counters = {
type 'a with_ra_counters = {
ra: 'a;
ra_counters: (Ast.counter * LKappa.switching) option array;
}
Expand All @@ -24,8 +24,8 @@ val make_counter : int -> string -> Ast.counter

val remove_counter_rule :
Signature.s ->
LKappa.rule_agent rule_agent_counters list ->
Raw_mixture.agent rule_agent_counters list ->
LKappa.rule_agent with_ra_counters list ->
Raw_mixture.agent with_ra_counters list ->
LKappa.rule_agent list * Raw_mixture.agent list

val counters_perturbations :
Expand All @@ -45,23 +45,23 @@ val annotate_dropped_counters :
int ->
string ->
(int -> unit) option ->
LKappa.rule_agent rule_agent_counters
LKappa.rule_agent with_ra_counters

val annotate_edit_counters :
Signature.s ->
string * Locality.t ->
Ast.counter list ->
LKappa.rule_agent ->
(int -> int -> int -> int -> unit) ->
LKappa.rule_agent rule_agent_counters
LKappa.rule_agent with_ra_counters

val annotate_created_counters :
Signature.s ->
string * Locality.t ->
Ast.counter list ->
(int -> int -> int -> int -> unit) ->
Raw_mixture.agent ->
Raw_mixture.agent rule_agent_counters
Raw_mixture.agent with_ra_counters

val annotate_counters_with_diff :
Signature.s ->
Expand All @@ -70,7 +70,7 @@ val annotate_counters_with_diff :
Ast.counter list ->
LKappa.rule_agent ->
(int -> int -> int -> int -> unit) ->
LKappa.rule_agent rule_agent_counters
LKappa.rule_agent with_ra_counters

val add_counter_to_contact_map :
Signature.s -> (int -> int -> int -> int -> unit) -> unit
Loading

0 comments on commit 064e776

Please sign in to comment.