Statement
This explanation was written alongside the formalization to describe the statement and its reasoning.
Theorem
Lean statement
Trellis authored these statements and proofs. Lean checks the formal proofs; the assumptions used by each proof are listed below.
import Tablet.DecimalGoalVocabularyDefault
import Tablet.Assumptions
import Tablet.ModelF64MantissaDigits
import Tablet.ModelU64BitAnd
import Tablet.ModelU64BitOr
import Tablet.ModelU64Shl
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64
import Tablet.F64_Insts_CoreOpsArithDivF64F64
import Tablet.F64_Insts_CoreOpsArithMulF64F64
import Tablet.F64_Insts_CoreOpsArithNegF64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatExtU64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_BITS
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_LARGEST_POWER_OF_TEN
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_MAX_EXPONENT_ROUND_TO_EVEN
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_MIN_EXPONENT_ROUND_TO_EVEN
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SIG_TOTAL_BITS
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SMALLEST_POWER_OF_TEN
import Tablet.num_imp_dec2flt_Dec2FltAssemblyTrace
import Tablet.num_imp_dec2flt_Dec2FltTrace
import Tablet.num_imp_dec2flt_dec2flt
import Tablet.num_imp_dec2flt_dec2flt_with_trace
import Tablet.num_imp_dec2flt_parse_parse_number
import Tablet.num_imp_dec2flt_parse_parse_inf_nan
import Tablet.num_imp_dec2flt_decimal_Decimal_try_fast_path
import Tablet.num_imp_dec2flt_common_BiasedFp
import Tablet.num_imp_dec2flt_common_BiasedFp_Insts_CoreCmpPartialEqBiasedFp_eq
import Tablet.num_imp_dec2flt_common_BiasedFp_zero_pow2
import Tablet.num_imp_dec2flt_decimal_seq_DecimalSeq_left_shift
import Tablet.num_imp_dec2flt_decimal_seq_DecimalSeq_right_shift
import Tablet.num_imp_dec2flt_decimal_seq_DecimalSeq_round
import Tablet.num_imp_dec2flt_decimal_seq_parse_decimal_seq
import Tablet.num_imp_dec2flt_lemire_compute_float
import Tablet.num_imp_dec2flt_lemire_compute_product_approx
import Tablet.num_imp_dec2flt_lemire_full_multiplication
import Tablet.num_imp_dec2flt_lemire_power
import Tablet.num_imp_dec2flt_slow_parse_long_mantissa
import Tablet.num_imp_dec2flt_slow_parse_long_mantissa_MAX_SHIFT
import Tablet.num_imp_dec2flt_slow_parse_long_mantissa_closure_Insts_CoreOpsFunctionFnTupleUsizeUsize_call
import Tablet.num_imp_dec2flt_table_LARGEST_POWER_OF_FIVE
import Tablet.num_imp_dec2flt_table_POWER_OF_FIVE_128
import Tablet.num_imp_dec2flt_table_SMALLEST_POWER_OF_FIVE
import Tablet.num_imp_traits_Float_EXP_BIAS_default
import Tablet.num_imp_traits_Float_EXP_BITS_default
import Tablet.num_imp_traits_Float_EXP_MIN_default
import Tablet.num_imp_traits_Float_EXP_SAT_default
import Tablet.num_imp_traits_Float_INFINITE_POWER_default
import Tablet.num_imp_traits_Float_SIG_BITS_default
import Tablet.num_imp_dec2flt_biased_fp_to_float
import Tablet.ParserComputeFloatExponentRange
import Tablet.ParserSlowExponentRange
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: ParserSelectedExponent]
theorem ParserSelectedExponent :
∀ (s : Str) (f : F64) (tr : num.imp.dec2flt.Dec2FltAssemblyTrace F64),
DecimalGoalVocabularyDefault.sourceString s ->
num.imp.dec2flt.dec2flt_with_trace
F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64
F64.Insts.CoreOpsArithDivF64F64 F64.Insts.CoreOpsArithMulF64F64
F64.Insts.CoreOpsArithNegF64 s =
ok (core.result.Result.Ok f, num.imp.dec2flt.Dec2FltTrace.Assembled tr) ->
0 <= tr.selected_pair.p_biased.val ∧ tr.selected_pair.p_biased.val <= 2047 := 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
Float component reached through the
traitsFloatExtInst field of
F64 Insts Dec2flt modelNumImpDec2fltLemireU64. By
F64 Insts Dec2flt modelNumImpTraitsFloatExtU64 that component is
exactly F64 Insts Dec2flt modelNumImpTraitsFloatU64. We first
evaluate the f64 constants used below. By
F64 Insts Dec2flt modelNumImpTraitsFloatU64 BITS,
BITS=64. The declaration
F64 Insts Dec2flt modelNumImpTraitsFloatU64 SIG TOTAL BITS calls the
operation ModelF64MantissaDigits, which returns 53. Thus the
checked subtraction in num imp traits Float SIG BITS default is
53-1=52, and SIG_BITS=52. The two checked subtractions in
num imp traits Float EXP BITS default are 64-52=12 and
12-1=11, so EXP_BITS=11. In
num imp traits Float EXP SAT default, the shift count 11 is below
the 32-bit width, 1\mathbin{\mathtt{<<}}11=2048, and the following checked
subtraction gives EXP_SAT=2047. Hence
num imp traits Float INFINITE POWER default casts the in-range
unsigned value 2047 to the signed value 2047, while
num imp traits Float EXP BIAS default shifts 2047 right once and
gives 1023. Finally num imp traits Float EXP MIN default casts
1023 exactly, subtracts one without overflow, and negates 1022, giving
EXP_MIN=-1022. These computations also show that every monadic
operation in the constant chain succeeds. The other f64 constants which are
read in the integer converter are -342, 308, -4, and 23 by
F64 Insts Dec2flt modelNumImpTraitsFloatU64 SMALLEST POWER OF TEN,
F64 Insts Dec2flt modelNumImpTraitsFloatU64 LARGEST POWER OF TEN,
F64 Insts Dec2flt modelNumImpTraitsFloatU64 MIN EXPONENT ROUND TO EVEN,
and
F64 Insts Dec2flt modelNumImpTraitsFloatU64 MAX EXPONENT ROUND TO EVEN.m and
p_biased. The three eager calls to
num imp dec2flt common BiasedFp zero pow2 produce, respectively,
fp_0=(0,0), fp_\infty=(0,2047), and fp_{\rm error}=(0,-1); this accounts
for the zero-mantissa return, the two decimal-cutoff returns, and the
approximation-error return. If none of those returns is taken, then w\ne0
and -342\leq q\leq308. Consequently its leading-zero count is in
0,\ldots,63, normalization shifts by a legal count, the cast of
SIG_BITS to usize is 52, and the checked precision
addition is 52+3=55. The identical table bounds -342 and 308 in
num imp dec2flt table SMALLEST POWER OF FIVE and
num imp dec2flt table LARGEST POWER OF FIVE, together with the
651-entry declaration
num imp dec2flt table POWER OF FIVE 128, show that
num imp dec2flt lemire compute product approx receives a legal
precision and a table index q-(-342) in 0,\ldots,650. Its mask shift is
therefore legal. The two widening casts and 128-bit product in
num imp dec2flt lemire full multiplication are exact because the
product of two 64-bit words fits in 128 bits; its shift by 64 is legal. A
possible checked increment of the returned high limb, and every operation in
the product approximation which could nevertheless fail, is bound through
the surrounding result monad: such a failure would make the assumed
compute_float equation a failure rather than ok b. No
range conclusion below is inferred from a value on such a failing branch.lo = u64::MAX test when the additional
-27\leq q\leq55 test succeeds, and one below its false branch. They are
textually identical, so we check both by checking that common block. Shifting
the high product limb right by 63 is legal and yields an
upperbit in \{0,1\}. Its cast to i32 is exact;
64+\texttt{upperbit} is 64 or 65; and the checked subtractions of 52 and 3
give the legal mantissa shift 9 or 10. The cast of q from i64 to
i32 is exact because -342\leq q\leq308. In
num imp dec2flt lemire power, the checked constant addition is
152170+65536=217706, the product with q lies between -74455452 and
67053448 and hence the wrapping product equals the mathematical product,
the shift by 16 is legal, and adding 63 gives a value between -1074 and
1086. Adding upperbit, casting the leading-zero count exactly,
subtracting that count, subtracting EXP_MIN=-1022, and adding one
therefore keep the intermediate power2 between -114 and 2110.
All those signed additions and subtractions are consequently in range. This
discharges the casts, shifts, and checked arithmetic through the
power2 test in each duplicated block.power2 <= 0, its checked negation is at most 114 and cannot be the
forbidden negation of i32::MIN. The following checked addition by
one is at most 115. A value at least 64 returns fp_0; otherwise the repeated
addition by one gives a shift count in 1,\ldots,63. The two right shifts,
by that count and by one, are legal; the conjunction with one is total by
ModelU64BitAnd; and if the intervening mantissa addition overflowed,
the result monad would preclude the assumed successful return. The shift
1\mathbin{\mathtt{<<}}52 is legal by ModelU64Shl. The returned
exponent is the signed cast of the Boolean comparison, hence exactly zero or
one.power2 > 0, all round-to-even subbranches alter only the
mantissa. Their casts of -4 and 23 to i64 are exact; the
conjunctions are total; and their shifts use the already established count 9
or 10. The final low-bit conjunction gives zero or one. A failing checked
mantissa increment again cannot occur on an ok path, and the
following right shift by one is legal because 1<64. The threshold
2\mathbin{\mathtt{<<}}52 and replacement 1\mathbin{\mathtt{<<}}52 use the
legal count 52. If rounding carries, the checked exponent increment is at
most 2111; otherwise the exponent remains power2. Clearing the
implicit bit uses one more legal shift by 52 and a total conjunction. The
last test compares this final exponent p with 2047. If p\geq2047 the
function returns fp_\infty; if not, it returns a record with
0<p<2047. This proves (1) in both duplicated branches, including every
ordinary, underflow, and sentinel return.some, or, after a call through
num imp dec2flt slow parse long mantissa closure Insts CoreOpsFunctionFnTupleUsizeUsize call
and num imp dec2flt decimal seq DecimalSeq right shift, stores
exactly some fp_0 when the shifted decimal point is below the
negative range constant. Thus (3) is inductive. Every narrowing cast,
negation, exponent addition, shift-helper operation, array operation, or
decimal shift which fails makes the loop and hence the outer call fail; on a
successful transition the checked arithmetic has its displayed mathematical
meaning. Therefore a returned some from loop 0 is exactly fp_0.none; the only assignments to it occur
after either left-shift branch and assign exactly some fp_\infty.
The other iterations preserve it, and a body presented with some
terminates. The zero-index array read, sign change and cast of the decimal
point, closure call, casts of the shift, checked exponent subtraction, and
the calls to num imp dec2flt decimal seq DecimalSeq left shift are
all monadic predecessors of the loop result. A failure in any one is
therefore incompatible with a successful outer return. Hence a returned
some from loop 1 is exactly fp_\infty.done only when the test
EXP_MIN > exp2 is false, which is precisely
\texttt{exp2}\geq-1022. In the true branch the positive checked difference
-1022-\texttt{exp2} is cast to usize, capped by
num imp dec2flt slow parse long mantissa MAX SHIFT at 60, passed to
num imp dec2flt decimal seq DecimalSeq right shift, cast back
exactly from the interval 0,\ldots,60, and added to exp2 before a
cont. Any subtraction, cast, shift, or addition failure propagates,
so a successful loop return must eventually be a done return and
satisfies (5).SIG_BITS=52 to usize, the checked addition producing 53,
the decimal left shift by 53, and the call to
num imp dec2flt decimal seq DecimalSeq round must all succeed on the
assumed normal path. The shifts 1\mathbin{\mathtt{<<}}53 and
1\mathbin{\mathtt{<<}}52 are legal. Without a rounding carry, the returned
exponent is x or the successful checked value x-1, hence belongs to
[0,2046]. With a carry, the checked e'=e+1 is followed by a second
guard on
x'=e'-(-1022)+1=x+1. If x'\geq2047 it returns fp_\infty; otherwise
2\leq x'\leq2046, and the returned exponent is x' or x'-1, again in
[0,2046]. The mask subtractions from 2^{52} cannot underflow and the
final conjunctions are total. Any failing checked e+1, subtraction,
addition, decimal shift/round, scalar shift, or cast would propagate instead
of yielding the assumed ok b. This proves (2) with all direct,
loop-result, carrying, and noncarrying exits covered.EmptyInput and SignOnly; numeric
failure followed by special failure returns Invalid; numeric failure
followed by special success returns Special; and successful
try_fast_path returns FastPath. None can equal the assumed
Assembled tr. Hence
num imp dec2flt parse parse number returned some r and
num imp dec2flt decimal Decimal try fast path returned
none; the call to
num imp dec2flt parse parse inf nan is not made on this branch.many_digits is false, or its first exponent is negative, the second
guard is false and the post-comparison pair is the first pair. Otherwise the
checked addition r.\texttt{mantissa}+1 and the second integer call must both
succeed, since either failure would propagate and contradict the assumed
outer ok. The second result also satisfies (1). The comparison is
the total field comparison in
num imp dec2flt common BiasedFp Insts CoreCmpPartialEqBiasedFp eq.
If it reports equality the code retains the first pair; if it reports
inequality the record update retains the first mantissa and writes exponent
-1. Thus in every case the post-comparison exponent is -1 or is in
[0,2047].selected_pair has exponent in [0,2047]. The next
IScalar.hcast .U64 is a total sign-extending bit-vector cast, rather
than a range-checking cast; on the range just proved it nevertheless agrees
with the ordinary nonnegative conversion. The following shift uses the
already computed count 52, the OR is total by ModelU64BitOr, and any failure in those assembly
operations, num imp dec2flt biased fp to float, or final negation
would contradict the assumed successful result.Dec2FltTrace.Assembled records, placing that same local pair
in the selected_pair field. Constructor injectivity applied to the
assumed equality identifies the constructed record with tr, and hence
identifies its pair with tr.\texttt{selected_pair}. Transferring the range
proved above gives
0\leq tr.\texttt{selected_pair}.p_{\rm biased}\leq2047, as required. The
sourceString premise from DecimalGoalVocabularyDefault is
needed to state the supplied source-domain
goal faithfully but no additional lexical property is needed for this
model-internal range argument.Lean proof
intro s f tr hs h
have bind_ok_inv : ∀ {α β : Type} (r : Result α) (g : α → Result β) y,
Bind.bind r g = ok y → ∃ x, r = ok x ∧ g x = ok y := by
intro α β r g y hr
cases r with
| fail err => simp [Bind.bind, Aeneas.Std.bind] at hr
| div => simp [Bind.bind, Aeneas.Std.bind] at hr
| ok x => exact ⟨x, rfl, hr⟩
let Good := fun (x : num.imp.dec2flt.common.BiasedFp) =>
x.p_biased.val = -1 ∨
(0 ≤ x.p_biased.val ∧ x.p_biased.val ≤ 2047)
unfold num.imp.dec2flt.dec2flt_with_trace at h
obtain ⟨body, hbody, h⟩ := bind_ok_inv _ _ _ h
obtain ⟨first, hfirst, h⟩ := bind_ok_inv _ _ _ h
cases first with
| none =>
obtain ⟨pfe, hpfe, h⟩ := bind_ok_inv _ _ _ h
cases h
| some c =>
obtain ⟨body1, hbody1, h⟩ := bind_ok_inv _ _ _ h
obtain ⟨empty, hempty, h⟩ := bind_ok_inv _ _ _ h
by_cases he : empty = true
· simp only [he, if_true] at h
obtain ⟨pfe, hpfe, h⟩ := bind_ok_inv _ _ _ h
cases h
· have hef : empty = false := Bool.eq_false_of_not_eq_true he
simp only [hef, if_false] at h
obtain ⟨parsed, hparsed, h⟩ := bind_ok_inv _ _ _ h
cases parsed with
| none =>
obtain ⟨special, hspecial, h⟩ := bind_ok_inv _ _ _ h
cases special with
| none =>
obtain ⟨pfe, hpfe, h⟩ := bind_ok_inv _ _ _ h
cases h
| some value => cases h
| some r =>
obtain ⟨fast, hfast, h⟩ := bind_ok_inv _ _ _ h
cases fast with
| some value => cases h
| none =>
obtain ⟨firstPair, hfirstPair, h⟩ := bind_ok_inv _ _ _ h
have hfirstGood : Good firstPair :=
ParserComputeFloatExponentRange _ _ _ hfirstPair
obtain ⟨phase1, hphase1, h⟩ := bind_ok_inv _ _ _ h
rcases phase1 with ⟨many1, many2, firstPair1, fp, guard⟩
have hfp : fp = firstPair := by
by_cases hm : r.many_digits
· simp only [hm, if_true] at hphase1
cases hphase1
rfl
· simp only [hm, if_false] at hphase1
cases hphase1
rfl
subst fp
obtain ⟨phase2, hphase2, h⟩ := bind_ok_inv _ _ _ h
rcases phase2 with
⟨post, secondExp, secondMant, secondResult, secondEqual, forced⟩
have hpost : Good post := by
cases guard with
| false =>
simp only [Bool.false_eq_true, if_false] at hphase2
cases hphase2
exact hfirstGood
| true =>
simp only [if_true] at hphase2
obtain ⟨mantissa, hmantissa, hphase2⟩ :=
bind_ok_inv _ _ _ hphase2
obtain ⟨second, hsecond, hphase2⟩ :=
bind_ok_inv _ _ _ hphase2
have hsecondGood : Good second :=
ParserComputeFloatExponentRange _ _ _ hsecond
obtain ⟨equal, hequal, hphase2⟩ :=
bind_ok_inv _ _ _ hphase2
obtain ⟨chosen, hchosen, hphase2⟩ :=
bind_ok_inv _ _ _ hphase2
rcases chosen with ⟨bf, wasForced⟩
have hbf : Good bf := by
by_cases heq : equal = true
· simp only [heq, if_true] at hchosen
cases hchosen
exact hfirstGood
· have heqf : equal = false := Bool.eq_false_of_not_eq_true heq
simp only [heqf, if_false] at hchosen
cases hchosen
left
norm_num
cases hphase2
exact hbf
obtain ⟨phase3, hphase3, h⟩ := bind_ok_inv _ _ _ h
rcases phase3 with ⟨selected, slowGuard, slowResult⟩
have hselected : 0 ≤ selected.p_biased.val ∧
selected.p_biased.val ≤ 2047 := by
by_cases hneg : post.p_biased < 0#i32
· simp only [hneg, if_true] at hphase3
obtain ⟨replacement, hreplacement, hphase3⟩ :=
bind_ok_inv _ _ _ hphase3
have hrange := ParserSlowExponentRange _ _ hreplacement
cases hphase3
exact hrange
· simp only [hneg, if_false] at hphase3
cases hphase3
rcases hpost with hminus | hrange
· change ¬ post.p_biased.val < 0 at hneg
omega
· exact hrange
obtain ⟨i, hi, h⟩ := bind_ok_inv _ _ _ h
obtain ⟨i1, hi1, h⟩ := bind_ok_inv _ _ _ h
obtain ⟨i2, hi2, h⟩ := bind_ok_inv _ _ _ h
obtain ⟨word, hword, h⟩ := bind_ok_inv _ _ _ h
obtain ⟨assembled, hassembled, h⟩ := bind_ok_inv _ _ _ h
by_cases hnegative : c = 45#u8
· simp only [hnegative, if_true] at h
obtain ⟨result, hresult, h⟩ := bind_ok_inv _ _ _ h
cases h
exact hselected
· simp only [hnegative, if_false] at h
cases h
exact hselected
end dec2flt_model
Download Lean source · Download TeX source
Complete Lean module
import Tablet.DecimalGoalVocabularyDefault
import Tablet.Assumptions
import Tablet.ModelF64MantissaDigits
import Tablet.ModelU64BitAnd
import Tablet.ModelU64BitOr
import Tablet.ModelU64Shl
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64
import Tablet.F64_Insts_CoreOpsArithDivF64F64
import Tablet.F64_Insts_CoreOpsArithMulF64F64
import Tablet.F64_Insts_CoreOpsArithNegF64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatExtU64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_BITS
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_LARGEST_POWER_OF_TEN
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_MAX_EXPONENT_ROUND_TO_EVEN
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_MIN_EXPONENT_ROUND_TO_EVEN
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SIG_TOTAL_BITS
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SMALLEST_POWER_OF_TEN
import Tablet.num_imp_dec2flt_Dec2FltAssemblyTrace
import Tablet.num_imp_dec2flt_Dec2FltTrace
import Tablet.num_imp_dec2flt_dec2flt
import Tablet.num_imp_dec2flt_dec2flt_with_trace
import Tablet.num_imp_dec2flt_parse_parse_number
import Tablet.num_imp_dec2flt_parse_parse_inf_nan
import Tablet.num_imp_dec2flt_decimal_Decimal_try_fast_path
import Tablet.num_imp_dec2flt_common_BiasedFp
import Tablet.num_imp_dec2flt_common_BiasedFp_Insts_CoreCmpPartialEqBiasedFp_eq
import Tablet.num_imp_dec2flt_common_BiasedFp_zero_pow2
import Tablet.num_imp_dec2flt_decimal_seq_DecimalSeq_left_shift
import Tablet.num_imp_dec2flt_decimal_seq_DecimalSeq_right_shift
import Tablet.num_imp_dec2flt_decimal_seq_DecimalSeq_round
import Tablet.num_imp_dec2flt_decimal_seq_parse_decimal_seq
import Tablet.num_imp_dec2flt_lemire_compute_float
import Tablet.num_imp_dec2flt_lemire_compute_product_approx
import Tablet.num_imp_dec2flt_lemire_full_multiplication
import Tablet.num_imp_dec2flt_lemire_power
import Tablet.num_imp_dec2flt_slow_parse_long_mantissa
import Tablet.num_imp_dec2flt_slow_parse_long_mantissa_MAX_SHIFT
import Tablet.num_imp_dec2flt_slow_parse_long_mantissa_closure_Insts_CoreOpsFunctionFnTupleUsizeUsize_call
import Tablet.num_imp_dec2flt_table_LARGEST_POWER_OF_FIVE
import Tablet.num_imp_dec2flt_table_POWER_OF_FIVE_128
import Tablet.num_imp_dec2flt_table_SMALLEST_POWER_OF_FIVE
import Tablet.num_imp_traits_Float_EXP_BIAS_default
import Tablet.num_imp_traits_Float_EXP_BITS_default
import Tablet.num_imp_traits_Float_EXP_MIN_default
import Tablet.num_imp_traits_Float_EXP_SAT_default
import Tablet.num_imp_traits_Float_INFINITE_POWER_default
import Tablet.num_imp_traits_Float_SIG_BITS_default
import Tablet.num_imp_dec2flt_biased_fp_to_float
import Tablet.ParserComputeFloatExponentRange
import Tablet.ParserSlowExponentRange
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: ParserSelectedExponent]
theorem ParserSelectedExponent :
∀ (s : Str) (f : F64) (tr : num.imp.dec2flt.Dec2FltAssemblyTrace F64),
DecimalGoalVocabularyDefault.sourceString s ->
num.imp.dec2flt.dec2flt_with_trace
F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64
F64.Insts.CoreOpsArithDivF64F64 F64.Insts.CoreOpsArithMulF64F64
F64.Insts.CoreOpsArithNegF64 s =
ok (core.result.Result.Ok f, num.imp.dec2flt.Dec2FltTrace.Assembled tr) ->
0 <= tr.selected_pair.p_biased.val ∧ tr.selected_pair.p_biased.val <= 2047 := by
-- BODY
intro s f tr hs h
have bind_ok_inv : ∀ {α β : Type} (r : Result α) (g : α → Result β) y,
Bind.bind r g = ok y → ∃ x, r = ok x ∧ g x = ok y := by
intro α β r g y hr
cases r with
| fail err => simp [Bind.bind, Aeneas.Std.bind] at hr
| div => simp [Bind.bind, Aeneas.Std.bind] at hr
| ok x => exact ⟨x, rfl, hr⟩
let Good := fun (x : num.imp.dec2flt.common.BiasedFp) =>
x.p_biased.val = -1 ∨
(0 ≤ x.p_biased.val ∧ x.p_biased.val ≤ 2047)
unfold num.imp.dec2flt.dec2flt_with_trace at h
obtain ⟨body, hbody, h⟩ := bind_ok_inv _ _ _ h
obtain ⟨first, hfirst, h⟩ := bind_ok_inv _ _ _ h
cases first with
| none =>
obtain ⟨pfe, hpfe, h⟩ := bind_ok_inv _ _ _ h
cases h
| some c =>
obtain ⟨body1, hbody1, h⟩ := bind_ok_inv _ _ _ h
obtain ⟨empty, hempty, h⟩ := bind_ok_inv _ _ _ h
by_cases he : empty = true
· simp only [he, if_true] at h
obtain ⟨pfe, hpfe, h⟩ := bind_ok_inv _ _ _ h
cases h
· have hef : empty = false := Bool.eq_false_of_not_eq_true he
simp only [hef, if_false] at h
obtain ⟨parsed, hparsed, h⟩ := bind_ok_inv _ _ _ h
cases parsed with
| none =>
obtain ⟨special, hspecial, h⟩ := bind_ok_inv _ _ _ h
cases special with
| none =>
obtain ⟨pfe, hpfe, h⟩ := bind_ok_inv _ _ _ h
cases h
| some value => cases h
| some r =>
obtain ⟨fast, hfast, h⟩ := bind_ok_inv _ _ _ h
cases fast with
| some value => cases h
| none =>
obtain ⟨firstPair, hfirstPair, h⟩ := bind_ok_inv _ _ _ h
have hfirstGood : Good firstPair :=
ParserComputeFloatExponentRange _ _ _ hfirstPair
obtain ⟨phase1, hphase1, h⟩ := bind_ok_inv _ _ _ h
rcases phase1 with ⟨many1, many2, firstPair1, fp, guard⟩
have hfp : fp = firstPair := by
by_cases hm : r.many_digits
· simp only [hm, if_true] at hphase1
cases hphase1
rfl
· simp only [hm, if_false] at hphase1
cases hphase1
rfl
subst fp
obtain ⟨phase2, hphase2, h⟩ := bind_ok_inv _ _ _ h
rcases phase2 with
⟨post, secondExp, secondMant, secondResult, secondEqual, forced⟩
have hpost : Good post := by
cases guard with
| false =>
simp only [Bool.false_eq_true, if_false] at hphase2
cases hphase2
exact hfirstGood
| true =>
simp only [if_true] at hphase2
obtain ⟨mantissa, hmantissa, hphase2⟩ :=
bind_ok_inv _ _ _ hphase2
obtain ⟨second, hsecond, hphase2⟩ :=
bind_ok_inv _ _ _ hphase2
have hsecondGood : Good second :=
ParserComputeFloatExponentRange _ _ _ hsecond
obtain ⟨equal, hequal, hphase2⟩ :=
bind_ok_inv _ _ _ hphase2
obtain ⟨chosen, hchosen, hphase2⟩ :=
bind_ok_inv _ _ _ hphase2
rcases chosen with ⟨bf, wasForced⟩
have hbf : Good bf := by
by_cases heq : equal = true
· simp only [heq, if_true] at hchosen
cases hchosen
exact hfirstGood
· have heqf : equal = false := Bool.eq_false_of_not_eq_true heq
simp only [heqf, if_false] at hchosen
cases hchosen
left
norm_num
cases hphase2
exact hbf
obtain ⟨phase3, hphase3, h⟩ := bind_ok_inv _ _ _ h
rcases phase3 with ⟨selected, slowGuard, slowResult⟩
have hselected : 0 ≤ selected.p_biased.val ∧
selected.p_biased.val ≤ 2047 := by
by_cases hneg : post.p_biased < 0#i32
· simp only [hneg, if_true] at hphase3
obtain ⟨replacement, hreplacement, hphase3⟩ :=
bind_ok_inv _ _ _ hphase3
have hrange := ParserSlowExponentRange _ _ hreplacement
cases hphase3
exact hrange
· simp only [hneg, if_false] at hphase3
cases hphase3
rcases hpost with hminus | hrange
· change ¬ post.p_biased.val < 0 at hneg
omega
· exact hrange
obtain ⟨i, hi, h⟩ := bind_ok_inv _ _ _ h
obtain ⟨i1, hi1, h⟩ := bind_ok_inv _ _ _ h
obtain ⟨i2, hi2, h⟩ := bind_ok_inv _ _ _ h
obtain ⟨word, hword, h⟩ := bind_ok_inv _ _ _ h
obtain ⟨assembled, hassembled, h⟩ := bind_ok_inv _ _ _ h
by_cases hnegative : c = 45#u8
· simp only [hnegative, if_true] at h
obtain ⟨result, hresult, h⟩ := bind_ok_inv _ _ _ h
cases h
exact hselected
· simp only [hnegative, if_false] at h
cases h
exact hselected
end dec2flt_model
Proof structure
Follow the declared dependencies to read the supporting statements and proofs.
Uses
- Assumptions
- DecimalGoalVocabularyDefault
- F64 Insts CoreOpsArithDivF64F64
- F64 Insts CoreOpsArithMulF64F64
- F64 Insts CoreOpsArithNegF64
- F64 Insts Dec2flt modelNumImpDec2fltLemireU64
All 51 entries
- Assumptions
- DecimalGoalVocabularyDefault
- F64 Insts CoreOpsArithDivF64F64
- F64 Insts CoreOpsArithMulF64F64
- F64 Insts CoreOpsArithNegF64
- F64 Insts Dec2flt modelNumImpDec2fltLemireU64
- F64 Insts Dec2flt modelNumImpTraitsFloatExtU64
- F64 Insts Dec2flt modelNumImpTraitsFloatU64
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 BITS
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 LARGEST POWER OF TEN
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 MAX EXPONENT ROUND TO EVEN
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 MIN EXPONENT ROUND TO EVEN
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 SIG TOTAL BITS
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 SMALLEST POWER OF TEN
- ModelF64MantissaDigits
- ModelU64BitAnd
- ModelU64BitOr
- ModelU64Shl
- ParserComputeFloatExponentRange
- ParserSlowExponentRange
- num imp dec2flt Dec2FltAssemblyTrace
- num imp dec2flt Dec2FltTrace
- num imp dec2flt biased fp to float
- num imp dec2flt common BiasedFp
- num imp dec2flt common BiasedFp Insts CoreCmpPartialEqBiasedFp eq
- num imp dec2flt common BiasedFp zero pow2
- num imp dec2flt dec2flt
- num imp dec2flt dec2flt with trace
- num imp dec2flt decimal Decimal try fast path
- num imp dec2flt decimal seq DecimalSeq left shift
- num imp dec2flt decimal seq DecimalSeq right shift
- num imp dec2flt decimal seq DecimalSeq round
- num imp dec2flt decimal seq parse decimal seq
- num imp dec2flt lemire compute float
- num imp dec2flt lemire compute product approx
- num imp dec2flt lemire full multiplication
- num imp dec2flt lemire power
- num imp dec2flt parse parse inf nan
- num imp dec2flt parse parse number
- num imp dec2flt slow parse long mantissa
- num imp dec2flt slow parse long mantissa MAX SHIFT
- num imp dec2flt slow parse long mantissa closure Insts CoreOpsFunctionFnTupleUsizeUsize call
- num imp dec2flt table LARGEST POWER OF FIVE
- num imp dec2flt table POWER OF FIVE 128
- num imp dec2flt table SMALLEST POWER OF FIVE
- num imp traits Float EXP BIAS default
- num imp traits Float EXP BITS default
- num imp traits Float EXP MIN default
- num imp traits Float EXP SAT default
- num imp traits Float INFINITE POWER default
- num imp traits Float SIG BITS default
Inspect related source (201)
More program dependencies (159)
- BITS · traits.rs:319 Program Rust
- LARGEST_POWER_OF_TEN · traits.rs:327 Program Rust
- MAX_EXPONENT_ROUND_TO_EVEN · traits.rs:325 Program Rust
- MIN_EXPONENT_ROUND_TO_EVEN · traits.rs:324 Program Rust
- SIG_TOTAL_BITS · traits.rs:320 Program Rust
- SMALLEST_POWER_OF_TEN · traits.rs:328 Program Rust
- Dec2FltAssemblyTrace · dec2flt/mod.rs:329 Program Rust
- Dec2FltTrace · dec2flt/mod.rs:295 Program Rust
- biased_fp_to_float · dec2flt/mod.rs:282 Program Rust
- BiasedFp · dec2flt/common.rs:52 Program Rust
- eq · dec2flt/common.rs:51 Program Rust
- zero_pow2 · dec2flt/common.rs:62 Program Rust
- dec2flt · dec2flt/mod.rs:508 Program Rust
- dec2flt_with_trace · dec2flt/mod.rs:355 Program Rust
- try_fast_path · dec2flt/decimal.rs:59 Program Rust
- left_shift · dec2flt/decimal_seq.rs:129 Program Rust
- left_shift_loop0 · dec2flt/decimal_seq.rs:138 Program Rust
- body · dec2flt/decimal_seq.rs:138 Program Rust
- left_shift_loop1 · dec2flt/decimal_seq.rs:152 Program Rust
- body · dec2flt/decimal_seq.rs:152 Program Rust
- right_shift · dec2flt/decimal_seq.rs:175 Program Rust
- right_shift_loop0 · dec2flt/decimal_seq.rs:180 Program Rust
- body · dec2flt/decimal_seq.rs:180 Program Rust
- right_shift_loop0_loop0 · dec2flt/decimal_seq.rs:190 Program Rust
- body · dec2flt/decimal_seq.rs:190 Program Rust
- right_shift_loop1 · dec2flt/decimal_seq.rs:209 Program Rust
- body · dec2flt/decimal_seq.rs:209 Program Rust
- right_shift_loop2 · dec2flt/decimal_seq.rs:216 Program Rust
- body · dec2flt/decimal_seq.rs:216 Program Rust
- round · dec2flt/decimal_seq.rs:96 Program Rust
- round_loop · dec2flt/decimal_seq.rs:106 Program Rust
- body · dec2flt/decimal_seq.rs:106 Program Rust
- parse_decimal_seq · dec2flt/decimal_seq.rs:283 Program Rust
- parse_decimal_seq_loop0 · dec2flt/decimal_seq.rs:290 Program Rust
- body · dec2flt/decimal_seq.rs:290 Program Rust
- parse_decimal_seq_loop1 · dec2flt/decimal_seq.rs:361 Program Rust
- body · dec2flt/decimal_seq.rs:361 Program Rust
- parse_decimal_seq_loop2 · dec2flt/decimal_seq.rs:303 Program Rust
- body · dec2flt/decimal_seq.rs:303 Program Rust
- parse_decimal_seq_loop3 · dec2flt/decimal_seq.rs:307 Program Rust
- body · dec2flt/decimal_seq.rs:307 Program Rust
- parse_decimal_seq_loop4 · dec2flt/decimal_seq.rs:361 Program Rust
- body · dec2flt/decimal_seq.rs:361 Program Rust
- parse_decimal_seq_loop5 · dec2flt/decimal_seq.rs:307 Program Rust
- body · dec2flt/decimal_seq.rs:307 Program Rust
- parse_decimal_seq_loop6 · dec2flt/decimal_seq.rs:361 Program Rust
- body · dec2flt/decimal_seq.rs:361 Program Rust
- parse_decimal_seq_loop7 · dec2flt/decimal_seq.rs:361 Program Rust
- body · dec2flt/decimal_seq.rs:361 Program Rust
- compute_float · dec2flt/lemire.rs:26 Program Rust
- compute_product_approx · dec2flt/lemire.rs:134 Program Rust
- full_multiplication · dec2flt/lemire.rs:126 Program Rust
- power · dec2flt/lemire.rs:121 Program Rust
- parse_inf_nan · dec2flt/parse.rs:241 Program Rust
- parse_number · dec2flt/parse.rs:231 Program Rust
- parse_long_mantissa · dec2flt/slow.rs:27 Program Rust
- MAX_SHIFT · dec2flt/slow.rs:28 Program Rust
- call · dec2flt/slow.rs:33 Program Rust
- parse_long_mantissa_loop0 · dec2flt/slow.rs:51 Program Rust
- body · dec2flt/slow.rs:51 Program Rust
- parse_long_mantissa_loop1 · dec2flt/slow.rs:69 Program Rust
- body · dec2flt/slow.rs:69 Program Rust
- parse_long_mantissa_loop2 · dec2flt/slow.rs:94 Program Rust
- body · dec2flt/slow.rs:94 Program Rust
- LARGEST_POWER_OF_FIVE · dec2flt/table.rs:10 Program Rust
- POWER_OF_FIVE_128 · dec2flt/table.rs:19 Program Rust
- SMALLEST_POWER_OF_FIVE · dec2flt/table.rs:9 Program Rust
- default · traits.rs:116 Program Rust
- default · traits.rs:104 Program Rust
- default · traits.rs:119 Program Rust
- default · traits.rs:110 Program Rust
- default · traits.rs:113 Program Rust
- default · traits.rs:101 Program Rust
- MAX_EXPONENT_DISGUISED_FAST_PATH · dec2flt/mod.rs:220 Program Rust
- MAX_EXPONENT_FAST_PATH · dec2flt/mod.rs:219 Program Rust
- pow10_fast_path · dec2flt/mod.rs:222 Program Rust
- from_u64_bits · traits.rs:341 Program Rust
- integer_decode · traits.rs:348 Program Rust
- EXP_MASK · traits.rs:321 Program Rust
- INFINITY · traits.rs:312 Program Rust
- NAN · traits.rs:314 Program Rust
- NEG_INFINITY · traits.rs:313 Program Rust
- NEG_NAN · traits.rs:317 Program Rust
- SIG_MASK · traits.rs:322 Program Rust
- classify · traits.rs:334 Program Rust
- to_bits · traits.rs:330 Program Rust
- read_u64 · dec2flt/common.rs:18 Program Rust
- write_u64 · dec2flt/common.rs:25 Program Rust
- Dec2flt_modelNumImpTraitsInt · traits.rs:51 Program Rust
- ParseFloatError · num/mod.rs:13 Program Rust
- Lemire · dec2flt/mod.rs:115 Program Rust
- default · dec2flt/mod.rs:128 Program Rust
- default · dec2flt/mod.rs:121 Program Rust
- is_8digits · dec2flt/common.rs:40 Program Rust
- Decimal · dec2flt/decimal.rs:32 Program Rust
- can_use_fast_path · dec2flt/decimal.rs:42 Program Rust
- INT_POW10 · dec2flt/decimal.rs:8 Program Rust
- DecimalSeq · dec2flt/decimal_seq.rs:21 Program Rust
- DECIMAL_POINT_RANGE · dec2flt/decimal_seq.rs:67 Program Rust
- default · dec2flt/decimal_seq.rs:33 Program Rust
- MAX_DIGITS · dec2flt/decimal_seq.rs:63 Program Rust
- MAX_DIGITS_WITHOUT_OVERFLOW · dec2flt/decimal_seq.rs:66 Program Rust
- trim · dec2flt/decimal_seq.rs:82 Program Rust
- trim_loop · dec2flt/decimal_seq.rs:91 Program Rust
- body · dec2flt/decimal_seq.rs:91 Program Rust
- count_trailing_zeros · dec2flt/decimal_seq.rs:235 Program Rust
- count_trailing_zeros_loop · dec2flt/decimal_seq.rs:239 Program Rust
- body · dec2flt/decimal_seq.rs:239 Program Rust
- number_of_digits_decimal_left_shift · dec2flt/decimal_seq.rs:368 Program Rust
- number_of_digits_decimal_left_shift_loop · dec2flt/decimal_seq.rs:434 Program Rust
- body · dec2flt/decimal_seq.rs:434 Program Rust
- parse_decimal_exponent · dec2flt/decimal_seq.rs:269 Program Rust
- parse_decimal_exponent_loop · dec2flt/decimal_seq.rs:272 Program Rust
- body · dec2flt/decimal_seq.rs:272 Program Rust
- parse_digits_into_seq · dec2flt/decimal_seq.rs:256 Program Rust
- parse_digits_into_seq_loop · dec2flt/decimal_seq.rs:258 Program Rust
- body · dec2flt/decimal_seq.rs:258 Program Rust
- set_precision · dec2flt/fpu.rs:99 Program Rust
- parse_partial_number · dec2flt/parse.rs:161 Program Rust
- pfe_empty · dec2flt/mod.rs:270 Program Rust
- pfe_invalid · dec2flt/mod.rs:277 Program Rust
- NUM_POWERS · dec2flt/slow.rs:29 Program Rust
- POWERS · dec2flt/slow.rs:30 Program Rust
- closure · dec2flt/slow.rs:33 Program Rust
- Float · traits.rs:74 Program Rust
- FloatExt · traits.rs:170 Program Rust
- from_u64 · dec2flt/mod.rs:263 Program Rust
- offset_from · dec2flt/common.rs:30 Program Rust
- Dec2flt_modelNumImpTraitsCastIntoI16 · traits.rs:45 Program Rust
- ONE · traits.rs:53 Program Rust
- ZERO · traits.rs:52 Program Rust
- FloatErrorKind · num/mod.rs:18 Program Rust
- ByteSlice · dec2flt/common.rs:4 Program Rust
- try_add_digit · dec2flt/decimal_seq.rs:73 Program Rust
- TABLE · dec2flt/decimal_seq.rs:370 Program Rust
- TABLE_POW5 · dec2flt/decimal_seq.rs:379 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
- parse_many_digits · dec2flt/parse.rs:104 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_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
- CastInto · traits.rs:18 Program Rust
- Int · traits.rs:27 Program Rust
- cast · traits.rs:46 Program Rust
- MIN_19DIGIT_INT · dec2flt/parse.rs:8 Program Rust
- parse_8digits · dec2flt/parse.rs:18 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
- MASK · dec2flt/parse.rs:19 Program Rust
- MUL1 · dec2flt/parse.rs:20 Program Rust
- MUL2 · dec2flt/parse.rs:21 Program Rust
Standard-library dependencies (39)
- 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
- MANTISSA_DIGITS · core/src/num/f64.rs:412 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
- 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_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
- split_first · core/src/slice/mod.rs:198 Rust library
- as_bytes · core/src/str/mod.rs:498 Rust library
- CoreOpsArithDivF64F64 · core/src/ops/arith.rs:511 Rust library
- CoreOpsArithMulF64F64 · core/src/ops/arith.rs:344 Rust library
- CoreOpsArithNegF64 · core/src/ops/arith.rs:713 Rust library
- CoreMarkerCopy · core/src/marker.rs:57 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
- CoreCloneClone · core/src/clone.rs:696 Rust library
- CoreOpsBitBitAndU64U64 · core/src/ops/bit.rs:174 Rust library
- CoreOpsBitBitOrU64U64 · core/src/ops/bit.rs:278 Rust library
- CoreOpsBitShlU32U64 · core/src/ops/bit.rs:483 Rust library
- CoreOpsBitShrU32U64 · core/src/ops/bit.rs:606 Rust library
- FpCategory · core/src/num/mod.rs:1522 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
- 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 156 entries
- Binary64Model
- Binary64ModelDefault
- DecimalGoalVocabulary
- DecimalGoalVocabularyDefault
- DecimalLexeme
- F64
- F64 Insts CoreCloneClone
- F64 Insts CoreMarkerCopy
- F64 Insts CoreOpsArithDivF64F64
- F64 Insts CoreOpsArithMulF64F64
- F64 Insts CoreOpsArithNegF64
- F64 Insts Dec2flt modelNumImpDec2fltLemireU64
- F64 Insts Dec2flt modelNumImpDec2fltLemireU64 MAX EXPONENT DISGUISED FAST PATH
- F64 Insts Dec2flt modelNumImpDec2fltLemireU64 MAX EXPONENT FAST PATH
- F64 Insts Dec2flt modelNumImpDec2fltLemireU64 pow10 fast path
- F64 Insts Dec2flt modelNumImpTraitsFloatExtU64
- F64 Insts Dec2flt modelNumImpTraitsFloatExtU64 from u64 bits
- F64 Insts Dec2flt modelNumImpTraitsFloatExtU64 integer decode
- F64 Insts Dec2flt modelNumImpTraitsFloatU64
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 BITS
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 EXP MASK
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 INFINITY
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 LARGEST POWER OF TEN
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 MAX EXPONENT ROUND TO EVEN
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 MIN EXPONENT ROUND TO EVEN
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 NAN
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 NEG INFINITY
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 NEG NAN
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 SIG MASK
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 SIG TOTAL BITS
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 SMALLEST POWER OF TEN
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 classify
- F64 Insts Dec2flt modelNumImpTraitsFloatU64 to bits
- ModelF64Classify
- ModelF64Clone
- ModelF64Div
- ModelF64ExponentMask
- ModelF64FromBits
- ModelF64FromU64
- ModelF64Infinity
- ModelF64MantissaDigits
- ModelF64MantissaMask
- ModelF64Mul
- ModelF64Nan
- ModelF64Neg
- ModelF64NegInfinity
- ModelF64ToBits
- ModelOptionBranch
- ModelOptionFromResidual
- ModelSliceFirst
- ModelSliceSplitFirst
- ModelStrAsBytes
- ModelU64BitAnd
- ModelU64BitOr
- ModelU64Shl
- ModelU64Shr
- ModelU8IsAsciiDigit
- ParserComputeFloatExponentRange
- ParserExponentConstants
- ParserSelectedExponent
- ParserSlowExponentRange
- ParserSlowLoopInfinityResult
- ParserSlowLoopMinimumExponent
- ParserSlowLoopZeroResult
- Preamble
- ResultLoopPartial
- SliceU8 Insts Dec2flt modelNumImpDec2fltCommonByteSlice offset from
- SliceU8 Insts Dec2flt modelNumImpDec2fltCommonByteSlice read u64
- SliceU8 Insts Dec2flt modelNumImpDec2fltCommonByteSlice write u64
- U64 Insts CoreOpsBitBitAndU64U64
- U64 Insts CoreOpsBitBitOrU64U64
- U64 Insts CoreOpsBitShlU32U64
- U64 Insts CoreOpsBitShrU32U64
- U64 Insts Dec2flt modelNumImpTraitsCastIntoI16
- U64 Insts Dec2flt modelNumImpTraitsCastIntoI16 cast
- U64 Insts Dec2flt modelNumImpTraitsInt
- U64 Insts Dec2flt modelNumImpTraitsInt ONE
- U64 Insts Dec2flt modelNumImpTraitsInt ZERO
- core num FpCategory
- core ops arith Div
- core ops arith Mul
- core ops arith Neg
- core ops bit BitOr
- core ops bit Shl
- core ops bit Shr
- num float parse FloatErrorKind
- num float parse ParseFloatError
- num imp dec2flt Dec2FltAssemblyTrace
- num imp dec2flt Dec2FltTrace
- num imp dec2flt Lemire
- num imp dec2flt Lemire MAX MANTISSA FAST PATH default
- num imp dec2flt biased fp to float
- num imp dec2flt common BiasedFp
- num imp dec2flt common BiasedFp Insts CoreCmpPartialEqBiasedFp eq
- num imp dec2flt common BiasedFp zero pow2
- num imp dec2flt common is 8digits
- num imp dec2flt dec2flt with trace
- num imp dec2flt decimal Decimal
- num imp dec2flt decimal Decimal can use fast path
- num imp dec2flt decimal Decimal try fast path
- num imp dec2flt decimal INT POW10
- num imp dec2flt decimal seq DecimalSeq
- num imp dec2flt decimal seq DecimalSeq DECIMAL POINT RANGE
- num imp dec2flt decimal seq DecimalSeq Insts CoreDefaultDefault default
- num imp dec2flt decimal seq DecimalSeq MAX DIGITS
- num imp dec2flt decimal seq DecimalSeq MAX DIGITS WITHOUT OVERFLOW
- num imp dec2flt decimal seq DecimalSeq left shift
- num imp dec2flt decimal seq DecimalSeq right shift
- num imp dec2flt decimal seq DecimalSeq round
- num imp dec2flt decimal seq DecimalSeq trim
- num imp dec2flt decimal seq DecimalSeq try add digit
- num imp dec2flt decimal seq count trailing zeros
- num imp dec2flt decimal seq number of digits decimal left shift
- num imp dec2flt decimal seq number of digits decimal left shift TABLE
- num imp dec2flt decimal seq number of digits decimal left shift TABLE POW5
- num imp dec2flt decimal seq parse decimal exponent
- num imp dec2flt decimal seq parse decimal seq
- num imp dec2flt decimal seq parse digits into seq
- num imp dec2flt fpu fpu precision set precision
- num imp dec2flt lemire compute float
- num imp dec2flt lemire compute product approx
- num imp dec2flt lemire full multiplication
- num imp dec2flt lemire power
- 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 inf nan
- 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
- num imp dec2flt pfe empty
- num imp dec2flt pfe invalid
- num imp dec2flt slow parse long mantissa
- num imp dec2flt slow parse long mantissa MAX SHIFT
- num imp dec2flt slow parse long mantissa NUM POWERS
- num imp dec2flt slow parse long mantissa POWERS
- num imp dec2flt slow parse long mantissa closure
- num imp dec2flt slow parse long mantissa closure Insts CoreOpsFunctionFnTupleUsizeUsize call
- num imp dec2flt table LARGEST POWER OF FIVE
- num imp dec2flt table POWER OF FIVE 128
- num imp dec2flt table SMALLEST POWER OF FIVE
- num imp traits CastInto
- num imp traits Float
- num imp traits FloatExt
- num imp traits Float EXP BIAS default
- num imp traits Float EXP BITS default
- num imp traits Float EXP MIN default
- num imp traits Float EXP SAT default
- num imp traits Float SIG BITS default
- num imp traits Int
Technical checking records
Local closure summary
{
"node": "ParserSelectedExponent",
"closure_version": "patch_c_v1",
"active_decl_hash": "e4ca753538e42d6b08e4b20d5b34caaff3d19fbf8120f7d53f6290f7183a94c0",
"active_statement_hash": "84f4fe10d0fa7a701708a1bb001629bdd15eea3daefe51ba878a31370f1879da",
"kernel_axioms": [
"Classical.choice",
"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-132",
"boundary_theorems": {},
"strict_theorem_deps": {
"ParserComputeFloatExponentRange": "d9f781305664f993",
"ParserSlowExponentRange": "4b9c15f786857b92",
"num_imp_dec2flt_dec2flt_with_trace": "8f54814ba9c190ea",
"num_imp_traits_Float_SIG_BITS_default": "9ab622d85ef04d94"
},
"strict_definition_deps": {
"DecimalGoalVocabulary": "1f42f752b5d22513",
"DecimalGoalVocabularyDefault": "512f8d0aea894250",
"F64": "ec4e25fbaf4e11d4",
"F64_Insts_CoreOpsArithDivF64F64": "dc44e13a99fc6bed",
"F64_Insts_CoreOpsArithMulF64F64": "1ae1a9021a654abd",
"F64_Insts_CoreOpsArithNegF64": "2d9be310c546ea2e",
"F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64": "30963b4ef656cc79",
"F64_Insts_Dec2flt_modelNumImpTraitsFloatExtU64": "60afe26c6a80cf0f",
"F64_Insts_Dec2flt_modelNumImpTraitsFloatU64": "94095c9bf79da164",
"F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SIG_TOTAL_BITS": "887b52d84a3fc9c4",
"Preamble": "86dc391ab250c79b",
"core_ops_arith_Neg": "0ff07135a60bcbf9",
"num_float_parse_ParseFloatError": "c43614ff2149ecf2",
"num_imp_dec2flt_Dec2FltAssemblyTrace": "598dfa7d7b371110",
"num_imp_dec2flt_Dec2FltTrace": "27322b4608129f59",
"num_imp_dec2flt_Lemire": "1923f90c53d323e6",
"num_imp_dec2flt_biased_fp_to_float": "acdde060e8d35ca7",
"num_imp_dec2flt_common_BiasedFp": "c43614ff2149ecf2",
"num_imp_dec2flt_common_BiasedFp_Insts_CoreCmpPartialEqBiasedFp_eq": "fbbf553e3c502a05",
"num_imp_dec2flt_dec2flt_with_trace": "d34666730435cdb9",
"num_imp_dec2flt_decimal_Decimal": "4da4ccbe640ef8e6",
"num_imp_dec2flt_decimal_Decimal_try_fast_path": "2e4888f65a06b49f",
"num_imp_dec2flt_lemire_compute_float": "39d89e3f0a8a9d4c",
"num_imp_dec2flt_parse_parse_inf_nan": "85655c19a8791b54",
"num_imp_dec2flt_parse_parse_number": "f73f8bc11faa6db3",
"num_imp_dec2flt_pfe_empty": "89046d1da5ac1ce2",
"num_imp_dec2flt_pfe_invalid": "21db875427d92c6d",
"num_imp_dec2flt_slow_parse_long_mantissa": "cd8af64c3688b60f",
"num_imp_traits_Float": "02acccb9db3e30f2",
"num_imp_traits_FloatExt": "f996e5400649797d"
}
}Prose assessment
{
"label": "Recorded Sound: VerifierPass",
"assessment_status": "VerifierPass",
"fingerprint_relation": "matches current fingerprint",
"assessment_fingerprint": "sound-v2:0e34d41c6265b97107c5e35a9c79ef70b4a75ff48c375465ce47ef3913e1117a",
"current_fingerprint": "sound-v2:0e34d41c6265b97107c5e35a9c79ef70b4a75ff48c375465ce47ef3913e1117a",
"superseded_for_theorem_closure": false
}Review verdicts
{
"corr_status": "Pass",
"sound_status": "Pass",
"substantiveness_status": "Pass"
}