Page
Library
Module
Module type
Parameter
Class
Class type
Source
Nuscrlib.ExprExpressions, used in RefinementTypes pragma
An expression, used in RefinementType extension
type t = | Var of VariableName.t (** A variable *) | Int of int (** An integer constant *) | Bool of bool (** An boolean constant *) | String of string (** A string literal *) | Binop of binop * t * t (** A binary operator *) | Unop of unop * t (** An unary operator *)
val sexp_of_t : t -> Sexplib0.Sexp.tval equal : t -> t -> Ppx_deriving_runtime.boolval compare : t -> t -> Ppx_deriving_runtime.intval show : t -> Base.stringval free_var : t -> Base.Set.M(Names.VariableName).tGet free variables in an expression
val substitute : from:Names.VariableName.t -> replace:t -> t -> tPerform substitutions on an expression
module Sexp : sig ... endAn modified S-expression library that distinguishes literal strings and * atoms
type payload_type = | PTIntA type for integers
*)| PTBoolA type for booleans
*)| PTStringA type for strings
*)| PTUnitA type for units
*)| PTAbstract of Names.PayloadTypeName.tA type for other un-modelled payloads, e.g. custom types
*)| PTRefined of Names.VariableName.t * payload_type * tA refined types, PTRefined (x, ty, e) stands for the refined type 'x:ty{e}' where e is a predicate on x.
Types for expressions. Integers, booleans and strings are are modelled, and can be thus refined with RefinementTypes extension
val sexp_of_payload_type : payload_type -> Sexplib0.Sexp.tval equal_payload_type :
payload_type ->
payload_type ->
Ppx_deriving_runtime.boolval compare_payload_type :
payload_type ->
payload_type ->
Ppx_deriving_runtime.intval show_payload_type : payload_type -> Base.stringval payload_typename_of_payload_type : payload_type -> Names.PayloadTypeName.tExtract PayloadTypeName from a payload_type
val smt_sort_of_type : payload_type -> Base.stringGet the SMT sort of a payload_type
val default_value : payload_type -> tGet the default value of a payload type, which may not exist.
val parse_typename : Names.PayloadTypeName.t -> payload_typeConvert a PayloadTypeName to a payload_type
val new_typing_env : typing_envval is_well_formed_type : typing_env -> payload_type -> Base.boolCheck whether a payload type is well-formed under the typing context
val ensure_satisfiable : typing_env -> Base.unitValidate whether the typing context is satisfiable, i.e. it does not contain in consistencies
val env_append :
typing_env ->
Names.VariableName.t ->
payload_type ->
typing_envAppend an new entry into typing context
val check_type : typing_env -> t -> payload_type -> Base.boolCheck whether an expression can be assigned a provided type under a typing context
val add_assert_s_expr : Sexp.t -> smt_script -> smt_scriptAdd an assertion into a SMT script
val encode_env : typing_env -> smt_scriptEncode a typing context into a SMT script
val check_sat : smt_script -> [ `Sat | `Unsat | `Unknown ]Invoke SMT solver on an SMT script