Module Sasacore.Register

type 's neighbor = {
state : 's;
pid : string;
spid : string;
reply : unit -> int;
weight : unit -> int;
}
type algo_id = string
type action = string
type 's enable_fun = 's neighbor list -> 's -> action list
type 's step_fun = 's neighbor list -> 's -> action -> 's
type 's fault_fun = int -> string -> 's -> 's
type pid = string
type 's potential_fun = pid list -> (pid -> 's * ('s neighbor * pid) list) -> float
type 's legitimate_fun = string list -> (string -> 's * ('s neighbor * pid) list) -> bool
val reg_init_state : algo_id -> (int -> string -> 's) -> unit
val reg_enable : algo_id -> 's enable_fun -> unit
val reg_step : algo_id -> 's step_fun -> unit
val reg_potential : 's potential_fun option -> unit
val reg_legitimate : 's legitimate_fun option -> unit
val reg_fault : 's fault_fun option -> unit
val reg_actions : action list -> unit
val reg_value_to_string : ('s -> string) -> unit
val reg_value_of_string : (string -> 's) -> unit
val reg_copy_value : ('s -> 's) -> unit
val card : unit -> int
val min_degree : unit -> int
val mean_degree : unit -> float
val max_degree : unit -> int
val is_cyclic : unit -> bool
val is_connected : unit -> bool
val is_tree : unit -> bool
val is_directed : unit -> bool
val height : unit -> (string -> int) option

If height () = None, then the graph doesn't have a height (because it isn't a tree) Otherwise, height () = Some h.

val diameter : unit -> int
val verbose_level : int Stdlib.ref
val get_graph_attribute : string -> string
val get_enable : algo_id -> 's enable_fun
val get_step : algo_id -> 's step_fun
val get_init_state : algo_id -> int -> string -> 's
val get_actions : unit -> action list
val get_potential : unit -> 's potential_fun option
val get_legitimate : unit -> 's legitimate_fun option
val get_fault : unit -> 's fault_fun option
val get_value_to_string : unit -> 's -> string
val get_value_of_string : unit -> (string -> 's) option
val get_copy_value : unit -> 's -> 's
val to_string : 's -> string
val set_card : (unit -> int) -> unit

Those are called by sasa once the graph has been parsed

val set_degrees : (unit -> int * int) -> unit
val set_mean_deg : (unit -> float) -> unit
val set_is_connected_cyclic : (unit -> bool * bool) -> unit
val set_is_directed : (unit -> bool) -> unit
type node_id = string
val set_height : (node_id -> int) -> unit
val set_diameter : (unit -> int) -> unit
val set_graph_attribute : string -> string -> unit
val graph_attribute_list : unit -> (string * string) list