proofs.rs

Claim #8 — Verification of <str as heck::ToUpperCamelCase>::to_upper_camel_case (with creusot 0.14.0)

<str as heck::ToUpperCamelCase>::to_upper_camel_case

Recorded callable · signature and safety not independently recorded.

Tool: creusot 0.14.0

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

Creusot specification

#[ensures(
        crate::case_spec::converted(self@, 6u8, result@)
    )]
fn to_upper_camel_case(&self) -> String

Source at recorded commit · Recorded check

Evidence

https://github.com/MasWag/crate-proofs/blob/e2ca16b520acd15414f7b22472733efd44e3e659/heck/0.5.0/creusot/src/upper_camel.rs#L34-L40

What is trusted

From the report

The contracts assume that string iteration yields exactly the input's scalar sequence in order and that scalar case iterators yield the complete ordered mappings and terminate, with the stated bounds on mapping lengths. The Unicode predicates and scalar mappings are modeled as opaque functions assumed to match the corresponding Rust standard-library operations. Collection of a finite Vec<char> iterator into a String is assumed to terminate; its output content is checked against the standard models. Vector and string operations rely on those models and on successful, representable allocation; resource exhaustion is outside the termination and output guarantee. The proof also relies on Creusot's translation, verification conditions and the underlying proof tools.

Technical limitations

From the report

The verified bodies are a runtime adaptation of the release. The release's owned methods format their Display wrappers; the adaptation prepares scalar classifications and case expansions, then builds the result directly. This makes the segmentation and mapping pipeline accessible to the verifier. The original Display implementations and their formatting, write errors and partial output are not verified by these contracts. The adaptation changes allocation and execution behavior. Formal equivalence to the unchanged release, including resource failures, remains open.

Finite native comparisons between release and adapted implementations provide evidence of correspondence; they do not establish equivalence for all inputs. The standard-library Unicode models are assumptions rather than a proof of the underlying Unicode tables. Alias delegation and the behavior of third-party implementations are outside this report's selected owned-method contracts.

Read and join the discussion on the report →