Select one bit in BitVec #7197
-
I want to implement two operations:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
you can extract a range, but not a single bit. Extract(v, k, k) is a bit-vector of length 1. It is either BitVecVal(0,1) or BitVecVal(1,1). You can compare the result of extraction to get a Boolean. To update the "index"th entry of vector you have |
Beta Was this translation helpful? Give feedback.
-
For bit-vectors you can't use symbolic indices. You can use a big if-then-else statement to dispatch on the symbolic index. |
Beta Was this translation helpful? Give feedback.
-
bit-vectors are typically not used in the same domains as arrays. Extraction at variable offsets isn't built-in as the main use case for bit-vectors is that they have fixed (and relatively small) sizes. |
Beta Was this translation helpful? Give feedback.
For bit-vectors you can't use symbolic indices. You can use a big if-then-else statement to dispatch on the symbolic index.