-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: BitVec.toInt BitVec.signExtend (#6157)
This PR adds toInt theorems for BitVec.signExtend. If the current width `w` is larger than the extended width `v`, then the value when interpreted as an integer is truncated, and we compute a modulo by `2^v`. ```lean theorem toInt_signExtend_of_le (x : BitVec w) (hv : v ≤ w) : (x.signExtend v).toInt = Int.bmod (x.toNat) (2^v) ``` Co-authored-by: Siddharth Bhat <[email protected]> Co-authored-by: Harun Khan <[email protected]> Stacked on top of #6155 --------- Co-authored-by: Harun Khan <[email protected]>
- Loading branch information
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters