lean4-htt/src/Init/Data/BitVec
Siddharth 107a2e8b2e
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>
2024-11-23 07:29:08 +00:00
..
Basic.lean chore: remove >6 month old deprecations (#6057) 2024-11-13 23:21:23 +00:00
BasicAux.lean refactor: redefine unsigned fixed width integers in terms of BitVec (#5323) 2024-10-16 07:28:23 +00:00
Bitblast.lean feat: BitVec.getElem_[sub|neg|sshiftRight'|abs] (#6126) 2024-11-21 07:01:11 +00:00
Folds.lean chore: deprecate duplicated Fin.size_pos (#6025) 2024-11-11 04:06:13 +00:00
Lemmas.lean feat: BitVec.toInt BitVec.signExtend (#6157) 2024-11-23 07:29:08 +00:00