Program Rust
TABLE
This Rust is the input prepared for Aeneas. Modeling choices explains the adaptations from the production source.
374 375 fn number_of_digits_decimal_left_shift(d: &DecimalSeq, mut shift: usize) -> usize {376 #[rustfmt::skip]377 const TABLE: [u16; 65] = [378 0x0000, 0x0800, 0x0801, 0x0803, 0x1006, 0x1009, 0x100D, 0x1812, 0x1817, 0x181D, 0x2024,379 0x202B, 0x2033, 0x203C, 0x2846, 0x2850, 0x285B, 0x3067, 0x3073, 0x3080, 0x388E, 0x389C,380 0x38AB, 0x38BB, 0x40CC, 0x40DD, 0x40EF, 0x4902, 0x4915, 0x4929, 0x513E, 0x5153, 0x5169,381 0x5180, 0x5998, 0x59B0, 0x59C9, 0x61E3, 0x61FD, 0x6218, 0x6A34, 0x6A50, 0x6A6D, 0x6A8B,382 0x72AA, 0x72C9, 0x72E9, 0x7B0A, 0x7B2B, 0x7B4D, 0x8370, 0x8393, 0x83B7, 0x83DC, 0x8C02,383 0x8C28, 0x8C4F, 0x9477, 0x949F, 0x94C8, 0x9CF2, 0x051C, 0x051C, 0x051C, 0x051C,384 ];385 #[rustfmt::skip]386 const TABLE_POW5: [u8; 0x051C] = [387 5, 2, 5, 1, 2, 5, 6, 2, 5, 3, 1, 2, 5, 1, 5, 6, 2, 5, 7, 8, 1, 2, 5, 3, 9, 0, 6, 2, 5, 1,Aeneas declaration
The Lean below was mechanically extracted by Aeneas from Rust.
@[global_simps, irreducible]
def num.imp.dec2flt.decimal_seq.number_of_digits_decimal_left_shift.TABLE
: Array Std.U16 65#usize :=
Array.make 65#usize [
0#u16, 2048#u16, 2049#u16, 2051#u16, 4102#u16, 4105#u16, 4109#u16,
6162#u16, 6167#u16, 6173#u16, 8228#u16, 8235#u16, 8243#u16, 8252#u16,
10310#u16, 10320#u16, 10331#u16, 12391#u16, 12403#u16, 12416#u16,
14478#u16, 14492#u16, 14507#u16, 14523#u16, 16588#u16, 16605#u16,
16623#u16, 18690#u16, 18709#u16, 18729#u16, 20798#u16, 20819#u16,
20841#u16, 20864#u16, 22936#u16, 22960#u16, 22985#u16, 25059#u16,
25085#u16, 25112#u16, 27188#u16, 27216#u16, 27245#u16, 27275#u16,
29354#u16, 29385#u16, 29417#u16, 31498#u16, 31531#u16, 31565#u16,
33648#u16, 33683#u16, 33719#u16, 33756#u16, 35842#u16, 35880#u16,
35919#u16, 38007#u16, 38047#u16, 38088#u16, 40178#u16, 1308#u16, 1308#u16,
1308#u16, 1308#u16
]Source details
| Declaration | num.imp.dec2flt.decimal_seq.number_of_digits_decimal_left_shift.TABLE |
|---|---|
| File | num/imp/../../dec2flt/decimal_seq.rs |
| Lines | 377:4–384:6 |
| Program version | Revised program |