Skip to content

Commit 43363c5

Browse files
authored
Merge pull request #1356 from cryspen/misc-proof-libs
feat(proof-libs): add missing definitions
2 parents 1d195b8 + 2ca3acd commit 43363c5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

proof-libs/fstar/core/Core.Num.fsti

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ val impl_u64__to_be_bytes: u64 -> t_Array u8 (sz 8)
3636
val impl_u64__rotate_right: u64 -> u64 -> u64
3737

3838
let impl_u128__wrapping_add: u128 -> u128 -> u128 = add_mod
39+
let impl_u128__wrapping_sub: u128 -> u128 -> u128 = sub_mod
3940
val impl_u128__rotate_left: u128 -> u128 -> u128
4041
val impl_u128__from_le_bytes: t_Array u8 (sz 16) -> u128
4142
val impl_u128__from_be_bytes: t_Array u8 (sz 16) -> u128
@@ -51,6 +52,9 @@ val impl_u128__pow: u128 -> u32 -> u128
5152
val impl_i16__pow (base: i16) (exponent: u32): result: i16 {v base == 2 /\ v exponent < 15 ==> (Math.Lemmas.pow2_lt_compat 15 (v exponent); result == mk_i16 (pow2 (v exponent)))}
5253
val impl_i32__pow (base: i32) (exponent: u32): result: i32 {v base == 2 /\ v exponent <= 16 ==> result == mk_i32 (pow2 (v exponent))}
5354

55+
let impl_i128__wrapping_add: i128 -> i128 -> i128 = add_mod
56+
let impl_i128__wrapping_sub: i128 -> i128 -> i128 = sub_mod
57+
5458
val impl_u8__count_ones: u8 -> r:u32{v r <= 8}
5559
val impl_i32__count_ones: i32 -> r:u32{v r <= 32}
5660

proof-libs/fstar/rust_primitives/Rust_primitives.Integers.fsti

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ val pow2_values: x:nat -> Lemma
1515
| 32 -> p=4294967296
1616
| 63 -> p=9223372036854775808
1717
| 64 -> p=18446744073709551616
18+
| 127 -> p=170141183460469231731687303715884105728
19+
| 128 -> p=340282366920938463463374607431768211456
1820
| 2 | 3 | 4 | 5 | 6 | 7
1921
| 9 | 10 | 11 | 12 | 13 | 14 | 15
2022
| 17 | 18 | 19 | 20 | 21 | 22 | 23

0 commit comments

Comments
 (0)