Skip to content

Commit

Permalink
add remaining u8 libfunc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
javra committed Apr 9, 2024
1 parent 6d9f2ae commit 65a37fe
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Aegis/Tests/Libfuncs/U8/U8TryFromFelt252.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Aegis.Commands

open Sierra

aegis_load_file "../../e2e_libfuncs/u8_aegis/u8_try_from_felt252.sierra"

aegis_spec "test::foo" :=
fun _ _ a _ ρ =>
a.val < U8_MOD ∧ ρ = .inl a.cast
∨ U8_MOD ≤ a.val ∧ ρ = .inr ()

aegis_prove "test::foo" :=
fun _ _ a _ ρ => by
unfold «spec_test::foo»
rename_i x x_1 x_2
intro h_auto
unhygienic aesop_cases h_auto
· simp_all only [and_self, true_or]
· simp_all only [and_self, or_true]

aegis_complete
19 changes: 19 additions & 0 deletions Aegis/Tests/Libfuncs/U8/U8WideMul.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Aegis.Commands

open Sierra

aegis_load_file "../../e2e_libfuncs/u8_aegis/u8_wide_mul.sierra"

aegis_spec "test::foo" :=
fun _ a b ρ =>
ρ = a.cast * b.cast

aegis_prove "test::foo" :=
fun _ a b ρ => by
unfold «spec_test::foo»
rename_i x
intro h_auto
aesop_subst h_auto
simp_all only

aegis_complete

0 comments on commit 65a37fe

Please sign in to comment.