3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-29 20:08:52 +00:00

move from justified_expr to dependent_expr by aligning datatypes

This commit is contained in:
Nikolaj Bjorner 2025-01-22 10:58:51 -08:00
parent fc9ff946b7
commit decaee83f3
9 changed files with 52 additions and 51 deletions

View file

@ -83,7 +83,7 @@ class asserted_formulas {
class reduce_asserted_formulas_fn : public simplify_fmls {
public:
reduce_asserted_formulas_fn(asserted_formulas& af): simplify_fmls(af, "reduce-asserted") {}
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { af.m_rewriter(j.get_fml(), n, p); }
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { af.m_rewriter(j.fml(), n, p); }
};
class find_macros_fn : public simplify_fmls {
@ -122,7 +122,7 @@ class asserted_formulas {
distribute_forall m_functor;
public:
distribute_forall_fn(asserted_formulas& af): simplify_fmls(af, "distribute-forall"), m_functor(af.m) {}
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { m_functor(j.get_fml(), n); }
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { m_functor(j.fml(), n); }
bool should_apply() const override { return af.m_smt_params.m_distribute_forall && af.has_quantifiers(); }
void post_op() override { af.reduce_and_solve(); TRACE("asserted_formulas", af.display(tout);); }
};
@ -131,7 +131,7 @@ class asserted_formulas {
pattern_inference_rw m_infer;
public:
pattern_inference_fn(asserted_formulas& af): simplify_fmls(af, "pattern-inference"), m_infer(af.m, af.m_smt_params) {}
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { m_infer(j.get_fml(), n, p); }
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { m_infer(j.fml(), n, p); }
bool should_apply() const override { return af.m_smt_params.m_ematching && af.has_quantifiers(); }
};
@ -145,7 +145,7 @@ class asserted_formulas {
class max_bv_sharing_fn : public simplify_fmls {
public:
max_bv_sharing_fn(asserted_formulas& af): simplify_fmls(af, "maximizing-bv-sharing") {}
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { af.m_bv_sharing(j.get_fml(), n, p); }
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { af.m_bv_sharing(j.fml(), n, p); }
bool should_apply() const override { return af.m_smt_params.m_max_bv_sharing; }
void post_op() override { af.m_reduce_asserted_formulas(); }
};
@ -164,7 +164,7 @@ class asserted_formulas {
elim_term_ite_rw m_elim;
public:
elim_term_ite_fn(asserted_formulas& af): simplify_fmls(af, "elim-term-ite"), m_elim(af.m, af.m_defined_names) {}
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { m_elim(j.get_fml(), n, p); }
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { m_elim(j.fml(), n, p); }
bool should_apply() const override { return af.m_smt_params.m_eliminate_term_ite && af.m_smt_params.m_lift_ite != lift_ite_kind::LI_FULL; }
void post_op() override { af.m_formulas.append(m_elim.new_defs()); af.reduce_and_solve(); m_elim.reset(); }
void push() { m_elim.push(); }
@ -186,7 +186,7 @@ class asserted_formulas {
FUNCTOR m_functor; \
NAME(asserted_formulas& af):simplify_fmls(af, MSG), m_functor ARG {} \
virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { \
m_functor(j.get_fml(), n, p); \
m_functor(j.fml(), n, p); \
} \
virtual void post_op() { if (REDUCE) af.reduce_and_solve(); } \
virtual bool should_apply() const { return APP; } \
@ -270,8 +270,8 @@ public:
unsigned get_qhead() const { return m_qhead; }
void commit();
void commit(unsigned new_qhead);
expr * get_formula(unsigned idx) const { return m_formulas[idx].get_fml(); }
proof * get_formula_proof(unsigned idx) const { return m_formulas[idx].get_proof(); }
expr * get_formula(unsigned idx) const { return m_formulas[idx].fml(); }
proof * get_formula_proof(unsigned idx) const { return m_formulas[idx].pr(); }
params_ref const& get_params() const { return m_params; }
void get_assertions(ptr_vector<expr> & result) const;