3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-02 09:20:22 +00:00

cave in to supporting proofs (partially) in simplifiers, updated doc

This commit is contained in:
Nikolaj Bjorner 2022-12-06 17:02:04 -08:00
parent aaabbfb594
commit 80033e8744
36 changed files with 157 additions and 108 deletions

View file

@ -24,21 +24,26 @@ Author:
class dependent_expr {
ast_manager& m;
expr* m_fml;
proof* m_proof;
expr_dependency* m_dep;
public:
dependent_expr(ast_manager& m, expr* fml, expr_dependency* d):
dependent_expr(ast_manager& m, expr* fml, proof* p, expr_dependency* d):
m(m),
m_fml(fml),
m_proof(p),
m_dep(d) {
SASSERT(fml);
m.inc_ref(fml);
m.inc_ref(d);
m.inc_ref(p);
}
dependent_expr(ast_translation& tr, dependent_expr const& src) :
m(tr.to()) {
m_fml = tr(src.fml());
m.inc_ref(m_fml);
m_proof = tr(src.pr());
m.inc_ref(m_proof);
expr_dependency_translation dtr(tr);
m_dep = dtr(src.dep());
m.inc_ref(m_dep);
@ -49,10 +54,13 @@ public:
if (this != &other) {
m.inc_ref(other.m_fml);
m.inc_ref(other.m_dep);
m.inc_ref(other.m_proof);
m.dec_ref(m_fml);
m.dec_ref(m_dep);
m.dec_ref(m_proof);
m_fml = other.m_fml;
m_dep = other.m_dep;
m_proof = other.m_proof;
}
return *this;
}
@ -60,24 +68,30 @@ public:
dependent_expr(dependent_expr const& other):
m(other.m),
m_fml(other.m_fml),
m_proof(other.m_proof),
m_dep(other.m_dep) {
m.inc_ref(m_fml);
m.inc_ref(m_proof);
m.inc_ref(m_dep);
}
dependent_expr(dependent_expr && other) noexcept :
m(other.m),
m_fml(nullptr),
m_proof(nullptr),
m_dep(nullptr) {
std::swap(m_fml, other.m_fml);
std::swap(m_proof, other.m_proof);
std::swap(m_dep, other.m_dep);
}
~dependent_expr() {
m.dec_ref(m_fml);
m.dec_ref(m_dep);
m.dec_ref(m_proof);
m_fml = nullptr;
m_dep = nullptr;
m_proof = nullptr;
}
ast_manager& get_manager() const { return m; }
@ -85,9 +99,11 @@ public:
expr* fml() const { return m_fml; }
expr_dependency* dep() const { return m_dep; }
proof* pr() const { return m_proof; }
std::tuple<expr*, expr_dependency*> operator()() const {
return { m_fml, m_dep };
std::tuple<expr*, proof*, expr_dependency*> operator()() const {
return { m_fml, m_proof, m_dep };
}
std::ostream& display(std::ostream& out) const {
@ -99,6 +115,8 @@ public:
for (expr* arg : deps)
out << mk_pp(arg, m) << " ";
}
if (m_proof)
out << "\n:- " << mk_pp(m_proof, m);
return out;
}
};