This PR introduces a rewrite from (^ 2 t) to (pow2 t) in order to make use of the specialized pow2 solver.
One regression that expects an error when t is not a constant is changed accordingly.
}
}
}
+ else if (t[0].getKind() == kind::CONST_RATIONAL
+ && t[0].getConst<Rational>().getNumerator().toUnsignedInt() == 2)
+ {
+ return RewriteResponse(
+ REWRITE_DONE, NodeManager::currentNM()->mkNode(kind::POW2, t[1]));
+ }
// Todo improve the exception thrown
std::stringstream ss;
regress0/nl/pow2-native-1.smt2
regress0/nl/pow2-native-2.smt2
regress0/nl/pow2-native-3.smt2
+ regress0/nl/pow2-pow.smt2
regress0/nl/real-as-int.smt2
regress0/nl/real-div-ufnra.smt2
regress0/nl/sin-cos-346-b-chunk-0169.smt2
--- /dev/null
+; EXPECT: unsat
+(set-logic QF_NIA)
+(declare-fun x () Int)
+(assert (< x 0))
+(assert (distinct (^ 2 x) 0))
+(check-sat)
% EXPECT: The exponent of the POW(^) operator can only be a positive integral constant below 67108864. Exception occurred in:
-% EXPECT: 2 ^ x
+% EXPECT: 3 ^ x
% EXIT: 1
x: INT;
-ASSERT 2^x = 8;
+ASSERT 3^x = 27;
QUERY x=3;