proofs.rs

Claim #1 — Verification of lexical_core::parse (with Aeneas be86ab0f1989d04944292b345b24c435be3ad10a)

lexical_core::parse

pub fn parse<N: FromLexical>(bytes: &[u8]) -> Result<N>

Tool: Aeneas be86ab0f1989d04944292b345b24c435be3ad10a

This claim has no explanation of its own. Read the report Overview, and treat the formal statement below as authoritative. See Concepts and terminology.

Preconditions

The selected trait dictionary call terminates with Result.ok out and satisfies the independent output relation P; concrete numeric dictionary correctness is an explicit premise, not proved here.

Formal statement

LexicalCorePublicationProofs.parse_spec

for allN : Type
for allinst : lexical_core.FromLexical N
for allbytes : Aeneas.Std.Slice Aeneas.Std.U8
for allP : Aeneas.Std.core.result.Result N lexical_core.lexical_util.error.Error → Prop
assumeh : ∃ out, inst.from_lexical bytes = Aeneas.Std.Result.ok out ∧ P out
then∃ out, lexical_core.parse inst bytes = Aeneas.Std.Result.ok out ∧ P out
Complete Lean proposition
∀ {N : Type} (inst : lexical_core.FromLexical.{0} N) (bytes : Aeneas.Std.Slice.{0} Aeneas.Std.U8)
  (P : Aeneas.Std.core.result.Result.{0, 0} N lexical_core.lexical_util.error.Error → Prop)
  (h :
    @Exists.{1} (Aeneas.Std.core.result.Result.{0, 0} N lexical_core.lexical_util.error.Error)
      fun (out : Aeneas.Std.core.result.Result.{0, 0} N lexical_core.lexical_util.error.Error) =>
      And
        (@Eq.{1} (Aeneas.Std.Result.{0} (Aeneas.Std.core.result.Result.{0, 0} N lexical_core.lexical_util.error.Error))
          (@lexical_core.FromLexical.from_lexical.{0} N inst bytes)
          (@Aeneas.Std.Result.ok.{0} (Aeneas.Std.core.result.Result.{0, 0} N lexical_core.lexical_util.error.Error)
            out))
        (P out)),
  @Exists.{1} (Aeneas.Std.core.result.Result.{0, 0} N lexical_core.lexical_util.error.Error)
    fun (out : Aeneas.Std.core.result.Result.{0, 0} N lexical_core.lexical_util.error.Error) =>
    And
      (@Eq.{1} (Aeneas.Std.Result.{0} (Aeneas.Std.core.result.Result.{0, 0} N lexical_core.lexical_util.error.Error))
        (@lexical_core.parse.{0} N inst bytes)
        (@Aeneas.Std.Result.ok.{0} (Aeneas.Std.core.result.Result.{0, 0} N lexical_core.lexical_util.error.Error) out))
      (P out)

Theorem source at recorded commit · Recorded check

Referenced definitions (up to 100 direct references)

Mapping: manual. Translation was not rerun by this recording.

Evidence

https://github.com/MasWag/crate-proofs/blob/e62defe37eef5b1f670f12f15574379fabca2cda/lexical-core/1.0.6/publication/proofs/Proofs.lean#L31-L36

What is trusted

From the report

The results depend on the pinned Rust-to-Lean translation, Aeneas standard models and Lean kernel. Trait methods supplied to the facade are arbitrary; the success and output property needed for the conditional contracts are premises. Source correspondence checks and native comparisons support the adaptations but are not formal equivalence proofs.

Technical limitations

From the report

The fork copies the six release function definitions exactly but replaces their trait types with method-only traits, removing unused supertraits and associated-type bounds. A source check compares function text and required method signatures; source review supports projecting release dictionaries to those methods. No checked equivalence relates the fork to the release facade. The unchanged facade translation emits unused float cast fields that fail to compile in Lean.

The compact helper specializes the release algorithm to u8 and decimal, makes casts concrete and inlines the copy helper. Its theorem covers a count and updated buffer, not the public returned slice or its backward function; no formal bridge to the release algorithm is established. Native comparisons cover finite buffer cases only.

No unchanged-release concrete integer or floating-point parsing or writing algorithm is proved. In particular, the facade premises do not establish numeric correctness, error behavior, buffer capacity or panic freedom for built-in implementations. Custom formats and options and other types require separate contracts. Native findings are separate from formal proof.

Tool limitations

Lean backend only, requiring cargo-proofs 0.4.0 or later. The version identifies the official Aeneas Git revision pinned in lake-manifest.json (backends/lean); this revision uses Lean 4.35.0. The recorder checks committed Lean theorem declarations and permits only propext, Classical.choice, and Quot.sound as transitive axioms. It rejects sorryAx and custom axioms, including axiomatized external models. Charon/Aeneas extraction is not rerun. The author must review that the committed functional model matches the recorded Rust source, that the named theorem corresponds to the public API, and that the reported precondition matches the theorem. A checked theorem alone does not establish those links or the adequacy of the specification. The current adapter records the default Cargo configuration, with ordinary Lean module paths and a pinned official Git dependency. Other backends, custom Lake source directories, and local-path Aeneas dependencies are unsupported. See https://proofs.rs/book/aeneas.html and https://github.com/AeneasVerif/aeneas/tree/be86ab0f1989d04944292b345b24c435be3ad10a.

Updated 2026-10-16 00:00 UTC

Aeneas be86ab0f1989d04944292b345b24c435be3ad10a — version details

Read and join the discussion on the report →