3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

fix bug in new core not detecting conflict, fix #6525, add tactic doc

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2023-01-14 17:20:37 -05:00
parent feda706d0d
commit 4f7f4376b8
14 changed files with 175 additions and 26 deletions

View file

@ -1673,6 +1673,7 @@ bool ast_manager::are_distinct(expr* a, expr* b) const {
}
void ast_manager::add_lambda_def(func_decl* f, quantifier* q) {
TRACE("model", tout << "add lambda def " << mk_pp(q, *this) << "\n");
m_lambda_defs.insert(f, q);
f->get_info()->set_lambda(true);
inc_ref(q);

View file

@ -1631,6 +1631,7 @@ public:
void add_lambda_def(func_decl* f, quantifier* q);
quantifier* is_lambda_def(func_decl* f);
quantifier* is_lambda_def(app* e) { return is_lambda_def(e->get_decl()); }
obj_map<func_decl, quantifier*> const& lambda_defs() const { return m_lambda_defs; }
symbol const& lambda_def_qid() const { return m_lambda_def; }

View file

@ -83,6 +83,23 @@ void dependent_expr_state::freeze_recfun() {
m_num_recfun = sz;
}
/**
* Freeze all functions used in lambda defined declarations
*/
void dependent_expr_state::freeze_lambda() {
auto& m = m_frozen_trail.get_manager();
unsigned sz = m.lambda_defs().size();
if (m_num_lambdas >= sz)
return;
ast_mark visited;
for (auto const& [f, body] : m.lambda_defs())
freeze_terms(body, false, visited);
m_trail.push(value_trail(m_num_lambdas));
m_num_lambdas = sz;
}
/**
* The current qhead is to be updated to qtail.
* Before this update, freeze all functions appearing in formulas.
@ -100,8 +117,9 @@ void dependent_expr_state::freeze_suffix() {
if (m_suffix_frozen)
return;
m_suffix_frozen = true;
auto& m = m_frozen_trail.get_manager();
freeze_recfun();
freeze_lambda();
auto& m = m_frozen_trail.get_manager();
ast_mark visited;
ptr_vector<expr> es;
for (unsigned i = qhead(); i < qtail(); ++i) {

View file

@ -43,12 +43,13 @@ Author:
class dependent_expr_state {
unsigned m_qhead = 0;
bool m_suffix_frozen = false;
unsigned m_num_recfun = 0;
unsigned m_num_recfun = 0, m_num_lambdas = 0;
lbool m_has_quantifiers = l_undef;
ast_mark m_frozen;
func_decl_ref_vector m_frozen_trail;
void freeze_prefix();
void freeze_recfun();
void freeze_lambda();
void freeze_terms(expr* term, bool only_as_array, ast_mark& visited);
void freeze(expr* term);
void freeze(func_decl* f);

View file

@ -116,10 +116,10 @@ namespace euf {
for (auto const& eq : m_next[j]) {
auto const& [orig, v, t, d] = eq;
SASSERT(j == var2id(v));
bool is_safe = true;
if (m_fmls.frozen(v))
continue;
bool is_safe = true;
unsigned todo_sz = todo.size();
// determine if substitution is safe.
@ -223,6 +223,8 @@ namespace euf {
void solve_eqs::reduce() {
m_fmls.freeze_suffix();
for (extract_eq* ex : m_extract_plugins)
ex->pre_process(m_fmls);