3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-15 11:35:42 +00:00

update pattern inference to allow patterns with variables outside of scope

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2026-07-08 19:48:10 -07:00
parent 30a4a84c79
commit aa6dddbdf0
3 changed files with 4 additions and 7 deletions

View file

@ -173,13 +173,9 @@ inline void pattern_inference_cfg::collect::save(expr * n, unsigned delta, info
void pattern_inference_cfg::collect::save_candidate(expr * n, unsigned delta) {
switch (n->get_kind()) {
case AST_VAR: {
unsigned idx = to_var(n)->get_idx();
if (idx >= m_num_bindings + delta) {
save(n, delta, nullptr);
return;
}
uint_set free_vars;
if (delta <= idx)
unsigned idx = to_var(n)->get_idx();
if (delta <= idx && idx < m_num_bindings + delta)
free_vars.insert(idx - delta);
info * i = alloc(info, m, n, free_vars, 1);
save(n, delta, i);

View file

@ -917,7 +917,6 @@ namespace smt {
void propagate() override {
if (!m_active)
return;
IF_VERBOSE(10, verbose_stream() << "ho_matching: propagate(), mam.has_work=" << m_mam->has_work() << "\n");
m_mam->match();
if (!m_context->relevancy() && use_ematching()) {
ptr_vector<enode>::const_iterator it = m_context->begin_enodes();

View file

@ -339,6 +339,8 @@ namespace smt {
}
void theory_array_base::assert_congruent(enode * a1, enode * a2) {
if (ctx.get_fparams().m_array_fake_support)
return;
TRACE(array, tout << "congruent: #" << a1->get_owner_id() << " #" << a2->get_owner_id() << "\n";);
SASSERT(is_array_sort(a1));
SASSERT(is_array_sort(a2));