: INTEGER_LITERAL
{
std::string intStr = AntlrInput::tokenText($INTEGER_LITERAL);
- atomTerm = SOLVER->mkInteger(intStr);
+ atomTerm = PARSER_STATE->mkRealOrIntFromNumeral(intStr);
}
| DECIMAL_LITERAL
{
&& name.find_first_not_of("0123456789", 1) == std::string::npos;
}
+cvc5::Term Smt2::mkRealOrIntFromNumeral(const std::string& str)
+{
+ // if arithmetic is enabled, and integers are disabled
+ if (d_logic.isTheoryEnabled(internal::theory::THEORY_ARITH)
+ && !d_logic.areIntegersUsed())
+ {
+ return d_solver->mkReal(str);
+ }
+ return d_solver->mkInteger(str);
+}
+
void Smt2::parseOpApplyTypeAscription(ParseOp& p, cvc5::Sort type)
{
Trace("parser") << "parseOpApplyTypeAscription : " << p << " " << type
/** Does name denote an abstract value? (of the form '@n' for numeral n). */
bool isAbstractValue(const std::string& name);
- /** Make abstract value
+ /**
+ * Make real or int from numeral string.
*
- * Abstract values are used for processing get-value calls. The argument
- * name should be such that isUninterpretedSortValue(name) is true.
+ * In particular, if arithmetic is enabled, but integers are disabled, then
+ * we construct a real. Otherwise, we construct an integer.
*/
- cvc5::Term mkUninterpretedSortValue(const std::string& name);
+ cvc5::Term mkRealOrIntFromNumeral(const std::string& str);
/**
* Smt2 parser provides its own checkDeclaration, which does the