Skip to content

Commit

Permalink
chore: add theorem for bitvec_152 (#605)
Browse files Browse the repository at this point in the history
PR to solve
[issue#602](#602) (`b *
BitVec.allOnes w = -b`)

---------

Co-authored-by: Tobias Grosser <[email protected]>
  • Loading branch information
luisacicolini and tobiasgrosser authored Sep 8, 2024
1 parent a938776 commit cefc98a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SSA/Projects/InstCombine/ForLean.lean
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@ theorem one_shiftLeft_mul {x y : BitVec w} :
1#w <<< x.toNat * y = y <<< x.toNat := by
simp [←BitVec.mul_twoPow_eq_shiftLeft, BitVec.mul_comm]

@[simp]
theorem mul_allOnes {x : BitVec w} :
x * BitVec.allOnes w = -x := by
simp [← BitVec.negOne_eq_allOnes]

end BitVec

namespace Bool
Expand Down

0 comments on commit cefc98a

Please sign in to comment.