proofs.rs

Claim #4 — Verification of bytes::buf::Take::limit (with Aeneas be86ab0f1989d04944292b345b24c435be3ad10a)

bytes::buf::Take::limit

impl<T> Take<T>
pub fn limit(self: &Self) -> usize

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

true

Formal statement

bytes.take_limit_spec

for allT : Type u_1
for alls : bytes.buf.take.Take T
then∃ out, bytes.buf.take.Take.impl.limit s = Aeneas.Std.Result.ok out ∧ out = s.limit
Complete Lean proposition
∀ {T : Type u_1} (s : bytes.buf.take.Take.{u_1} T),
  @Exists.{1} Aeneas.Std.Usize fun (out : Aeneas.Std.Usize) =>
    And
      (@Eq.{1} (Aeneas.Std.Result.{0} Aeneas.Std.Usize) (@bytes.buf.take.Take.impl.limit.{u_1} T s)
        (@Aeneas.Std.Result.ok.{0} Aeneas.Std.Usize out))
      (@Eq.{1} Aeneas.Std.Usize out (@bytes.buf.take.Take.limit.{u_1} T s))

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/keiichiw/crate-proofs/blob/3785357a67f63cc5c25005cdbc8684b20390d5a3/bytes/1.12.1/aeneas/profiles/unpatched/proofs/Proofs/Take.lean#L17-L19

What is trusted

From the report

Charon/Aeneas translation and Aeneas Lean standard library, Lean kernel and its permitted standard axioms. The compiler translation is trusted, not proved by this report.

Technical limitations

From the report

Only the mapped contracts are verified. No whole-crate, unsafe memory-safety or signed variable-width reader correctness claim.

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 →