Hash function for `Arr` does not consider array structure and size
Opened this issue · 1 comments
bowenszhu commented
Currently, the hash
function for Arr
only considers its value
field.
Lines 495 to 499 in 1da13fd
This means that two Arr
objects with identical symbolic elements but different array structures and sizes will have the same hash
value.
For example, the following code snippet demonstrates this issue:
using Symbolics
a1 = only(@variables a[1:5])
a2 = only(@variables a[1:4, 1:6])
a3 = only(@variables a)
h1 = hash(a1)
h2 = hash(a2)
h3 = hash(a3)
h1 == h2 == h3 # This returns true, but we expect it to be false
ChrisRackauckas commented
Yeah it seems to me that should hash differently.