package KaSim

  1. Overview
  2. Docs
type syntax_version =
  1. | V3
  2. | V4
val merge_version : syntax_version -> syntax_version -> syntax_version
type internal = string option Locality.annot list
type port = {
  1. port_nme : string Locality.annot;
  2. port_int : internal;
  3. port_int_mod : string Locality.annot option;
  4. port_lnk : (string Locality.annot, unit) link Locality.annot list;
  5. port_lnk_mod : int Locality.annot option option;
}
type counter_test =
  1. | CEQ of int
  2. | CGTE of int
  3. | CVAR of string
type counter = {
  1. count_nme : string Locality.annot;
  2. count_test : counter_test Locality.annot option;
  3. count_delta : int Locality.annot;
}
type site =
  1. | Port of port
  2. | Counter of counter
type agent_mod =
  1. | Erase
  2. | Create
type agent =
  1. | Present of string Locality.annot * site list * agent_mod option
  2. | Absent of Locality.t
type mixture = agent list
type edit_notation = {
  1. mix : mixture;
  2. delta_token : ((mixture, string) Alg_expr.e Locality.annot * string Locality.annot) list;
}
type arrow_notation = {
  1. lhs : mixture;
  2. rm_token : ((mixture, string) Alg_expr.e Locality.annot * string Locality.annot) list;
  3. rhs : mixture;
  4. add_token : ((mixture, string) Alg_expr.e Locality.annot * string Locality.annot) list;
}
type rule_content =
  1. | Edit of edit_notation
  2. | Arrow of arrow_notation
type rule = {
  1. rewrite : rule_content;
  2. bidirectional : bool;
  3. k_def : (mixture, string) Alg_expr.e Locality.annot;
  4. k_un : ((mixture, string) Alg_expr.e Locality.annot * (mixture, string) Alg_expr.e Locality.annot option) option;
  5. k_op : (mixture, string) Alg_expr.e Locality.annot option;
  6. k_op_un : ((mixture, string) Alg_expr.e Locality.annot * (mixture, string) Alg_expr.e Locality.annot option) option;
}
val flip_label : string -> string
type (!'pattern, !'mixture, !'id, !'rule) modif_expr =
  1. | APPLY of ('pattern, 'id) Alg_expr.e Locality.annot * 'rule Locality.annot
  2. | UPDATE of 'id Locality.annot * ('pattern, 'id) Alg_expr.e Locality.annot
  3. | STOP of ('pattern, 'id) Alg_expr.e Primitives.print_expr list
  4. | SNAPSHOT of ('pattern, 'id) Alg_expr.e Primitives.print_expr list
  5. | PRINT of ('pattern, 'id) Alg_expr.e Primitives.print_expr list * ('pattern, 'id) Alg_expr.e Primitives.print_expr list
  6. | PLOTENTRY
  7. | CFLOWLABEL of bool * string Locality.annot
  8. | CFLOWMIX of bool * 'pattern Locality.annot
  9. | DIN of Primitives.din_kind * ('pattern, 'id) Alg_expr.e Primitives.print_expr list
  10. | DINOFF of ('pattern, 'id) Alg_expr.e Primitives.print_expr list
  11. | SPECIES_OF of bool * ('pattern, 'id) Alg_expr.e Primitives.print_expr list * 'pattern Locality.annot
type (!'pattern, !'mixture, !'id, !'rule) perturbation = (Nbr.t option * ('pattern, 'id) Alg_expr.bool Locality.annot option * ('pattern, 'mixture, 'id, 'rule) modif_expr list * ('pattern, 'id) Alg_expr.bool Locality.annot option) Locality.annot
type configuration = string Locality.annot * string Locality.annot list
type (!'pattern, !'id) variable_def = string Locality.annot * ('pattern, 'id) Alg_expr.e Locality.annot
type (!'mixture, !'id) init_t =
  1. | INIT_MIX of 'mixture Locality.annot
  2. | INIT_TOK of 'id Locality.annot list
type (!'pattern, !'mixture, !'id) init_statment = ('pattern, 'id) Alg_expr.e Locality.annot * ('mixture, 'id) init_t
type (!'agent, !'pattern, !'mixture, !'id, !'rule) instruction =
  1. | SIG of 'agent
  2. | TOKENSIG of string Locality.annot
  3. | VOLSIG of string * float * string
  4. | INIT of ('pattern, 'mixture, 'id) init_statment
  5. | DECLARE of ('pattern, 'id) variable_def
  6. | OBS of ('pattern, 'id) variable_def
  7. | PLOT of ('pattern, 'id) Alg_expr.e Locality.annot
  8. | PERT of ('pattern, 'mixture, 'id, 'rule) perturbation
  9. | CONFIG of configuration
  10. | RULE of string Locality.annot option * 'rule Locality.annot
type (!'pattern, !'mixture, !'id, !'rule) command =
  1. | RUN of ('pattern, 'id) Alg_expr.bool Locality.annot
  2. | MODIFY of ('pattern, 'mixture, 'id, 'rule) modif_expr list
  3. | QUIT
type (!'agent, !'pattern, !'mixture, !'id, !'rule) compil = {
  1. filenames : string list;
  2. variables : ('pattern, 'id) variable_def list;
  3. signatures : 'agent list;
  4. rules : (string Locality.annot option * 'rule Locality.annot) list;
  5. observables : ('pattern, 'id) Alg_expr.e Locality.annot list;
  6. init : ('pattern, 'mixture, 'id) init_statment list;
  7. perturbations : ('pattern, 'mixture, 'id, 'rule) perturbation list;
  8. configurations : configuration list;
  9. tokens : string Locality.annot list;
  10. volumes : (string * float * string) list;
}
type parsing_compil = (agent, mixture, mixture, string, rule) compil
type parsing_instruction = (agent, mixture, mixture, string, rule) instruction
val empty_compil : parsing_compil
val no_more_site_on_right : bool -> site list -> site list -> bool
val split_mixture : mixture -> mixture * mixture
val implicit_signature : parsing_compil -> parsing_compil
val print_counter : Format.formatter -> counter -> unit
val print_ast_mix : Format.formatter -> mixture -> unit
val print_ast_rule : Format.formatter -> rule -> unit
val print_rule_content : bidirectional:bool -> Format.formatter -> rule_content -> unit
val to_erased_mixture : mixture -> mixture
val to_created_mixture : mixture -> mixture
val compil_of_json : Yojson.Basic.json -> parsing_compil
val compil_to_json : parsing_compil -> Yojson.Basic.json