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

#6364 - remove option of redundant clauses from internalization

gc-ing definitions leads to unsoundness when they are not replayed.
Instead of attempting to replay definitions theory internalization is irredundant by default.
This is also the old solver behavior where TH_LEMMA is essentially never used, but is valid for top-level theory lemmas.
This commit is contained in:
Nikolaj Bjorner 2022-10-24 00:38:31 -07:00
parent c8e1e180ea
commit 5c7eaec566
29 changed files with 133 additions and 147 deletions

View file

@ -30,9 +30,8 @@ namespace euf {
protected:
euf::enode_vector m_args;
svector<sat::eframe> m_stack;
bool m_is_redundant{ false };
bool visit_rec(ast_manager& m, expr* e, bool sign, bool root, bool redundant);
bool visit_rec(ast_manager& m, expr* e, bool sign, bool root);
virtual bool visit(expr* e) { return false; }
virtual bool visited(expr* e) { return false; }
@ -41,9 +40,9 @@ namespace euf {
public:
virtual ~th_internalizer() = default;
virtual sat::literal internalize(expr* e, bool sign, bool root, bool redundant) = 0;
virtual sat::literal internalize(expr* e, bool sign, bool root) = 0;
virtual void internalize(expr* e, bool redundant) = 0;
virtual void internalize(expr* e) = 0;
/**
@ -135,7 +134,7 @@ namespace euf {
virtual bool is_beta_redex(euf::enode* p, euf::enode* n) const { return false; }
sat::status status() const { return sat::status::th(m_is_redundant, get_id()); }
sat::status status() const { return sat::status::th(false, get_id()); }
};
@ -155,8 +154,6 @@ namespace euf {
sat::literal expr2literal(expr* e) const;
region& get_region();
sat::status mk_status(th_proof_hint const* ps = nullptr);
bool add_unit(sat::literal lit, th_proof_hint const* ps = nullptr);
bool add_units(sat::literal_vector const& lits);
bool add_clause(sat::literal lit, th_proof_hint const* ps = nullptr) { return add_unit(lit, ps); }
@ -164,9 +161,11 @@ namespace euf {
bool add_clause(sat::literal a, sat::literal b, sat::literal c, th_proof_hint const* ps = nullptr);
bool add_clause(sat::literal a, sat::literal b, sat::literal c, sat::literal d, th_proof_hint const* ps = nullptr);
bool add_clause(sat::literal_vector const& lits, th_proof_hint const* ps = nullptr) { return add_clause(lits.size(), lits.data(), ps); }
bool add_clause(unsigned n, sat::literal* lits, th_proof_hint const* ps = nullptr);
bool add_clause(unsigned n, sat::literal* lits, th_proof_hint const* ps, bool is_redundant = false);
void add_equiv(sat::literal a, sat::literal b);
void add_equiv_and(sat::literal a, sat::literal_vector const& bs);
bool add_redundant(sat::literal_vector const& lits, th_proof_hint const* ps) { return add_clause(lits.size(), lits.data(), ps, true); }
bool add_redundant(unsigned n, sat::literal* lits, th_proof_hint const* ps);
bool is_true(sat::literal lit);