mirror of
https://github.com/Z3Prover/z3
synced 2025-05-01 04:45:52 +00:00
fix #5016
This commit is contained in:
parent
04a1d4245c
commit
083d09aa81
14 changed files with 366 additions and 294 deletions
|
@ -49,44 +49,16 @@ namespace recfun {
|
|||
unsigned_vector m_preds_lim;
|
||||
unsigned m_num_rounds { 0 };
|
||||
|
||||
struct propagation_item {
|
||||
case_expansion* m_case { nullptr };
|
||||
body_expansion* m_body { nullptr };
|
||||
sat::literal_vector m_clause;
|
||||
expr* m_guard { nullptr };
|
||||
|
||||
~propagation_item() {
|
||||
dealloc(m_case);
|
||||
dealloc(m_body);
|
||||
}
|
||||
|
||||
propagation_item(expr* guard):
|
||||
m_guard(guard)
|
||||
{}
|
||||
|
||||
propagation_item(sat::literal_vector const& clause):
|
||||
m_clause(clause)
|
||||
{}
|
||||
|
||||
propagation_item(body_expansion* b):
|
||||
m_body(b)
|
||||
{}
|
||||
propagation_item(case_expansion* c):
|
||||
m_case(c)
|
||||
{}
|
||||
|
||||
bool is_guard() const { return m_guard != nullptr; }
|
||||
bool is_clause() const { return !m_clause.empty(); }
|
||||
bool is_case() const { return m_case != nullptr; }
|
||||
bool is_body() const { return m_body != nullptr; }
|
||||
};
|
||||
scoped_ptr_vector<propagation_item> m_propagation_queue;
|
||||
unsigned m_qhead { 0 };
|
||||
|
||||
void push_body_expand(expr* e);
|
||||
void push_case_expand(expr* e);
|
||||
void push_body_expand(expr* e) { push(alloc(propagation_item, alloc(body_expansion, u(), to_app(e)))); }
|
||||
void push_case_expand(expr* e) { push(alloc(propagation_item, alloc(case_expansion, u(), to_app(e)))); }
|
||||
void push_guard(expr* e) { push(alloc(propagation_item, e)); }
|
||||
void push_core(expr_ref_vector const& core) { push(alloc(propagation_item, core)); }
|
||||
void push(propagation_item* p);
|
||||
|
||||
bool is_enabled_guard(expr* guard) { expr_ref ng(m.mk_not(guard), m); return m_enabled_guards.contains(ng); }
|
||||
bool is_enabled_guard(expr* guard) { return m_enabled_guards.contains(guard); }
|
||||
bool is_disabled_guard(expr* guard) { return m_disabled_guards.contains(guard); }
|
||||
|
||||
recfun::util & u() const { return m_util; }
|
||||
|
@ -96,20 +68,15 @@ namespace recfun {
|
|||
bool is_defined(euf::enode * e) const { return is_defined(e->get_expr()); }
|
||||
bool is_case_pred(euf::enode * e) const { return is_case_pred(e->get_expr()); }
|
||||
|
||||
void activate_guard(expr* guard, expr_ref_vector const& guards);
|
||||
|
||||
expr_ref apply_args(vars const & vars, expr_ref_vector const & args, expr * e); //!< substitute variables by args
|
||||
expr_ref apply_args(vars const & vars, expr_ref_vector const & args, expr * e);
|
||||
void assert_macro_axiom(case_expansion & e);
|
||||
void assert_case_axioms(case_expansion & e);
|
||||
void assert_body_axiom(body_expansion & e);
|
||||
|
||||
void add_induction_lemmas(unsigned depth);
|
||||
void assert_guard(expr* guard, expr_ref_vector const& guards);
|
||||
void block_core(expr_ref_vector const& core);
|
||||
void disable_guard(expr* guard, expr_ref_vector const& guards);
|
||||
unsigned get_depth(expr* e);
|
||||
void set_depth(unsigned d, expr* e);
|
||||
void set_depth_rec(unsigned d, expr* e);
|
||||
|
||||
sat::literal mk_eq_lit(expr* l, expr* r);
|
||||
bool is_standard_order(recfun::vars const& vars) const {
|
||||
return vars.empty() || vars[vars.size()-1]->get_idx() == 0;
|
||||
}
|
||||
|
@ -130,15 +97,16 @@ namespace recfun {
|
|||
sat::check_result check() override;
|
||||
std::ostream& display(std::ostream& out) const override;
|
||||
std::ostream& display_justification(std::ostream& out, sat::ext_justification_idx idx) const override { return display_constraint(out, idx); }
|
||||
std::ostream& display_constraint(std::ostream& out, sat::ext_constraint_idx idx) const override;
|
||||
std::ostream& display_constraint(std::ostream& out, sat::ext_constraint_idx idx) const override { return out; }
|
||||
void collect_statistics(statistics& st) const override;
|
||||
euf::th_solver* clone(euf::solver& ctx) override;
|
||||
bool unit_propagate() override;
|
||||
sat::literal internalize(expr* e, bool sign, bool root, bool learned) override;
|
||||
void internalize(expr* e, bool redundant) override;
|
||||
euf::theory_var mk_var(euf::enode* n) override;
|
||||
void init_search() override;
|
||||
void finalize_model(model& mdl) override;
|
||||
bool is_shared(euf::theory_var v) const override { return true; }
|
||||
void init_search() override {}
|
||||
bool should_research(sat::literal_vector const& core) override;
|
||||
void add_assumptions() override;
|
||||
bool tracking_assumptions() override { return true; }
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue