mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
User Propagator: Return if propagated lemma is redundant (#6791)
* Give users ability to see if propagation failed * Skip propagations in the new core if they are already satisfied
This commit is contained in:
parent
f5c069f899
commit
4cb158a79b
10 changed files with 48 additions and 31 deletions
|
@ -83,7 +83,7 @@ void theory_user_propagator::add_expr(expr* term, bool ensure_enode) {
|
|||
|
||||
}
|
||||
|
||||
void theory_user_propagator::propagate_cb(
|
||||
bool theory_user_propagator::propagate_cb(
|
||||
unsigned num_fixed, expr* const* fixed_ids,
|
||||
unsigned num_eqs, expr* const* eq_lhs, expr* const* eq_rhs,
|
||||
expr* conseq) {
|
||||
|
@ -95,9 +95,10 @@ void theory_user_propagator::propagate_cb(
|
|||
if (!ctx.get_manager().is_true(_conseq) && !ctx.get_manager().is_false(_conseq))
|
||||
ctx.mark_as_relevant((expr*)_conseq);
|
||||
|
||||
if (ctx.lit_internalized(_conseq) && ctx.get_assignment(ctx.get_literal(_conseq)) == l_true)
|
||||
return;
|
||||
m_prop.push_back(prop_info(num_fixed, fixed_ids, num_eqs, eq_lhs, eq_rhs, _conseq));
|
||||
if (ctx.lit_internalized(_conseq) && ctx.get_assignment(ctx.get_literal(_conseq)) == l_true)
|
||||
return false;
|
||||
m_prop.push_back(prop_info(num_fixed, fixed_ids, num_eqs, eq_lhs, eq_rhs, _conseq));
|
||||
return true;
|
||||
}
|
||||
|
||||
void theory_user_propagator::register_cb(expr* e) {
|
||||
|
@ -386,7 +387,7 @@ bool theory_user_propagator::internalize_atom(app* atom, bool gate_ctx) {
|
|||
return internalize_term(atom);
|
||||
}
|
||||
|
||||
bool theory_user_propagator::internalize_term(app* term) {
|
||||
bool theory_user_propagator::internalize_term(app* term) {
|
||||
for (auto arg : *term)
|
||||
ensure_enode(arg);
|
||||
if (term->get_family_id() == get_id() && !ctx.e_internalized(term))
|
||||
|
|
|
@ -130,7 +130,7 @@ namespace smt {
|
|||
|
||||
bool has_fixed() const { return (bool)m_fixed_eh; }
|
||||
|
||||
void propagate_cb(unsigned num_fixed, expr* const* fixed_ids, unsigned num_eqs, expr* const* lhs, expr* const* rhs, expr* conseq) override;
|
||||
bool propagate_cb(unsigned num_fixed, expr* const* fixed_ids, unsigned num_eqs, expr* const* lhs, expr* const* rhs, expr* conseq) override;
|
||||
void register_cb(expr* e) override;
|
||||
bool next_split_cb(expr* e, unsigned idx, lbool phase) override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue