Definition and explanation
This explanation was written alongside the formalization to describe the statement and its reasoning.
Definition
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: ModelSliceSplitFirst]
def ModelSliceSplitFirst {T : Type}
(s : Slice T) : Result (Option (T × Slice T)) :=
-- BODY
match h : s.val with
| [] => ok none
| x :: xs => ok (some (x, ⟨xs, by
have p := s.property
rw [h] at p
have p' : 1 + xs.length ≤ Usize.max := by
simpa [Nat.add_comm] using p
exact Nat.le_trans (Nat.le_add_left xs.length 1) p'⟩))
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
Slice Std.U8 value satisfying
SourceValidByteSlice and representing a Rust &[u8] in the
complete configured source domain, this binding returns Ok None for
the empty slice and otherwise returns Ok (Some (x, xs)), where
x is the same first byte returned by the source's shared reference and
xs is the same ordered tail returned by its shared subslice.Proof
&[u8] and adds no restriction
on its byte values. The pinned Aeneas definition represents a slice by its
complete ordered list. If that list is empty, both the binding and the pinned
Rust split_first body return None. If it is
x :: xs, the binding returns the head x and precisely the
ordered suffix xs; the Rust body returns shared references to that same
head and tail. These bodies are pinned in
reference/model-evidence/binary64-boundary.txt; the Aeneas commit,
slice representation, shared-borrow translation rule, extracted signature, and
complete call-site inventory are pinned in
reference/model-evidence/aeneas-slice-observations.txt.T = Std.U8. Aeneas represents the returned &u8 by the same
copied U8 value and the shared tail by that ordered byte suffix. All
call sites only read these results, so neither mutation nor reference identity
is observable; erasing lifetimes and aliasing is harmless.Requirement: assembly correspondence
biased_fp_to_float subject has no split-first call, so this binding is noninterfering.Requirement: classification determinism
Requirement: classification significand digit
Requirement: classification totality
Requirement: dispatch abstract composition
Requirement: dispatch component compliance
Requirement: exponent value agreement
Requirement: integer correct or defer
compute_float subject accepts integer values and has no split-first call, so the binding is noninterfering.Requirement: native correct or defer
try_fast_path subject accepts a Decimal and has no split-first call, so the binding is noninterfering.Requirement: number helper acceptance
Some acceptance.Requirement: number helper accumulated value
Requirement: number helper record bounds
Requirement: number helper rejection
None result.Requirement: parser accumulated rounding
Requirement: parser equal target rounding
Requirement: parser exact rounding
Requirement: parser infinity
None before the unchanged special path is selected.Requirement: parser invalid rejection
Some/None decision before invalid rejection.Requirement: parser nan acceptance
None branch that passes the unchanged body to the NaN helper.Requirement: parser non nan results
Requirement: parser numeric acceptance
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
parse_long_mantissa subject and its extracted callees contain no split-first call, so its full source-valid domain and result are unchanged.Requirement: special helper infinity
parse_inf_nan subject has no split-first call, so its byte-slice and separate-sign observations are unchanged.Requirement: special helper nan
parse_inf_nan subject has no split-first call, so its byte-slice and NaN observations are unchanged.Requirement: special helper rejection
parse_inf_nan subject has no split-first call, so its rejection observation on every source-valid byte slice is unchanged.Proof structure
Follow the declared dependencies to read the supporting statements and proofs.
Uses
No declared dependencies.
Used by
- NumberHelperAccumulatedValue
- NumberHelperLeadingPointSplit
- NumberHelperPartialAcceptanceSafeLength
- NumberHelperPartialNumberSafeLength
- NumberHelperRecordBounds
- NumberHelperScientificClassificationSourceLength
All 20 entries
- NumberHelperAccumulatedValue
- NumberHelperLeadingPointSplit
- NumberHelperPartialAcceptanceSafeLength
- NumberHelperPartialNumberSafeLength
- NumberHelperRecordBounds
- NumberHelperScientificClassificationSourceLength
- NumberHelperScientificExact
- NumberHelperScientificPrefixSafeLength
- NumberHelperScientificShortSuffixSafeLength
- NumberHelperScientificSignedSuffixSafeLength
- NumberHelperScientificSuffixSafeLength
- NumberHelperScientificTrailingByte
- NumberHelperSharpParseFailure
- NumberHelperSharpTrailingParseFailure
- NumberHelperTryParse19SafeLength
- ParserExactRoundingExecution
- ParserExactRounding Refutation
- ParserNumericRecordCertificate
- ParserSignedZero
- Preamble
Inspect related source (1)
- split_first · core/src/slice/mod.rs:198 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
- Classical.choice
- Quot.sound
- 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": "ModelSliceSplitFirst",
"closure_version": "patch_c_v1",
"active_decl_hash": "f2b66ed1eafca9de7351e962dd2a28ef015b982da6ac255c70d5e9623e05199e",
"active_statement_hash": "763bf8c37d808420d7fa7e74c84fccbd7ad86fb1abe6b4106e147a95d594e02c",
"kernel_axioms": [
"Classical.choice",
"Quot.sound",
"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-10",
"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:26b49c7c49d49814e1a51411bf568f7da00bae4f8bf32f6ec912937a0dfec17c",
"current_fingerprint": "preservation-v1:26b49c7c49d49814e1a51411bf568f7da00bae4f8bf32f6ec912937a0dfec17c",
"superseded_for_theorem_closure": false
}Review verdicts
{
"corr_status": "Pass",
"sound_status": "Pass",
"substantiveness_status": "Pass"
}