#include "options/smt_options.h"
#include "preprocessing/assertion_pipeline.h"
#include "preprocessing/preprocessing_pass_context.h"
+#include "smt/logic_exception.h"
#include "theory/rewriter.h"
#include "theory/theory.h"
#include "util/bitvector.h"
case kind::ITE: break;
default:
if (childrenTypesChanged(current, cache)) {
- throw TypeCheckingExceptionPrivate(
- current,
- string("Cannot translate to BV: ") + current.toString());
+ std::stringstream ss;
+ ss << "Cannot translate " << current
+ << " to a bit-vector term. Remove option `--solve-int-as-bv`.";
+ throw LogicException(ss.str());
}
break;
}
+
for (size_t i = 0, csize = children.size(); i < csize; ++i)
{
TypeNode type = children[i].getType();
}
}
}
+
+ if (tn.isInteger() && newKind == current.getKind())
+ {
+ std::stringstream ss;
+ ss << "Cannot translate the operator " << current.getKind()
+ << " to a bit-vector operator. Remove option `--solve-int-as-bv`.";
+ throw LogicException(ss.str());
+ }
NodeBuilder builder(newKind);
if (current.getMetaKind() == kind::metakind::PARAMETERIZED) {
builder << current.getOperator();
regress0/ineq_basic.smtv1.smt2
regress0/ineq_slack.smtv1.smt2
regress0/int-to-bv/basic.smt2
+ regress0/int-to-bv/issue8935-unsupported-operators.smt2
regress0/int-to-bv/neg-consts.smt2
regress0/int-to-bv/not-enough-bits.smt2
regress0/int-to-bv/overflow.smt2
--- /dev/null
+; EXPECT: (error "Cannot translate the operator STRING_STOI to a bit-vector operator. Remove option `--solve-int-as-bv`.")
+; EXIT: 1
+(set-option :solve-int-as-bv 1)
+(set-logic ALL)
+(declare-fun a () String)
+(assert (ite (= (- 1) (str.to_int a)) false true))
+(check-sat)