MoxiTypeCheckerSort checker for MoXI scripts
Checks a parsed script against the MoXI language definition before it is translated into transition systems: the sorts of the variables are well-formed and belong to the declared logic; every term is well-sorted under the SMT-LIB theories of Core, Ints, Reals, Reals_Ints, FixedSizeBitVectors and ArraysEx, and only uses the symbols of the declared logic (including its linearity restriction); the constants, enumeration sorts and values, and functions are declared once, under names of their own; the :init and :inv conditions are one-state formulas and the :trans condition is a two-state formula; every subsystem instance refers to a defined system and binds its inputs and outputs to variables of the right sorts and kinds; and every check-system renames the variables of its system consistently, primes only inputs in its assumptions, and names declared conditions in its queries.
The checker stops at the first error.
val pp_print_sort : Stdlib.Format.formatter -> sort -> unitPrint a sort in SMT-LIB syntax
type error_kind = | UnknownLogic of string| LogicAlreadySet| LogicAfterDefinition| UnknownSort of string| MalformedSort of string * string| SortNotInLogic of sort * string| NumeralNotInLogic of string| DecimalNotInLogic of string| BitvectorNotInLogic of string| BitvectorOutOfRange of string * int| SymbolNotInLogic of string * string| NonlinearTerm of string * string| UnboundVariable of string| UnknownFunction of string| UnknownIndexedIdentifier of string| PrimedLetVariable of string| PrimedNonVariable of string| PrimeNotAllowed of string * string| PrimedNonInput of string * string| Arity of string * string * int| ArgumentSort of string * int * sort * string| ExpectedBool of string * sort| AscriptionMismatch of sort * sort| ConstArrayWithoutSort| ConstArrayNotArraySort of sort| DuplicateLetBinding of string| SystemRedefined of string| FunctionRedefined of string| SymbolRedeclared of string| BuiltinRedefined of string| SortRedeclared of string| FunctionBodySort of string * sort * sort| UnknownSystem of string| SelfInstantiation of string| DuplicateInstance of string| DuplicateVariable of string| SubsystemArity of string * string * int * int| SubsystemArgumentSort of string * string * sort * string * sort| SubsystemOutputToInput of string * string * string| RenamingArity of string * string * int * int| RenamingSort of string * sort * string * sort| DuplicateFormula of string| DuplicateQuery of string| UnknownFormula of string * string| SeveralCurrent of stringWhat went wrong
type error = Lib.position * error_kindAn error and where it was found
val error_message : error_kind -> stringA message describing an error
val check_script : MoxiAst.script -> (unit, error) Stdlib.resultCheck a script, returning the first error found, if any
val string_of_indexed_id : string -> MoxiAst.index list -> stringAn identifier with its indices as written, (_ f i j), or the bare symbol when it has none
val bv_literal : string -> MoxiAst.index list -> (Numeral.t * Numeral.t) optionThe value and width of a bit-vector literal (_ bvN m), given the symbol and indices of an indexed identifier, if it is one. The checker has verified that the value fits the width of every literal of a checked script.