Zulip Chat Archive
Stream: Is there code for X?
Topic: setting BitVec
Wrenna Robson (Dec 12 2025 at 14:30):
I was expecting to find setLsb and setMsb as we have getLsb and getMsb in BitVec. Do these have a different name?
Henrik Böving (Dec 12 2025 at 14:31):
x ||| (1#w <<< n) is the name I would say
Wrenna Robson (Dec 12 2025 at 14:32):
That certainly is what I'd define it as, but I was somewhat expecting there to be a name for it beyond that!
Henrik Böving (Dec 12 2025 at 14:39):
BitVec currently implements SMT-LIB, SMT-LIB doesn't do this
Wrenna Robson (Dec 12 2025 at 14:40):
Right.
Henrik Böving (Dec 12 2025 at 14:41):
If you want to add it feel free but keep in mind that you would have to define a couple dozen theorems to capture its behavior.
Wrenna Robson (Dec 12 2025 at 14:41):
Oh of course :)
Wrenna Robson (Dec 12 2025 at 14:42):
Actually I have some more complicated functions that I've defined due to an off-library project (which I hope to get into the library at some point) and I was hoping to mimic the API
Wrenna Robson (Dec 12 2025 at 15:36):
I assume a similar reason is why BitVec.msb exists but BitVec.lsb does not.
Ralf Stephan (Feb 17 2026 at 17:59):
@Wrenna Robson is your code somewhere? I'm suddenly in need of this too.
Wrenna Robson (Feb 17 2026 at 18:04):
Unfortunately I don't think I did do it fully.
Wrenna Robson (Feb 17 2026 at 18:04):
It would be useful I think!
Last updated: Feb 28 2026 at 14:05 UTC