Statement
This explanation was written alongside the formalization to describe the statement and its reasoning.
Helper · Exact numeric record
first have the fixed eleven-zero, 19-byte word, and replicated
zero shape; let point be a point followed by first; and let
body be an ASCII zero followed by point. The extracted
parse_number operation returns the decimal record with exponent
-30, mantissa 1{,}000{,}000{,}000{,}000{,}000{,}080, negative flag false,
and many-digits flag true.Lean statement
Trellis authored these statements and proofs. Lean checks the formal proofs; the assumptions used by each proof are listed below.
import Tablet.ParserNumericManyDigitsCertificate
import Tablet.ParserNumericAdjustmentCertificate
import Tablet.NumberHelperDigitScanSourceLength
import Tablet.NumberHelperOffsetSourceLength
import Tablet.ModelSliceSplitFirst
import Tablet.num_imp_dec2flt_parse_parse_number
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxRecDepth 262144
set_option maxHeartbeats 2000000
namespace dec2flt_model
-- [TABLET NODE: ParserNumericRecordCertificate]
theorem ParserNumericRecordCertificate (body first point : Slice Std.U8)
(hfirst : first.val = List.replicate 11 48#u8 ++
[49#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
48#u8, 48#u8, 48#u8, 56#u8, 48#u8] ++
List.replicate 2147483618 48#u8)
(hpoint : point.val = 46#u8 :: first.val)
(hbody : body.val = 48#u8 :: point.val) :
num.imp.dec2flt.parse.parse_number body = ok (some {
exponent := (-30)#i64
mantissa := 1000000000000000080#u64
negative := false
many_digits := true }) := by
Proof
Natural-language proof
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.
Proof
first, one more for
point, and 2{,}147{,}483{,}650 for body. Apply
NumberHelperDigitScanSourceLength first to the leading zero of
body; the decimal point is the first nondigit, so the residual is
point. By NumberHelperOffsetSourceLength, that integral
scan has offset one. Splitting point exposes the point byte and
exactly first.first is one of the displayed ASCII digits. A second
application of NumberHelperDigitScanSourceLength therefore consumes
all of first and leaves the empty slice. Its offset from
first has value 2^{31}. This value is carried as the value of the
runtime 64-bit isize, rather than as a compile-time portable literal.
Checked negation gives -2^{31} and the checked cast to i64 preserves
it. Adding the integral offset gives total digit count 2^{31}+1; both
operations are within the 64-bit signed bounds fixed by
Assumptions.body is 2{,}147{,}483{,}650; its nonnegative checked cast to
usize equals the body length. The total digit count is nonzero and
greater than 19. Checked subtraction of 19 gives
2{,}147{,}483{,}630. By
ParserNumericAdjustmentCertificate, adjustment gives the positive
count 2{,}147{,}483{,}618, so the many-digit branch is taken. By
ParserNumericManyDigitsCertificate, that branch returns the claimed
mantissa and exponent. Thus the extracted partial parser returns the claimed
record paired with the full body length. Unfolding
num imp dec2flt parse parse number, its exact-length check succeeds,
which proves the stated result.Lean proof
have hfirstLen : first.val.length = 2147483648 := by
rw [hfirst]
simp only [List.length_append, List.length_replicate, List.length_cons,
List.length_nil]
have hpointLen : point.val.length = 2147483649 := by
rw [hpoint, List.length_cons, hfirstLen]
have hbodyLen : body.val.length = 2147483650 := by
rw [hbody, List.length_cons, hpointLen]
have hfirstDigits : forall b, List.Mem b first.val ->
48 <= b.val /\ b.val <= 57 := by
intro b hb
rw [hfirst] at hb
rcases List.mem_append.mp hb with hb | hb
· rcases List.mem_append.mp hb with hb | hb
· rw [List.mem_replicate] at hb
rcases hb with ⟨_, rfl⟩
norm_num
· simp only [List.mem_cons, List.not_mem_nil, or_false] at hb
rcases hb with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl |
rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl <;>
norm_num
· rw [List.mem_replicate] at hb
rcases hb with ⟨_, rfl⟩
norm_num
have hzeroDigit : forall b, List.Mem b ([48#u8] : List Std.U8) ->
48 <= b.val /\ b.val <= 57 := by
intro b hb
cases hb with
| head => norm_num
| tail _ hb => cases hb
have hpointNotDigit : forall b rest, point.val = b :: rest ->
Not (48 <= b.val /\ b.val <= 57) := by
intro b rest h
rw [hpoint] at h
simp only [List.cons.injEq] at h
rcases h with ⟨rfl, _⟩
norm_num
obtain ⟨initialValue, intEnd, hscan0, hintEndVal⟩ :=
NumberHelperDigitScanSourceLength body 0#u64 [48#u8] point.val
(by simpa [hbody]) hzeroDigit hpointNotDigit (by omega)
have hintEndEq : intEnd = point := (Slice.eq_iff _ _).2 hintEndVal
subst intEnd
obtain ⟨nDigits, hnDigits, hnDigitsVal⟩ :=
NumberHelperOffsetSourceLength body point (by omega) (by omega)
have hnDigitsEq : nDigits = 1#isize := by
apply IScalar.eq_of_val_eq
rw [hnDigitsVal, hbodyLen, hpointLen]
scalar_tac
subst nDigits
have hsplitPoint : core.slice.Slice.split_first point =
ok (some (46#u8, first)) := by
let point' : Slice Std.U8 := ⟨46#u8 :: first.val, by
rw [← hpoint]
exact point.property⟩
have hpointEq : point = point' := (Slice.eq_iff _ _).2 hpoint
rw [hpointEq]
simp [core.slice.Slice.split_first, dec2flt_model.ModelSliceSplitFirst,
point']
have hnilTail : forall b rest, ([] : List Std.U8) = b :: rest ->
Not (48 <= b.val /\ b.val <= 57) := by
intro b rest h
simp at h
obtain ⟨fractionValue, fractionEnd, hscan1, hfractionEndVal⟩ :=
NumberHelperDigitScanSourceLength first initialValue first.val []
(by simp) hfirstDigits hnilTail (by omega)
let empty : Slice Std.U8 := ⟨[], by simp⟩
have hfractionEndEq : fractionEnd = empty :=
(Slice.eq_iff _ _).2 (by simpa [empty] using hfractionEndVal)
subst fractionEnd
obtain ⟨nAfter, hnAfter, hnAfterVal⟩ :=
NumberHelperOffsetSourceLength first empty (by omega) (by simp [empty])
have hnAfterValExact : nAfter.val = 2147483648 := by
rw [hnAfterVal, hfirstLen]
simp [empty]
have hnAfterNotMin : nAfter ≠ IScalar.min .Isize := by
rw [hnAfterValExact]
simp [IScalar.min, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits]
obtain ⟨negAfter, hneg, hnegVal⟩ := Aeneas.Std.WP.spec_imp_exists
(HNeg.hNeg.step nAfter hnAfterNotMin)
have hnegAfterEq : negAfter = (-2147483648)#isize := by
apply IScalar.eq_of_val_eq
rw [hnegVal, hnAfterValExact]
scalar_tac
subst negAfter
have hcastExp : lift (IScalar.cast .I64 ((-2147483648)#isize)) =
ok (-2147483648)#i64 := by
have hc := IScalar.cast_inBounds_spec .I64 ((-2147483648)#isize) (by
constructor
· rw [IScalar.min_IScalarTy_I64_eq, I64.min_eq]
scalar_tac
· rw [IScalar.max_IScalarTy_I64_eq, I64.max_eq]
scalar_tac)
obtain ⟨z, hz, hzval⟩ := Aeneas.Std.WP.spec_imp_exists hc
rw [hz]
congr 2
apply IScalar.eq_of_val_eq
simpa using hzval
have haddBounds : IScalar.min .Isize ≤ (1#isize).val + nAfter.val /\
(1#isize).val + nAfter.val ≤ IScalar.max .Isize := by
simp [IScalar.min, IScalar.max, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits, hnAfterValExact]
obtain ⟨totalDigits, haddDigits, htotalDigitsVal⟩ :=
Aeneas.Std.WP.spec_imp_exists
(IScalar.add_spec haddBounds.1 haddBounds.2)
have htotalDigitsValExact : totalDigits.val = 2147483649 := by
norm_num at htotalDigitsVal
omega
have hsplitEmpty : core.slice.Slice.split_first empty = ok none := by
simp [core.slice.Slice.split_first, dec2flt_model.ModelSliceSplitFirst,
empty]
obtain ⟨fullOffset, hfullOffset, hfullOffsetVal⟩ :=
NumberHelperOffsetSourceLength body empty (by omega) (by simp [empty])
have hfullOffsetValExact : fullOffset.val = 2147483650 := by
rw [hfullOffsetVal, hbodyLen]
simp [empty]
have hfullCastBounds : 0 ≤ fullOffset.val /\
fullOffset.val ≤ UScalar.max .Usize := by
rw [hfullOffsetValExact]
simp [UScalar.max, Dec2Flt.configured_x86_64_numBits]
obtain ⟨fullLen, hcastLen0, hfullLenVal⟩ :=
Aeneas.Std.WP.spec_imp_exists
(IScalar.hcast_inBounds_spec .Usize fullOffset hfullCastBounds)
have hfullLenEq : fullLen = Slice.len body := by
apply UScalar.eq_of_val_eq
rw [hfullOffsetVal] at hfullLenVal
simpa [empty, Slice.len_val] using hfullLenVal
subst fullLen
have hcastLen : lift (IScalar.hcast .Usize fullOffset) =
ok (Slice.len body) := by simpa [Aeneas.Std.lift] using hcastLen0
have htotalNonzero : ¬ totalDigits.val = 0 := by
rw [htotalDigitsValExact]
omega
have htotalLarge : ¬ totalDigits.val ≤ 19 := by
rw [htotalDigitsValExact]
omega
have hsubBounds : IScalar.min .Isize ≤
totalDigits.val - (19#isize).val /\
totalDigits.val - (19#isize).val ≤ IScalar.max .Isize := by
simp [IScalar.min, IScalar.max, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits, htotalDigitsValExact]
obtain ⟨moreDigits, hsubDigits0, hmoreDigitsVal⟩ :=
Aeneas.Std.WP.spec_imp_exists
(IScalar.sub_spec hsubBounds.1 hsubBounds.2)
have hmoreDigitsEq : moreDigits = 2147483630#isize := by
apply IScalar.eq_of_val_eq
norm_num at hmoreDigitsVal
rw [htotalDigitsValExact] at hmoreDigitsVal
simpa using hmoreDigitsVal
subst moreDigits
have hsubDigits : totalDigits - 19#isize =
ok 2147483630#isize := hsubDigits0
have hadjust := ParserNumericAdjustmentCertificate body
([48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
48#u8, 48#u8, 56#u8, 48#u8] ++
List.replicate 2147483618 48#u8) (by
rw [hbody, hpoint, hfirst]
simp only [List.cons_append, List.append_assoc]
rfl)
have hmany := ParserNumericManyDigitsCertificate body first point
hfirst hpoint hbody
let pointPhase :=
(match (46#u8 : Std.U8) with
| 46#uscalar =>
ok (empty, fractionValue, nAfter, (-2147483648)#i64)
| _ => ok (point, initialValue, 0#isize, 0#i64))
have hpointMatch : pointPhase =
ok (empty, fractionValue, nAfter, (-2147483648)#i64) := by
rfl
have hpartial : num.imp.dec2flt.parse.parse_partial_number body =
ok (some ({
exponent := (-30)#i64
mantissa := 1000000000000000080#u64
negative := false
many_digits := true }, Slice.len body)) := by
unfold num.imp.dec2flt.parse.parse_partial_number
simp [hbody, hscan0, hnDigits, hsplitPoint, hscan1, hnAfter,
hneg, hcastExp]
change (do let x ← pointPhase; _) = _
rw [hpointMatch]
simp [haddDigits, hsplitEmpty, hfullOffset, hcastLen,
htotalNonzero, htotalLarge, hsubDigits, hadjust, hmany]
unfold num.imp.dec2flt.parse.parse_number
simp [hpartial]
end dec2flt_model
Download Lean source · Download TeX source
Complete Lean module
import Tablet.ParserNumericManyDigitsCertificate
import Tablet.ParserNumericAdjustmentCertificate
import Tablet.NumberHelperDigitScanSourceLength
import Tablet.NumberHelperOffsetSourceLength
import Tablet.ModelSliceSplitFirst
import Tablet.num_imp_dec2flt_parse_parse_number
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxRecDepth 262144
set_option maxHeartbeats 2000000
namespace dec2flt_model
-- [TABLET NODE: ParserNumericRecordCertificate]
theorem ParserNumericRecordCertificate (body first point : Slice Std.U8)
(hfirst : first.val = List.replicate 11 48#u8 ++
[49#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
48#u8, 48#u8, 48#u8, 56#u8, 48#u8] ++
List.replicate 2147483618 48#u8)
(hpoint : point.val = 46#u8 :: first.val)
(hbody : body.val = 48#u8 :: point.val) :
num.imp.dec2flt.parse.parse_number body = ok (some {
exponent := (-30)#i64
mantissa := 1000000000000000080#u64
negative := false
many_digits := true }) := by
-- BODY
have hfirstLen : first.val.length = 2147483648 := by
rw [hfirst]
simp only [List.length_append, List.length_replicate, List.length_cons,
List.length_nil]
have hpointLen : point.val.length = 2147483649 := by
rw [hpoint, List.length_cons, hfirstLen]
have hbodyLen : body.val.length = 2147483650 := by
rw [hbody, List.length_cons, hpointLen]
have hfirstDigits : forall b, List.Mem b first.val ->
48 <= b.val /\ b.val <= 57 := by
intro b hb
rw [hfirst] at hb
rcases List.mem_append.mp hb with hb | hb
· rcases List.mem_append.mp hb with hb | hb
· rw [List.mem_replicate] at hb
rcases hb with ⟨_, rfl⟩
norm_num
· simp only [List.mem_cons, List.not_mem_nil, or_false] at hb
rcases hb with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl |
rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl <;>
norm_num
· rw [List.mem_replicate] at hb
rcases hb with ⟨_, rfl⟩
norm_num
have hzeroDigit : forall b, List.Mem b ([48#u8] : List Std.U8) ->
48 <= b.val /\ b.val <= 57 := by
intro b hb
cases hb with
| head => norm_num
| tail _ hb => cases hb
have hpointNotDigit : forall b rest, point.val = b :: rest ->
Not (48 <= b.val /\ b.val <= 57) := by
intro b rest h
rw [hpoint] at h
simp only [List.cons.injEq] at h
rcases h with ⟨rfl, _⟩
norm_num
obtain ⟨initialValue, intEnd, hscan0, hintEndVal⟩ :=
NumberHelperDigitScanSourceLength body 0#u64 [48#u8] point.val
(by simpa [hbody]) hzeroDigit hpointNotDigit (by omega)
have hintEndEq : intEnd = point := (Slice.eq_iff _ _).2 hintEndVal
subst intEnd
obtain ⟨nDigits, hnDigits, hnDigitsVal⟩ :=
NumberHelperOffsetSourceLength body point (by omega) (by omega)
have hnDigitsEq : nDigits = 1#isize := by
apply IScalar.eq_of_val_eq
rw [hnDigitsVal, hbodyLen, hpointLen]
scalar_tac
subst nDigits
have hsplitPoint : core.slice.Slice.split_first point =
ok (some (46#u8, first)) := by
let point' : Slice Std.U8 := ⟨46#u8 :: first.val, by
rw [← hpoint]
exact point.property⟩
have hpointEq : point = point' := (Slice.eq_iff _ _).2 hpoint
rw [hpointEq]
simp [core.slice.Slice.split_first, dec2flt_model.ModelSliceSplitFirst,
point']
have hnilTail : forall b rest, ([] : List Std.U8) = b :: rest ->
Not (48 <= b.val /\ b.val <= 57) := by
intro b rest h
simp at h
obtain ⟨fractionValue, fractionEnd, hscan1, hfractionEndVal⟩ :=
NumberHelperDigitScanSourceLength first initialValue first.val []
(by simp) hfirstDigits hnilTail (by omega)
let empty : Slice Std.U8 := ⟨[], by simp⟩
have hfractionEndEq : fractionEnd = empty :=
(Slice.eq_iff _ _).2 (by simpa [empty] using hfractionEndVal)
subst fractionEnd
obtain ⟨nAfter, hnAfter, hnAfterVal⟩ :=
NumberHelperOffsetSourceLength first empty (by omega) (by simp [empty])
have hnAfterValExact : nAfter.val = 2147483648 := by
rw [hnAfterVal, hfirstLen]
simp [empty]
have hnAfterNotMin : nAfter ≠ IScalar.min .Isize := by
rw [hnAfterValExact]
simp [IScalar.min, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits]
obtain ⟨negAfter, hneg, hnegVal⟩ := Aeneas.Std.WP.spec_imp_exists
(HNeg.hNeg.step nAfter hnAfterNotMin)
have hnegAfterEq : negAfter = (-2147483648)#isize := by
apply IScalar.eq_of_val_eq
rw [hnegVal, hnAfterValExact]
scalar_tac
subst negAfter
have hcastExp : lift (IScalar.cast .I64 ((-2147483648)#isize)) =
ok (-2147483648)#i64 := by
have hc := IScalar.cast_inBounds_spec .I64 ((-2147483648)#isize) (by
constructor
· rw [IScalar.min_IScalarTy_I64_eq, I64.min_eq]
scalar_tac
· rw [IScalar.max_IScalarTy_I64_eq, I64.max_eq]
scalar_tac)
obtain ⟨z, hz, hzval⟩ := Aeneas.Std.WP.spec_imp_exists hc
rw [hz]
congr 2
apply IScalar.eq_of_val_eq
simpa using hzval
have haddBounds : IScalar.min .Isize ≤ (1#isize).val + nAfter.val /\
(1#isize).val + nAfter.val ≤ IScalar.max .Isize := by
simp [IScalar.min, IScalar.max, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits, hnAfterValExact]
obtain ⟨totalDigits, haddDigits, htotalDigitsVal⟩ :=
Aeneas.Std.WP.spec_imp_exists
(IScalar.add_spec haddBounds.1 haddBounds.2)
have htotalDigitsValExact : totalDigits.val = 2147483649 := by
norm_num at htotalDigitsVal
omega
have hsplitEmpty : core.slice.Slice.split_first empty = ok none := by
simp [core.slice.Slice.split_first, dec2flt_model.ModelSliceSplitFirst,
empty]
obtain ⟨fullOffset, hfullOffset, hfullOffsetVal⟩ :=
NumberHelperOffsetSourceLength body empty (by omega) (by simp [empty])
have hfullOffsetValExact : fullOffset.val = 2147483650 := by
rw [hfullOffsetVal, hbodyLen]
simp [empty]
have hfullCastBounds : 0 ≤ fullOffset.val /\
fullOffset.val ≤ UScalar.max .Usize := by
rw [hfullOffsetValExact]
simp [UScalar.max, Dec2Flt.configured_x86_64_numBits]
obtain ⟨fullLen, hcastLen0, hfullLenVal⟩ :=
Aeneas.Std.WP.spec_imp_exists
(IScalar.hcast_inBounds_spec .Usize fullOffset hfullCastBounds)
have hfullLenEq : fullLen = Slice.len body := by
apply UScalar.eq_of_val_eq
rw [hfullOffsetVal] at hfullLenVal
simpa [empty, Slice.len_val] using hfullLenVal
subst fullLen
have hcastLen : lift (IScalar.hcast .Usize fullOffset) =
ok (Slice.len body) := by simpa [Aeneas.Std.lift] using hcastLen0
have htotalNonzero : ¬ totalDigits.val = 0 := by
rw [htotalDigitsValExact]
omega
have htotalLarge : ¬ totalDigits.val ≤ 19 := by
rw [htotalDigitsValExact]
omega
have hsubBounds : IScalar.min .Isize ≤
totalDigits.val - (19#isize).val /\
totalDigits.val - (19#isize).val ≤ IScalar.max .Isize := by
simp [IScalar.min, IScalar.max, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits, htotalDigitsValExact]
obtain ⟨moreDigits, hsubDigits0, hmoreDigitsVal⟩ :=
Aeneas.Std.WP.spec_imp_exists
(IScalar.sub_spec hsubBounds.1 hsubBounds.2)
have hmoreDigitsEq : moreDigits = 2147483630#isize := by
apply IScalar.eq_of_val_eq
norm_num at hmoreDigitsVal
rw [htotalDigitsValExact] at hmoreDigitsVal
simpa using hmoreDigitsVal
subst moreDigits
have hsubDigits : totalDigits - 19#isize =
ok 2147483630#isize := hsubDigits0
have hadjust := ParserNumericAdjustmentCertificate body
([48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
48#u8, 48#u8, 56#u8, 48#u8] ++
List.replicate 2147483618 48#u8) (by
rw [hbody, hpoint, hfirst]
simp only [List.cons_append, List.append_assoc]
rfl)
have hmany := ParserNumericManyDigitsCertificate body first point
hfirst hpoint hbody
let pointPhase :=
(match (46#u8 : Std.U8) with
| 46#uscalar =>
ok (empty, fractionValue, nAfter, (-2147483648)#i64)
| _ => ok (point, initialValue, 0#isize, 0#i64))
have hpointMatch : pointPhase =
ok (empty, fractionValue, nAfter, (-2147483648)#i64) := by
rfl
have hpartial : num.imp.dec2flt.parse.parse_partial_number body =
ok (some ({
exponent := (-30)#i64
mantissa := 1000000000000000080#u64
negative := false
many_digits := true }, Slice.len body)) := by
unfold num.imp.dec2flt.parse.parse_partial_number
simp [hbody, hscan0, hnDigits, hsplitPoint, hscan1, hnAfter,
hneg, hcastExp]
change (do let x ← pointPhase; _) = _
rw [hpointMatch]
simp [haddDigits, hsplitEmpty, hfullOffset, hcastLen,
htotalNonzero, htotalLarge, hsubDigits, hadjust, hmany]
unfold num.imp.dec2flt.parse.parse_number
simp [hpartial]
end dec2flt_model
Proof structure
Follow the declared dependencies to read the supporting statements and proofs.
Uses
Inspect related source (69)
- parse_number · dec2flt/parse.rs:231 Program Rust
- offset_from · dec2flt/common.rs:30 Program Rust
- read_u64 · dec2flt/common.rs:18 Program Rust
More program dependencies (36)
- is_8digits · dec2flt/common.rs:40 Program Rust
- Decimal · dec2flt/decimal.rs:32 Program Rust
- parse_8digits · dec2flt/parse.rs:18 Program Rust
- parse_many_digits · dec2flt/parse.rs:104 Program Rust
- parse_partial_number · dec2flt/parse.rs:161 Program Rust
- try_parse_digits · dec2flt/parse.rs:30 Program Rust
- try_parse_digits_loop0 · dec2flt/parse.rs:33 Program Rust
- body · dec2flt/parse.rs:33 Program Rust
- try_parse_digits_loop1 · dec2flt/parse.rs:50 Program Rust
- body · dec2flt/parse.rs:50 Program Rust
- from_u64 · dec2flt/mod.rs:263 Program Rust
- FloatErrorKind · num/mod.rs:18 Program Rust
- ParseFloatError · num/mod.rs:13 Program Rust
- Dec2FltAssemblyTrace · dec2flt/mod.rs:329 Program Rust
- Dec2FltTrace · dec2flt/mod.rs:295 Program Rust
- Lemire · dec2flt/mod.rs:115 Program Rust
- BiasedFp · dec2flt/common.rs:52 Program Rust
- ByteSlice · dec2flt/common.rs:4 Program Rust
- DecimalSeq · dec2flt/decimal_seq.rs:21 Program Rust
- MIN_19DIGIT_INT · dec2flt/parse.rs:8 Program Rust
- adjust_many_digit_count · dec2flt/parse.rs:86 Program Rust
- adjust_many_digit_count_loop · dec2flt/parse.rs:89 Program Rust
- body · dec2flt/parse.rs:89 Program Rust
- MASK · dec2flt/parse.rs:19 Program Rust
- MUL1 · dec2flt/parse.rs:20 Program Rust
- MUL2 · dec2flt/parse.rs:21 Program Rust
- parse_scientific · dec2flt/parse.rs:121 Program Rust
- parse_scientific_loop · dec2flt/parse.rs:142 Program Rust
- body · dec2flt/parse.rs:142 Program Rust
- try_parse_19digits · dec2flt/parse.rs:61 Program Rust
- try_parse_19digits_loop · dec2flt/parse.rs:64 Program Rust
- body · dec2flt/parse.rs:64 Program Rust
- CastInto · traits.rs:18 Program Rust
- Float · traits.rs:74 Program Rust
- FloatExt · traits.rs:170 Program Rust
- Int · traits.rs:27 Program Rust
Standard-library dependencies (30)
- split_first · core/src/slice/mod.rs:198 Rust library
- clone · core/src/clone.rs:698 Rust library
- div · core/src/ops/arith.rs:515 Rust library
- mul · core/src/ops/arith.rs:350 Rust library
- neg · core/src/ops/arith.rs:719 Rust library
- bitand · core/src/ops/bit.rs:178 Rust library
- bitor · core/src/ops/bit.rs:282 Rust library
- shl · core/src/ops/bit.rs:489 Rust library
- shr · core/src/ops/bit.rs:612 Rust library
- EXPONENT_MASK · core/src/num/f64.rs:615 Rust library
- INFINITY · core/src/num/f64.rs:512 Rust library
- MANTISSA_DIGITS · core/src/num/f64.rs:412 Rust library
- MANTISSA_MASK · core/src/num/f64.rs:637 Rust library
- NAN · core/src/num/f64.rs:509 Rust library
- NEG_INFINITY · core/src/num/f64.rs:515 Rust library
- classify · core/src/num/f64.rs:782 Rust library
- from_bits · core/src/num/f64.rs:1269 Rust library
- to_bits · core/src/num/f64.rs:1223 Rust library
- is_ascii_digit · core/src/num/mod.rs:958 Rust library
- from_residual · core/src/option.rs:2793 Rust library
- branch · core/src/option.rs:2779 Rust library
- first · core/src/slice/mod.rs:155 Rust library
- as_bytes · core/src/str/mod.rs:498 Rust library
- FpCategory · core/src/num/mod.rs:1522 Rust library
- Div · core/src/ops/arith.rs:460 Rust library
- Mul · core/src/ops/arith.rs:322 Rust library
- Neg · core/src/ops/arith.rs:690 Rust library
- BitOr · core/src/ops/bit.rs:254 Rust library
- Shl · core/src/ops/bit.rs:461 Rust library
- Shr · core/src/ops/bit.rs:584 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
- Dec2Flt.configured_x86_64_numBits
- 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
All 56 entries
- Binary64Model
- Binary64ModelDefault
- F64
- ModelF64Classify
- ModelF64Clone
- ModelF64Div
- ModelF64ExponentMask
- ModelF64FromBits
- ModelF64FromU64
- ModelF64Infinity
- ModelF64MantissaDigits
- ModelF64MantissaMask
- ModelF64Mul
- ModelF64Nan
- ModelF64Neg
- ModelF64NegInfinity
- ModelF64ToBits
- ModelOptionBranch
- ModelOptionFromResidual
- ModelSliceFirst
- ModelSliceSplitFirst
- ModelStrAsBytes
- ModelU64BitAnd
- ModelU64BitOr
- ModelU64Shl
- ModelU64Shr
- ModelU8IsAsciiDigit
- NumberHelperDigitScanSourceLength
- NumberHelperEightDigitWord
- NumberHelperOffsetSourceLength
- NumberHelperParseEightDigitsSafe
- NumberHelperReadEightBytes
- NumberHelperTryParse19SafeLength
- ParserNumericAdjustmentCertificate
- ParserNumericLeadingTry19Certificate
- ParserNumericManyDigitsCertificate
- ParserNumericRecordCertificate
- ParserNumericTry19Certificate
- Preamble
- SliceU8 Insts Dec2flt modelNumImpDec2fltCommonByteSlice offset from
- SliceU8 Insts Dec2flt modelNumImpDec2fltCommonByteSlice read u64
- core num FpCategory
- num imp dec2flt common is 8digits
- num imp dec2flt decimal Decimal
- num imp dec2flt parse MIN 19DIGIT INT
- num imp dec2flt parse adjust many digit count
- num imp dec2flt parse parse 8digits
- num imp dec2flt parse parse 8digits MASK
- num imp dec2flt parse parse 8digits MUL1
- num imp dec2flt parse parse 8digits MUL2
- num imp dec2flt parse parse many digits
- num imp dec2flt parse parse number
- num imp dec2flt parse parse partial number
- num imp dec2flt parse parse scientific
- num imp dec2flt parse try parse 19digits
- num imp dec2flt parse try parse digits
Technical checking records
Local closure summary
{
"node": "ParserNumericRecordCertificate",
"closure_version": "patch_c_v1",
"active_decl_hash": "136873f9730d71efeb47cde351e51894961f20d6352fee3d6952cdb0f62a62ee",
"active_statement_hash": "4df34300f33f44b090725b4668b431a4f964397c8327abe652321cb290090a13",
"kernel_axioms": [
"Classical.choice",
"Dec2Flt.configured_x86_64_numBits",
"Quot.sound",
"propext"
],
"toolchain_hash": "ce4c4e3d87434b9663f46de25ce34b48a0cf0d392e0a320a0787b4674a2d7b61",
"lean_executable_hash": "3e0d0d3d801675359f2d4cf9815bfdb417b20b92fdd9d48b3b14c95bbae28bbf",
"checker_script_hash": "c8e4a03273e23b9a8f2e141020652a4e0b7b0a8ab0883366ea9d031ca3f37aa1",
"approved_axioms_hash": "ab64d13f256386ee0e494a5abcc6a5db49512cf3d90bbdfcabd6327793a31f95",
"axcheck_status": "Agreed",
"accepted_at_snapshot_id": "worker-result-local-closure-issuance-cycle-126",
"boundary_theorems": {},
"strict_theorem_deps": {
"ModelSliceSplitFirst": "f617ee05dd2925a9",
"NumberHelperDigitScanSourceLength": "8892b939bba0ecf9",
"NumberHelperOffsetSourceLength": "de0168dfeba3b802",
"ParserNumericAdjustmentCertificate": "ac89a90ca662a92a",
"ParserNumericManyDigitsCertificate": "341fb91624188605",
"num_imp_dec2flt_parse_parse_partial_number": "854af4cc12136a58"
},
"strict_definition_deps": {
"Preamble": "7754ffaf671693bf",
"SliceU8_Insts_Dec2flt_modelNumImpDec2fltCommonByteSlice_offset_from": "7e7284dc9bc88830",
"num_imp_dec2flt_decimal_Decimal": "4da4ccbe640ef8e6",
"num_imp_dec2flt_parse_adjust_many_digit_count": "4e59e3776b6cfdaa",
"num_imp_dec2flt_parse_parse_many_digits": "50c9ef13b3ed7fe8",
"num_imp_dec2flt_parse_parse_number": "f73f8bc11faa6db3",
"num_imp_dec2flt_parse_parse_partial_number": "359d30eefc709c2a",
"num_imp_dec2flt_parse_parse_scientific": "447f722d5841d2c5",
"num_imp_dec2flt_parse_try_parse_digits": "238b4a73cd46fc56"
}
}Prose assessment
{
"label": "Lean proof closed; predictive prose review no longer required",
"assessment_status": null,
"fingerprint_relation": "unknown",
"assessment_fingerprint": null,
"current_fingerprint": "sound-v2:3acb0b13ac09a2f92e124ca47393ad28dec7626e86c7683ab0fe031b4a79a0ff",
"superseded_for_theorem_closure": false
}Review verdicts
{
"corr_status": "Pass",
"substantiveness_status": "Pass"
}