Full-significand diagnostic
Disprovedparse_long_mantissaFull-significand diagnostic. For every unsigned numeric literal, a normal
result is a pair whose assembled word is the nonnegative binary64 rounding
of its accumulated-exponent value, retaining the full significand's
contribution to rounding.
Later revision · decision
Keep the complete original requirement text and its full source-valid unsigned domain. SlowAccumulatedRounding__Refutation proves a normal zero for 2147483648 ones whose accumulated target is infinity, not merely a panic. Repair the final point using i64 count subtraction and final-only saturating exponent combination, while retaining the 768-digit buffer, trimming and discarded-nonzero information. Saturation beyond i64 is allowed only after the final cancellation and corresponds to an existing extreme slow guard. The common new exponent fold changes this source-defined diagnostic meaning and requires fresh Modeling and proof. Restricting this helper to publicly reachable calls, or excluding gigabyte inputs, is not authorized.
Supporting proofs
Inspect related source (201)
- Dec2flt_modelNumImpDec2fltLemireU64 · dec2flt/mod.rs:217 Program Rust
- Dec2flt_modelNumImpTraitsFloatExtU64 · traits.rs:339 Program Rust
- BITS · traits.rs:319 Program Rust
More program dependencies (159)
- SIG_TOTAL_BITS · traits.rs:320 Program Rust
- biased_fp_to_float · dec2flt/mod.rs:282 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
- MAX_DIGITS_WITHOUT_OVERFLOW · dec2flt/decimal_seq.rs:66 Program Rust
- compute_float · dec2flt/lemire.rs:26 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
- 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
- default · traits.rs:104 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
- Dec2flt_modelNumImpTraitsFloatU64 · traits.rs:309 Program Rust
- read_u64 · dec2flt/common.rs:18 Program Rust
- ParseFloatError · num/mod.rs:13 Program Rust
- Dec2FltTrace · dec2flt/mod.rs:295 Program Rust
- Lemire · dec2flt/mod.rs:115 Program Rust
- default · dec2flt/mod.rs:128 Program Rust
- default · dec2flt/mod.rs:121 Program Rust
- BiasedFp · dec2flt/common.rs:52 Program Rust
- eq · dec2flt/common.rs:51 Program Rust
- zero_pow2 · dec2flt/common.rs:62 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
- 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
- set_precision · dec2flt/fpu.rs:99 Program Rust
- compute_product_approx · dec2flt/lemire.rs:134 Program Rust
- power · dec2flt/lemire.rs:121 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
- MAX_SHIFT · dec2flt/slow.rs:28 Program Rust
- call · 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
- EXP_MASK · traits.rs:321 Program Rust
- INFINITY · traits.rs:312 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
- 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
- SMALLEST_POWER_OF_TEN · traits.rs:328 Program Rust
- classify · traits.rs:334 Program Rust
- to_bits · traits.rs:330 Program Rust
- offset_from · dec2flt/common.rs:30 Program Rust
- write_u64 · dec2flt/common.rs:25 Program Rust
- Dec2flt_modelNumImpTraitsInt · traits.rs:51 Program Rust
- FloatErrorKind · num/mod.rs:18 Program Rust
- Dec2FltAssemblyTrace · dec2flt/mod.rs:329 Program Rust
- ByteSlice · dec2flt/common.rs:4 Program Rust
- is_8digits · dec2flt/common.rs:40 Program Rust
- default · dec2flt/decimal_seq.rs:33 Program Rust
- MAX_DIGITS · dec2flt/decimal_seq.rs:63 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
- full_multiplication · dec2flt/lemire.rs:126 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
- NUM_POWERS · dec2flt/slow.rs:29 Program Rust
- POWERS · dec2flt/slow.rs:30 Program Rust
- closure · dec2flt/slow.rs:33 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
- CastInto · traits.rs:18 Program Rust
- default · traits.rs:116 Program Rust
- default · traits.rs:119 Program Rust
- Int · traits.rs:27 Program Rust
- Dec2flt_modelNumImpTraitsCastIntoI16 · traits.rs:45 Program Rust
- ONE · traits.rs:53 Program Rust
- ZERO · traits.rs:52 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
- 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
- cast · traits.rs:46 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)
- 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
- 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_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
- 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
- CoreMarkerCopy · core/src/marker.rs:57 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
- 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
Related source and models come from the extraction records and declared dependencies.
Lean statement and supporting proof
Proposition checked for this verdict
theorem SlowAccumulatedRounding__Refutation : ¬ (∀ (s : Slice Std.U8) (x : DecimalLexeme) fp, SourceValidByteSlice s -> x.leadingSign = none ->
DecimalGoalVocabularyDefault.validNumeric x -> DecimalGoalVocabularyDefault.bytes s = DecimalGoalVocabularyDefault.renderNumeric x ->
num.imp.dec2flt.slow.parse_long_mantissa
F64.Insts.Dec2flt_modelNumImpTraitsFloatU64 s = ok fp ->
∃ target : F64, DecimalGoalVocabularyDefault.assembledWord fp target ∧
DecimalGoalVocabularyDefault.roundsMagnitude (DecimalGoalVocabularyDefault.accumulatedMagnitude x) target) := byThe negation is proved, disproving the requirement.
Alternate registered target · outside this verdict
theorem SlowAccumulatedRounding :
∀ (s : Slice Std.U8) (x : DecimalLexeme) fp, SourceValidByteSlice s -> x.leadingSign = none ->
DecimalGoalVocabularyDefault.validNumeric x -> DecimalGoalVocabularyDefault.bytes s = DecimalGoalVocabularyDefault.renderNumeric x ->
num.imp.dec2flt.slow.parse_long_mantissa
F64.Insts.Dec2flt_modelNumImpTraitsFloatU64 s = ok fp ->
∃ target : F64, DecimalGoalVocabularyDefault.assembledWord fp target ∧
DecimalGoalVocabularyDefault.roundsMagnitude (DecimalGoalVocabularyDefault.accumulatedMagnitude x) target := byStatement registration
| Live polarity | disprove |
|---|---|
| Authority | recorded audit polarity |
| Registered target | authored:SlowAccumulatedRounding__refutation |
| Closure nodes |
|
Counterexample argument as recorded · SlowAccumulatedRounding__Refutation
Theorem
The following result is false:
For every Rust byte slice that is an unsigned numeric literal, every normal result of
parse_long_mantissa is a raw pair whose unrestricted assembled word is the nonnegative binary64 rounding target of the full-significand accumulated-exponent value.Proof
Suppose, for contradiction, that the universal statement being negated is
true. Put
N=2^{31}=2147483648,
\qquad s.\mathit{val}=\operatorname{replicate}(N,49\#\mathrm{u8}),
and let x be the decimal lexeme with no leading sign, integer-digit list
\operatorname{replicate}(N,1), no decimal point, and no exponent. We first
verify all four premises with which the supposed universal statement will be
instantiated.The list underlying s has length N. It is a legitimate Aeneas
Slice U8, since N<2^{64}, and it satisfies
SourceValidByteSlice, since
N=2^{31}\leq2^{63}-1=9223372036854775807. The concrete meanings in
DecimalGoalVocabularyDefault make x valid: every integer digit is
1<10, its integer list is nonempty because N>0, and the absent fraction
and exponent impose no further digit obligations. The leading-sign field is
definitionally none. Finally, mapping the digit renderer
d\mapsto48+d over N copies of 1 gives N copies of 49; the absent
sign, fraction, and exponent render as empty lists. Mapping unsigned-byte
value over s.\mathit{val} also gives N copies of 49. The standard
length and map equations for List.replicate therefore prove
\operatorname{bytes}(s)=\operatorname{renderNumeric}(x).
This is a symbolic list calculation and does not expand the N-element list.We next calculate the extracted helper result. The calculation unfolds the
pinned default record, bound, digit insertion, digit loop, trailing-zero
loop, decimal-sequence parser, zero-pair constructor, f64 trait instance, and
slow helper in
num imp dec2flt decimal seq DecimalSeq Insts CoreDefaultDefault default,
num imp dec2flt decimal seq DecimalSeq MAX DIGITS,
num imp dec2flt decimal seq DecimalSeq try add digit,
num imp dec2flt decimal seq parse digits into seq,
num imp dec2flt decimal seq count trailing zeros,
num imp dec2flt decimal seq parse decimal seq,
num imp dec2flt common BiasedFp zero pow2,
F64 Insts Dec2flt modelNumImpTraitsFloatU64, and
num imp dec2flt slow parse long mantissa.
The default decimal sequence has count and decimal point zero, false
truncated, and an array of 768 zero bytes. The initial leading-zero
loop is nonempty, reads the in-bounds zeroth byte 49, finds it unequal to
48, and returns the original slice without an iteration. For the following
parse_digits_into_seq loop, define D_k, for 0\leq k\leq N,
to be the record with
\begin{split}
D_k.\mathit{num\_digits}&=k,\\
D_k.\mathit{decimal\_point}&=0,\\
D_k.\mathit{truncated}&=\mathrm{false},\\
D_k.\mathit{digits}[j]&=
\begin{cases}1,&j<\min(k,768),\\0,&\min(k,768)\leq j<768.
\end{cases}
\end{split}
The loop invariant is that its state is (D_k,k) and the unconsumed suffix
s[k\mathinner{..}] is \operatorname{replicate}(N-k,49\#\mathrm{u8}).
It holds at k=0 by the default-record equation and the replicate/drop
equations.For the induction step, assume k<N. The length guard is true, and the
bounds-checked access at k succeeds because k<N=\operatorname{len}(s);
the replicate-index equation makes the returned byte 49. Both occurrences
of wrapping subtraction compute 49-48=1, and 1<10, so both lifted pure
computations return normally and the digit branch is taken. If k<768,
try_add_digit performs its bounds-checked array update at k;
this is in range and changes precisely that zero entry to one. If
768\leq k, its guard is false and it leaves the already-all-one array
unchanged. In both cases the checked usize addition changes the
record count from k to k+1. The loop's separate checked count addition
does the same. Neither addition can overflow, because
k+1\leq N=2^{31}<2^{64}. Thus the body returns
ok (cont (D_{k+1},k+1)), and dropping the consumed byte changes the
symbolic suffix from N-k copies to N-(k+1) copies. Unfolding
Aeneas.Std.loop.eq_def once and applying the induction hypothesis
proves the invariant step. Induction on the natural number N-k proves
termination without reducing the enormous list. At k=N the length guard
is false, so the body returns done; the subsequent range-from slice
at start N is in bounds and returns the empty suffix. Consequently
parse_digits_into_seq returns normally with empty remainder and
D_N. In particular, its machine count is exactly N, while all 768 stored
array entries are one.The empty remainder makes the first
is_empty branch of
parse_decimal_seq true. Since N\ne0, it computes the consumed
length as the checked usize subtraction N-0=N. The
count_trailing_zeros loop starts at
(\mathit{zeros},i,\mathit{scanning})=(0,N,\mathrm{true}). Because N>0,
the checked subtraction N-1 succeeds and the bounds-checked access at that
index succeeds; the replicate-index equation again returns 49. This byte
is neither 48 nor 46, so the body returns
(0,N,\mathrm{false}). One more use of
Aeneas.Std.loop.eq_def sees the false scanning flag and returns
ok 0. Thus the number of trailing zero digits is exactly zero, not
merely bounded by zero.Casting that zero to
i32 gives zero, and the checked addition to the
initial decimal point is 0+0=0. The checked subtraction of trailing zeros
from the digit count is N-0=N. The following
UScalar.hcast .I32 is the extracted narrowing cast, not a
range-checked conversion. It retains the low 32 bits and interprets them as
signed. Since N=2^{31}, its residue modulo 2^{32} is 2^{31} and hence
its signed value is
2^{31}-2^{32}=-2^{31}=-2147483648.
The ensuing checked signed addition is therefore
0+(-2147483648)=-2147483648, which is exactly i32::MIN and is in
range. Because N>768, the truncation branch replaces the exposed count by
768 and sets truncated to true. The remainder is empty, so no
exponent-marker access or exponent arithmetic occurs. Finally the cleanup
range starts at 768, while
num imp dec2flt decimal seq DecimalSeq MAX DIGITS WITHOUT OVERFLOW
states that its end is exactly 19. Since 768>19, the range 768\mathinner{..}19
is empty and performs no array access or update. We have proved the exact
monadic equation
\texttt{parse\_decimal\_seq}(s)=\texttt{ok}\,
\{\mathit{num\_digits}=768,\quad \mathit{decimal\_point}=-2147483648,
\quad \mathit{truncated}=\mathrm{true},
\quad \mathit{digits}=\operatorname{repeat}(768,1)\}.
It remains only to unfold the beginning of the slow helper. Its
zero_pow2(0) call returns normally with
fp_0=\{m=0\#\mathrm{u64},p_{\rm biased}=0\#\mathrm{i32}\}. In the f64
trait, F64 Insts Dec2flt modelNumImpTraitsFloatU64 BITS states that
BITS is 64, while
F64 Insts Dec2flt modelNumImpTraitsFloatU64 SIG TOTAL BITS calls the
mantissa-digits operation and ModelF64MantissaDigits states that this
operation returns ok 53. Therefore
num imp traits Float SIG BITS default performs the checked unsigned
subtraction 53-1, which cannot underflow and returns ok 52.
Next, num imp traits Float EXP BITS default performs its two checked
unsigned subtractions: 64-52=12 and then 12-1=11; neither underflows, so
EXP_BITS returns ok 11. By
num imp traits Float EXP SAT default, the checked shift
1\#\mathrm{u32}\mathbin{\texttt{<<}}11 succeeds because 11<32 and gives
2048, after which the checked subtraction 2048-1 cannot underflow and
gives EXP_SAT=2047. Finally,
num imp traits Float INFINITE POWER default applies the extracted
unsigned-to-signed hcast to 2047. Since
0\leq2047\leq2^{31}-1, this cast is exactly 2047\#\mathrm{i32}, so
INFINITE_POWER returns ok 2047. Thus the eagerly
constructed infinity pair also returns normally. The parser equation above then supplies the
decimal record. Its count is not zero, but
-2147483648<-324, so the second short-circuit branch returns fp_0 before
any shifting loop or array access. Therefore
\texttt{parse\_long\_mantissa}(s)=\texttt{ok }fp_0. \tag{1}
We now bound the mathematical value of the witness. Because x has no
exponent and no fraction, DecimalGoalVocabularyDefault reduces its
accumulated explicit exponent and fraction count to zero, and hence
\operatorname{accumulatedMagnitude}(x)
=\bigl(\operatorname{digitsValue}(\operatorname{replicate}(N,1)):\mathbb R\bigr).
Here is a symbolic lower bound for that fold. If A_k is the natural-number
fold of k copies of one from zero, then A_1=1=10^0, and
A_{k+1}=10A_k+1\geq10A_k. Induction gives
A_k\geq10^{k-1} for every k\geq1. Also, a fold starting at a
nonnegative accumulator never decreases when another digit one is appended,
because 10a+1\geq a. Since
\operatorname{replicate}(N,1)=
\operatorname{replicate}(1025,1)\mathbin{++}
\operatorname{replicate}(N-1025,1)
and 1025<N, the fold-append equation and the two inductions give
10^{1024}\leq A_{1025}\leq A_N
=\operatorname{digitsValue}(\operatorname{replicate}(N,1)).
Coercion from naturals to reals preserves this inequality, so
(10:\mathbb R)^{1024}\leq
\operatorname{accumulatedMagnitude}(x). \tag{2}
Instantiate the assumed universal statement with s, x, fp_0, the
source-validity, sign, validity, and rendering facts above, and equation (1).
It supplies a target word w that both assembles from fp_0 and satisfies
roundsMagnitude for the value in (2). Such a rounding target must be
positive infinity. Indeed, writing
T=2^{1024}-2^{970} for the overflow threshold,
T\leq2^{1024}\leq10^{1024}
\leq\operatorname{accumulatedMagnitude}(x).
The first inequality uses 2^{970}\geq0, and the second follows from
2\leq10 by monotonicity of natural powers. If
w.\mathit{val}\ne2047\cdot2^{52}, unfolding
roundsMagnitude selects its finite branch and requires the strict
opposite inequality
\operatorname{accumulatedMagnitude}(x)<T, contradicting the displayed
bound. Hence
w.\mathit{val}=2047\cdot2^{52}=9218868437227405312. \tag{3}
On the other hand, unfolding
assembledWord at fp_0 gives
w.\mathit{val}=\operatorname{Nat.lor}
\left(0,
\bigl(((0\mathbin{\mathrm{emod}}2^{64}).\mathit{toNat})2^{52}\bigr)
\bmod2^{64}\right)=\operatorname{Nat.lor}(0,0)=0. \tag{4}
Equations (3) and (4) are incompatible because
2047\cdot2^{52}>0. This contradiction disproves the universal statement
and establishes its exact negation.