You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These maintain similar invariants (though the invariant is undocumented in the case of MemWord), and the latter seems strictly more general than the former. Perhaps we could replace MemWord with BV? This would be advantageous because libraries like What4 use BV, so we wouldn't have to convert between them. It also probably wouldn't be too hard to do, given that the constructor of MemWord is hidden.
It does appear that MemWord implements Bits, and BV does not. I'm not clear if clients use the Bits instance of MemWord, nor whether one could be provided for BV.
The text was updated successfully, but these errors were encountered:
They are similar, but I think of them as conceptually different things, since MemWords are always guaranteed to be machine words that are 32 or 64 bits. Perhaps it would make sense to make MemWord a newtype around BV to share some parts of their implementations, but I'm not sure about making them the same type—I worry about the possibility of mixing up general-purpose BVs with machine-specific MemWords, especially if we use bv-sized in more parts of macaw.
Consider the
MemWord
type:macaw/base/src/Data/Macaw/Memory.hs
Lines 260 to 264 in aaa5ea1
and
BV
:https://github.com/GaloisInc/bv-sized/blob/d8b0e400101d4491859d5060cf491153ae09ab86/src/Data/BitVector/Sized/Internal.hs#L89-L98
These maintain similar invariants (though the invariant is undocumented in the case of
MemWord
), and the latter seems strictly more general than the former. Perhaps we could replaceMemWord
withBV
? This would be advantageous because libraries like What4 useBV
, so we wouldn't have to convert between them. It also probably wouldn't be too hard to do, given that the constructor ofMemWord
is hidden.It does appear that
MemWord
implementsBits
, andBV
does not. I'm not clear if clients use theBits
instance ofMemWord
, nor whether one could be provided forBV
.The text was updated successfully, but these errors were encountered: