Skip to content

Commit

Permalink
revert my mess with the ast hashtable
Browse files Browse the repository at this point in the history
will share results form the experiments later
  • Loading branch information
nunoplopes committed Feb 17, 2021
1 parent 4f9117a commit bcad4d9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/api/api_ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/api/api_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/ast/ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,8 @@ class ast_manager {
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);
Expand Down
4 changes: 2 additions & 2 deletions src/ast/ast_translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ class ast_translation {
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);
}

Expand Down

0 comments on commit bcad4d9

Please sign in to comment.