Skip to content

Commit

Permalink
chore: generalize shifts (#650)
Browse files Browse the repository at this point in the history
Co-authored-by: luisacicolini <[email protected]>
  • Loading branch information
tobiasgrosser and luisacicolini authored Sep 24, 2024
1 parent 6daa533 commit d770d3e
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 @@ -606,6 +606,11 @@ theorem shiftLeft_add_distrib {x y : BitVec w} {n : Nat} :
rw [Nat.mod_eq_of_eq]
omega

@[simp]
theorem shiftLeft_and_distrib' {x y : BitVec w} {n m : Nat} :
x <<< n &&& y <<< (m + n) = (x &&& y <<< m) <<< n := by
simp [BitVec.shiftLeft_and_distrib, BitVec.shiftLeft_add]

@[simp]
theorem allOnes_shiftLeft_and_shiftLeft {x : BitVec w} (n : Nat) :
BitVec.allOnes w <<< n &&& x <<< n = x <<< n := by
Expand Down

0 comments on commit d770d3e

Please sign in to comment.