Source context

Program Rust

body

This Rust is the input prepared for Aeneas. Modeling choices explains the adaptations from the production source.

188                 // no intervening operation and preserves the unchanged value.189                 all_zero = true;190             } else {191                 while (n >> shift) == 0 {192                     n *= 10;193                     read_index += 1;194                 }195                 break;196             }197         }

Aeneas declaration

The Lean below was mechanically extracted by Aeneas from Rust.

@[rust_loop_body]
def num.imp.dec2flt.decimal_seq.DecimalSeq.right_shift_loop0_loop0.body
  (shift : Std.Usize) (read_index : Std.Usize) (n : Std.U64) :
  Result (ControlFlow (Std.Usize × Std.U64) (Std.Usize × Std.U64))
  := do
  let i ← n >>> shift
  if i = 0#u64
  then
    let n1 ← n * 10#u64
    let read_index1 ← read_index + 1#usize
    ok (cont (read_index1, n1))
  else ok (done (read_index, n))
Other extracted objects at this span

num.imp.dec2flt.decimal_seq.DecimalSeq.right_shift_loop0_loop0

Source details
Declarationnum.imp.dec2flt.decimal_seq.DecimalSeq.right_shift_loop0_loop0.body
Filenum/imp/../../dec2flt/decimal_seq.rs
Lines191:16–194:17
Program versionRevised program