3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-12 10:14:42 +00:00

Merge branch 'theory-assumptions' into develop

Conflicts:
	src/smt/smt_context.cpp
	src/smt/smt_context.h
	src/smt/smt_theory.h
This commit is contained in:
Murphy Berzish 2017-04-22 13:31:43 -04:00
commit 06cd07e3c2
53 changed files with 1712 additions and 929 deletions

View file

@ -3242,8 +3242,7 @@ namespace smt {
});
validate_unsat_core();
// theory validation of unsat core
ptr_vector<theory>::iterator th_it = m_theory_set.begin();
ptr_vector<theory>::iterator th_it = m_theory_set.begin();
ptr_vector<theory>::iterator th_end = m_theory_set.end();
for (; th_it != th_end; ++th_it) {
lbool theory_result = (*th_it)->validate_unsat_core(m_unsat_core);
@ -3251,7 +3250,6 @@ namespace smt {
return l_undef;
}
}
return l_false;
}
@ -3297,15 +3295,10 @@ namespace smt {
setup_context(m_fparams.m_auto_config);
expr_ref_vector theory_assumptions(m_manager);
ptr_vector<theory>::iterator it = m_theory_set.begin();
ptr_vector<theory>::iterator end = m_theory_set.end();
for (; it != end; ++it) {
(*it)->add_theory_assumptions(theory_assumptions);
}
get_theory_assumptions(theory_assumptions);
if (!theory_assumptions.empty()) {
TRACE("search", tout << "Adding theory assumptions to context" << std::endl;);
// this works even though we already did part of setup
return check(theory_assumptions.size(), theory_assumptions.c_ptr(), reset_cancel);
return check(theory_assumptions.size(), theory_assumptions.c_ptr(), reset_cancel, true);
}
internalize_assertions();
@ -3369,7 +3362,15 @@ namespace smt {
(*it)->setup();
}
lbool context::check(unsigned ext_num_assumptions, expr * const * ext_assumptions, bool reset_cancel) {
void context::get_theory_assumptions(expr_ref_vector & theory_assumptions) {
ptr_vector<theory>::iterator it = m_theory_set.begin();
ptr_vector<theory>::iterator end = m_theory_set.end();
for (; it != end; ++it) {
(*it)->add_theory_assumptions(theory_assumptions);
}
}
lbool context::check(unsigned ext_num_assumptions, expr * const * ext_assumptions, bool reset_cancel, bool already_did_theory_assumptions) {
m_stats.m_num_checks++;
TRACE("check_bug", tout << "STARTING check(num_assumptions, assumptions)\n";
tout << "inconsistent: " << inconsistent() << ", m_unsat_core.empty(): " << m_unsat_core.empty() << "\n";
@ -3381,20 +3382,20 @@ namespace smt {
if (!check_preamble(reset_cancel))
return l_undef;
expr_ref_vector theory_assumptions(m_manager);
expr_ref_vector all_assumptions(m_manager);
for (unsigned i = 0; i < ext_num_assumptions; ++i) {
theory_assumptions.push_back(ext_assumptions[i]);
all_assumptions.push_back(ext_assumptions[i]);
}
ptr_vector<theory>::iterator it = m_theory_set.begin();
ptr_vector<theory>::iterator end = m_theory_set.end();
for (; it != end; ++it) {
(*it)->add_theory_assumptions(theory_assumptions);
if (!already_did_theory_assumptions) {
ptr_vector<theory>::iterator it = m_theory_set.begin();
ptr_vector<theory>::iterator end = m_theory_set.end();
for (; it != end; ++it) {
(*it)->add_theory_assumptions(all_assumptions);
}
}
if (!theory_assumptions.empty()) {
TRACE("search", tout << "Adding theory assumptions to context" << std::endl;);
}
unsigned num_assumptions = theory_assumptions.size();
expr * const * assumptions = theory_assumptions.c_ptr();
unsigned num_assumptions = all_assumptions.size();
expr * const * assumptions = all_assumptions.c_ptr();
if (!validate_assumptions(num_assumptions, assumptions))
return l_undef;