3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-07 18:05:21 +00:00

revert my mess with the ast hashtable

will share results form the experiments later
This commit is contained in:
Nuno Lopes 2021-02-17 14:29:07 +00:00
parent 4f9117a921
commit bcad4d9435
4 changed files with 6 additions and 4 deletions

View file

@ -1323,7 +1323,7 @@ extern "C" {
SET_ERROR_CODE(Z3_INVALID_ARG, nullptr);
RETURN_Z3(nullptr);
}
// yo! SASSERT(mk_c(c)->m().contains(to_ast(a)));
SASSERT(mk_c(c)->m().contains(to_ast(a)));
ast_translation translator(mk_c(c)->m(), mk_c(target)->m());
ast * _result = translator(to_ast(a));
mk_c(target)->save_ast_trail(_result);

View file

@ -224,7 +224,7 @@ namespace api {
void context::save_ast_trail(ast * n) {
// cherry on top? SASSERT(m().contains(n));
SASSERT(m().contains(n));
if (m_user_ref_count) {
// Corner case bug: n may be in m_last_result, and this is the only reference to n.
// When, we execute reset() it is deleted

View file

@ -1667,6 +1667,8 @@ public:
bool are_equal(expr * a, expr * b) const;
bool are_distinct(expr * a, expr * b) const;
bool contains(ast * a) const { return m_ast_table.contains(a); }
bool is_lambda_def(quantifier* q) const { return q->get_qid() == m_lambda_def; }
void add_lambda_def(func_decl* f, quantifier* q);

View file

@ -76,9 +76,9 @@ public:
template<typename T>
T * translate(T const * n) {
if (&from() == &to()) return const_cast<T*>(n);
// A Valentine? SASSERT(!n || from().contains(const_cast<T*>(n)));
SASSERT(!n || from().contains(const_cast<T*>(n)));
ast * r = process(n);
// Pretty please SASSERT((!n && !r) || to().contains(const_cast<ast*>(r)));
SASSERT((!n && !r) || to().contains(const_cast<ast*>(r)));
return static_cast<T*>(r);
}