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: ModelSliceFirst]
def ModelSliceFirst {T : Type} (s : Slice T) : Result (Option T) :=
-- BODY
ok s.val.head?
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), where x
is the same first byte that the source returns by shared reference.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 first body return None. If it is x :: xs, the
binding returns Some x, while the Rust body returns a shared reference
to that same head. 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.
Every frozen call infers T = Std.U8. Aeneas therefore represents the
returned &u8 by the same copied U8 value. All such call
sites only read that byte, so neither mutable state nor reference identity is
observable; erasing its lifetime and aliasing information is harmless. The
input ordered list is unchanged in both cases.Requirement: assembly correspondence
biased_fp_to_float subject has no slice-first call, so this binding is noninterfering.Requirement: classification determinism
Requirement: classification significand digit
Requirement: classification totality
Requirement: dispatch abstract composition
Std.U8 body. The proved empty/head correspondence preserves exactly the branch input used by abstract composition.Requirement: dispatch component compliance
Requirement: exponent value agreement
Requirement: integer correct or defer
compute_float subject accepts integer values and has no slice-first call, so the binding is noninterfering.Requirement: native correct or defer
try_fast_path subject accepts a Decimal and has no slice-first call, so the binding is noninterfering.Requirement: number helper acceptance
parse_number subject has no first call; its slice observations are therefore unchanged by this binding.Requirement: number helper accumulated value
parse_number subject has no first call; its returned record and accumulated value are therefore unchanged by this binding.Requirement: number helper record bounds
parse_number subject has no first call, so this binding neither narrows its SourceValidByteSlice domain nor changes a returned record.Requirement: number helper rejection
parse_number subject has no first call; its None observations are therefore unchanged by this binding.Requirement: parser accumulated rounding
Requirement: parser equal target rounding
Requirement: parser exact rounding
Requirement: parser infinity
Requirement: parser invalid rejection
Requirement: parser nan acceptance
Requirement: parser non nan results
Requirement: parser numeric acceptance
Requirement: parser numeric sign
+ or - and records the negative flag.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 has no slice-first call, so its full source-valid slice domain and result are unchanged.Requirement: special helper infinity
parse_inf_nan subject has no slice-first call, so its byte-slice and separate-sign observations are unchanged.Requirement: special helper nan
parse_inf_nan subject has no slice-first call, so its byte-slice and NaN observations are unchanged.Requirement: special helper rejection
parse_inf_nan subject has no slice-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
- InvalidOverflowBoundaryWitness
- ParserAccumulatedRounding
- ParserExactRoundingExecution
- ParserExactRounding Refutation
- ParserInfinity
- ParserInvalidRejectionSafeLength
All 15 entries
- InvalidOverflowBoundaryWitness
- ParserAccumulatedRounding
- ParserExactRoundingExecution
- ParserExactRounding Refutation
- ParserInfinity
- ParserInvalidRejectionSafeLength
- ParserNanAcceptance
- ParserNonNanResults
- ParserNumericAcceptance Refutation
- ParserNumericOverflowPropagation
- ParserNumericPublicOverflowWitness
- ParserNumericSign
- ParserNumericTraceShape
- ParserSignedZero
- Preamble
Inspect related source (1)
- first · core/src/slice/mod.rs:155 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": "ModelSliceFirst",
"closure_version": "patch_c_v1",
"active_decl_hash": "f38dbcad0a84ab884eec3f16d86eb111712b828a19dccf0bf5974d6d1e02bd18",
"active_statement_hash": "335139a4afbfb70e58bb0bcb1244b046933cf859037e19598e254e40a3e50024",
"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-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:613b2edd8feaccbb058727b693d4737fa58dfa7db6665e3ee2272038e963e6c7",
"current_fingerprint": "preservation-v1:613b2edd8feaccbb058727b693d4737fa58dfa7db6665e3ee2272038e963e6c7",
"superseded_for_theorem_closure": false
}Review verdicts
{
"corr_status": "Pass",
"sound_status": "Pass",
"substantiveness_status": "Pass"
}