mirror of
https://github.com/Z3Prover/z3
synced 2026-07-23 23:42:33 +00:00
fix loop bug in ho_matching and add throttle configurations
This commit is contained in:
parent
d9d3be959c
commit
b2f0d0682a
7 changed files with 35 additions and 1 deletions
|
|
@ -1411,10 +1411,14 @@ namespace smt {
|
|||
}
|
||||
|
||||
void populate_inst_sets(quantifier *q, auf_solver &s, context *ctx) override {
|
||||
bool use_term_enum = ctx->get_fparams().m_term_enumeration;
|
||||
if (!use_term_enum)
|
||||
return;
|
||||
node *S = s.get_uvar(q, m_var_i);
|
||||
sort *srt = S->get_sort();
|
||||
|
||||
IF_VERBOSE(3, verbose_stream() << "ho_var::populate_inst_sets: " << q->get_id() << " " << mk_pp(srt, m) << "\n";);
|
||||
|
||||
term_enumeration tn(m);
|
||||
// Add ground terms of type S.
|
||||
// Add productions for functions in E-graph
|
||||
|
|
@ -1423,6 +1427,7 @@ namespace smt {
|
|||
ast_mark visited;
|
||||
tn.add_production(m.mk_true());
|
||||
tn.add_production(m.mk_false());
|
||||
|
||||
for (enode *n : ctx->enodes()) {
|
||||
if (!ctx->is_relevant(n))
|
||||
continue;
|
||||
|
|
@ -1431,6 +1436,8 @@ namespace smt {
|
|||
TRACE(model_finder, tout << "inserting " << mk_pp(e, m) << " into inst set\n");
|
||||
S->insert(e, n->get_generation());
|
||||
}
|
||||
else if (!use_term_enum)
|
||||
continue;
|
||||
else if (is_app(e) && to_app(e)->get_decl()->is_skolem())
|
||||
;
|
||||
else if (is_uninterp_const(e)) {
|
||||
|
|
@ -1446,7 +1453,7 @@ namespace smt {
|
|||
tn.add_production(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unsigned max_count = 20;
|
||||
for (auto t : tn.enum_terms(srt)) {
|
||||
if (max_count == 0)
|
||||
|
|
|
|||
|
|
@ -657,6 +657,7 @@ namespace smt {
|
|||
|
||||
if (m_fparams->m_ho_matching) {
|
||||
m_ho_matcher = alloc(euf::ho_matcher, m, m_context->get_trail_stack());
|
||||
m_ho_matcher->set_max_iterations(m_fparams->m_ho_matching_bound);
|
||||
std::function<void(euf::ho_subst&)> on_match = [this](euf::ho_subst& s) {
|
||||
on_ho_match(s);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue