trywith 60 --nl-ext-tplanes --decision=justification
trywith 60 --no-nl-ext-tplanes --decision=internal
# this totals up to more than 40 minutes, although notice that smaller bit-widths may quickly fail
- trywith 600 --solve-int-as-bv=2 --bitblast=eager --bv-sat-solver=cadical --no-bv-abstraction
- trywith 600 --solve-int-as-bv=4 --bitblast=eager --bv-sat-solver=cadical --no-bv-abstraction
- trywith 600 --solve-int-as-bv=8 --bitblast=eager --bv-sat-solver=cadical --no-bv-abstraction
- trywith 600 --solve-int-as-bv=16 --bitblast=eager --bv-sat-solver=cadical --no-bv-abstraction
- trywith 1200 --solve-int-as-bv=32 --bitblast=eager --bv-sat-solver=cadical --no-bv-abstraction
+ trywith 600 --solve-int-as-bv=2 --bv-sat-solver=cadical --no-bv-abstraction
+ trywith 600 --solve-int-as-bv=4 --bv-sat-solver=cadical --no-bv-abstraction
+ trywith 600 --solve-int-as-bv=8 --bv-sat-solver=cadical --no-bv-abstraction
+ trywith 600 --solve-int-as-bv=16 --bv-sat-solver=cadical --no-bv-abstraction
+ trywith 1200 --solve-int-as-bv=32 --bv-sat-solver=cadical --no-bv-abstraction
finishwith --nl-ext-tplanes --decision=internal
;;
QF_NRA)
intToBV_stack_element(TNode node) : d_node(node), d_children_added(false) {}
}; /* struct intToBV_stack_element */
+bool childrenTypesChanged(Node n, NodeMap& cache) {
+ bool result = false;
+ for (Node child : n) {
+ TypeNode originalType = child.getType();
+ TypeNode newType = cache[child].getType();
+ if (! newType.isSubtypeOf(originalType)) {
+ result = true;
+ break;
+ }
+ }
+ return result;
+}
+
+
Node intToBVMakeBinary(TNode n, NodeMap& cache)
{
// Do a topological sort of the subexpressions and substitute them
else
{
NodeBuilder<> builder(current.getKind());
+ if (current.getMetaKind() == kind::metakind::PARAMETERIZED) {
+ builder << current.getOperator();
+ }
+
for (unsigned i = 0; i < current.getNumChildren(); ++i)
{
Assert(cache.find(current[i]) != cache.end());
case kind::EQUAL:
case kind::ITE: break;
default:
- if (Theory::theoryOf(current) == THEORY_BOOL)
- {
- break;
- }
- throw TypeCheckingException(
+ if (childrenTypesChanged(current, cache)) {
+ throw TypeCheckingException(
current.toExpr(),
string("Cannot translate to BV: ") + current.toString());
+ }
+ break;
}
for (unsigned i = 0; i < children.size(); ++i)
{
}
}
NodeBuilder<> builder(newKind);
+ if (current.getMetaKind() == kind::metakind::PARAMETERIZED) {
+ builder << current.getOperator();
+ }
for (unsigned i = 0; i < children.size(); ++i)
{
builder << children[i];
nm->mkBitVectorType(size),
"Variable introduced in intToBV pass");
}
- else
- {
- AlwaysAssert(current.getType() == nm->booleanType());
- }
}
else if (current.isConst())
{
case kind::CONST_RATIONAL:
{
Rational constant = current.getConst<Rational>();
- AlwaysAssert(constant.isIntegral());
- AlwaysAssert(constant >= 0);
- BitVector bv(size, constant.getNumerator());
- if (bv.toSignedInteger() != constant.getNumerator())
- {
- throw TypeCheckingException(
- current.toExpr(),
- string("Not enough bits for constant in intToBV: ")
- + current.toString());
+ if (constant.isIntegral()) {
+ AlwaysAssert(constant >= 0);
+ BitVector bv(size, constant.getNumerator());
+ if (bv.toSignedInteger() != constant.getNumerator())
+ {
+ throw TypeCheckingException(
+ current.toExpr(),
+ string("Not enough bits for constant in intToBV: ")
+ + current.toString());
+ }
+ result = nm->mkConst(bv);
}
- result = nm->mkConst(bv);
break;
}
- case kind::CONST_BOOLEAN: break;
- default:
- throw TypeCheckingException(
- current.toExpr(),
- string("Cannot translate const to BV: ")
- + current.toString());
+ default: break;
}
}
else
PreprocessingPassResult IntToBV::applyInternal(
AssertionPipeline* assertionsToPreprocess)
{
- unordered_map<Node, Node, NodeHashFunction> cache;
+ NodeMap cache;
for (unsigned i = 0; i < assertionsToPreprocess->size(); ++i)
{
assertionsToPreprocess->replace(