Module Mavryk_benchmark_alpha.Michelson_mcmc_samplers

MCMC-based Michelson data and code samplers.

MCMC samplers can either produce data or code. Note that the samplers natively produce data and code in Micheline (ie untyped) form.

type michelson_code = {
  1. term : Mavryk_protocol_alpha.Protocol.Script_repr.expr;
    (*

    term is a typeable Michelson program in Micheline form.

    *)
  2. bef : Mavryk_protocol_alpha.Protocol.Script_repr.expr list;
    (*

    bef is an input stack type for which term is a well-typed script.

    *)
  3. aft : Mavryk_protocol_alpha.Protocol.Script_repr.expr list;
    (*

    aft is the stack type corresponding to the execution of term on a stack of type bef.

    *)
}
type michelson_data = {
  1. term : Mavryk_protocol_alpha.Protocol.Script_repr.expr;
    (*

    term is a typeable Michelson data in Micheline form.

    *)
  2. typ : Mavryk_protocol_alpha.Protocol.Script_repr.expr;
    (*

    typ is the type of term.

    *)
}
type michelson_sample =
  1. | Code of michelson_code
  2. | Data of michelson_data

A michelson_sample is either a code sample or a data sample.

val michelson_sample_list_encoding : michelson_sample list Data_encoding.t

Encoding used for saving or loading data.

val save : filename:string -> terms:michelson_sample list -> unit

Saving a list of samples to a file. Exits with code 1 if an error arises during encoding or file manipulation.

val load : filename:string -> michelson_sample list

Loading a list of samples from a file. Exits with code 1 if an error arises during decoding or file manipulation.

Make_code_sampler produces a sampler for well-typed Michelson code. The parameters of the functor are:

See documentation for Make_code_sampler