mirror of
https://github.com/Z3Prover/z3
synced 2025-04-10 19:27:06 +00:00
parent
a8c4384536
commit
c3b344ec47
|
@ -47,36 +47,27 @@ struct mbp_basic_tg::impl {
|
|||
//they contain variables/are c-ground
|
||||
bool apply() {
|
||||
if (!m_use_mdl) return false;
|
||||
expr *term, *c, *th, *el;
|
||||
expr *c, *th, *el;
|
||||
expr_ref nterm(m);
|
||||
bool progress = false;
|
||||
TRACE("mbp_tg", tout << "Iterating over terms of tg";);
|
||||
// Not resetting terms because get_terms calls resize on terms
|
||||
m_tg.get_terms(terms, false);
|
||||
for (unsigned i = 0; i < terms.size(); i++) {
|
||||
term = terms.get(i);
|
||||
// Unsupported operators
|
||||
SASSERT(!m.is_and(term));
|
||||
SASSERT(!m.is_or(term));
|
||||
SASSERT(!m.is_distinct(term));
|
||||
SASSERT(!m.is_implies(term));
|
||||
|
||||
if (is_seen(term)) continue;
|
||||
for (expr* term : terms) {
|
||||
if (is_seen(term))
|
||||
continue;
|
||||
if (m.is_ite(term, c, th, el)) {
|
||||
mark_seen(term);
|
||||
progress = true;
|
||||
if (m_mdl.is_true(c)) {
|
||||
m_tg.add_lit(c);
|
||||
m_tg.add_eq(term, th);
|
||||
} else {
|
||||
if (m.is_not(c))
|
||||
nterm = to_app(c)->get_arg(0);
|
||||
else
|
||||
nterm = m.mk_not(c);
|
||||
}
|
||||
else {
|
||||
nterm = mk_not(m, c);
|
||||
m_tg.add_lit(nterm);
|
||||
m_tg.add_eq(term, el);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return progress;
|
||||
|
|
Loading…
Reference in a new issue