Module Middle.UnsizedType

Types which have dimensionalities but not sizes, e.g. array[,,]

type t =
  1. | UInt
  2. | UReal
  3. | UVector
  4. | UComplex
  5. | URowVector
  6. | UMatrix
  7. | UComplexVector
  8. | UComplexRowVector
  9. | UComplexMatrix
  10. | UArray of t
  11. | UTuple of t list
  12. | UFun of signature
  13. | UMathLibraryFunction
and autodifftype =
  1. | DataOnly
  2. | AutoDiffable
  3. | TupleAD of autodifftype list
and argumentlist = (autodifftype * t) list
and returntype =
  1. | Void
  2. | ReturnType of t
val compare : t -> t -> int
val compare_autodifftype : autodifftype -> autodifftype -> int
val compare_argumentlist : argumentlist -> argumentlist -> int
val compare_returntype : returntype -> returntype -> int
val compare_signature : signature -> signature -> int
val sexp_of_t : t -> Sexplib0__.Sexp.t
val sexp_of_autodifftype : autodifftype -> Sexplib0__.Sexp.t
val sexp_of_argumentlist : argumentlist -> Sexplib0.Sexp.t
val sexp_of_returntype : returntype -> Sexplib0.Sexp.t
val sexp_of_signature : signature -> Sexplib0.Sexp.t
val equal : t -> t -> bool
val equal_autodifftype : autodifftype -> autodifftype -> bool
val equal_argumentlist : argumentlist -> argumentlist -> bool
val equal_returntype : returntype -> returntype -> bool
val equal_signature : signature -> signature -> bool
type variadic_signature = {
  1. return_type : t;
  2. control_args : argumentlist;
  3. required_fn_rt : t;
  4. required_fn_args : argumentlist;
}
val pp_tuple_autodifftype : autodifftype Fmt.t
val returntype_to_type_opt : returntype -> t option
val pp_autodifftype : Stdlib.Format.formatter -> autodifftype -> unit
val count_dims : t -> int
val contains_tuple : t -> bool
val unwind_array_type : t -> t * int
val wind_array_type : (t * int) -> t
val is_fun_type : t -> bool
val pp : t Fmt.t
val pp_fun_arg : (autodifftype * t) Fmt.t
val pp_returntype : Stdlib.Format.formatter -> returntype -> unit
val pp_math_sig : Stdlib.Format.formatter -> signature -> unit
val autodifftype_can_convert : autodifftype -> autodifftype -> bool
val has_autodiff : autodifftype -> bool
val any_autodiff : autodifftype list -> bool
val lub_ad_type : autodifftype list -> autodifftype option
val common_type : (t * t) -> t Std.Option.t

Given two types find the minimal type both can convert to

val is_autodiffable : t -> bool
val is_autodifftype : autodifftype -> bool
val is_dataonlytype : autodifftype -> bool
val is_scalar_type : t -> bool
val promote_container : t -> t -> t
val is_discrete_type : t -> bool

Used to determine valid covariates for _lpmf functions

val is_int_type : t -> bool

Used in code generation and other places, does _not_ include tuples of ints

val is_complex_type : t -> bool
val internal_scalar : t -> t
val is_eigen_type : t -> bool
val contains_int : t -> bool

Detect if type contains an integer

val contains_eigen_type : t -> bool
val is_container : t -> bool
val is_array : t -> bool
val is_indexing_matrix : (t * 'a list) -> bool
val fill_adtype_for_type : autodifftype -> t -> autodifftype

In some places (e.g. code generation) we need to instantiate an AD type. Previously we would just say DataOnly or AutoDiffable, however this breaks the invariant that a Tuple always has TupleAD as it's autodifftype

val enumerate_tuple_names_io : string -> t -> string Std.List.t

List all possible tuple sub-names for IO purposes. E.g, the decl array[2] (int, real) foo; should yield the list ["foo.1";"foo.2"].