Module LustreAstInlineConstants

Inlining constants throughout the program

module TC = TypeCheckerContext
module LA = LustreAst
type error_kind =
  1. | Unknown of string
  2. | FreeIntIdentifier of HString.t
  3. | ConstantMustBeInt of LA.expr
  4. | UnaryMustBeInt of LA.expr
  5. | BinaryMustBeInt of LA.expr
  6. | FreeBoolIdentifier of HString.t
  7. | ConstantMustBeBool of LA.expr
  8. | UnaryMustBeBool of LA.expr
  9. | BinaryMustBeBool of LA.expr
  10. | IdentifierMustBeConstant of HString.t
  11. | UnableToEvaluate of LA.expr
  12. | WidthOperatorUnsupported
  13. | OutOfBounds of string
type error = [
  1. | `LustreAstInlineConstantsError of Lib.position * error_kind
]
val error_message : error_kind -> string

Returns an message describing the error kind

val inline_constants : TC.tc_context -> LA.t -> (TC.tc_context * LA.t, [> error ]) Stdlib.result

Best effort at inlining constants

val inline_constants_of_lustre_type : ?ind_vars:HString.t list -> TC.tc_context -> LA.lustre_type -> LA.lustre_type

Best effort at inlining constants in a lustre type

val eval_int_expr : TC.tc_context -> LA.expr -> (int, [> error ]) Stdlib.result

try to evaluate an expression to an int