Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Jul 6, 2021
1 parent af5b2a4 commit c2595b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ast/ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,11 @@ unsigned get_node_hash(ast const * n) {
return to_sort(n)->get_name().hash();
else
return combine_hash(to_sort(n)->get_name().hash(), to_sort(n)->get_info()->hash());
case AST_FUNC_DECL:
case AST_FUNC_DECL: {
unsigned h = combine_hash(to_func_decl(n)->get_name().hash(), to_func_decl(n)->get_range()->hash());
return ast_array_hash(to_func_decl(n)->get_domain(), to_func_decl(n)->get_arity(),
to_func_decl(n)->get_info() == nullptr ?
to_func_decl(n)->get_name().hash() : combine_hash(to_func_decl(n)->get_name().hash(), to_func_decl(n)->get_info()->hash()));
combine_hash(h, to_func_decl(n)->get_info() == nullptr ? 0 : to_func_decl(n)->get_info()->hash()));
}
case AST_APP:
return ast_array_hash(to_app(n)->get_args(),
to_app(n)->get_num_args(),
Expand Down

2 comments on commit c2595b9

@nunoplopes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've benchmarked this patch and the performance is all over the place. Some regressions, some improvements; no clear direction. Average is roughly stable.

@NikolajBjorner
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, it is expected to introduce fluctuations.
Similar fluctuations are possible with random seeds or change in formula orders.

Please sign in to comment.