mirror of
https://github.com/Z3Prover/z3
synced 2025-11-22 05:36:41 +00:00
Handle conversion of quantified lemma to quantifier free
When a cube is updated, a lemma might loose all of its quantified variables. In this case, it is effectively quantifier free and might be a version of an already existing lemma. For that reason, we convert it to quantifier free lemma when this happens.
This commit is contained in:
parent
23a8e59493
commit
9cdb63ae4a
2 changed files with 23 additions and 8 deletions
|
|
@ -1300,6 +1300,18 @@ void lemma::update_cube (pob_ref const &p, expr_ref_vector &cube) {
|
|||
m_body.reset();
|
||||
m_cube.append(cube);
|
||||
if (m_cube.empty()) {m_cube.push_back(m.mk_true());}
|
||||
|
||||
// after the cube is updated, if there are no skolems,
|
||||
// convert the lemma to quantifier-free
|
||||
bool is_quant = false;
|
||||
for (unsigned i = 0, sz = cube.size(); !is_quant && i < sz; ++i) {
|
||||
is_quant = has_zk_const(cube.get(i));
|
||||
}
|
||||
|
||||
if (!is_quant) {
|
||||
m_zks.reset();
|
||||
m_bindings.reset();
|
||||
}
|
||||
}
|
||||
|
||||
bool lemma::has_binding(app_ref_vector const &binding) {
|
||||
|
|
@ -2272,7 +2284,7 @@ void context::init_lemma_generalizers(datalog::rule_set& rules)
|
|||
}
|
||||
|
||||
if (m_params.spacer_use_quant_generalizer()) {
|
||||
m_lemma_generalizers.push_back(alloc(lemma_bool_inductive_generalizer, *this, 0, false));
|
||||
m_lemma_generalizers.push_back(alloc(lemma_bool_inductive_generalizer, *this, 0, true));
|
||||
m_lemma_generalizers.push_back(alloc(lemma_quantifier_generalizer, *this));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue