Closed bollu closed 5 days ago
Given that bv_decide
is only supposed to work on fixed width things anyways, why would there need to be normalization up to associativity and commutativity? Just running the equivalent of simp only [seval] at <BitVec fvars>
should be enough right?
Closing as everyone seems to agree this is as designed
I'm not sure I stand behind with that conclusion: I read @hargoniX comment as "it should be enough to have bv_decide
do constant folding in the normalization pass", which I agree with, rather than as "the current status-quo is fine, seeing as it should be enough to rely on the user to do constant folding via simp only [seval] at ...
".
It'd be nice for bv_decide
to do this automatically!
Consider the MWE:
Changing the type of
(x : BitVec (8 * 8))
to(x : BitVec 64)
allowsbv_decide
to see that the values are indeed equivalent. Intuitively, one might expectbv_decide
to index bitvectors upto defeq of their widths, since those are the equalities that Lean itself allows.It would be nice if
bv_decide
ran normalizations on the width, so that cases like these are automatically proven. It may need to be a somewhat carefully engineered normalization, that does not spend too long evaluating / unfolding, but it should probably perform constant folding and rewrite upto associativity/commutativity.A larger issue with this as the MWE was discovered by @pennyannn, and was reduced by @alexkeizer .
CC @hargoniX