mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
Fixed warnings produced by gcc 4.6.3 when compiling in debug mode
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
b1ce9f796c
commit
d8f627c6c8
53 changed files with 116 additions and 121 deletions
|
@ -75,10 +75,10 @@ class tst_bv_simplifier_plugin_cls {
|
|||
public:
|
||||
|
||||
tst_bv_simplifier_plugin_cls() :
|
||||
m_bv_util(m_manager),
|
||||
m_bsimp(m_manager),
|
||||
m_arith(m_manager),
|
||||
m_simp(m_manager, m_bsimp, m_bv_params),
|
||||
m_bv_util(m_manager),
|
||||
m_fid(m_manager.get_family_id("bv")) {
|
||||
reg_decl_plugins(m_manager);
|
||||
}
|
||||
|
@ -88,7 +88,6 @@ public:
|
|||
void test_num(unsigned a) {
|
||||
expr_ref e(m_manager), e1(m_manager);
|
||||
app_ref ar(m_manager);
|
||||
int sa = static_cast<int>(a);
|
||||
uint64 a64 = static_cast<uint64>(a);
|
||||
|
||||
e1 = m_bv_util.mk_numeral(rational(a), 32);
|
||||
|
|
|
@ -39,6 +39,6 @@ void tst_check_assumptions()
|
|||
|
||||
expr * assumpt[] = { nq.get(), nr.get() };
|
||||
//here it should crash
|
||||
lbool res2 = ctx.check(2, assumpt);
|
||||
ctx.check(2, assumpt);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ static void dl_context_simple_query_test(params_ref & params) {
|
|||
context ctx(m, fparams);
|
||||
ctx.updt_params(params);
|
||||
|
||||
lbool status = dl_context_eval_unary_predicate(m, ctx, "Z 64\n\nP(x:Z)\nP(\"a\").", "P");
|
||||
/* lbool status = */ dl_context_eval_unary_predicate(m, ctx, "Z 64\n\nP(x:Z)\nP(\"a\").", "P");
|
||||
|
||||
#if 0
|
||||
// TBD:
|
||||
|
|
|
@ -48,7 +48,6 @@ void dl_query_test(ast_manager & m, front_end_params & fparams, params_ref& para
|
|||
bool use_magic_sets) {
|
||||
|
||||
dl_decl_util decl_util(m);
|
||||
relation_manager & rel_mgr_b = ctx_b.get_rmanager();
|
||||
|
||||
context ctx_q(m, fparams);
|
||||
params.set_bool(":magic-sets-for-queries", use_magic_sets);
|
||||
|
|
|
@ -179,8 +179,8 @@ namespace datalog {
|
|||
Z3_ast ffx = Z3_mk_app(ctx, cons_decl, 2, zero_fx);
|
||||
Z3_ast xy[2] = { x, y };
|
||||
Z3_ast zy[2] = { z, y };
|
||||
Z3_ast ffxy[2] = { ffx, y };
|
||||
Z3_ast fxy[2] = { fx, y };
|
||||
// Z3_ast ffxy[2] = { ffx, y };
|
||||
// Z3_ast fxy[2] = { fx, y };
|
||||
Z3_ast zero_nil[2] = { zero, Z3_mk_app(ctx, nil_decl, 0, 0) };
|
||||
Z3_ast f0 = Z3_mk_app(ctx, cons_decl, 2, zero_nil);
|
||||
Z3_ast zero_f0[2] = { zero, f0 };
|
||||
|
|
|
@ -73,18 +73,15 @@ static void tst_get_implied_equalities2() {
|
|||
Z3_context ctx = Z3_mk_context(cfg);
|
||||
Z3_del_config(cfg);
|
||||
Z3_sort int_ty = Z3_mk_int_sort(ctx);
|
||||
Z3_sort a_ty = Z3_mk_array_sort(ctx, int_ty, int_ty);
|
||||
Z3_ast a = mk_int_var(ctx,"a");
|
||||
Z3_ast b = mk_int_var(ctx,"b");
|
||||
Z3_ast c = mk_int_var(ctx,"c");
|
||||
Z3_ast d = mk_int_var(ctx,"d");
|
||||
Z3_ast one = Z3_mk_numeral(ctx, "1", int_ty);
|
||||
Z3_ast two = Z3_mk_numeral(ctx, "2", int_ty);
|
||||
Z3_ast x = Z3_mk_const_array(ctx, int_ty, one);
|
||||
Z3_ast y = Z3_mk_store(ctx, x, one, a);
|
||||
Z3_ast z = Z3_mk_store(ctx, y, two , b);
|
||||
Z3_ast u = Z3_mk_store(ctx, x, two , b);
|
||||
Z3_ast v = Z3_mk_store(ctx, u, one , a);
|
||||
Z3_ast one = Z3_mk_numeral(ctx, "1", int_ty);
|
||||
Z3_ast two = Z3_mk_numeral(ctx, "2", int_ty);
|
||||
Z3_ast x = Z3_mk_const_array(ctx, int_ty, one);
|
||||
Z3_ast y = Z3_mk_store(ctx, x, one, a);
|
||||
Z3_ast z = Z3_mk_store(ctx, y, two , b);
|
||||
Z3_ast u = Z3_mk_store(ctx, x, two , b);
|
||||
Z3_ast v = Z3_mk_store(ctx, u, one , a);
|
||||
unsigned const num_terms = 5;
|
||||
unsigned i;
|
||||
Z3_ast terms[5] = { x, y, z, u, v};
|
||||
|
|
|
@ -92,10 +92,10 @@ static void bug_to_rational() {
|
|||
m.to_rational(a, r);
|
||||
ad = m.to_double(a);
|
||||
rd = mq.get_double(r);
|
||||
double diff = (ad-rd);
|
||||
#ifdef _WINDOWS
|
||||
// CMW: This one depends on the rounding mode,
|
||||
// which is implicit in both hwf::set and in mpq::to_double.
|
||||
double diff = (ad-rd);
|
||||
SASSERT(diff >= -DBL_EPSILON && diff <= DBL_EPSILON);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -167,8 +167,6 @@ tst_inf_rational()
|
|||
SASSERT(ceil(inf_rational(rational(1))) == rational(1));
|
||||
SASSERT(ceil(inf_rational(rational(1),true)) == rational(2));
|
||||
|
||||
unsigned h = r9.hash();
|
||||
|
||||
inf_rational x(rational(1,2),true);
|
||||
inf_rational y(1,2);
|
||||
x.swap(y);
|
||||
|
|
|
@ -20,9 +20,7 @@ void tst_model_retrieval()
|
|||
|
||||
family_id array_fid = m.get_family_id(symbol("array"));
|
||||
array_util au(m);
|
||||
array_decl_plugin& ad = *static_cast<array_decl_plugin *>(m.get_plugin(array_fid));
|
||||
|
||||
|
||||
|
||||
// arr_s and select_fn creation copy-pasted from z3.cpp
|
||||
|
||||
parameter sparams[2] = { parameter(to_sort(m.mk_bool_sort())), parameter(to_sort(m.mk_bool_sort())) };
|
||||
|
|
|
@ -113,7 +113,7 @@ static void tst7() {
|
|||
m.display_smt2(std::cout, a); std::cout << "\n";
|
||||
}
|
||||
|
||||
// if (!qm.le(qa, qt)) { TRACE("mpff_bug", tout << fa << "\n" << qa << "\n" << qt << "\n";); UNREACHABLE(); } \
|
||||
// if (!qm.le(qa, qt)) { TRACE("mpff_bug", tout << fa << "\n" << qa << "\n" << qt << "\n";); UNREACHABLE(); }
|
||||
|
||||
|
||||
#define MK_BIN_OP(OP) \
|
||||
|
|
|
@ -268,7 +268,6 @@ static void tst4() {
|
|||
static void tst5() {
|
||||
params_ref ps;
|
||||
nlsat::solver s(ps);
|
||||
unsynch_mpq_manager & qm = s.qm();
|
||||
anum_manager & am = s.am();
|
||||
nlsat::pmanager & pm = s.pm();
|
||||
nlsat::assignment as(am);
|
||||
|
|
|
@ -55,7 +55,7 @@ static void tst1() {
|
|||
cell_allocator m;
|
||||
|
||||
cell * c1 = m.allocate<true>();
|
||||
cell * c2 = m.allocate<true>();
|
||||
/* cell * c2 = */ m.allocate<true>();
|
||||
|
||||
c1->m_coeff = rational(10);
|
||||
m.recycle(c1);
|
||||
|
|
|
@ -112,10 +112,10 @@ static void tst2() {
|
|||
m.display_info(tout, a1); tout << "\n";
|
||||
m.display_info(tout, a2); tout << "\n";);
|
||||
for (unsigned i = 0; i < m.size(a1); i++) {
|
||||
SASSERT(m.get(a1, i) == i);
|
||||
SASSERT(static_cast<unsigned>(m.get(a1, i)) == i);
|
||||
}
|
||||
for (unsigned i = 0; i < m.size(a2); i++) {
|
||||
SASSERT(m.get(a2, i) == i);
|
||||
SASSERT(static_cast<unsigned>(m.get(a2, i)) == i);
|
||||
}
|
||||
TRACE("parray",
|
||||
m.display_info(tout, a1); tout << "\n";
|
||||
|
@ -161,7 +161,7 @@ static void tst3() {
|
|||
m.push_back(a4, 30);
|
||||
|
||||
for (unsigned i = 0; i < 20; i++) {
|
||||
SASSERT(m.get(a2, i) == i+1);
|
||||
SASSERT(static_cast<unsigned>(m.get(a2, i)) == i+1);
|
||||
}
|
||||
TRACE("parray",
|
||||
m.display_info(tout, a1); tout << "\n";
|
||||
|
@ -182,11 +182,11 @@ static void tst3() {
|
|||
SASSERT(m.size(a3) == 19);
|
||||
SASSERT(m.size(a4) == 19);
|
||||
for (unsigned i = 0; i < 20; i++) {
|
||||
SASSERT(m.get(a1, i) == i);
|
||||
SASSERT(m.get(a2, i) == i+1);
|
||||
SASSERT(i >= 18 || m.get(a4, i) == i+1);
|
||||
SASSERT(i >= 6 || m.get(a3, i) == i+1);
|
||||
SASSERT(!(6 <= i && i <= 17) || m.get(a3, i) == i);
|
||||
SASSERT(static_cast<unsigned>(m.get(a1, i)) == i);
|
||||
SASSERT(static_cast<unsigned>(m.get(a2, i)) == i+1);
|
||||
SASSERT(i >= 18 || static_cast<unsigned>(m.get(a4, i)) == i+1);
|
||||
SASSERT(i >= 6 || static_cast<unsigned>(m.get(a3, i)) == i+1);
|
||||
SASSERT(!(6 <= i && i <= 17) || static_cast<unsigned>(m.get(a3, i)) == i);
|
||||
}
|
||||
SASSERT(m.get(a4, 18) == 30);
|
||||
SASSERT(m.get(a3, 18) == 40);
|
||||
|
|
|
@ -747,9 +747,6 @@ static void tst_psc() {
|
|||
polynomial_ref & d = x3;
|
||||
polynomial_ref & e = x4;
|
||||
polynomial_ref & f = x5;
|
||||
polynomial_ref & g = x6;
|
||||
polynomial_ref & h = x7;
|
||||
polynomial_ref & i = x8;
|
||||
polynomial_ref & x = x9;
|
||||
tst_psc((x^4) + a*(x^2) + b*x + c, 4*(x^3) + 2*a*x + b, 9,
|
||||
16*(a^4)*c - 4*(a^3)*(b^2) - 128*(a^2)*(c^2) + 144*a*(b^2)*c - 27*(b^4) + 256*(c^3), 8*(a^3) - 32*a*c + 36*(b^2));
|
||||
|
|
|
@ -247,7 +247,7 @@ static void tst_factor_finite_1() {
|
|||
|
||||
// factor it
|
||||
upolynomial::zp_factors factors(upm);
|
||||
bool factorized = upolynomial::zp_factor(upm, K_u, factors);
|
||||
/* bool factorized = */ upolynomial::zp_factor(upm, K_u, factors);
|
||||
|
||||
// check the result
|
||||
unsigned distinct = factors.distinct_factors();
|
||||
|
@ -383,8 +383,8 @@ static void tst_factor_finite_3() {
|
|||
cout << "Got " << factors << endl;
|
||||
cout << "Thats " << distinct << " distinct factors, " << total << " total" << endl;
|
||||
|
||||
SASSERT(random_polynomial[random_i][0][prime_i] == distinct);
|
||||
SASSERT(random_polynomial[random_i][1][prime_i] == total);
|
||||
// SASSERT(random_polynomial[random_i][0][prime_i] == distinct);
|
||||
// SASSERT(random_polynomial[random_i][1][prime_i] == total);
|
||||
|
||||
upolynomial::numeral_vector multiplied;
|
||||
factors.multiply(multiplied);
|
||||
|
@ -548,7 +548,7 @@ static void tst_factor_square_free_univariate_1(unsigned max_length) {
|
|||
cout << "factoring "; upm.display(cout, f_u); cout << endl;
|
||||
cout << "expecting " << length << " factors ";
|
||||
upolynomial::factors factors(upm);
|
||||
bool ok = upolynomial::factor_square_free(upm, f_u, factors);
|
||||
/* bool ok = */ upolynomial::factor_square_free(upm, f_u, factors);
|
||||
cout << "got " << factors << endl;
|
||||
|
||||
SASSERT(factors.distinct_factors() == length);
|
||||
|
|
|
@ -23,12 +23,12 @@ static void tst1() {
|
|||
SASSERT(v1.empty());
|
||||
for (unsigned i = 0; i < 1000; i++) {
|
||||
v1.push_back(i + 3);
|
||||
SASSERT(v1[i] == i + 3);
|
||||
SASSERT(static_cast<unsigned>(v1[i]) == i + 3);
|
||||
SASSERT(v1.capacity() >= v1.size());
|
||||
SASSERT(!v1.empty());
|
||||
}
|
||||
for (unsigned i = 0; i < 1000; i++) {
|
||||
SASSERT(v1[i] == i + 3);
|
||||
SASSERT(static_cast<unsigned>(v1[i]) == i + 3);
|
||||
}
|
||||
vector<int>::iterator it = v1.begin();
|
||||
vector<int>::iterator end = v1.end();
|
||||
|
@ -36,7 +36,7 @@ static void tst1() {
|
|||
SASSERT(*it == i + 3);
|
||||
}
|
||||
for (unsigned i = 0; i < 1000; i++) {
|
||||
SASSERT(v1.back() == 1000 - i - 1 + 3);
|
||||
SASSERT(static_cast<unsigned>(v1.back()) == 1000 - i - 1 + 3);
|
||||
SASSERT(v1.size() == 1000 - i);
|
||||
v1.pop_back();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue