Skip to content

Commit

Permalink
fix typo in u128s_from_felt252
Browse files Browse the repository at this point in the history
  • Loading branch information
javra committed Jun 21, 2024
1 parent a6d1f64 commit 6318bf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Aegis/Libfuncs/UInt128.lean
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def u128s_from_felt252 : FuncData where
q(($a).val < U128_MOD ∧ $ρ = ($a).cast) },
{ outputTypes := [RangeCheck, U128, U128]
condition := fun _ (a : Q(F)) _ (ρ_high ρ_low : Q(UInt128)) =>
q(U128_MOD ≤ ($a).val ∧ $ρ_high = $(a).val % U128_MOD
q(U128_MOD ≤ ($a).val ∧ $ρ_high = $(a).val / U128_MOD
∧ $ρ_low = $(a).cast) }]

def u128_safe_divmod : FuncData where
Expand Down
9 changes: 2 additions & 7 deletions Aegis/Tests/Libfuncs/U128/U128sFromFelt252.lean
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@ aegis_load_file "../../e2e_libfuncs/u128_aegis/u128s_from_felt252.sierra"
aegis_spec "test::foo" :=
fun _ _ a _ ρ =>
a.val < U128_MOD ∧ ρ = .inl a.cast
∨ U128_MOD ≤ a.val ∧ ρ = .inr ((a.val % U128_MOD : UInt128), a.cast)
∨ U128_MOD ≤ a.val ∧ ρ = .inr ((a.val / U128_MOD : UInt128), a.cast)

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

aegis_complete

0 comments on commit 6318bf0

Please sign in to comment.