diff options
author | Son HO | 2024-06-22 15:07:14 +0200 |
---|---|---|
committer | GitHub | 2024-06-22 15:07:14 +0200 |
commit | 8719c17f1a363c0463d74b90e558b2aaa24645d6 (patch) | |
tree | 94cd2fb84f10912e76d1d1e8e89d8f9aee948f0c /backends/lean/Base/Primitives/Vec.lean | |
parent | 8144c39f4d37aa1fa14a8a061eb7ed60e153fb4c (diff) |
Do some cleanup in the Lean backend (#257)
Diffstat (limited to 'backends/lean/Base/Primitives/Vec.lean')
-rw-r--r-- | backends/lean/Base/Primitives/Vec.lean | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/backends/lean/Base/Primitives/Vec.lean b/backends/lean/Base/Primitives/Vec.lean index 12789fa9..82ecb8ed 100644 --- a/backends/lean/Base/Primitives/Vec.lean +++ b/backends/lean/Base/Primitives/Vec.lean @@ -16,6 +16,10 @@ namespace alloc.vec def Vec (α : Type u) := { l : List α // l.length ≤ Usize.max } +instance [BEq α] : BEq (Vec α) := SubtypeBEq _ + +instance [BEq α] [LawfulBEq α] : LawfulBEq (Vec α) := SubtypeLawfulBEq _ + instance (a : Type u) : Arith.HasIntProp (Vec a) where prop_ty := λ v => 0 ≤ v.val.len ∧ v.val.len ≤ Scalar.max ScalarTy.Usize prop := λ ⟨ _, l ⟩ => by simp[Scalar.max, List.len_eq_length, *] |