mirror of
https://github.com/Z3Prover/z3
synced 2025-08-18 09:12:16 +00:00
merge with master
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
commit
c513f3ca09
883 changed files with 13979 additions and 16480 deletions
|
@ -43,7 +43,7 @@ bvsls_opt_engine::optimization_result bvsls_opt_engine::optimize(
|
|||
m_hard_tracker.initialize(m_assertions);
|
||||
setup_opt_tracker(objective, _maximize);
|
||||
|
||||
if (initial_model.get() != 0) {
|
||||
if (initial_model.get() != nullptr) {
|
||||
TRACE("sls_opt", tout << "Initial model provided: " << std::endl;
|
||||
for (unsigned i = 0; i < initial_model->get_num_constants(); i++) {
|
||||
func_decl * fd = initial_model->get_constant(i);
|
||||
|
|
|
@ -65,7 +65,7 @@ protected:
|
|||
unsigned & best_const, mpz & best_value, unsigned & new_bit, move_type & move,
|
||||
mpz const & max_score, expr * objective);
|
||||
|
||||
mpz top_score(void) {
|
||||
mpz top_score() {
|
||||
mpz res(0);
|
||||
obj_hashtable<expr> const & top_exprs = m_obj_tracker.get_top_exprs();
|
||||
for (obj_hashtable<expr>::iterator it = top_exprs.begin();
|
||||
|
|
|
@ -537,7 +537,7 @@ bailout:
|
|||
|
||||
void sls_engine::operator()(goal_ref const & g, model_converter_ref & mc) {
|
||||
if (g->inconsistent()) {
|
||||
mc = 0;
|
||||
mc = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -565,7 +565,7 @@ void sls_engine::operator()(goal_ref const & g, model_converter_ref & mc) {
|
|||
g->reset();
|
||||
}
|
||||
else
|
||||
mc = 0;
|
||||
mc = nullptr;
|
||||
}
|
||||
|
||||
lbool sls_engine::operator()() {
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
|
||||
// stats const & get_stats(void) { return m_stats; }
|
||||
void collect_statistics(statistics & st) const;
|
||||
void reset_statistics(void) { m_stats.reset(); }
|
||||
void reset_statistics() { m_stats.reset(); }
|
||||
|
||||
bool full_eval(model & mdl);
|
||||
|
||||
|
@ -109,7 +109,7 @@ public:
|
|||
void mk_inv(unsigned bv_sz, const mpz & old_value, mpz & inverted);
|
||||
void mk_flip(sort * s, const mpz & old_value, unsigned bit, mpz & flipped);
|
||||
|
||||
lbool search(void);
|
||||
lbool search();
|
||||
|
||||
lbool operator()();
|
||||
void operator()(goal_ref const & g, model_converter_ref & mc);
|
||||
|
|
|
@ -42,25 +42,25 @@ public:
|
|||
m_engine = alloc(sls_engine, m, p);
|
||||
}
|
||||
|
||||
virtual tactic * translate(ast_manager & m) {
|
||||
tactic * translate(ast_manager & m) override {
|
||||
return alloc(sls_tactic, m, m_params);
|
||||
}
|
||||
|
||||
virtual ~sls_tactic() {
|
||||
~sls_tactic() override {
|
||||
dealloc(m_engine);
|
||||
}
|
||||
|
||||
virtual void updt_params(params_ref const & p) {
|
||||
void updt_params(params_ref const & p) override {
|
||||
m_params = p;
|
||||
m_engine->updt_params(p);
|
||||
}
|
||||
|
||||
virtual void collect_param_descrs(param_descrs & r) {
|
||||
void collect_param_descrs(param_descrs & r) override {
|
||||
sls_params::collect_param_descrs(r);
|
||||
}
|
||||
|
||||
virtual void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result) {
|
||||
void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result) override {
|
||||
SASSERT(g->is_well_sorted());
|
||||
result.reset();
|
||||
|
||||
|
@ -76,17 +76,17 @@ public:
|
|||
SASSERT(g->is_well_sorted());
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
void cleanup() override {
|
||||
sls_engine * d = alloc(sls_engine, m, m_params);
|
||||
std::swap(d, m_engine);
|
||||
dealloc(d);
|
||||
}
|
||||
|
||||
virtual void collect_statistics(statistics & st) const {
|
||||
void collect_statistics(statistics & st) const override {
|
||||
m_engine->collect_statistics(st);
|
||||
}
|
||||
|
||||
virtual void reset_statistics() {
|
||||
void reset_statistics() override {
|
||||
m_engine->reset_statistics();
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class sls_tracker {
|
|||
mpz m_zero, m_one, m_two;
|
||||
|
||||
struct value_score {
|
||||
value_score() : m(0), value(unsynch_mpz_manager::mk_z(0)), score(0.0), score_prune(0.0), has_pos_occ(0), has_neg_occ(0), distance(0), touched(1) {};
|
||||
value_score() : m(nullptr), value(unsynch_mpz_manager::mk_z(0)), score(0.0), score_prune(0.0), has_pos_occ(0), has_neg_occ(0), distance(0), touched(1) {};
|
||||
value_score(value_score && other) :
|
||||
m(other.m),
|
||||
value(std::move(other.value)),
|
||||
|
@ -1038,7 +1038,7 @@ public:
|
|||
if (m_mpz_manager.neq(get_value(as[0]), m_one))
|
||||
return as[0];
|
||||
else
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
m_temp_constants.reset();
|
||||
|
||||
|
@ -1061,7 +1061,7 @@ public:
|
|||
}
|
||||
}
|
||||
if (pos == static_cast<unsigned>(-1))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
m_touched++;
|
||||
m_scores.find(as[pos]).touched++;
|
||||
|
@ -1082,7 +1082,7 @@ public:
|
|||
for (unsigned i = 0; i < sz; i++)
|
||||
if (m_mpz_manager.neq(get_value(as[i]), m_one) && (get_random_uint(16) % ++cnt_unsat == 0)) pos = i;
|
||||
if (pos == static_cast<unsigned>(-1))
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
m_last_pos = pos;
|
||||
|
@ -1092,7 +1092,7 @@ public:
|
|||
expr * get_new_unsat_assertion(ptr_vector<expr> const & as) {
|
||||
unsigned sz = as.size();
|
||||
if (sz == 1)
|
||||
return 0;
|
||||
return nullptr;
|
||||
m_temp_constants.reset();
|
||||
|
||||
unsigned cnt_unsat = 0, pos = -1;
|
||||
|
@ -1100,7 +1100,7 @@ public:
|
|||
if ((i != m_last_pos) && m_mpz_manager.neq(get_value(as[i]), m_one) && (get_random_uint(16) % ++cnt_unsat == 0)) pos = i;
|
||||
|
||||
if (pos == static_cast<unsigned>(-1))
|
||||
return 0;
|
||||
return nullptr;
|
||||
return as[pos];
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue