Source context

Program Rust

offset_from

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

27     }28 29     #[inline]30     fn offset_from(&self, other: &Self) -> isize {31         other.len() as isize - self.len() as isize32     }33 34 }35 

Aeneas declaration

The Lean below was mechanically extracted by Aeneas from Rust.

def SliceU8.Insts.Dec2flt_modelNumImpDec2fltCommonByteSlice.offset_from
  (self : Slice Std.U8) (other : Slice Std.U8) : Result Std.Isize := do
  let i := Slice.len other
  let i1 โ† lift (UScalar.hcast .Isize i)
  let i2 := Slice.len self
  let i3 โ† lift (UScalar.hcast .Isize i2)
  i1 - i3
Source details
DeclarationSliceU8.Insts.Dec2flt_modelNumImpDec2fltCommonByteSlice.offset_from
Filenum/imp/../../dec2flt/common.rs
Lines30:4โ€“32:5
Program versionOriginal program