Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
(* Time-stamp: <modified the 06/03/2019 (at 17:05) by Erwan Jahier> *)
(** Process programmer API *)
type value = I of int | F of float | B of bool | S of string
type local_env = string -> value (* XXX assez efficace ? *)
type action = string (* label? *)
type varT = It | Nt | Ft | Bt | Et of int (* XXX what else ? *)
type vars = (string * varT) list
type neighbor = {
lenv: local_env;
n_vars: vars;
}
type enable_fun = neighbor list -> local_env -> action list
type step_fun = neighbor list -> local_env -> action -> local_env
(** Those 4 registering functions must be called! *)
type algo_id = string (* XXX comment s'en passer ??? *)
val reg_vars : algo_id -> vars -> unit
val reg_enable : algo_id -> enable_fun -> unit
val reg_step : algo_id -> step_fun -> unit
(** nb: The initialisation done in the dot file have priority over this one *)
val reg_init_vars : algo_id -> local_env -> unit
(** util(s) *)
val value_to_string : value -> string
(**/**)
val verbose_level: int ref
(** raised by get_* functions *)
exception Unregistred of string * string
(** the following functions are used by sasa *)
val get_vars : algo_id -> vars
val get_init_vars : algo_id -> (string * varT) list -> local_env
val get_enable : algo_id -> enable_fun
val get_step : algo_id -> step_fun