3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-02 05:15:52 +00:00

separate out, add copy constructor

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-08-26 09:23:15 -07:00
parent 2955b0c2ef
commit 0d5cfe9292
5 changed files with 56 additions and 35 deletions

View file

@ -2470,41 +2470,6 @@ public:
void operator()(AST * n) { m_manager.inc_ref(n); }
};
class justified_expr {
ast_manager& m;
expr* m_fml;
proof* m_proof;
public:
justified_expr(ast_manager& m, expr* fml, proof* p):
m(m),
m_fml(fml),
m_proof(p) {
m.inc_ref(fml);
m.inc_ref(p);
}
justified_expr& operator=(justified_expr& other) {
SASSERT(&m == &other.m);
if (this != &other) {
m.dec_ref(m_fml);
m.dec_ref(m_proof);
m_fml = other.get_fml();
m_proof = other.get_proof();
m.inc_ref(m_fml);
m.inc_ref(m_proof);
}
return *this;
}
~justified_expr() {
m.dec_ref(m_fml);
m.dec_ref(m_proof);
}
expr* get_fml() const { return m_fml; }
proof* get_proof() const { return m_proof; }
};
#endif /* AST_H_ */