Skip to content

Commit 826835f

Browse files
fixes to build warnings
1 parent 2ac6f8b commit 826835f

21 files changed

+20
-65
lines changed

src/ast/euf/euf_ac_plugin.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,9 @@ namespace euf {
440440
TRACE("plugin", tout << "propagate " << eq_id << ": " << eq_pp(*this, m_eqs[eq_id]) << "\n");
441441

442442
// simplify eq using processed
443-
for (auto other_eq : backward_iterator(eq_id))
444-
TRACE("plugin", tout << "backward iterator " << eq_id << " vs " << other_eq << " " << is_processed(other_eq) << "\n");
443+
TRACE("plugin",
444+
for (auto other_eq : backward_iterator(eq_id))
445+
tout << "backward iterator " << eq_id << " vs " << other_eq << " " << is_processed(other_eq) << "\n"););
445446
for (auto other_eq : backward_iterator(eq_id))
446447
if (is_processed(other_eq) && backward_simplify(eq_id, other_eq))
447448
goto loop_start;

src/ast/euf/euf_egraph.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ namespace euf {
107107
void egraph::update_children(enode* n) {
108108
for (enode* child : enode_args(n))
109109
child->get_root()->add_parent(n);
110-
for (enode* child : enode_args(n))
111-
SASSERT(child->get_root()->m_parents.back() == n);
110+
DEBUG_CODE(for (enode* child : enode_args(n))
111+
SASSERT(child->get_root()->m_parents.back() == n););
112112
m_updates.push_back(update_record(n, update_record::update_children()));
113113
}
114114

src/math/lp/nla_divisions.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ Module Name:
1919
namespace nla {
2020

2121
void divisions::add_idivision(lpvar q, lpvar x, lpvar y) {
22-
const auto& lra = m_core.lra;
2322
if (x == null_lpvar || y == null_lpvar || q == null_lpvar)
2423
return;
2524
m_idivisions.push_back({q, x, y});
2625
m_core.trail().push(push_back_vector(m_idivisions));
2726
}
2827

2928
void divisions::add_rdivision(lpvar q, lpvar x, lpvar y) {
30-
auto& lra = m_core.lra;
3129
if (x == null_lpvar || y == null_lpvar || q == null_lpvar)
3230
return;
3331
m_rdivisions.push_back({ q, x, y });

src/muz/ddnf/ddnf.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -678,14 +678,9 @@ namespace datalog {
678678
}
679679

680680
bool compile_rules1(rule_set const& rules, rule_set& new_rules) {
681-
datalog::rule_set::iterator it = rules.begin();
682-
datalog::rule_set::iterator end = rules.end();
683-
unsigned idx = 0;
684-
for (; it != end; ++idx, ++it) {
685-
if (!compile_rule1(**it, rules, new_rules)) {
681+
for (auto const & r : rules)
682+
if (!compile_rule1(*r, rules, new_rules))
686683
return false;
687-
}
688-
}
689684
return true;
690685
}
691686

src/muz/fp/datalog_parser.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,6 @@ class dparser : public parser {
902902
unsigned arg_idx = 0;
903903
tok = m_lexer->next_token();
904904
while (tok != TK_EOS && tok != TK_ERROR) {
905-
symbol alias;
906905
sort* s = nullptr;
907906

908907
if(!f) {
@@ -939,7 +938,6 @@ class dparser : public parser {
939938
}
940939
s = f->get_domain(arg_idx);
941940

942-
symbol var_symbol;
943941
tok = parse_arg(tok, s, args);
944942
}
945943

@@ -1067,7 +1065,7 @@ class dparser : public parser {
10671065

10681066
bool read_line(std::istream& strm, std::string& line) {
10691067
line.clear();
1070-
char ch = strm.get();
1068+
int ch = strm.get();
10711069
while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') {
10721070
ch = strm.get();
10731071
}

src/muz/rel/dl_product_relation.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,7 @@ namespace datalog {
10301030
}
10311031
new_rels.push_back(irel);
10321032
}
1033+
(void)old_remain;
10331034
SASSERT(old_remain==0); //the new specification must be a superset of the old one
10341035
m_relations = new_rels;
10351036

src/muz/spacer/spacer_unsat_core_plugin.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ namespace spacer {
9797
// XXX this assertion should be true so there is no need to check for it
9898
SASSERT (!m_ctx.is_closed (step));
9999
func_decl* d = step->get_decl();
100-
symbol sym;
101100
TRACE("spacer.farkas",
102101
tout << "looking at: " << mk_pp(step, m) << "\n";);
103102
if (!m_ctx.is_closed(step) && is_farkas_lemma(m, step)) {
@@ -239,9 +238,8 @@ namespace spacer {
239238
SASSERT(m_ctx.is_b(step));
240239

241240
func_decl* d = step->get_decl();
242-
symbol sym;
243241
if (!m_ctx.is_closed(step) && // if step is not already interpolated
244-
is_farkas_lemma(m, step)) {
242+
is_farkas_lemma(m, step)) {
245243
SASSERT(d->get_num_parameters() == m.get_num_parents(step) + 2);
246244
SASSERT(m.has_fact(step));
247245

src/opt/opt_cores.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,11 @@ namespace opt {
256256
void cores::rotate_cores() {
257257
expr_ref_vector soft(m);
258258
soft.append(ctx.soft());
259-
unsigned num_sat = 0, num_unsat = 0, num_undef = 0;
259+
unsigned num_sat = 0, num_undef = 0;
260260
lbool is_sat = l_false;
261261
while (m.inc() && m_cores.size() < m_max_num_cores) {
262262
switch (is_sat) {
263263
case l_false: {
264-
++num_unsat;
265264
auto core = unsat_core();
266265
add_core(core);
267266
if (core.empty())

src/opt/opt_lns.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ namespace opt {
174174
void lns::relax_cores() {
175175
if (!m_cores.empty() && m_cores_are_valid) {
176176
std::sort(m_cores.begin(), m_cores.end(), [&](expr_ref_vector const& a, expr_ref_vector const& b) { return a.size() < b.size(); });
177-
unsigned num_disjoint = 0;
178177
vector<expr_ref_vector> new_cores;
179178
for (auto const& c : m_cores) {
180179
bool in_core = false;
@@ -185,7 +184,6 @@ namespace opt {
185184
for (auto* e : c)
186185
m_in_core.mark(e);
187186
new_cores.push_back(c);
188-
++num_disjoint;
189187
}
190188
IF_VERBOSE(2, verbose_stream() << "num cores: " << m_cores.size() << " new cores: " << new_cores.size() << "\n");
191189
ctx.relax_cores(new_cores);

src/parsers/smt2/smt2parser.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,6 @@ namespace smt2 {
942942
}
943943
for (unsigned i = 0; i < sz; i++) {
944944
pdatatype_decl * d = new_dt_decls[i];
945-
symbol duplicated;
946945
check_duplicate(d, line, pos);
947946
if (!is_smt2_6) {
948947
// datatypes are inserted up front in SMT2.6 mode, so no need to re-insert them.

src/sat/sat_clause_use_list.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ namespace sat {
2525
unsigned sz = 0;
2626
for (clause* c : m_clauses)
2727
if (!c->was_removed())
28-
sz++;
29-
SASSERT(sz == m_size);
28+
sz++;
29+
VERIFY(sz == m_size);
3030
unsigned redundant = 0;
3131
for (clause* c : m_clauses)
3232
if (c->is_learned())
3333
redundant++;
34-
SASSERT(redundant == m_num_redundant);
34+
VERIFY(redundant == m_num_redundant);
3535

3636
return true;
3737
}

src/sat/sat_lookahead.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,6 @@ namespace sat {
13921392
void lookahead::propagate_clauses_searching(literal l) {
13931393
// clauses where l is negative
13941394
unsigned sz = m_nary_count[(~l).index()];
1395-
literal lit;
13961395
SASSERT(m_search_mode == lookahead_mode::searching);
13971396
for (nary* n : m_nary[(~l).index()]) {
13981397
if (sz-- == 0) break;

src/shell/dimacs_frontend.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ static void track_clauses(sat::solver const& src,
110110
dst.mk_var(false, true);
111111
}
112112
sat::literal_vector lits;
113-
sat::literal lit;
114113
sat::clause * const * it = src.begin_clauses();
115114
sat::clause * const * end = src.end_clauses();
116115
svector<sat::solver::bin_clause> bin_clauses;

src/smt/diff_logic.h

+1
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ class dl_graph {
569569
void traverse_neg_cycle2(bool try_relax, Functor & f) {
570570
static unsigned num_conflicts = 0;
571571
++num_conflicts;
572+
(void)num_conflicts;
572573
SASSERT(!is_feasible(m_edges[m_last_enabled_edge]));
573574
vector<numeral> potentials;
574575
svector<edge_id> edges;

src/smt/dyn_ack.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ namespace smt {
294294

295295
void dyn_ack_manager::gc() {
296296
TRACE("dyn_ack", tout << "dyn_ack GC\n";);
297-
unsigned num_deleted = 0;
298297
m_to_instantiate.reset();
299298
m_qhead = 0;
300299
svector<app_pair>::iterator it = m_app_pairs.begin();
@@ -318,7 +317,6 @@ namespace smt {
318317
// SASSERT(num_occs > 0);
319318
num_occs = static_cast<unsigned>(num_occs * m_params.m_dack_gc_inv_decay);
320319
if (num_occs <= 1) {
321-
num_deleted++;
322320
TRACE("dyn_ack", tout << "2) erasing:\n" << mk_pp(p.first, m) << "\n" << mk_pp(p.second, m) << "\n";);
323321
m_app_pair2num_occs.erase(p.first, p.second);
324322
m.dec_ref(p.first);
@@ -337,7 +335,6 @@ namespace smt {
337335
// app_pair_lt is not a total order on pairs of expressions.
338336
// So, we should use stable_sort to avoid different behavior in different platforms.
339337
std::stable_sort(m_to_instantiate.begin(), m_to_instantiate.end(), f);
340-
// IF_VERBOSE(10, if (num_deleted > 0) verbose_stream() << "dynamic ackermann GC: " << num_deleted << "\n";);
341338
}
342339

343340
class dyn_ack_clause_del_eh : public clause_del_eh {
@@ -519,7 +516,6 @@ namespace smt {
519516

520517
void dyn_ack_manager::gc_triples() {
521518
TRACE("dyn_ack", tout << "dyn_ack GC\n";);
522-
unsigned num_deleted = 0;
523519
m_triple.m_to_instantiate.reset();
524520
m_triple.m_qhead = 0;
525521
svector<app_triple>::iterator it = m_triple.m_apps.begin();
@@ -544,7 +540,6 @@ namespace smt {
544540
// SASSERT(num_occs > 0);
545541
num_occs = static_cast<unsigned>(num_occs * m_params.m_dack_gc_inv_decay);
546542
if (num_occs <= 1) {
547-
num_deleted++;
548543
TRACE("dyn_ack", tout << "2) erasing:\n" << mk_pp(p.first, m) << "\n" << mk_pp(p.second, m) << "\n";);
549544
m_triple.m_app2num_occs.erase(p.first, p.second, p.third);
550545
m.dec_ref(p.first);
@@ -563,7 +558,6 @@ namespace smt {
563558
app_triple_lt f(m_triple.m_app2num_occs);
564559
// app_triple_lt is not a total order
565560
std::stable_sort(m_triple.m_to_instantiate.begin(), m_triple.m_to_instantiate.end(), f);
566-
// IF_VERBOSE(10, if (num_deleted > 0) verbose_stream() << "dynamic ackermann GC: " << num_deleted << "\n";);
567561
}
568562

569563

src/smt/theory_arith_core.h

+1-16
Original file line numberDiff line numberDiff line change
@@ -3030,7 +3030,7 @@ namespace smt {
30303030
template<typename Ext>
30313031
void theory_arith<Ext>::propagate_bounds() {
30323032
TRACE("propagate_bounds_detail", display(tout););
3033-
unsigned num_prop = 0, count = 0;
3033+
unsigned count = 0;
30343034
for (unsigned r_idx : m_to_check) {
30353035
row & r = m_rows[r_idx];
30363036
if (r.get_base_var() != null_theory_var) {
@@ -3039,34 +3039,19 @@ namespace smt {
30393039
int upper_idx;
30403040
is_row_useful_for_bound_prop(r, lower_idx, upper_idx);
30413041

3042-
++num_prop;
30433042
if (lower_idx >= 0)
30443043
count += imply_bound_for_monomial(r, lower_idx, true);
30453044
else if (lower_idx == -1)
30463045
count += imply_bound_for_all_monomials(r, true);
3047-
else
3048-
--num_prop;
30493046

3050-
++num_prop;
30513047
if (upper_idx >= 0)
30523048
count += imply_bound_for_monomial(r, upper_idx, false);
30533049
else if (upper_idx == -1)
30543050
count += imply_bound_for_all_monomials(r, false);
3055-
else
3056-
--num_prop;
30573051

30583052
// sneaking cheap eq detection in this loop
30593053
propagate_cheap_eq(r_idx);
30603054
}
3061-
3062-
#if 0
3063-
theory_var v = r.get_base_var();
3064-
if (!is_int(v) || get_value(v).is_int()) {
3065-
// If an integer value is not assigned to an integer value, then
3066-
// bound propagation can diverge.
3067-
m_in_to_check.remove(v);
3068-
}
3069-
#endif
30703055
}
30713056
}
30723057

src/smt/theory_bv.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1988,6 +1988,7 @@ namespace smt {
19881988
while (curr != v);
19891989

19901990
zero_one_bits const & _bits = m_zero_one_bits[v];
1991+
(void)num_bits;
19911992
SASSERT(_bits.size() == num_bits);
19921993
bool_vector already_found;
19931994
already_found.resize(bv_sz, false);

src/smt/theory_lra.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -3495,10 +3495,8 @@ class theory_lra::imp {
34953495

34963496
bool validate_eq(enode* x, enode* y) {
34973497
static bool s_validating = false;
3498-
static unsigned s_count = 0;
34993498
if (s_validating)
35003499
return true;
3501-
++s_count;
35023500
flet<bool> _svalid(s_validating, true);
35033501
context nctx(m, ctx().get_fparams(), ctx().get_params());
35043502
add_background(nctx);

src/smt/theory_pb.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2127,9 +2127,9 @@ namespace smt {
21272127
tout << "sum: " << sum << " " << maxsum << " ";
21282128
tout << ctx.get_assignment(c.lit()) << "\n";);
21292129

2130-
SASSERT(sum <= maxsum);
2131-
SASSERT((sum >= c.k()) == (ctx.get_assignment(c.lit()) == l_true));
2132-
SASSERT((maxsum < c.k()) == (ctx.get_assignment(c.lit()) == l_false));
2130+
VERIFY(sum <= maxsum);
2131+
VERIFY((sum >= c.k()) == (ctx.get_assignment(c.lit()) == l_true));
2132+
VERIFY((maxsum < c.k()) == (ctx.get_assignment(c.lit()) == l_false));
21332133
}
21342134

21352135
void theory_pb::validate_final_check(ineq& c) {

src/tactic/smtlogics/qfnra_tactic.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ Module Name:
2525

2626
#include "tactic/smtlogics/qflra_tactic.h"
2727

28-
static tactic * mk_qfnra_sat_solver(ast_manager& m, params_ref const& p, unsigned bv_size) {
29-
params_ref nra2sat_p = p;
30-
nra2sat_p.set_uint("nla2bv_max_bv_size", p.get_uint("nla2bv_max_bv_size", bv_size));
31-
32-
return and_then(mk_nla2bv_tactic(m, nra2sat_p),
33-
mk_smt_tactic(m),
34-
mk_fail_if_undecided_tactic());
35-
}
3628

3729
tactic * mk_multilinear_ls_tactic(ast_manager & m, params_ref const & p, unsigned ls_time = 60) {
3830
params_ref p_mls = p;

src/util/params.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ class params {
390390
void reset(char const * k);
391391

392392
void validate(param_descrs const & p) {
393-
symbol suffix, prefix;
394393
for (params::entry& e : m_entries) {
395394
param_kind expected = p.get_kind_in_module(e.first);
396395
if (expected == CPK_INVALID) {

0 commit comments

Comments
 (0)