Closed TomMD closed 10 years ago
This is a "known" shortcoming.. Unfortunately, SMT-Lib does not support bit-wise operations for unbounded integers (for good reason); while Haskell fully does. So, there's a tension between what's possible and what's actually supported. For instance, the following doesn't work either:
sat $ \x y -> (x .&. y .== (x::SInteger))
for pretty much the same reason. So, we're bound by the class hierarchy in Haskell not quite nicely matching up with what SMT-Lib understands.
(Note that this is the same issue with Cryptols finite/infinite type variables; which is similarly problematic. But I digress.)
The right thing to do is to actually have two classes: FiniteBits
and Bits
, I suppose; and only allow these operations on FiniteBits
members. (And obviously do not make Integer
and instance of FiniteBits
.) But that's a whole another can of worms.
I'd be willing to entertain other ideas if you can come up with a reasonable design to avoid such anomalies.
Observe:
Intentional or not, it appears
SInteger
is not supported bysbvTestBit
. If this is expected then I can submit a documentation patch. If not then.. well... bug!