package nuscr
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=c5a419fd1fdea78fb63b3a3c335b0e6b0f2b08d65b79870565bdcc0f997bc728
sha512=83ef593ed514eeef1b10069af54562833d617d1c338c5adaf82ee5c3ea7ec4569b3643fcbb237b3cb79ce2f579094cbd17217efa5f4e522bd20f67e1df3a7dbd
doc/nuscr.lib/Nuscrlib/Expr/index.html
Module Nuscrlib.Expr
Expressions, used in RefinementTypes pragma
Expressions
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
Types
type payload_type = | PTInt(*A type for integers
*)| PTBool(*A type for booleans
*)| PTString(*A type for strings
*)| PTUnit(*A type for units
*)| PTAbstract of Names.PayloadTypeName.t(*A type for other un-modelled payloads, e.g. custom types
*)| PTRefined of Names.VariableName.t * payload_type * t(*A refined types,
*)PTRefined (x, ty, e)stands for the refined type 'x:ty{e}' whereeis a predicate onx.
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
Typing
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
SMT Interfacing
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