Source context

Program Rust

Dec2FltTrace

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

292 /// first component returned by `dec2flt_with_trace` is the ordinary parser293 /// result, so projecting it preserves every public source observation without294 /// assuming any correctness goal.295 pub enum Dec2FltTrace<'a, F> {296     /// The original string was empty; no helper was called.297     EmptyInput,298     /// Removing one lexical sign left an empty body; no helper was called.299     SignOnly { body: &'a [u8], negative: bool },300     /// Both lexical helpers returned `None`; no raw pair was selected.301     Invalid {302         body: &'a [u8],303         negative: bool,304         parse_number_result: Option<decimal::Decimal>,305         parse_inf_nan_result: Option<F>,306     },307     /// The special helper supplied the directly returned value; no pair was selected.308     Special {309         body: &'a [u8],310         negative: bool,311         parse_number_result: Option<decimal::Decimal>,312         parse_inf_nan_result: Option<F>,313         result: F,314     },315     /// The ordinary native shortcut supplied the directly returned value.316     FastPath {317         body: &'a [u8],318         negative: bool,319         parse_number_result: Option<decimal::Decimal>,320         fast_path_input: decimal::Decimal,321         fast_path_result: Option<F>,322         result: F,323     },324     /// The integer/slow path selected and assembled one raw pair.325     Assembled(Dec2FltAssemblyTrace<'a, F>),326 }327 328 /// Full observation record for the dispatcher path that performs final assembly.329 pub struct Dec2FltAssemblyTrace<'a, F> {

Aeneas declaration

The Lean below was mechanically extracted by Aeneas from Rust.

@[discriminant isize]
inductive num.imp.dec2flt.Dec2FltTrace (F : Type) where
| EmptyInput : num.imp.dec2flt.Dec2FltTrace F
| SignOnly : Slice Std.U8 → Bool → num.imp.dec2flt.Dec2FltTrace F
| Invalid :
  Slice Std.U8 →
  Bool →
  Option num.imp.dec2flt.decimal.Decimal →
  Option F →
  num.imp.dec2flt.Dec2FltTrace F
| Special :
  Slice Std.U8 →
  Bool →
  Option num.imp.dec2flt.decimal.Decimal →
  Option F →
  F →
  num.imp.dec2flt.Dec2FltTrace F
| FastPath :
  Slice Std.U8 →
  Bool →
  Option num.imp.dec2flt.decimal.Decimal →
  num.imp.dec2flt.decimal.Decimal →
  Option F →
  F →
  num.imp.dec2flt.Dec2FltTrace F
| Assembled :
  num.imp.dec2flt.Dec2FltAssemblyTrace F →
  num.imp.dec2flt.Dec2FltTrace F
Operations used here

Decimal · Program Rust

Dec2FltAssemblyTrace · Program Rust

Source details
Declarationnum.imp.dec2flt.Dec2FltTrace
Filenum/imp/../../dec2flt/mod.rs
Lines295:0–326:1
Program versionOriginal program