Library
Module
Module type
Parameter
Class
Class type
Boltzgen runtime library entry point
module Type : sig ... end
val compute_boltzman :
?silent:bool ->
Type.compo_type ->
float ->
float * float * float
Main generation function
compute_boltzman fd z
Evaluates the Boltzmann generating function for function signature fd
using Boltzmann parameter z
val gen_string_of_compo : Type.compo_type -> string
Generates the to_string function for a type
val gen_from_compo :
Random.State.t ->
int ->
Type.compo_type ->
float ->
Type.hidden_type * int
Generates a value for a type
val print_from_compo :
Type.compo_type ->
Format.formatter ->
Type.hidden_type ->
unit
Prints a value given its type
val parse_string : string -> Type.def_type list * Type.func option
Parsing and type generation
val evaluate : Type.def_type -> unit
Builds the type and adds it to the type library
val boltzmann_size : float ref
val send_warning : bool ref
type random_fun_table =
(Type.compo_type list * Type.compo_type, char) Hashtbl.t
val gen_random_fun_def :
Format.formatter ->
Type.def_type list ->
random_fun_table ->
Type.func ->
unit
Generates and prints random functions with memoization
val random_state : unit -> Random.State.t
Initializes a random generator state
val call_random :
?tsrange:(int * int) ->
?max_iter:int ->
random_fun_table ->
Random.State.t ->
int ->
float ->
Type.func ->
string
Generates and prints a call for a function
val stagfun_struct : Format.formatter_stag_functions
val nb_test : int ref
val nb_fail : int ref
val print_value : Format.formatter -> string -> 'a -> unit
HIGHLY UNSAFE: Given a type description and a value, prints it on the formatter. Undefined behavior if types do not match. See print_from_compo
for a safe version
rand_value ~seed ~size type
returns a value of type type
. seed
is a seed for the random generator; if omitted, Random.bits is used. size
controls the size of the value, overriding set_boltzmann_size
. See gen_from_compo
for a safer version
rand_fun ~size ~silent type arg
is a pure generic function; it generates a value of type type
. arg
is a parameter for the value, similar to rand_value
but makes the type checker happy
rand_fun_alea ~seed ~size ~silent type arg
is a pure generic function; it generates a value of type type
. seed
and arg
are parameters for the value, similar to rand_value
but makes the type checker happy