Middle.Program
Defines the core of the MIR
type fun_arg_decl = (UnsizedType.autodifftype * string * UnsizedType.t) list
val fun_arg_decl_of_sexp : Sexplib0.Sexp.t -> fun_arg_decl
val sexp_of_fun_arg_decl : fun_arg_decl -> Sexplib0.Sexp.t
val hash_fold_fun_arg_decl :
Ppx_hash_lib.Std.Hash.state ->
fun_arg_decl ->
Ppx_hash_lib.Std.Hash.state
val hash_fun_arg_decl : fun_arg_decl -> Ppx_hash_lib.Std.Hash.hash_value
type 'a fun_def = {
fdrt : UnsizedType.returntype;
fdname : string;
fdsuffix : unit Fun_kind.suffix;
fdargs : (UnsizedType.autodifftype * string * UnsizedType.t) list;
fdbody : 'a option;
fdloc : Location_span.t;
}
val fold_fun_def : ('a -> 'b -> 'a) -> 'a -> 'b fun_def -> 'a
val hash_fold_fun_def :
'a. (Ppx_hash_lib.Std.Hash.state -> 'a -> Ppx_hash_lib.Std.Hash.state) ->
Ppx_hash_lib.Std.Hash.state ->
'a fun_def ->
Ppx_hash_lib.Std.Hash.state
val fun_def_of_sexp :
'a. (Sexplib0.Sexp.t -> 'a) ->
Sexplib0.Sexp.t ->
'a fun_def
val sexp_of_fun_def :
'a. ('a -> Sexplib0.Sexp.t) ->
'a fun_def ->
Sexplib0.Sexp.t
val io_block_of_sexp : Sexplib0.Sexp.t -> io_block
val sexp_of_io_block : io_block -> Sexplib0.Sexp.t
val hash_fold_io_block :
Ppx_hash_lib.Std.Hash.state ->
io_block ->
Ppx_hash_lib.Std.Hash.state
val hash_io_block : io_block -> Ppx_hash_lib.Std.Hash.hash_value
type 'e outvar = {
out_unconstrained_st : 'e SizedType.t;
out_constrained_st : 'e SizedType.t;
out_block : io_block;
out_trans : 'e Transformation.t;
}
val fold_outvar : ('a -> 'b -> 'a) -> 'a -> 'b outvar -> 'a
val outvar_of_sexp :
'e. (Sexplib0.Sexp.t -> 'e) ->
Sexplib0.Sexp.t ->
'e outvar
val sexp_of_outvar :
'e. ('e -> Sexplib0.Sexp.t) ->
'e outvar ->
Sexplib0.Sexp.t
val hash_fold_outvar :
'e. (Ppx_hash_lib.Std.Hash.state -> 'e -> Ppx_hash_lib.Std.Hash.state) ->
Ppx_hash_lib.Std.Hash.state ->
'e outvar ->
Ppx_hash_lib.Std.Hash.state
type ('a, 'b, 'm) t = {
functions_block : 'b fun_def list;
input_vars : (string * 'm * 'a SizedType.t) list;
prepare_data : 'b list;
log_prob : 'b list;
reverse_mode_log_prob : 'b list;
generate_quantities : 'b list;
transform_inits : 'b list;
unconstrain_array : 'b list;
output_vars : (string * 'm * 'a outvar) list;
prog_name : string;
prog_path : string;
}
val fold :
('a -> 'b -> 'a) ->
('a -> 'c -> 'a) ->
('a -> 'd -> 'a) ->
'a ->
('b, 'c, 'd) t ->
'a
val t_of_sexp :
'a 'b 'm. (Sexplib0.Sexp.t -> 'a) ->
(Sexplib0.Sexp.t -> 'b) ->
(Sexplib0.Sexp.t -> 'm) ->
Sexplib0.Sexp.t ->
('a, 'b, 'm) t
val sexp_of_t :
'a 'b 'm. ('a -> Sexplib0.Sexp.t) ->
('b -> Sexplib0.Sexp.t) ->
('m -> Sexplib0.Sexp.t) ->
('a, 'b, 'm) t ->
Sexplib0.Sexp.t
val pp_fun_arg_decl :
Stdlib.Format.formatter ->
(UnsizedType.autodifftype * string * UnsizedType.t) ->
unit
val pp_fun_def :
(Stdlib.Format.formatter -> 'a -> unit) ->
Stdlib.Format.formatter ->
'a fun_def ->
unit
val pp_io_block : Stdlib.Format.formatter -> io_block -> unit
val pp_output_var :
'a Fmt.t ->
Stdlib.Format.formatter ->
(string * 'b * 'a outvar) ->
unit
val pp_input_var :
'a Fmt.t ->
Stdlib.Format.formatter ->
(string * 'b * 'a SizedType.t) ->
unit
val pp_input_vars :
'a Fmt.t ->
Stdlib.Format.formatter ->
(string * 'b * 'a SizedType.t) list ->
unit
val pp_output_vars :
'a Fmt.t ->
Stdlib.Format.formatter ->
(string * 'b * 'a outvar) list ->
unit
val pp :
'a Fmt.t ->
'b Fmt.t ->
Stdlib.Format.formatter ->
('a, 'b, 'c) t ->
unit
module Typed : sig ... end
Programs with typed expressions and locations
module Numbered : sig ... end