mirror of
https://github.com/Z3Prover/z3
synced 2025-06-23 22:33:40 +00:00
remove qe-lite pass in quant_tatics
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
701f32471e
commit
5e737641b7
3 changed files with 47 additions and 6 deletions
|
@ -491,6 +491,10 @@ namespace eq {
|
||||||
m_new_args.push_back(args[i]);
|
m_new_args.push_back(args[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (m_new_args.size() == num_args) {
|
||||||
|
r = q;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
expr_ref t(m);
|
expr_ref t(m);
|
||||||
if (q->is_forall()) {
|
if (q->is_forall()) {
|
||||||
|
@ -771,7 +775,7 @@ namespace eq {
|
||||||
proof_ref curr_pr(m);
|
proof_ref curr_pr(m);
|
||||||
q = to_quantifier(r);
|
q = to_quantifier(r);
|
||||||
reduce_quantifier1(q, r, curr_pr);
|
reduce_quantifier1(q, r, curr_pr);
|
||||||
if (m.proofs_enabled()) {
|
if (m.proofs_enabled() && r != q) {
|
||||||
pr = m.mk_transitivity(pr, curr_pr);
|
pr = m.mk_transitivity(pr, curr_pr);
|
||||||
}
|
}
|
||||||
} while (q != r && is_quantifier(r));
|
} while (q != r && is_quantifier(r));
|
||||||
|
@ -2297,7 +2301,7 @@ public:
|
||||||
}
|
}
|
||||||
m_imp(indices, true, result);
|
m_imp(indices, true, result);
|
||||||
if (is_forall(q)) {
|
if (is_forall(q)) {
|
||||||
result = m.mk_not(result);
|
result = push_not(result);
|
||||||
}
|
}
|
||||||
result = m.update_quantifier(
|
result = m.update_quantifier(
|
||||||
q,
|
q,
|
||||||
|
@ -2476,6 +2480,41 @@ class qe_lite_tactic : public tactic {
|
||||||
cooperate("qe-lite");
|
cooperate("qe-lite");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void debug_diff(expr* a, expr* b) {
|
||||||
|
ptr_vector<expr> as, bs;
|
||||||
|
as.push_back(a);
|
||||||
|
bs.push_back(b);
|
||||||
|
expr* a1, *a2, *b1, *b2;
|
||||||
|
while (!as.empty()) {
|
||||||
|
a = as.back();
|
||||||
|
b = bs.back();
|
||||||
|
as.pop_back();
|
||||||
|
bs.pop_back();
|
||||||
|
if (a == b) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (is_forall(a) && is_forall(b)) {
|
||||||
|
as.push_back(to_quantifier(a)->get_expr());
|
||||||
|
bs.push_back(to_quantifier(b)->get_expr());
|
||||||
|
}
|
||||||
|
else if (m.is_and(a, a1, a2) && m.is_and(b, b1, b2)) {
|
||||||
|
as.push_back(a1);
|
||||||
|
as.push_back(a2);
|
||||||
|
bs.push_back(b1);
|
||||||
|
bs.push_back(b2);
|
||||||
|
}
|
||||||
|
else if (m.is_eq(a, a1, a2) && m.is_eq(b, b1, b2)) {
|
||||||
|
as.push_back(a1);
|
||||||
|
as.push_back(a2);
|
||||||
|
bs.push_back(b1);
|
||||||
|
bs.push_back(b2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
TRACE("qe", tout << mk_pp(a, m) << " != " << mk_pp(b, m) << "\n";);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void operator()(goal_ref const & g,
|
void operator()(goal_ref const & g,
|
||||||
goal_ref_buffer & result,
|
goal_ref_buffer & result,
|
||||||
model_converter_ref & mc,
|
model_converter_ref & mc,
|
||||||
|
@ -2507,8 +2546,12 @@ class qe_lite_tactic : public tactic {
|
||||||
new_pr = g->pr(i);
|
new_pr = g->pr(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (f != new_f) {
|
||||||
|
TRACE("qe", tout << mk_pp(f, m) << "\n" << new_f << "\n";);
|
||||||
|
debug_diff(f, new_f);
|
||||||
g->update(i, new_f, new_pr, g->dep(i));
|
g->update(i, new_f, new_pr, g->dep(i));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
g->inc_depth();
|
g->inc_depth();
|
||||||
result.push_back(g.get());
|
result.push_back(g.get());
|
||||||
TRACE("qe", g->display(tout););
|
TRACE("qe", g->display(tout););
|
||||||
|
|
|
@ -105,6 +105,7 @@ bool proto_model::eval(expr * e, expr_ref & result, bool model_completion) {
|
||||||
m_eval.set_model_completion(model_completion);
|
m_eval.set_model_completion(model_completion);
|
||||||
try {
|
try {
|
||||||
m_eval(e, result);
|
m_eval(e, result);
|
||||||
|
std::cout << result << "\n";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (model_evaluator_exception & ex) {
|
catch (model_evaluator_exception & ex) {
|
||||||
|
|
|
@ -22,8 +22,6 @@ Revision History:
|
||||||
#include"solve_eqs_tactic.h"
|
#include"solve_eqs_tactic.h"
|
||||||
#include"elim_uncnstr_tactic.h"
|
#include"elim_uncnstr_tactic.h"
|
||||||
#include"qe_tactic.h"
|
#include"qe_tactic.h"
|
||||||
#include"qe_sat_tactic.h"
|
|
||||||
#include"qe_lite.h"
|
|
||||||
#include"qsat.h"
|
#include"qsat.h"
|
||||||
#include"nlqsat.h"
|
#include"nlqsat.h"
|
||||||
#include"ctx_simplify_tactic.h"
|
#include"ctx_simplify_tactic.h"
|
||||||
|
@ -54,7 +52,6 @@ static tactic * mk_quant_preprocessor(ast_manager & m, bool disable_gaussian = f
|
||||||
using_params(mk_simplify_tactic(m), pull_ite_p),
|
using_params(mk_simplify_tactic(m), pull_ite_p),
|
||||||
solve_eqs,
|
solve_eqs,
|
||||||
mk_elim_uncnstr_tactic(m),
|
mk_elim_uncnstr_tactic(m),
|
||||||
mk_qe_lite_tactic(m),
|
|
||||||
mk_simplify_tactic(m));
|
mk_simplify_tactic(m));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue