12#ifndef MCRL2_DATA_TYPECHECK_H
13#define MCRL2_DATA_TYPECHECK_H
83 if (x1.
sort() != expected_sort)
100 std::set<core::identifier_string> names;
104 if (names.find(name) != names.end())
128 std::cout <<
"--- basic sorts ---" << std::endl;
129 for (
auto const& x: sortspec.user_defined_sorts())
131 std::cout << x << std::endl;
133 std::cout <<
"--- aliases ---" << std::endl;
134 for (
auto const& x: sortspec.user_defined_aliases())
136 std::cout << x << std::endl;
138 std::cout <<
"--- user constants ---" << std::endl;
141 std::cout << user_constant.first <<
" -> " << user_constant.second << std::endl;
143 std::cout <<
"--- user functions ---" << std::endl;
146 std::cout << user_function.first <<
" -> " << user_function.second << std::endl;
175 std::vector<T> result;
187 const bool strictly_ambiguous=
true,
188 const bool warn_upcasting=
false,
189 const bool print_cast_error=
true)
const;
199 const bool strictly_ambiguous=
true,
200 const std::size_t nFactPars=std::string::npos,
201 const bool warn_upcasting=
false,
202 const bool print_cast_error=
true)
const;
246 const bool strictly_ambiguous,
247 bool warn_upcasting=
false,
248 const bool print_cast_error=
false)
const;
308template <
typename VariableContainer>
310 const VariableContainer& variables,
359 if (parameters.
empty())
Term containing a string.
const_iterator end() const
Returns a const_iterator pointing to the end of the term_list.
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the term_list.
bool empty() const
Returns true if the list's size is 0.
An application of a data expression to a number of arguments.
\brief Assignment of a data expression to a variable
const data_expression & rhs() const
const variable & lhs() const
sort_expression sort() const
Returns the sort of the data expression.
bool IsNotInferredL(sort_expression_list TypeList) const
bool TypeMatchL(const sort_expression_list &TypeList, const sort_expression_list &PosTypeList, sort_expression_list &result) const
bool UnFBag(sort_expression PosType, sort_expression &result) const
std::map< core::identifier_string, sort_expression_list > system_functions
bool MatchIf(const function_sort &type, sort_expression &result) const
sort_expression 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
bool MatchFalseFunction(const function_sort &type, sort_expression &result) const
bool MatchListOpCons(const function_sort &type, sort_expression &result) const
std::map< core::identifier_string, sort_expression_list > system_constants
bool UnifyMinType(const sort_expression &Type1, const sort_expression &Type2, sort_expression &result) const
bool MatchListOpEltAt(const function_sort &type, sort_expression &result) const
const data_specification operator()() const
Yields a type checked data specification, provided typechecking was successful. If not successful an ...
bool EqTypesA(const sort_expression &Type1, const sort_expression &Type2) const
std::map< core::identifier_string, sort_expression_list > user_functions
sort_expression 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
bool UnifyElementSort(sort_expression &Arg1, sort_expression &Arg2, sort_expression &result) const
bool MatchListSetBagOpIn(const function_sort &type, sort_expression &result) const
bool match_fbag_cinsert(const function_sort &type, sort_expression &result) const
bool MatchSqrt(const function_sort &type, sort_expression &result) const
bool MatchBagOpBag2Set(const function_sort &type, sort_expression &result) const
void read_constructors_and_mappings(const function_symbol_vector &constructors, const function_symbol_vector &mappings, const function_symbol_vector &normalized_constructors)
bool MatchEqNeqComparison(const function_sort &type, sort_expression &result) const
void print_context() const
bool InTypesL(const sort_expression_list &Type, atermpp::term_list< sort_expression_list > Types) const
sort_expression UnwindType(const sort_expression &Type) const
bool strict_type_check(const data_expression &d) const
bool MatchBagConstructor(const function_sort &type, sort_expression &result) const
bool MatchBagOpBagCount(const function_sort &type, sort_expression &result) const
assignment_list typecheck_assignment_list(const assignment_list &assignments, const detail::variable_context &variable_context)
sort_expression ExpandNumTypesUp(sort_expression Type) const
sort_expression ExpandNumTypesDown(sort_expression Type) const
sort_expression_list ExpandNumTypesUpL(const sort_expression_list &type_list) const
void add_constant(const data::function_symbol &f, const std::string &msg)
bool MatchSetBagOpUnionDiffIntersect(const core::identifier_string &data_term_name, const function_sort &type, sort_expression &result) const
bool MatchListOpSnoc(const function_sort &type, sort_expression &result) const
bool UnFSet(sort_expression PosType, sort_expression &result) const
bool MatchListOpConcat(const function_sort &type, sort_expression &result) const
void add_system_function(const data::function_symbol &f)
void ErrorMsgCannotCast(sort_expression CandidateType, data_expression_list Arguments, sort_expression_list ArgumentTypes, std::string previous_reason) const
void TransformVarConsTypeData(data_specification &data_spec)
void add_system_constants_and_functions(const std::vector< data::function_symbol > &v)
bool IsTypeAllowedA(const sort_expression &Type, const sort_expression &PosType) const
data_expression typecheck_data_expression(const data_expression &x, const sort_expression &expected_sort, const detail::variable_context &variable_context)
assignment typecheck_assignment(const assignment &x, const detail::variable_context &variable_context)
bool MatchSetOpSetCompl(const function_sort &type, sort_expression &result) const
void initialise_system_defined_functions(void)
bool InTypesA(const sort_expression &Type, sort_expression_list Types) const
bool MaximumType(const sort_expression &Type1, const sort_expression &Type2, sort_expression &result) const
std::map< core::identifier_string, sort_expression > user_constants
bool was_warning_upcasting
bool UnList(sort_expression PosType, sort_expression &result) const
bool MatchFuncUpdate(const function_sort &type, sort_expression &result) const
void add_system_constant(const data::function_symbol &f)
bool MatchSetOpSet2Bag(const function_sort &type, sort_expression &result) const
std::pair< bool, sort_expression_list > AdjustNotInferredList(const sort_expression_list &PosTypeList, const atermpp::term_list< sort_expression_list > &TypeListList) const
bool EqTypesL(sort_expression_list Type1, sort_expression_list Type2) const
sort_expression determine_allowed_type(const data_expression &d, const sort_expression &proposed_type) const
data_expression upcast_numeric_type(const data_expression &x, const sort_expression &expected_sort, const detail::variable_context &variable_context)
void add_function(const data::function_symbol &f, const std::string &msg, bool allow_double_decls=false)
sort_expression_list GetNotInferredList(const atermpp::term_list< sort_expression_list > &TypeListList) const
void read_sort(const sort_expression &SortExpr)
const data_specification & typechecked_data_specification() const
bool MatchListOpHead(const function_sort &type, sort_expression &result) const
bool match_fset_insert(const function_sort &type, sort_expression &result) const
sort_expression 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
sort_expression_list InsertType(const sort_expression_list &TypeList, const sort_expression &Type) const
bool UnArrowProd(const sort_expression_list &ArgTypes, sort_expression PosType, sort_expression &result) const
bool TypeMatchA(const sort_expression &Type_in, const sort_expression &PosType_in, sort_expression &result) const
bool IsTypeAllowedL(const sort_expression_list &TypeList, const sort_expression_list &PosTypeList) const
bool MatchSetConstructor(const function_sort &type, sort_expression &result) const
data_specification type_checked_data_spec
bool MatchListOpTail(const function_sort &type, sort_expression &result) const
atermpp::term_list< T > UnwindType(const atermpp::term_list< T > &l)
void add_context_variables(const VariableContainer &variables)
const sort_specification & get_sort_specification() const
void check_sort_is_declared(const sort_expression &x) const
\brief An untyped identifier
\brief Unknown sort expression
const sort_expression & sort() const
Standard exception class for reporting runtime errors.
The class data_specification.
std::vector< assignment > assignment_vector
\brief vector of assignments
void typecheck_sort_expression(const sort_expression &sort_expr, const data_specification &data_spec)
Type check a sort expression. Throws an exception if something went wrong.
atermpp::term_list< sort_expression_list > sorts_list
void typecheck_data_specification(data_specification &data_spec)
Type check a parsed mCRL2 data specification. Throws an exception if something went wrong.
data_expression typecheck_data_expression(const data_expression &x, const VariableContainer &variables, const data_specification &dataspec=data_specification())
Type check a data expression. Throws an exception if something went wrong.
std::vector< data_equation > data_equation_vector
\brief vector of data_equations
std::string pp(const abstraction &x)
data_expression typecheck_untyped_data_parameter(data_type_checker &typechecker, const core::identifier_string &name, const data_expression_list ¶meters, const data::sort_expression &expected_sort, const detail::variable_context &variable_context)
atermpp::term_list< variable > variable_list
\brief list of variables
atermpp::term_list< assignment > assignment_list
\brief list of assignments
data_expression normalize_sorts(const data_expression &x, const data::sort_specification &sortspec)
std::vector< function_symbol > function_symbol_vector
\brief vector of function_symbols
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
add your file description here.
add your file description here.