diff options
author | Son HO | 2023-12-05 17:46:17 +0100 |
---|---|---|
committer | GitHub | 2023-12-05 17:46:17 +0100 |
commit | 9eb117dc9e94d1b04d24c87d278d014f456b2d89 (patch) | |
tree | 2663915767c3558203990ed14f8d5604b7fd21d1 /backends/lean/Base/Primitives/Vec.lean | |
parent | 4795e5f823bc89504855d8eb946b111d9314f4d5 (diff) | |
parent | 726db4911add81a853aafcec3936b457aaeff5b4 (diff) |
Merge pull request #38 from AeneasVerif/son_fixes2
Simplify and add some lemmas
Diffstat (limited to '')
-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 e600a151..2c3fce91 100644 --- a/backends/lean/Base/Primitives/Vec.lean +++ b/backends/lean/Base/Primitives/Vec.lean @@ -37,6 +37,10 @@ example {a: Type u} (v : Vec a) : v.length ≤ Scalar.max ScalarTy.Usize := by def Vec.new (α : Type u): Vec α := ⟨ [], by apply Scalar.cMax_suffices .Usize; simp ⟩ +instance (α : Type u) : Inhabited (Vec α) := by + constructor + apply Vec.new + -- TODO: very annoying that the α is an explicit parameter def Vec.len (α : Type u) (v : Vec α) : Usize := Usize.ofIntCore v.val.len (by scalar_tac) (by scalar_tac) |