@@ -122,6 +122,14 @@ attribute [bv_normalize] Bool.cond_eq_if
122
122
attribute [bv_normalize] BitVec.abs_eq
123
123
attribute [bv_normalize] BitVec.twoPow_eq
124
124
125
+ @[bv_normalize]
126
+ theorem BitVec.getElem_eq_getLsbD (a : BitVec w) (i : Nat) (h : i < w) :
127
+ a[i]'h = a.getLsbD i := by
128
+ simp [BitVec.getLsbD_eq_getElem?_getD, BitVec.getElem?_eq, h]
129
+
130
+ -- The side condition about gets resolved if i and w are constant.
131
+ attribute [bv_normalize] BitVec.getMsbD_eq_getLsbD
132
+
125
133
end Reduce
126
134
127
135
section Constant
@@ -137,6 +145,10 @@ attribute [bv_normalize] BitVec.mul_one
137
145
attribute [bv_normalize] BitVec.one_mul
138
146
attribute [bv_normalize] BitVec.not_not
139
147
148
+ attribute [bv_normalize] decide_true
149
+ attribute [bv_normalize] decide_false
150
+ attribute [bv_normalize] decide_not
151
+
140
152
end Constant
141
153
142
154
attribute [bv_normalize] BitVec.zero_and
@@ -280,12 +292,6 @@ theorem BitVec.max_ult' (a : BitVec w) : (BitVec.ult (-1#w) a) = false := by
280
292
simp [this]
281
293
282
294
attribute [bv_normalize] BitVec.replicate_zero_eq
283
-
284
- @[bv_normalize]
285
- theorem BitVec.getElem_eq_getLsbD (a : BitVec w) (i : Nat) (h : i < w) :
286
- a[i] = a.getLsbD i := by
287
- simp [BitVec.getLsbD_eq_getElem?_getD, BitVec.getElem?_eq, h]
288
-
289
295
attribute [bv_normalize] BitVec.add_eq_xor
290
296
attribute [bv_normalize] BitVec.mul_eq_and
291
297
0 commit comments