I want to represent a hash function in z3, something like SHA(x). After doing some research, it appears z3 doesn't support injectivity very well, so I can't have a constraint like (and while I realise this isn't strictly speaking true because of collisions, as a heuristic it would be useful for my project)
forall([x, y],Implies(SHA(x)==SHA(y), x==y))
and expect the solver to terminate.
My question is, are there any known best practice workarounds for this problem? For instance, if I added a Implies(SHA(x)==SHA(y), x==y) constraint for every pair of x and y without using a quantifier, would this solve the problem?