3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 20:05:51 +00:00

tuning eval

This commit is contained in:
Nikolaj Bjorner 2021-09-28 09:55:49 -07:00
parent 2e176a0e02
commit 92c1b600c3
4 changed files with 52 additions and 18 deletions

View file

@ -25,7 +25,10 @@ namespace q {
struct eval::scoped_mark_reset {
eval& e;
scoped_mark_reset(eval& e): e(e) {}
~scoped_mark_reset() { e.m_mark.reset(); }
~scoped_mark_reset() {
e.m_mark.reset();
e.m_diseq_undef = euf::enode_pair();
}
};
eval::eval(euf::solver& ctx):
@ -97,12 +100,18 @@ namespace q {
if (sn && sn == tn)
return l_true;
if (sn && sn == m_diseq_undef.first && tn == m_diseq_undef.second)
return l_undef;
if (sn && tn && ctx.get_egraph().are_diseq(sn, tn)) {
evidence.push_back(euf::enode_pair(sn, tn));
return l_false;
}
if (sn && tn)
if (sn && tn) {
m_diseq_undef = euf::enode_pair(sn, tn);
return l_undef;
}
if (!sn && !tn)
return compare_rec(n, binding, s, t, evidence);
@ -115,7 +124,11 @@ namespace q {
std::swap(t, s);
}
unsigned sz = evidence.size();
for (euf::enode* t1 : euf::enode_class(tn)) {
unsigned count = 0;
for (euf::enode* t1 : euf::enode_class(tn)) {
if (!t1->is_cgr())
continue;
++count;
expr* t2 = t1->get_expr();
if ((c = compare_rec(n, binding, s, t2, evidence), c != l_undef)) {
evidence.push_back(euf::enode_pair(t1, tn));