mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
n/a
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
c0556b2f64
commit
2d4a5e0a5e
4 changed files with 17 additions and 28 deletions
|
@ -884,7 +884,6 @@ namespace smt {
|
|||
TRACE("recfun", tout << "registering theory recfun...\n";);
|
||||
theory_recfun * th = alloc(theory_recfun, m_manager);
|
||||
m_context.register_plugin(th);
|
||||
th->setup_params();
|
||||
}
|
||||
|
||||
void setup::setup_dl() {
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace smt {
|
|||
|
||||
char const * theory_recfun::get_name() const { return "recfun"; }
|
||||
|
||||
void theory_recfun::setup_params() {
|
||||
void theory_recfun::init_search_eh() {
|
||||
// obtain max depth via parameters
|
||||
smt_params_helper p(ctx().get_params());
|
||||
set_max_depth(p.recfun_max_depth());
|
||||
|
@ -330,28 +330,15 @@ namespace smt {
|
|||
}
|
||||
|
||||
final_check_status theory_recfun::final_check_eh() {
|
||||
if (m_guards.size() > get_max_depth()) {
|
||||
#if 1
|
||||
return FC_GIVEUP;
|
||||
#else
|
||||
for (unsigned i = get_max_depth(); i < m_guards.size(); ++i) {
|
||||
app* a = m_guards.get(i);
|
||||
body_expansion b_e(u(), a);
|
||||
push_body_expand(std::move(b_e));
|
||||
}
|
||||
unsigned new_depth = m_guards.size() + 1;
|
||||
IF_VERBOSE(2, verbose_stream() << "(smt.recfun :new-depth " << new_depth << ")\n");
|
||||
set_max_depth(new_depth);
|
||||
return FC_CONTINUE;
|
||||
#endif
|
||||
}
|
||||
return FC_DONE;
|
||||
}
|
||||
|
||||
void theory_recfun::add_theory_assumptions(expr_ref_vector & assumptions) {
|
||||
app_ref dlimit = m_util.mk_depth_limit_pred(get_max_depth());
|
||||
TRACEFN("add_theory_assumption " << mk_pp(dlimit.get(), m));
|
||||
assumptions.push_back(dlimit);
|
||||
if (u().has_def()) {
|
||||
app_ref dlimit = m_util.mk_depth_limit_pred(get_max_depth());
|
||||
TRACEFN("add_theory_assumption " << mk_pp(dlimit.get(), m));
|
||||
assumptions.push_back(dlimit);
|
||||
}
|
||||
}
|
||||
|
||||
// if `dlimit` occurs in unsat core, return 'true'
|
||||
|
|
|
@ -138,16 +138,16 @@ namespace smt {
|
|||
void new_diseq_eh(theory_var v1, theory_var v2) override {}
|
||||
void add_theory_assumptions(expr_ref_vector & assumptions) override;
|
||||
|
||||
void set_max_depth(unsigned n) { SASSERT(n>0); m_max_depth = n; }
|
||||
unsigned get_max_depth() const { return m_max_depth; }
|
||||
|
||||
public:
|
||||
theory_recfun(ast_manager & m);
|
||||
virtual ~theory_recfun() override;
|
||||
void setup_params(); // read parameters
|
||||
virtual theory * mk_fresh(context * new_ctx) override;
|
||||
virtual void display(std::ostream & out) const override;
|
||||
virtual void collect_statistics(::statistics & st) const override;
|
||||
unsigned get_max_depth() const { return m_max_depth; }
|
||||
void set_max_depth(unsigned n) { SASSERT(n>0); m_max_depth = n; }
|
||||
void inc_max_depth() { ++m_max_depth; }
|
||||
~theory_recfun() override;
|
||||
void init_search_eh() override;
|
||||
theory * mk_fresh(context * new_ctx) override;
|
||||
void display(std::ostream & out) const override;
|
||||
void collect_statistics(::statistics & st) const override;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue