Source context

Program Rust

Dec2FltTrace

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

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