3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-10-09 17:31:57 +00:00

unsat core validation for smt theories

This commit is contained in:
Murphy Berzish 2017-04-21 17:51:14 -04:00
parent bef64961ae
commit 5cfe5e15ac
5 changed files with 68 additions and 65 deletions

View file

@ -7302,6 +7302,28 @@ void theory_str::add_theory_assumptions(expr_ref_vector & assumptions) {
assumptions.push_back(get_manager().mk_not(m_theoryStrOverlapAssumption_term));
}
lbool theory_str::validate_unsat_core(expr_ref_vector & unsat_core) {
bool assumptionFound = false;
app * target_term = to_app(get_manager().mk_not(m_theoryStrOverlapAssumption_term));
internalize_term(target_term);
for (unsigned i = 0; i < unsat_core.size(); ++i) {
app * core_term = to_app(unsat_core.get(i));
// not sure if this is the correct way to compare terms in this context
enode * e1;
enode * e2;
e1 = get_context().get_enode(target_term);
e2 = get_context().get_enode(core_term);
if (e1 == e2) {
TRACE("t_str", tout << "overlap detected in unsat core, changing UNSAT to UNKNOWN" << std::endl;);
assumptionFound = true;
return l_undef;
}
}
return l_false;
}
void theory_str::init_search_eh() {
ast_manager & m = get_manager();
context & ctx = get_context();