Include file:
#include "mcrl2/data/typecheck.h
mcrl2::data::
data_type_checker
¶mcrl2::data::data_type_checker::
system_constants
¶mcrl2::data::data_type_checker::
system_functions
¶mcrl2::data::data_type_checker::
type_checked_data_spec
¶mcrl2::data::data_type_checker::
user_constants
¶mcrl2::data::data_type_checker::
user_functions
¶mcrl2::data::data_type_checker::
was_warning_upcasting
¶data_type_checker
(const data_specification &data_spec)¶make a data type checker. Throws a mcrl2::runtime_error exception if the data_specification is not well typed.
Parameters:
Returns: A data expression where all untyped identifiers have been replace by typed ones.
operator()
() const¶Yields a type checked data specification, provided typechecking was successful. If not successful an exception is thrown.
Returns: a data specification where all untyped identifiers have been replace by typed ones.
operator()
(const variable &v, const detail::variable_context &context) const¶Type checks a variable. Throws an mcrl2::runtime_error exception if the variable is not well typed.
A variable is not well typed if its name clashes with the name of a declared function, when its sort does not exist, or when the variable is used in its context with a different sort.
Parameters:
operator()
(const variable_list &l, const detail::variable_context &context) const¶Type checks a variable list. Throws an mcrl2::runtime_error exception if the variables are not well typed.
A variable is not well typed if its name clashes with the name of a declared function, when its sort does not exist, or when a variable occurs in the context. Furthermore, variables cannot occur multiple times in a variable list.
Parameters:
operator()
(data_equation_vector &eqns)¶Yields a type checked equation list, and sets the types in the equations right. If not successful an exception is thrown.
Parameters:
print_context
() const¶typecheck_assignment
(const assignment &x, const detail::variable_context &variable_context)¶typecheck_assignment_list
(const assignment_list &assignments, const detail::variable_context &variable_context)¶typecheck_data_expression
(const data_expression &x, const sort_expression &expected_sort, const detail::variable_context &variable_context)¶typechecked_data_specification
() const¶add_function
(const data::function_symbol &f, const std::string &msg, bool allow_double_decls = false)¶AdjustNotInferredList
(const sort_expression_list &PosTypeList, const atermpp::term_list<sort_expression_list> &TypeListList) const¶determine_allowed_type
(const data_expression &d, const sort_expression &proposed_type) const¶EqTypesA
(const sort_expression &Type1, const sort_expression &Type2) const¶EqTypesL
(sort_expression_list Type1, sort_expression_list Type2) const¶ErrorMsgCannotCast
(sort_expression CandidateType, data_expression_list Arguments, sort_expression_list ArgumentTypes, std::string previous_reason) const¶ExpandNumTypesDown
(sort_expression Type) const¶ExpandNumTypesUp
(sort_expression Type) const¶ExpandNumTypesUpL
(const sort_expression_list &type_list) const¶GetNotInferredList
(const atermpp::term_list<sort_expression_list> &TypeListList) const¶initialise_system_defined_functions
(void)¶InsertType
(const sort_expression_list &TypeList, const sort_expression &Type) const¶InTypesA
(const sort_expression &Type, sort_expression_list Types) const¶InTypesL
(const sort_expression_list &Type, atermpp::term_list<sort_expression_list> Types) const¶IsNotInferredL
(sort_expression_list TypeList) const¶IsTypeAllowedA
(const sort_expression &Type, const sort_expression &PosType) const¶IsTypeAllowedL
(const sort_expression_list &TypeList, const sort_expression_list &PosTypeList) const¶match_fbag_cinsert
(const function_sort &type, sort_expression &result) const¶match_fset_insert
(const function_sort &type, sort_expression &result) const¶MatchBagConstructor
(const function_sort &type, sort_expression &result) const¶MatchBagOpBag2Set
(const function_sort &type, sort_expression &result) const¶MatchBagOpBagCount
(const function_sort &type, sort_expression &result) const¶MatchEqNeqComparison
(const function_sort &type, sort_expression &result) const¶MatchFalseFunction
(const function_sort &type, sort_expression &result) const¶MatchFuncUpdate
(const function_sort &type, sort_expression &result) const¶MatchIf
(const function_sort &type, sort_expression &result) const¶MatchListOpConcat
(const function_sort &type, sort_expression &result) const¶MatchListOpCons
(const function_sort &type, sort_expression &result) const¶MatchListOpEltAt
(const function_sort &type, sort_expression &result) const¶MatchListOpHead
(const function_sort &type, sort_expression &result) const¶MatchListOpSnoc
(const function_sort &type, sort_expression &result) const¶MatchListOpTail
(const function_sort &type, sort_expression &result) const¶MatchListSetBagOpIn
(const function_sort &type, sort_expression &result) const¶MatchSetBagOpUnionDiffIntersect
(const function_sort &type, sort_expression &result) const¶MatchSetConstructor
(const function_sort &type, sort_expression &result) const¶MatchSetOpSet2Bag
(const function_sort &type, sort_expression &result) const¶MatchSetOpSetCompl
(const function_sort &type, sort_expression &result) const¶MatchSqrt
(const function_sort &type, sort_expression &result) const¶MaximumType
(const sort_expression &Type1, const sort_expression &Type2, sort_expression &result) const¶operator()
(const data_expression &data_expr, const detail::variable_context &context) const¶Type check a data expression. Throws a mcrl2::runtime_error exception if the expression is not well typed.
Parameters:
Returns: a data expression where all untyped identifiers have been replace by typed ones.
read_constructors_and_mappings
(const function_symbol_vector &constructors, const function_symbol_vector &mappings, const function_symbol_vector &normalized_constructors)¶read_sort
(const sort_expression &SortExpr)¶strict_type_check
(const data_expression &d) const¶TransformVarConsTypeData
(data_specification &data_spec)¶TraverseVarConsTypeD
(const detail::variable_context &DeclaredVars, data_expression &DataTerm, const sort_expression &PosType, const bool strictly_ambiguous = true, const bool warn_upcasting = false, const bool print_cast_error = true) const¶TraverseVarConsTypeDN
(const detail::variable_context &DeclaredVars, data_expression &DataTerm, sort_expression PosType, const bool strictly_ambiguous = true, const std::size_t nFactPars = std::string::npos, const bool warn_upcasting = false, const bool print_cast_error = true) const¶TypeMatchA
(const sort_expression &Type_in, const sort_expression &PosType_in, sort_expression &result) const¶TypeMatchL
(const sort_expression_list &TypeList, const sort_expression_list &PosTypeList, sort_expression_list &result) const¶UnArrowProd
(const sort_expression_list &ArgTypes, sort_expression PosType, sort_expression &result) const¶UnFBag
(sort_expression PosType, sort_expression &result) const¶UnFSet
(sort_expression PosType, sort_expression &result) const¶UnifyMinType
(const sort_expression &Type1, const sort_expression &Type2, sort_expression &result) const¶UnList
(sort_expression PosType, sort_expression &result) const¶UnwindType
(const sort_expression &Type) const¶upcast_numeric_type
(const data_expression &x, const sort_expression &expected_sort, const detail::variable_context &variable_context)¶UpCastNumericType
(sort_expression NeededType, sort_expression Type, data_expression &Par, const detail::variable_context &DeclaredVars, const bool strictly_ambiguous, bool warn_upcasting = false, const bool print_cast_error = false) const¶