-
Notifications
You must be signed in to change notification settings - Fork 426
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 <siddu.druid@gmail.com> Co-authored-by: Harun Khan <harun19@stanford.edu> Stacked on top of #6155 --------- Co-authored-by: Harun Khan <harun19@stanford.edu>
- 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