}
return t;
}
- // otherwise, nothing to do
- // check that the type is correct
- if (t.getSort() != s)
+ // Otherwise, check that the type is correct. Type ascriptions in SMT-LIB 2.6
+ // referred to the range of function sorts. Note that this is only a check
+ // and does not impact the returned term.
+ api::Sort checkSort = t.getSort();
+ if (checkSort.isFunction())
+ {
+ checkSort = checkSort.getFunctionCodomainSort();
+ }
+ if (checkSort != s)
{
std::stringstream ss;
- ss << "Type ascription not satisfied, term " << t << " expected sort " << s
- << " but has sort " << t.getSort();
+ ss << "Type ascription not satisfied, term " << t
+ << " expected (codomain) sort " << s << " but has sort " << t.getSort();
parseError(ss.str());
}
return t;
regress0/parser/force_logic_set_logic.smt2
regress0/parser/force_logic_success.smt2
regress0/parser/issue5163.smt2
+ regress0/parser/issue7274.smt2
regress0/parser/linear_arithmetic_err1.smt2
regress0/parser/linear_arithmetic_err2.smt2
regress0/parser/linear_arithmetic_err3.smt2