Skip to content

Commit

Permalink
new form
Browse files Browse the repository at this point in the history
  • Loading branch information
luisacicolini committed Nov 7, 2024
1 parent 4ee1756 commit fb08236
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SSA/Projects/InstCombine/ForLean.lean
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,12 @@ theorem getMsbD_rotateLeft {w i r : Nat} {x : BitVec w} :
else decide (w - 1 - i < w) && x.getLsbD (w - 1 - i - r % w)) := by
rw [getMsbD_eq_getLsbD, getLsbD_rotateLeft]

-- this is an alternative I thought of for getMsbD_rotateLeft,
-- but I cant figure out (1) whether it's correct (2) how to prove it (tried and kept
-- getting stuck)
theorem getMsbD_rotateLeft' {m n w : Nat} {x : BitVec w} :
(x.rotateLeft m).getMsbD n = (decide (n < w) && x.getMsbD ((m + n) % w)) := by sorry

@[simp]
theorem msb_rotateLeft {m w : Nat} {x : BitVec w} :
(x.rotateLeft m).msb = x.getMsbD (m % w) := by
Expand Down

0 comments on commit fb08236

Please sign in to comment.