File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -2781,6 +2781,16 @@ theorem getElem_rotateRight {x : BitVec w} {r i : Nat} (h : i < w) :
2781
2781
simp only [← BitVec.getLsbD_eq_getElem]
2782
2782
simp [getLsbD_rotateRight, h]
2783
2783
2784
+ theorem getMsbD_rotateRightAux_of_le {x : BitVec w} {r : Nat} {i : Nat} (hi : i < r) :
2785
+ (x.rotateRightAux r).getMsbD i = x.getMsbD (i + (w - r)) := by
2786
+ rw [rotateRightAux, getMsbD_or, getMsbD_ushiftRight]
2787
+ simp [show i < r by omega]
2788
+
2789
+
2790
+ theorem getMsbD_rotateRightAux_of_geq {x : BitVec w} {r : Nat} {i : Nat} (hi : i ≥ r) :
2791
+ (x.rotateRightAux r).getMsbD i = (decide (i < w) && x.getMsbD (i - r)) := by
2792
+ simp [rotateRightAux, show ¬ i < r by omega, show i + (w - r) ≥ w by omega]
2793
+
2784
2794
@[simp]
2785
2795
theorem getMsbD_rotateRight {w n m : Nat} {x : BitVec w} :
2786
2796
(x.rotateRight m).getMsbD n = (decide (n < w) && (if (n < m % w) then x.getMsbD ((w + n - m % w) % w) else x.getMsbD (n - m % w))):= by
You can’t perform that action at this time.
0 commit comments