Program Rust
Dec2FltTrace
This Rust is the input prepared for Aeneas. Modeling choices explains the adaptations from the production source.
281 /// first component returned by `dec2flt_with_trace` is the ordinary parser282 /// result, so projecting it preserves every public source observation without283 /// assuming any correctness goal.284 pub enum Dec2FltTrace<'a, F> {285 /// The original string was empty; no helper was called.286 EmptyInput,287 /// Removing one lexical sign left an empty body; no helper was called.288 SignOnly { body: &'a [u8], negative: bool },289 /// Both lexical helpers returned `None`; no raw pair was selected.290 Invalid {291 body: &'a [u8],292 negative: bool,293 parse_number_result: Option<decimal::Decimal>,294 parse_inf_nan_result: Option<F>,295 },296 /// The special helper supplied the directly returned value; no pair was selected.297 Special {298 body: &'a [u8],299 negative: bool,300 parse_number_result: Option<decimal::Decimal>,301 parse_inf_nan_result: Option<F>,302 result: F,303 },304 /// The ordinary native shortcut supplied the directly returned value.305 FastPath {306 body: &'a [u8],307 negative: bool,308 parse_number_result: Option<decimal::Decimal>,309 fast_path_input: decimal::Decimal,310 fast_path_result: Option<F>,311 result: F,312 },313 /// The integer/slow path selected and assembled one raw pair.314 Assembled(Dec2FltAssemblyTrace<'a, F>),315 }316 317 /// Full observation record for the dispatcher path that performs final assembly.318 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 FSource details
| Declaration | num.imp.dec2flt.Dec2FltTrace |
|---|---|
| File | num/imp/../../dec2flt/mod.rs |
| Lines | 284:0–315:1 |
| Program version | Preparation 1 |