3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-13 04:28:17 +00:00

Merge branch 'unstable' of https://github.com/Z3Prover/z3 into unstable

This commit is contained in:
Nikolaj Bjorner 2015-10-04 10:35:57 -07:00
commit 67ddbe4a05
7 changed files with 38 additions and 37 deletions

View file

@ -179,8 +179,6 @@ expr_ref fpa2bv_model_converter::convert_bv2rm(model * bv_mdl, func_decl * var,
void fpa2bv_model_converter::convert(model * bv_mdl, model * float_mdl) {
fpa_util fu(m);
bv_util bu(m);
unsynch_mpz_manager & mpzm = fu.fm().mpz_manager();
unsynch_mpq_manager & mpqm = fu.fm().mpq_manager();
TRACE("fpa2bv_mc", tout << "BV Model: " << std::endl;
for (unsigned i = 0; i < bv_mdl->get_num_constants(); i++)

View file

@ -123,7 +123,7 @@ datalog::ddnf_core* populate_ddnf(char const* file, ptr_vector<tbv>& tbvs) {
static void read_args(char ** argv, int argc, int& i) {
if (argc = i + 2) {
if (argc == i + 2) {
g_file = argv[i + 1];
++i;
return;

View file

@ -181,7 +181,6 @@ class test_doc_cls {
expr_ref result(m);
expr_ref_vector conjs(m);
unsigned n = m2.num_tbits();
tbv_manager& tm = m2.tbvm();
SASSERT(n <= m_vars.size());
for (unsigned i = 0; i < n; ++i) {
switch (t[i]) {

View file

@ -172,7 +172,6 @@ public:
static void tst2() {
typedef basic_interval_manager<unsynch_mpz_manager, false> mpzi_manager;
typedef mpzi_manager::interval mpzi;
typedef mpzi_manager::scoped_interval scoped_mpzi;
unsynch_mpz_manager nm;

View file

@ -24,35 +24,35 @@ static vector<R> vec(int i, int j) {
return nv;
}
static vector<R> vec(int i, int j, int k) {
vector<R> nv = vec(i, j);
nv.push_back(R(k));
return nv;
}
// static vector<R> vec(int i, int j, int k) {
// vector<R> nv = vec(i, j);
// nv.push_back(R(k));
// return nv;
// }
static vector<R> vec(int i, int j, int k, int l) {
vector<R> nv = vec(i, j, k);
nv.push_back(R(l));
return nv;
}
// static vector<R> vec(int i, int j, int k, int l) {
// vector<R> nv = vec(i, j, k);
// nv.push_back(R(l));
// return nv;
// }
static vector<R> vec(int i, int j, int k, int l, int x) {
vector<R> nv = vec(i, j, k, l);
nv.push_back(R(x));
return nv;
}
/// static vector<R> vec(int i, int j, int k, int l, int x) {
/// vector<R> nv = vec(i, j, k, l);
/// nv.push_back(R(x));
/// return nv;
/// }
static vector<R> vec(int i, int j, int k, int l, int x, int y) {
vector<R> nv = vec(i, j, k, l, x);
nv.push_back(R(y));
return nv;
}
// static vector<R> vec(int i, int j, int k, int l, int x, int y) {
// vector<R> nv = vec(i, j, k, l, x);
// nv.push_back(R(y));
// return nv;
// }
static vector<R> vec(int i, int j, int k, int l, int x, int y, int z) {
vector<R> nv = vec(i, j, k, l, x, y);
nv.push_back(R(z));
return nv;
}
// static vector<R> vec(int i, int j, int k, int l, int x, int y, int z) {
// vector<R> nv = vec(i, j, k, l, x, y);
// nv.push_back(R(z));
// return nv;
// }
@ -148,7 +148,7 @@ void tst_simplex() {
coeffs.push_back(mpz(i+1));
}
Simplex::row r = S.add_row(1, coeffs.size(), vars.c_ptr(), coeffs.c_ptr());
// Simplex::row r = S.add_row(1, coeffs.size(), vars.c_ptr(), coeffs.c_ptr());
is_sat = S.make_feasible();
std::cout << "feasible: " << is_sat << "\n";
S.display(std::cout);

View file

@ -85,8 +85,8 @@ hwf_manager::~hwf_manager()
{
}
#define RAW(X) (*reinterpret_cast<const uint64*>(&(X)))
#define DBL(X) (*reinterpret_cast<const double*>(&(X)))
uint64 RAW(double X) { uint64 tmp; memcpy(&tmp, &(X), sizeof(uint64)); return tmp; }
double DBL(uint64 X) { double tmp; memcpy(&tmp, &(X), sizeof(double)); return tmp; }
void hwf_manager::set(hwf & o, int value) {
o.value = (double) value;
@ -166,7 +166,7 @@ void hwf_manager::set(hwf & o, bool sign, uint64 significand, int exponent) {
uint64 raw = (sign?0x8000000000000000ull:0);
raw |= (((uint64)exponent) + 1023) << 52;
raw |= significand;
o.value = *reinterpret_cast<double*>(&raw);
memcpy(&o.value, &raw, sizeof(double));
}
void hwf_manager::set(hwf & o, hwf const & x) {

View file

@ -199,8 +199,10 @@ void mpfx_manager::set(mpfx & n, uint64 v) {
else {
allocate_if_needed(n);
n.m_sign = 0;
unsigned * _v = reinterpret_cast<unsigned*>(&v);
unsigned * w = words(n);
uint64 * _vp = &v;
unsigned * _v = 0;
memcpy(&_v, &_vp, sizeof(unsigned*));
for (unsigned i = 0; i < m_total_sz; i++)
w[i] = 0;
w[m_frac_part_sz] = _v[0];
@ -679,7 +681,8 @@ int64 mpfx_manager::get_int64(mpfx const & n) const {
SASSERT(is_int64(n));
unsigned * w = words(n);
w += m_frac_part_sz;
uint64 r = *reinterpret_cast<uint64*>(w);
uint64 r = 0;
memcpy(&r, w, sizeof(uint64));
if (r == 0x8000000000000000ull) {
SASSERT(is_neg(n));
return INT64_MIN;
@ -693,7 +696,9 @@ uint64 mpfx_manager::get_uint64(mpfx const & n) const {
SASSERT(is_uint64(n));
unsigned * w = words(n);
w += m_frac_part_sz;
return *reinterpret_cast<uint64*>(w);
uint64 r = 0;
memcpy(&r, w, sizeof(uint64));
return r;
}
template<bool SYNCH>