3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-18 14:44:21 +00:00

add nff and auto-relevant

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-10-18 15:32:55 -07:00
parent bc2020a39b
commit d5e5dcfe45
5 changed files with 80 additions and 13 deletions

View file

@ -54,7 +54,11 @@ namespace q {
m_eval(ctx),
m_qstat_gen(m, ctx.get_region()),
m_inst_queue(*this, ctx),
m_infer_patterns(m, ctx.get_config())
m_infer_patterns(m, ctx.get_config()),
m_new_defs(m),
m_new_proofs(m),
m_dn(m),
m_nnf(m, m_dn)
{
std::function<void(euf::enode*, euf::enode*)> _on_merge =
[&](euf::enode* root, euf::enode* other) {
@ -105,6 +109,20 @@ namespace q {
m_eval.explain(l, justification::from_index(idx), r, probing);
}
quantifier_ref ematch::nnf_skolem(quantifier* q) {
expr_ref r(m);
proof_ref p(m);
m_new_defs.reset();
m_new_proofs.reset();
m_nnf(q, m_new_defs, m_new_proofs, r, p);
SASSERT(is_quantifier(r));
for (expr* d : m_new_defs)
m_qs.add_unit(m_qs.mk_literal(d));
CTRACE("q", r != q, tout << mk_pp(q, m) << " -->\n" << r << "\n" << m_new_defs << "\n";);
return quantifier_ref(to_quantifier(r), m);
}
std::ostream& ematch::display_constraint(std::ostream& out, sat::ext_constraint_idx idx) const {
auto& j = justification::from_index(idx);
auto& c = j.m_clause;
@ -218,8 +236,6 @@ namespace q {
}
};
binding* ematch::tmp_binding(clause& c, app* pat, euf::enode* const* b) {
if (c.num_decls() > m_tmp_binding_capacity) {
void* mem = memory::allocate(sizeof(binding) + c.num_decls() * sizeof(euf::enode*));
@ -430,7 +446,10 @@ namespace q {
cl->m_literal.neg();
expr_ref body(mk_not(m, q->get_expr()), m);
q = m.update_quantifier(q, forall_k, body);
}
}
q = nnf_skolem(q);
expr_ref_vector ors(m);
flatten_or(q->get_expr(), ors);
for (expr* arg : ors)