-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trivial Hash Collision between 0.
and 0.F
#5379
Comments
0.
and +0.F
0.
and 0.F
I reported this as an issue since it feels like a bug as
Likewise, the identical function
Docs linked here. |
Of course hashes are not unique, and there are collisions. Identifiers are unique (just a bumped counter). Of course the hashing function can always be improved. But there's a tradeoff between speed and quality. Changing the hashing function is not something to be done lightly. |
I think function type parameters (to |
(_ +zero 8 24) |
I assume you can use the id instead of the hash. |
@NikolajBjorner What ID are you referring to? According to the docs
Also, would you like me to make a PR noting that sorts are not considered 'structural', at least by the hash docs' definition of structural? |
I assume you can use Z3_get_ast_id instead of Z3_get_ast_hash. |
I changed the hash function to use the sort as well so now you get two different hash values for your example. |
Ah, thanks! |
The following ASTs have the following hashes.
(_ +zero 8 24)
has a hash of 1098364533(_ +zero 11 53)
has a hash of 1098364533The same collision happens for
-0.
and-0.F
.Is this just two 1/(2^32) hash collisions? Or do the hashes not consider the
sort
? Or is this a bug?The text was updated successfully, but these errors were encountered: