Analysis_and_optimization.Pedantic_dist_warningsTypes and utilities
type compiletime_val = | Opaque| Number of Core.float * Core.string| Param of Core.string * Middle.Expr.Typed.t Middle.Transformation.t| Data of Core.stringUseful information about an expression. Opaque means we don't know anything.
type dist_info = {name : Core.string;loc : Middle.Location_span.t;args : (compiletime_val * Middle.Expr.Typed.Meta.t) Core.List.t;}Info about a distribution occurrences that's useful for checking that distribution properties are met
type range = {lower : (Core.float * Core.bool) Core.option;upper : (Core.float * Core.bool) Core.option;}Value constraint as a range. The bools are true if the bound is inclusive
type var_constraint = | Range of range| Ordered| PositiveOrdered| Simplex| UnitVector| CholeskyCorr| CholeskyCov| Correlation| CovarianceValue constraint for an argument
Constraint paired with a name for user messages
val unit_range : var_constraint_namedval exclusive_unit_range : var_constraint_namedval positive_range : var_constraint_namedval nonnegative_range : var_constraint_namedval simplex : var_constraint_namedval ordered : var_constraint_namedval correlation : var_constraint_namedval cholesky_correlation : var_constraint_namedval covariance : var_constraint_namedval cholesky_covariance : var_constraint_namedval bounds_out_of_range : range -> Mir_utils.bound_values -> Core.boolCheck for inconsistency between a distribution argument's value range and the declared bounds of a variable
val transform_mismatch_constraint :
var_constraint ->
Middle.Expr.Typed.t Middle.Transformation.t ->
Core.boolCheck for inconsistency between a distribution argument's constraint and the constraint transformation of a variable
val value_out_of_range : range -> Core.float -> Core.boolCheck for inconsistency between a distribution argument's range and a literal value
val value_mismatch_constraint : var_constraint -> Core.float -> Core.boolCheck for inconsistency between a distribution argument's constraint and a literal value
Argument constraint mismatch warnings
val constr_mismatch_message :
Core.string ->
Core.string ->
arg_info ->
Core.string ->
Core.stringval constr_literal_mismatch_message :
Core.string ->
Core.string ->
arg_info ->
Core.string ->
Core.stringval constr_mismatch_warning :
var_constraint_named ->
arg_info ->
dist_info ->
(Middle.Location_span.t * Core.string) Core.optionReturn a warning if the argn-th argument doesn't match its constraints
Distribution-specific warnings
val uniform_dist_message : Core.string -> Core.stringval uniform_dist_warning :
dist_info ->
(Middle.Location_span.t * Core.string) Core.optionWarning for all uniform distributions with a parameter
val lkj_corr_message : Core.stringval lkj_corr_dist_warning :
dist_info ->
(Middle.Location_span.t * Core.string) Core.optionWarn about all non-Cholesky lkj_corr distributions
val gamma_arg_dist_message : Core.stringval gamma_arg_dist_warning :
dist_info ->
(Middle.Location_span.t * Core.string) Core.optionWarning particular to gamma and inv_gamma, when A=B<1
Distribution properties table
val distribution_warning :
dist_info ->
(Middle.Location_span.t * Core.string) Core.List.tGenerate all of the warnings that are relevant to a given distribution
val distribution_warnings :
dist_info Core.Set.Poly.t ->
(Middle.Location_span.t * Core.string) Core.Set.Poly.tGenerate the distribution warnings for a program