File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ section Nat
15
15
/-- The `BitVec` with value `i mod 2^n`. -/
16
16
@[match_pattern]
17
17
protected def ofNat (n : Nat) (i : Nat) : BitVec n where
18
- toFin := Fin.ofNat' i (Nat.two_pow_pos n)
18
+ toFin := Fin.ofNat' ( 2 ^n) i
19
19
20
20
instance instOfNat : OfNat (BitVec n) i where ofNat := .ofNat n i
21
21
Original file line number Diff line number Diff line change @@ -237,11 +237,6 @@ instance (a b : UInt64) : Decidable (a ≤ b) := UInt64.decLe a b
237
237
instance : Max UInt64 := maxOfLe
238
238
instance : Min UInt64 := minOfLe
239
239
240
- -- This instance would interfere with the global instance `NeZero (n + 1)`,
241
- -- so we only enable it locally.
242
- @[local instance]
243
- private def instNeZeroUSizeSize : NeZero USize.size := ⟨add_one_ne_zero _⟩
244
-
245
240
@[extern "lean_usize_mul"]
246
241
def USize.mul (a b : USize) : USize := ⟨a.toBitVec * b.toBitVec⟩
247
242
@[extern "lean_usize_div"]
Original file line number Diff line number Diff line change @@ -17,6 +17,15 @@ Int.ofNat 2
17
17
1
18
18
1
19
19
1
20
+ 1
21
+ 1
22
+ 1
23
+ 1
24
+ 1
25
+ 1
26
+ 1
27
+ 1
28
+ 1
20
29
2147483648
21
30
0
22
31
0
@@ -26,3 +35,8 @@ Int.ofNat 2
26
35
1
27
36
1
28
37
1
38
+ 1
39
+ 1
40
+ 1
41
+ 1
42
+ 1
You can’t perform that action at this time.
0 commit comments