mirror of
https://github.com/Z3Prover/z3
synced 2025-07-21 11:52:05 +00:00
setting partial equivalence priority lower so that it doesn't intefere with inlining (partial fix to the fact that inlining will remove such implicit relations). Using short-circuit negation in qe to avoid redundant double negations in intermediary results
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
d4f41c0420
commit
8c538fd3f0
3 changed files with 11 additions and 16 deletions
|
@ -30,7 +30,7 @@ namespace datalog {
|
||||||
ast_manager & m;
|
ast_manager & m;
|
||||||
context & m_context;
|
context & m_context;
|
||||||
public:
|
public:
|
||||||
mk_partial_equivalence_transformer(context & ctx, unsigned priority=45000)
|
mk_partial_equivalence_transformer(context & ctx, unsigned priority=30000)
|
||||||
: plugin(priority),
|
: plugin(priority),
|
||||||
m(ctx.get_manager()),
|
m(ctx.get_manager()),
|
||||||
m_context(ctx) {}
|
m_context(ctx) {}
|
||||||
|
|
|
@ -307,8 +307,8 @@ namespace datalog {
|
||||||
if (m_context.similarity_compressor()) {
|
if (m_context.similarity_compressor()) {
|
||||||
transf.register_plugin(alloc(mk_similarity_compressor, m_context));
|
transf.register_plugin(alloc(mk_similarity_compressor, m_context));
|
||||||
}
|
}
|
||||||
transf.register_plugin(alloc(mk_partial_equivalence_transformer, m_context));
|
|
||||||
transf.register_plugin(alloc(mk_rule_inliner, m_context));
|
transf.register_plugin(alloc(mk_rule_inliner, m_context));
|
||||||
|
transf.register_plugin(alloc(mk_partial_equivalence_transformer, m_context));
|
||||||
transf.register_plugin(alloc(mk_interp_tail_simplifier, m_context));
|
transf.register_plugin(alloc(mk_interp_tail_simplifier, m_context));
|
||||||
transf.register_plugin(alloc(mk_separate_negated_tails, m_context));
|
transf.register_plugin(alloc(mk_separate_negated_tails, m_context));
|
||||||
|
|
||||||
|
|
|
@ -596,7 +596,7 @@ namespace qe {
|
||||||
p = m_pols.back();
|
p = m_pols.back();
|
||||||
if (!m_is_relevant(e)) {
|
if (!m_is_relevant(e)) {
|
||||||
pop();
|
pop();
|
||||||
insert(e, p, p?e:m.mk_not(e));
|
insert(e, p, p?e:mk_not(m, e));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!is_app(e)) {
|
if (!is_app(e)) {
|
||||||
|
@ -634,7 +634,7 @@ namespace qe {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pop();
|
pop();
|
||||||
insert(e, p, p?e:m.mk_not(e));
|
insert(e, p, p?e:mk_not(m, e));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1208,7 +1208,7 @@ namespace qe {
|
||||||
}
|
}
|
||||||
bool_rewriter(m).mk_or(fmls.size(), fmls.c_ptr(), fml);
|
bool_rewriter(m).mk_or(fmls.size(), fmls.c_ptr(), fml);
|
||||||
|
|
||||||
fml = m.mk_not(m.mk_iff(q, fml));
|
fml = mk_not(m, m.mk_iff(q, fml));
|
||||||
ast_smt_pp pp(m);
|
ast_smt_pp pp(m);
|
||||||
out << "; eliminate " << mk_pp(m_var, m) << "\n";
|
out << "; eliminate " << mk_pp(m_var, m) << "\n";
|
||||||
out << "(push)\n";
|
out << "(push)\n";
|
||||||
|
@ -1303,12 +1303,7 @@ namespace qe {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRACE("qe_verbose", tout << "No plugin for " << mk_ismt2_pp(e, m) << "\n";);
|
TRACE("qe_verbose", tout << "No plugin for " << mk_ismt2_pp(e, m) << "\n";);
|
||||||
if (p || m.is_not(e, e)) {
|
result = p?e:mk_not(m, e);
|
||||||
result = e;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
result = m.mk_not(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void i_solver_context::mk_atom_fn::operator()(expr* e, bool p, expr_ref& result) {
|
void i_solver_context::mk_atom_fn::operator()(expr* e, bool p, expr_ref& result) {
|
||||||
|
@ -1591,7 +1586,7 @@ namespace qe {
|
||||||
}
|
}
|
||||||
m_literals.reset();
|
m_literals.reset();
|
||||||
while (node) {
|
while (node) {
|
||||||
m_literals.push_back(m.mk_not(node->assignment()));
|
m_literals.push_back(mk_not(m, node->assignment()));
|
||||||
node = node->parent();
|
node = node->parent();
|
||||||
}
|
}
|
||||||
add_literal(l1);
|
add_literal(l1);
|
||||||
|
@ -1865,7 +1860,7 @@ namespace qe {
|
||||||
//
|
//
|
||||||
app* mk_eq_value(app* b, rational const& vl) {
|
app* mk_eq_value(app* b, rational const& vl) {
|
||||||
if (m.is_bool(b)) {
|
if (m.is_bool(b)) {
|
||||||
if (vl.is_zero()) return m.mk_not(b);
|
if (vl.is_zero()) return to_app(mk_not(m, b));
|
||||||
if (vl.is_one()) return b;
|
if (vl.is_one()) return b;
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
@ -2604,12 +2599,12 @@ namespace qe {
|
||||||
TRACE("qe", tout << "variables extracted" << mk_pp(result, m) << "\n";);
|
TRACE("qe", tout << "variables extracted" << mk_pp(result, m) << "\n";);
|
||||||
|
|
||||||
if (old_q->is_forall()) {
|
if (old_q->is_forall()) {
|
||||||
result = m.mk_not(result);
|
result = mk_not(m, result);
|
||||||
}
|
}
|
||||||
m_ctx.solve(result, vars);
|
m_ctx.solve(result, vars);
|
||||||
if (old_q->is_forall()) {
|
if (old_q->is_forall()) {
|
||||||
expr* e = 0;
|
expr* e = 0;
|
||||||
result = m.is_not(result, e)?e:m.mk_not(result);
|
result = m.is_not(result, e)?e:mk_not(m, result);
|
||||||
}
|
}
|
||||||
var_shifter shift(m);
|
var_shifter shift(m);
|
||||||
shift(result, vars.size(), result);
|
shift(result, vars.size(), result);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue