ModelU64Shl

Lean checked

Definition and explanation

This explanation was written alongside the formalization to describe the statement and its reasoning.

Definition

For every 64-bit word x and 32-bit unsigned count n, \mathsf{ModelU64Shl}(x,n) returns the bounded 64-bit left shift when n<64 and reports integer overflow otherwise.

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: ModelU64Shl]
def ModelU64Shl (x : Std.U64) (y : Std.U32) : Result Std.U64 :=
-- BODY
  x <<< y
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

For every 64-bit word and 32-bit count, this binding returns the bounded left shift when the count is below 64 and the checked overflow otherwise.

Proof

The complete source-to-model chain is pinned in reference/model-evidence/u64-shl.txt. A fresh inspect-native run identifies this exact external as Shl<u32> for u64, with signature Std.U64 -> Std.U32 -> Result Std.U64, its Rust source span, and its raw declaration hash. At that span the approved rust-src defines the method as self << other, instantiates it for u64/u32, and marks it rustc_inherit_overflow_checks. The frozen Cargo profiles enable overflow checks and use unwinding panics; a same-toolchain probe and MIR show the general dynamic-count guard n < 64, followed by the bounded u64 shift on success and the checked-overflow unwind edge otherwise.
At the pinned Aeneas revision, Std.U64 and Std.U32 are respectively 64- and 32-bit unsigned scalar carriers. The <<< instance resolves through UScalar.shiftLeft_UScalar to a branch on the count's full unsigned value. Below 64 it returns ok of BitVec.shiftLeft; the pinned scalar specification and bit-vector lemmas identify its value as the mathematical left shift modulo 2^{64} and its bits as the exact zero-filled, high-bit-truncated 64-bit shift. At 64 or above it returns fail integerOverflow. Thus, case by case over every 32-bit count, the binding and Rust both produce the same bounded 64-bit result below 64, while the Rust checked-shift panic and the extracted Aeneas integerOverflow failure correspond at 64 and above. No source-reachability restriction is used.

Requirement: assembly correspondence

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: classification determinism

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: classification significand digit

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: classification totality

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: dispatch abstract composition

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: dispatch component compliance

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: exponent value agreement

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: integer correct or defer

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: native correct or defer

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: number helper acceptance

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: number helper accumulated value

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: number helper record bounds

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: number helper rejection

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser accumulated rounding

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser equal target rounding

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser exact rounding

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser infinity

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser invalid rejection

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser nan acceptance

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser non nan results

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser numeric acceptance

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser numeric sign

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser selected exponent

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser selected magnitude sign

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser signed zero

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser totality

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: rounding determinism

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: rounding totality

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: slow accumulated rounding

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: special helper infinity

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: special helper nan

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: special helper rejection

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Download Lean source · Download TeX source

Proof structure

Follow the declared dependencies to read the supporting statements and proofs.

Explore this dependency tree

Inspect related source (1)

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

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": "ModelU64Shl",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "af3e1ddec0b1b5d69f2bf89e1dec00f75c043e894b228aaea868964ca597e2ad",
  "active_statement_hash": "73dfede1469c6ce88823f354249a828aa534d05edda5aef5d1604ca2364b6887",
  "kernel_axioms": [],
  "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-1",
  "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:4fb4381366862f4b70450f0e8c40ca40cdb21ea07f1ac48de4c0bceae5923502",
  "current_fingerprint": "preservation-v1:4fb4381366862f4b70450f0e8c40ca40cdb21ea07f1ac48de4c0bceae5923502",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "sound_status": "Pass",
  "substantiveness_status": "Pass"
}