proofs.rs

Claim #40 — Verification of <ipnet::IpSubnets as Clone>::clone (with Aeneas be86ab0f1989d04944292b345b24c435be3ad10a)

<ipnet::IpSubnets as Clone>::clone

impl Clone for IpSubnets
pub fn clone(self: &Self) -> IpSubnets

Tool: Aeneas be86ab0f1989 + patch 5067f5146882

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

TaggedDerived.subnets_clone_spec

Complete Lean proposition
∀ (r : ipnet.ipnet.IpSubnets),
  @Eq.{1} (Aeneas.Std.Result.{0} ipnet.ipnet.IpSubnets) (ipnet.ipnet.IpSubnets.Insts.CoreCloneClone.clone r)
    (@Aeneas.Std.Result.ok.{0} ipnet.ipnet.IpSubnets r)

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/6364881c457cf5494b026701c0c684cdaaf3896e/ipnet/2.12.2/aeneas/profiles/default/proofs/Proofs/TaggedDerived.lean#L57-L59

What is trusted

From the report

The selected crate bodies are extracted from the unchanged ipnet 2.12.2 release source. The source inventory and before-and-after checks establish the identity of those inputs; they do not independently prove that translation preserves every Rust behavior. The results depend on Rust-to-LLBC-to-Lean translation and selected standard-library models.

For address ordering, the model compares big-endian numeric values. The pinned Rust IPv4 comparison orders its octets lexicographically; the IPv6 comparison orders eight segments, each formed from a pair of octets. On the checked little-endian target, those orders agree with the corresponding big-endian numbers. The IPv6 constructor model similarly concatenates the big-endian bytes of its eight segments, matching the reviewed source's byte conversion and layout on that target. These are source-based correspondence arguments, not Lean proofs of Rust layout or comparator semantics. The concrete Result::ok model follows the source's variant match for the selected drop-free network and error types; it does not establish behavior for arbitrary destructors. The trailing-zero models reverse fixed-width bits and count leading zeros, matching the reviewed intrinsic's low-zero count, including zero yielding the bit width. These correspondences remain trusted even though the resulting model properties are kernel checked.

The independently pinned Aeneas patch supplies those narrow models and checked shift wrappers; the Charon patch lowers recorded true MIR undefined-behavior checks and represents divergent panic paths using the existing panic model, and selects the IPv6 constructor. This does not establish general abort or unwind equivalence. Checked shift-overflow examples, pinned standard-library source hashes, fresh extraction and the full theorem audit support this configuration but do not prove all Rust/model correspondence. Arithmetic lemmas about unchanged scalar models are kernel proofs about those models, not proofs of the Rust intrinsics. Runtime overflow and undefined-behavior checks were enabled and contract checks disabled. Lean's foundational propext, Classical.choice and Quot.sound are allowed by the transitive axiom audit.

Technical limitations

From the report

Parsing, formatting, aggregation, hashing, optional serde and schemars integrations, and unselected inherited defaults are outside the mapped claims. A nonempty raw subnet iterator with a requested prefix above the address-family width follows a modeled panic path. new_assert likewise does not have a total-success claim for invalid prefixes.

The model does not establish physical runtime behavior, general const evaluation, panic formatting, or abort/unwind equivalence. The accepted target is macOS arm64; retained Linux models are not an accepted run of this configuration. Full original logs are in a local evidence archive, and the committed summary is not a cargo-proofs SARIF recording.

Official base 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 →