Definition and explanation
This explanation was written alongside the formalization to describe the statement and its reasoning.
Definition
Str byte slice s,
\mathsf{ModelStrAsBytes}(s) successfully returns s itself.Lean definition
Trellis authored this Lean model for an operation outside the mechanical extraction. Modeling choices explains its behavior and review.
import Aeneas
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: ModelStrAsBytes]
def ModelStrAsBytes (s : Str) : Result (Slice Std.U8) :=
-- BODY
ok s
end dec2flt_model
Preservation and explanation
Natural-language argument
The status above describes the Lean proof. Its explanatory prose may remain a sketch after that proof closes.
Explanatory prose status
Prose retained as authored. The explanatory prose is preserved as it stood when captured.
Preservation argument
Claim
Str s satisfying
\mathsf{DecimalGoalVocabularyDefault.sourceString}(s), the configured Rust
str it represents has exactly those complete ordered UTF-8 bytes.
Source str::as_bytes returns normally with an immutable shared slice
of precisely those bytes, and ModelStrAsBytes returns
ok of the identical ordered Aeneas Slice U8 s.
No lexical-validity, A/B, acceptance, rounding, or termination premise is used.Proof
as_bytes body are
retained, explicitly as predecessor evidence, in
reference/model-evidence/aeneas-string-bytes.txt;
the historical slice and shared-borrow representation is in
reference/model-evidence/aeneas-slice-observations.txt.
Their current applicability, unchanged executable/library/core-source
identities, exact raw signatures and Rust symbols, declaration digests and
support bindings, and complete current call inventory are independently
checked in
reference/model-evidence/P89_T1_PrimitiveApplicability.txt.
The current sole generated as_bytes call is
generated.lean:4567, at the beginning of
dec2flt_with_trace, corresponding to
crate/dec2flt/mod.rs:364. The fixed dispatcher frame of DispatchFrame retains the
same conversion, including when its helper components are abstract.Str := Slice U8, so its type alone overapproximates
Rust strings: it permits arbitrary bytes up to Usize.max.
The definition DecimalGoalVocabularyDefault restricts
sourceString to length at most
9223372036854775807=\mathtt{isize::MAX} and a witness Lean string whose
UTF-8 encoding is the entire byte list.
These are the configured Rust str representation conditions in
reference/model-evidence/source-valid-byte-slice.txt.
Consequently the claim covers every configured source string and no invalid
UTF-8 model string. A general source-valid Rust &[u8] needs only
the length bound of SourceValidByteSlice, not this UTF-8 witness.ok s;
its result retains the same list, length and subtype bound. In particular the
output is source-valid because the input already has the stricter
\mathtt{isize::MAX} bound. No pointer identity or mutation through the
returned borrow is observed at any subsequent dispatcher use.Result.bind cases recorded in the current evidence show, a
later failure/divergence is not turned into normal helper None or
Rust Err. Primitive infallibility is not complete-parser totality,
lexical acceptance, rounding correctness, or component inhabitability.
The claim makes no source preservation assertion for model Str
values outside sourceString, and imposes no UTF-8 premise on direct
helper GOALs that take byte slices rather than strings.
For the applications below the original constants are
A=3458764513820540928 and B=576460752303421440 bytes; public bounds
refer to the complete string before any sign stripping.Requirement: assembly correspondence
BiasedFp,
not a string, and has no transitive string conversion. This binding is
noninterfering with its required normal return and cast/shift/OR word equation.Requirement: classification determinism
Requirement: classification significand digit
Requirement: classification totality
as_bytes call or
total-classification assumption is introduced.Requirement: dispatch abstract composition
Requirement: dispatch component compliance
Requirement: exponent value agreement
Requirement: integer correct or defer
i64/u64 operands, not a
string, and has no conversion callee. Its on-normal deferral/rounding
alternatives are unaffected.Requirement: native correct or defer
Decimal and has no string
conversion, including on the disguised path. Its on-normal None/
Some, sign and many_digits observations are unchanged.Requirement: number helper acceptance
Some, including with overflow checks, is not assumed.Requirement: number helper accumulated value
Requirement: number helper record bounds
Requirement: number helper rejection
None retain their original meaning.Requirement: parser accumulated rounding
Requirement: parser equal target rounding
Requirement: parser exact rounding
Requirement: parser infinity
Requirement: parser invalid rejection
Err without panic is not presumed.Requirement: parser nan acceptance
Requirement: parser non nan results
Requirement: parser numeric acceptance
Ok without panic remains required, not assumed.Requirement: parser numeric sign
Requirement: parser selected exponent
Requirement: parser selected magnitude sign
Requirement: parser signed zero
Requirement: parser totality
Requirement: rounding determinism
Requirement: rounding totality
Requirement: slow accumulated rounding
Requirement: special helper infinity
Requirement: special helper nan
Requirement: special helper rejection
None retain their meanings with no UTF-8 premise.Proof structure
Follow the declared dependencies to read the supporting statements and proofs.
Uses
No declared dependencies.
Inspect related source (1)
- as_bytes · core/src/str/mod.rs:498 Rust library
Related source and models come from the extraction records and declared dependencies.
Proof assumptions and review
Lean checks the formal proof. Trellis also reviews how the statement corresponds to the intended requirement.
Transitive assumptions
- propext
This list combines the assumptions recorded for this declaration and its dependencies. It may include assumptions used by auxiliary declarations in those modules.
Helper theorems included
Technical checking records
Local closure summary
{
"node": "ModelStrAsBytes",
"closure_version": "patch_c_v1",
"active_decl_hash": "8021e96ef85ff3c69be4b89e2bcdd08beb0207aed3c1c3c141e633c44ade6981",
"active_statement_hash": "f2c07a8479b86f8e65e17874a1a1ac6d3d23b6e603a676dd49d6a90c93970974",
"kernel_axioms": [
"propext"
],
"toolchain_hash": "ce4c4e3d87434b9663f46de25ce34b48a0cf0d392e0a320a0787b4674a2d7b61",
"lean_executable_hash": "3e0d0d3d801675359f2d4cf9815bfdb417b20b92fdd9d48b3b14c95bbae28bbf",
"checker_script_hash": "c8e4a03273e23b9a8f2e141020652a4e0b7b0a8ab0883366ea9d031ca3f37aa1",
"approved_axioms_hash": "d5c04ffa333d9b33b238a527f5beaa2be82e021d3e9c0bbe01b1310280f7f55a",
"axcheck_status": "Agreed",
"accepted_at_snapshot_id": "worker-result-local-closure-issuance-cycle-68",
"boundary_theorems": {},
"strict_theorem_deps": {},
"strict_definition_deps": {}
}Prose assessment
{
"label": "Recorded Sound: VerifierPass",
"assessment_status": "VerifierPass",
"fingerprint_relation": "matches current fingerprint",
"assessment_fingerprint": "preservation-v1:19a0abb42e685585efa526b41f112b4e06366bc0110ea62d4695dd60168fa4b8",
"current_fingerprint": "preservation-v1:19a0abb42e685585efa526b41f112b4e06366bc0110ea62d4695dd60168fa4b8",
"superseded_for_theorem_closure": false
}Review verdicts
{
"corr_status": "Pass",
"sound_status": "Pass",
"substantiveness_status": "Pass"
}