Source context

Program Rust

body

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

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

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
Lines190:16–193:17
Program versionPreparation 2