3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-25 12:35:59 +00:00

some more copilot aided updated

This commit is contained in:
Nikolaj Bjorner 2025-03-16 21:14:29 -07:00
parent 2ecf6dc53c
commit 03f18c148e
5 changed files with 39 additions and 52 deletions

View file

@ -127,26 +127,21 @@ class blast_term_ite_tactic : public tactic {
void operator()(goal_ref const & g, goal_ref_buffer & result) {
tactic_report report("blast-term-ite", *g);
bool produce_proofs = g->proofs_enabled();
expr_ref new_curr(m);
proof_ref new_pr(m);
unsigned size = g->size();
unsigned num_fresh = 0;
for (unsigned idx = 0; idx < size; idx++) {
expr * curr = g->form(idx);
unsigned idx = 0;
for (auto [curr, dep, pr] : *g) {
if (m_rw.m_cfg.m_max_inflation < UINT_MAX) {
m_rw.m_cfg.m_init_term_size = get_num_exprs(curr);
num_fresh += m_rw.m_cfg.m_num_fresh;
m_rw.m_cfg.m_num_fresh = 0;
}
m_rw(curr, new_curr, new_pr);
if (produce_proofs) {
proof * pr = g->pr(idx);
new_pr = m.mk_modus_ponens(pr, new_pr);
}
g->update(idx, new_curr, new_pr, g->dep(idx));
new_pr = m.mk_modus_ponens(pr, new_pr);
g->update(idx++, new_curr, new_pr, dep);
}
report_tactic_progress(":blast-term-ite-consts", m_rw.m_cfg.m_num_fresh + num_fresh);
g->inc_depth();
result.push_back(g.get());

View file

@ -425,14 +425,13 @@ class reduce_args_tactic : public tactic {
reduce_args_ctx ctx(m);
reduce_args_rw rw(*this, decl2args, ctx.m_decl2arg2funcs);
unsigned sz = g.size();
for (unsigned i = 0; i < sz; i++) {
unsigned idx = 0;
for (auto [f, dep, pr] : g) {
if (g.inconsistent())
break;
expr * f = g.form(i);
expr_ref new_f(m);
rw(f, new_f);
g.update(i, new_f);
g.update(idx++, new_f);
}
report_tactic_progress(":reduced-funcs", decl2args.size());

View file

@ -852,10 +852,10 @@ class tseitin_cnf_tactic : public tactic {
else
m_mc = nullptr;
unsigned size = g->size();
for (unsigned idx = 0; idx < size; idx++) {
process(g->form(idx), g->dep(idx));
g->update(idx, m.mk_true(), nullptr, nullptr); // to save memory
unsigned idx = 0;
for (auto [f, dep, pr] : *g) {
process(f, dep);
g->update(idx++, m.mk_true(), nullptr, nullptr);
}
SASSERT(!m_produce_unsat_cores || m_clauses.size() == m_deps.size());