mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +00:00
remove reference to deprecated code in cmd_context
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
5cdfa7cd1c
commit
96c05b0289
|
@ -560,14 +560,6 @@ void cmd_context::set_produce_proofs(bool f) {
|
||||||
m_params.m_proof = f;
|
m_params.m_proof = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmd_context::set_produce_interpolants(bool f) {
|
|
||||||
// can only be set before initialization
|
|
||||||
// FIXME currently synonym for produce_proofs
|
|
||||||
// also sets the default solver to be simple smt
|
|
||||||
SASSERT(!has_manager());
|
|
||||||
m_params.m_proof = f;
|
|
||||||
// set_solver_factory(mk_smt_solver_factory());
|
|
||||||
}
|
|
||||||
|
|
||||||
bool cmd_context::produce_models() const {
|
bool cmd_context::produce_models() const {
|
||||||
return m_params.m_model;
|
return m_params.m_model;
|
||||||
|
@ -577,11 +569,6 @@ bool cmd_context::produce_proofs() const {
|
||||||
return m_params.m_proof;
|
return m_params.m_proof;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmd_context::produce_interpolants() const {
|
|
||||||
// FIXME currently synonym for produce_proofs
|
|
||||||
return m_params.m_proof;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool cmd_context::produce_unsat_cores() const {
|
bool cmd_context::produce_unsat_cores() const {
|
||||||
return m_params.m_unsat_core;
|
return m_params.m_unsat_core;
|
||||||
}
|
}
|
||||||
|
@ -1895,25 +1882,14 @@ void cmd_context::validate_model() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: really interpolants_enabled ought to be a parameter to the solver factory,
|
|
||||||
// but this is a global change, so for now, we use an alternate solver factory
|
|
||||||
// for interpolation
|
|
||||||
|
|
||||||
void cmd_context::mk_solver() {
|
void cmd_context::mk_solver() {
|
||||||
bool proofs_enabled, models_enabled, unsat_core_enabled;
|
bool proofs_enabled, models_enabled, unsat_core_enabled;
|
||||||
params_ref p;
|
params_ref p;
|
||||||
m_params.get_solver_params(m(), p, proofs_enabled, models_enabled, unsat_core_enabled);
|
m_params.get_solver_params(m(), p, proofs_enabled, models_enabled, unsat_core_enabled);
|
||||||
if (produce_interpolants() && m_interpolating_solver_factory) {
|
m_solver = (*m_solver_factory)(m(), p, proofs_enabled, models_enabled, unsat_core_enabled, m_logic);
|
||||||
m_solver = (*m_interpolating_solver_factory)(m(), p, true /* must have proofs */, models_enabled, unsat_core_enabled, m_logic);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
m_solver = (*m_solver_factory)(m(), p, proofs_enabled, models_enabled, unsat_core_enabled, m_logic);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmd_context::set_interpolating_solver_factory(solver_factory * f) {
|
|
||||||
SASSERT(!has_manager());
|
|
||||||
m_interpolating_solver_factory = f;
|
|
||||||
}
|
|
||||||
|
|
||||||
void cmd_context::set_solver_factory(solver_factory * f) {
|
void cmd_context::set_solver_factory(solver_factory * f) {
|
||||||
m_solver_factory = f;
|
m_solver_factory = f;
|
||||||
|
|
|
@ -342,14 +342,12 @@ public:
|
||||||
void set_random_seed(unsigned s) { m_random_seed = s; }
|
void set_random_seed(unsigned s) { m_random_seed = s; }
|
||||||
bool produce_models() const;
|
bool produce_models() const;
|
||||||
bool produce_proofs() const;
|
bool produce_proofs() const;
|
||||||
bool produce_interpolants() const;
|
|
||||||
bool produce_unsat_cores() const;
|
bool produce_unsat_cores() const;
|
||||||
bool well_sorted_check_enabled() const;
|
bool well_sorted_check_enabled() const;
|
||||||
bool validate_model_enabled() const;
|
bool validate_model_enabled() const;
|
||||||
void set_produce_models(bool flag);
|
void set_produce_models(bool flag);
|
||||||
void set_produce_unsat_cores(bool flag);
|
void set_produce_unsat_cores(bool flag);
|
||||||
void set_produce_proofs(bool flag);
|
void set_produce_proofs(bool flag);
|
||||||
void set_produce_interpolants(bool flag);
|
|
||||||
void set_produce_unsat_assumptions(bool flag) { m_produce_unsat_assumptions = flag; }
|
void set_produce_unsat_assumptions(bool flag) { m_produce_unsat_assumptions = flag; }
|
||||||
bool produce_assignments() const { return m_produce_assignments; }
|
bool produce_assignments() const { return m_produce_assignments; }
|
||||||
bool produce_unsat_assumptions() const { return m_produce_unsat_assumptions; }
|
bool produce_unsat_assumptions() const { return m_produce_unsat_assumptions; }
|
||||||
|
@ -365,7 +363,6 @@ public:
|
||||||
sexpr_manager & sm() const { if (!m_sexpr_manager) const_cast<cmd_context*>(this)->m_sexpr_manager = alloc(sexpr_manager); return *m_sexpr_manager; }
|
sexpr_manager & sm() const { if (!m_sexpr_manager) const_cast<cmd_context*>(this)->m_sexpr_manager = alloc(sexpr_manager); return *m_sexpr_manager; }
|
||||||
|
|
||||||
void set_solver_factory(solver_factory * s);
|
void set_solver_factory(solver_factory * s);
|
||||||
void set_interpolating_solver_factory(solver_factory * s);
|
|
||||||
void set_check_sat_result(check_sat_result * r) { m_check_sat_result = r; }
|
void set_check_sat_result(check_sat_result * r) { m_check_sat_result = r; }
|
||||||
check_sat_result * get_check_sat_result() const { return m_check_sat_result.get(); }
|
check_sat_result * get_check_sat_result() const { return m_check_sat_result.get(); }
|
||||||
check_sat_state cs_state() const;
|
check_sat_state cs_state() const;
|
||||||
|
|
|
@ -391,10 +391,15 @@ private:
|
||||||
log_branches(status);
|
log_branches(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void report_sat(solver_state& s) {
|
void report_sat(solver_state& s, solver* conquer) {
|
||||||
close_branch(s, l_true);
|
close_branch(s, l_true);
|
||||||
model_ref mdl;
|
model_ref mdl;
|
||||||
s.get_solver().get_model(mdl);
|
if (conquer) {
|
||||||
|
conquer->get_model(mdl);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
s.get_solver().get_model(mdl);
|
||||||
|
}
|
||||||
if (mdl) {
|
if (mdl) {
|
||||||
std::lock_guard<std::mutex> lock(m_mutex);
|
std::lock_guard<std::mutex> lock(m_mutex);
|
||||||
if (&s.m() != &m_manager) {
|
if (&s.m() != &m_manager) {
|
||||||
|
@ -453,7 +458,7 @@ private:
|
||||||
if (canceled(s)) return;
|
if (canceled(s)) return;
|
||||||
switch (s.simplify()) {
|
switch (s.simplify()) {
|
||||||
case l_undef: break;
|
case l_undef: break;
|
||||||
case l_true: report_sat(s); return;
|
case l_true: report_sat(s, nullptr); return;
|
||||||
case l_false: report_unsat(s); return;
|
case l_false: report_unsat(s); return;
|
||||||
}
|
}
|
||||||
if (canceled(s)) return;
|
if (canceled(s)) return;
|
||||||
|
@ -498,7 +503,7 @@ private:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case l_true:
|
case l_true:
|
||||||
report_sat(s);
|
report_sat(s, conquer.get());
|
||||||
if (conquer) {
|
if (conquer) {
|
||||||
collect_statistics(*conquer.get());
|
collect_statistics(*conquer.get());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue