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

merge with unstable

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-01-05 20:44:56 -08:00
commit 23e811d136
95 changed files with 24076 additions and 414 deletions

View file

@ -57,6 +57,11 @@ public:
m_free_ids.finalize();
}
unsigned show_hash(){
unsigned h = string_hash((char *)&m_free_ids[0],m_free_ids.size()*sizeof(unsigned),17);
return hash_u_u(h,m_next_id);
}
/**
\brief Return N if the range of ids generated by this module is in the set [0..N)
*/

View file

@ -360,6 +360,8 @@ void mpf_manager::set(mpf & o, unsigned ebits, unsigned sbits, mpf_rounding_mode
mk_inf(ebits, sbits, x.sign, o);
else if (is_zero(x))
mk_zero(ebits, sbits, x.sign, o);
else if (x.ebits == ebits && x.sbits == sbits)
set(o, x);
else {
set(o, x);
unpack(o, true);
@ -1378,12 +1380,12 @@ bool mpf_manager::has_top_exp(mpf const & x) {
}
mpf_exp_t mpf_manager::mk_bot_exp(unsigned ebits) {
SASSERT(ebits > 0);
SASSERT(ebits >= 2);
return m_mpz_manager.get_int64(m_powers2.m1(ebits-1, true));
}
mpf_exp_t mpf_manager::mk_top_exp(unsigned ebits) {
SASSERT(ebits > 0);
SASSERT(ebits >= 2);
return m_mpz_manager.get_int64(m_powers2(ebits-1));
}

View file

@ -31,7 +31,7 @@ mpn_manager static_mpn_manager;
const mpn_digit mpn_manager::zero = 0;
mpn_manager::mpn_manager() {
#ifdef _DEBUG
#ifdef Z3DEBUG
trace_enabled=true;
#endif
}
@ -43,7 +43,7 @@ int mpn_manager::compare(mpn_digit const * a, size_t const lnga,
mpn_digit const * b, size_t const lngb) const {
int res = 0;
#ifdef _DEBUG
#ifdef Z3DEBUG
if (trace_enabled)
STRACE("mpn", tout << "[mpn] "; );
#endif
@ -60,7 +60,7 @@ int mpn_manager::compare(mpn_digit const * a, size_t const lnga,
res = -1;
}
#ifdef _DEBUG
#ifdef Z3DEBUG
if (trace_enabled)
STRACE("mpn", tout << ((res == 1) ? " > " : (res == -1) ? " < " : " == "); );
#endif
@ -212,7 +212,7 @@ bool mpn_manager::div(mpn_digit const * numer, size_t const lnum,
trace(numer, lnum, denom, lden, "%");
trace_nl(rem, lden);
#ifdef _DEBUG
#ifdef Z3DEBUG
mpn_sbuffer temp(lnum+1, 0);
mul(quot, lnum-lden+1, denom, lden, temp.c_ptr());
size_t real_size;
@ -340,7 +340,7 @@ bool mpn_manager::div_n(mpn_sbuffer & numer, mpn_sbuffer const & denom,
// Replace numer[j+n]...numer[j] with
// numer[j+n]...numer[j] - q * (denom[n-1]...denom[0])
mpn_digit q_hat_small = (mpn_digit)q_hat;
#ifdef _DEBUG
#ifdef Z3DEBUG
trace_enabled = false;
#endif
mul(&q_hat_small, 1, denom.c_ptr(), n, t_ms.c_ptr());
@ -354,7 +354,7 @@ bool mpn_manager::div_n(mpn_sbuffer & numer, mpn_sbuffer const & denom,
for (size_t i = 0; i < n+1; i++)
numer[j+i] = t_ab[i];
}
#ifdef _DEBUG
#ifdef Z3DEBUG
trace_enabled = true;
#endif
STRACE("mpn_div", tout << "q_hat=" << q_hat << " r_hat=" << r_hat;
@ -416,7 +416,7 @@ void mpn_manager::display_raw(std::ostream & out, mpn_digit const * a, size_t co
void mpn_manager::trace(mpn_digit const * a, size_t const lnga,
mpn_digit const * b, size_t const lngb,
const char * op) const {
#ifdef _DEBUG
#ifdef Z3DEBUG
if (trace_enabled)
STRACE("mpn", tout << "[mpn] " << to_string(a, lnga, char_buf, sizeof(char_buf));
tout << " " << op << " " << to_string(b, lngb, char_buf, sizeof(char_buf));
@ -425,14 +425,14 @@ void mpn_manager::trace(mpn_digit const * a, size_t const lnga,
}
void mpn_manager::trace(mpn_digit const * a, size_t const lnga) const {
#ifdef _DEBUG
#ifdef Z3DEBUG
if (trace_enabled)
STRACE("mpn", tout << to_string(a, lnga, char_buf, sizeof(char_buf)); );
#endif
}
void mpn_manager::trace_nl(mpn_digit const * a, size_t const lnga) const {
#ifdef _DEBUG
#ifdef Z3DEBUG
if (trace_enabled)
STRACE("mpn", tout << to_string(a, lnga, char_buf, sizeof(char_buf)) << std::endl; );
#endif

View file

@ -101,7 +101,7 @@ private:
bool div_n(mpn_sbuffer & numer, mpn_sbuffer const & denom,
mpn_digit * quot, mpn_digit * rem);
#ifdef _DEBUG
#ifdef Z3DEBUG
mutable char char_buf[4096];
bool trace_enabled;
#endif