* Add code to bitblast etc. for bvzx. BVZX can be created via the interface, and might not be simplified out before reaching the bitblaster.
git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@930
e59a4935-1847-0410-ae03-
e826735625c1
SOLVER_INCLUDE = $(TOP)/src/sat/core
endif
+ifeq ($(WITHCBITP),yes)
+ CFLAGS_BASE += -DWITHCBITP
+endif
+
# todo: These should be set by the config script of course..
TEST_PREFIX=../../stp-tests/
SHELL=/bin/bash
break;
}
case BVSX:
+ case BVZX:
//in BVSX(n[0],len), the length of the BVSX term must be
//greater than the length of n[0]
if (n[0].GetValueWidth() > n.GetValueWidth()) {
FatalError(
- "BVTypeCheck: BVSX(t,bvsx_len) : length of 't' must be <= bvsx_len\n",
+ "BVTypeCheck: BV[SZ]X(t,bv[sz]x_len) : length of 't' must be <= bv[sz]x_len\n",
n);
}
if ((v.size() != 2))
FatalError(
- "BVTypeCheck:BVSX must have two arguments. The second is the new width\n",
+ "BVTypeCheck:BV[SZ]X must have two arguments. The second is the new width\n",
n);
break;
bool bitConstantProp_flag;
+
+ bool cBitP_propagateForDivisionByZero;
+
// Available back-end SAT solvers.
enum SATSolvers
{
// Should constant bit propagation be enabled?
bitConstantProp_flag = true;
+ // given a/b = c, propagates that c<=a even if b may be zero.
+ cBitP_propagateForDivisionByZero =true;
+
} //End of constructor for UserDefinedFlags
}; //End of struct UserDefinedFlags
#include "../../AST/AST.h"
#include "FixedBits.h"
-//#include "../../utility/MersenneTwister.h"
+
+#ifdef WITHCBITP
+ #include "MersenneTwister.h"
+#endif
+
#include "ConstantBitP_Utility.h"
// To reduce the memory I tried using the constantbv stuff. But because it is not
return result;
}
-#if 0
+#ifdef WITHCBITP
// Getting a new random number is expensive. Not sure why.
FixedBits FixedBits::createRandom(const int length, const int probabilityOfSetting, MTRand& trand)
{
result.setValue(i, true);
break;
default:
- throw std::runtime_error(LOCATION "never.");
+ BEEV::FatalError(LOCATION "never.");
}
randomV >>= 1;
{
class ASTNode;
typedef unsigned int * CBV;
- extern bool disable_bitConstantProp;
+ void FatalError(const char * str);
}
namespace simplifier
break;
}
case BVSX:
+ case BVZX:
{
output = CONSTANTBV::BitVector_Create(inputwidth, true);
unsigned t0_width = t[0].GetValueWidth();
}
else
{
- bool topbit_sign = (CONSTANTBV::BitVector_Sign(tmp0) < 0);
+ bool topbit_sign = (k == BVSX)?(CONSTANTBV::BitVector_Sign(tmp0) < 0): false;
if (topbit_sign)
{
break;
}
- case BVSX: {
+ case BVSX:
+ case BVZX:
+ {
// Replicate high-order bit as many times as necessary.
// Arg 0 is expression to be sign extended.
const ASTNode& arg = term[0];
break;
} else {
//we need to sign extend
- const BBNode& msb = bbarg.back();
+ const BBNode& msb = (k == BVSX) ?bbarg.back() : BBFalse;
BBNodeVec tmp_res(result_width);