P367_T1_NumberHelperPartialNormalA

Lean checked

Statement

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

Lemma · Partial-parser normality on the full A domain

For every nonempty Aeneas byte-slice carrier s with |s|\le A=3458764513820540928, the actual extracted \texttt{parse\_partial\_number}(s) returns \texttt{ok}(o) for some o:\texttt{Option}(\texttt{Decimal}\times\texttt{Usize}). All byte values are permitted. There is no grammar, UTF-8, successful-call, or exponent-digit-count premise. Both None and Some are normal results; failure and divergence are excluded.

Lean statement

Trellis authored these statements and proofs. Lean checks the formal proofs; the assumptions used by each proof are listed below.

import Tablet.NumberHelperDigitScanSourceLength
import Tablet.P364_T1_NumberHelperDigitPrefix
import Tablet.P364_T1_NumberHelperOffsetSourceLength
import Tablet.P367_T1_NumberHelperAdjustmentA
import Tablet.P367_T1_NumberHelperScientificScan
import Tablet.P367_T1_NumberHelperFractionalRetryA
import Tablet.P804_T1_DecimalFoldBounds
import Tablet.ModelSliceSplitFirst
import Tablet.ModelOptionBranch
import Tablet.ModelOptionFromResidual
import Tablet.num_imp_dec2flt_parse_parse_partial_number
import Tablet.P435_T1_SignificandScanA
import Tablet.P367_T1_NumberHelperIntegralRetryA
import Tablet.P367_T1_NumberHelperExponentAddA

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false

namespace dec2flt_model

-- [TABLET NODE: P367_T1_NumberHelperPartialNormalA]
theorem P367_T1_NumberHelperPartialNormalA (s : Slice Std.U8)
    (hne : s.val ≠ []) (hlen : s.val.length <= 3458764513820540928) :
    exists result : Option (num.imp.dec2flt.decimal.Decimal × Std.Usize),
      num.imp.dec2flt.parse.parse_partial_number s = ok result := 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

Write L=|s|, M=2^{63}-1 and C=10\cdot2^{59}-1. The selected target in Assumptions makes Isize and Usize 64-bit, with ranges [-2^{63},M] and [0,2^{64}-1]. Here L\le A<M and A+C=M. The A bound is the bound in the acceptance, rejection and record-value clauses of GOAL.md; no B bound is used. We follow num imp dec2flt parse parse partial number in its actual order, proving a normal result for every reached operation. Its empty-slice test is exact, and nonemptiness makes the initial assertion true.
Apply NumberHelperDigitPrefix to s.\mathit{val}. Write the resulting decomposition as I\mathbin{++}T_1, with I all ASCII digits and T_1 empty or nondigit-headed. Apply NumberHelperDigitScanSourceLength with initial word zero. Its source-length premise follows from L\le A<M; it returns normally with a word m_0 and residual s_1 of contents T_1, regardless of whether the wrapping word represents the unbounded fold exactly. Since |T_1|\le L, NumberHelperOffsetSourceLength applied to s,s_1 gives a normal offset N_I=L-|T_1|=|I|\in[0,L]. Both length casts in that offset are exact, as required by that lemma.
By ModelSliceSplitFirst, splitting s_1 returns normally. If its first byte is not a point, or it is empty, the fractional tuple is (s_1,m_0,0,0); put F=[] and T_2=T_1. If its first byte is 46, that split gives a legitimate suffix u with T_1=[46]\mathbin{++}u.\mathit{val}. Apply NumberHelperDigitPrefix to u.\mathit{val} and write u.\mathit{val}=F\mathbin{++}T_2. The second use of NumberHelperDigitScanSourceLength, now starting from m_0, returns normally with word m_1 and residual s_2 of contents T_2. The arbitrary-initial-word clause is essential here. The suffix length is at most L, so NumberHelperOffsetSourceLength gives fractional count N_F=|F|\in[0,L]. This count is nonnegative and no greater than A, so it is not -2^{63}; checked negation is normal with value -|F|. The following Isize-to-I64 cast is exact because -|F|\in[-A,0]\subset[-2^{63},M]. In the no-point case the same base-exponent formula holds with |F|=0.
In both cases all bytes of I,F are digits, T_2 is empty or nondigit-headed, and the source has contents either I\mathbin{++}T_2 or I\mathbin{++}[46]\mathbin{++}F\mathbin{++}T_2. Hence D=|I|+|F|\le L. The checked sum N_I+N_F is normal and exact: it is in [0,A], inside the Isize range. If D=0 the extracted call returns \texttt{ok none} immediately. Suppose D>0 for the remaining branches.
The next split of s_2 is normal by ModelSliceSplitFirst. If T_2 is empty or its first byte is neither 101 nor 69, no scientific call is made; set E=0 and final residual r=s_2. The base exponent is already the normal -|F|. If its first byte is an exponent marker, the split removes just that byte and gives a suffix v of length at most L. Apply NumberHelperScientificScan to v. It returns normally on every byte list, stripping at most one sign, scanning the complete maximal exponent-digit run, and leaving its exact tail. If it returns None, ModelOptionBranch and ModelOptionFromResidual make the enclosing partial call return \texttt{ok none}. If it returns Some exponent e, put E=e.\mathit{val}. Its statement gives -C\le E\le C, and its tail decomposition gives |r|\le|v|\le L. Apply NumberHelperExponentAddA to the I64 base -|F|\in[-A,0] and e. This is exactly the checked sum preceding any many-digit test in both marker branches. It returns normally with value -|F|+E. In particular, no short exponent-digit assumption or mantissa bound has been used to justify that addition.
On every branch that reaches record construction, the residual r has length at most L and is a suffix of the original slice. Apply NumberHelperOffsetSourceLength to s,r. It gives normal consumed offset k=L-|r|\in[0,L]. Its cast to Usize is exact: 0\le k\le A<2^{64}. This proves the consumed-length operations even for an unmatched arbitrary-byte suffix. The three record-construction continuations (empty residual, marker success, and a nonmarker head) differ only in the just-audited residual and explicit exponent.
If D\le19, the corresponding constructor returns normally with \texttt{many\_digits=false}. Suppose D>19. The checked subtraction D-19 is in [1,A], and so returns normally as Isize. Apply NumberHelperAdjustmentA to this count and the original s. It returns normally with n'=D-19-z, where z counts zero bytes in the maximal initial zero-or-point prefix of the whole input. Its hypotheses hold since D-19\le L. This use permits that prefix to continue into a malformed tail, and does not assume z\le D. If n'\le0, the existing retained constructor returns normally, without a retry or additional arithmetic.
It remains to justify each retry when n'>0. If a point was scanned, the source and saved integer-end slice have exactly the shapes I[46]FT_2 and [46]FT_2 proved above. Apply NumberHelperFractionalRetryA with these lists and explicit exponent e, or I64 zero on a nonmarker branch. The digit, nondigit-tail, A-length and [-C,C] premises all hold. It establishes the guarded one-byte retry slice, both digit scans, exact offsets, safe negation and cast, and the final checked exponent sum, yielding a normal pair. No additional significant-digit premise is needed for this fractional retry theorem.
If no point was scanned, the saved integer-end is T_2=T_1 and its head, if present, is neither a digit nor a point. Let Z_0 be the maximal initial zero-digit prefix of I and write I=Z_0\mathbin{++}H. If H=[], the raw zero-or-point prefix contains all of I, so z\ge D and D-19-z<0, contradicting n'>0. Otherwise H starts with a nonzero digit; the raw prefix stops at that digit and has z=|Z_0|. Thus |H|=D-z>19. Decode H by b\mapsto b.\mathit{val}-48: all digits are below ten and its first digit is at least one. DecimalFoldBounds gives its natural value at least 10^{|H|-1}\ge10^{19}\ge10^{18}. Folding the zero prefix from zero leaves zero, by induction over that prefix, so the fold of I equals the fold of H. Apply NumberHelperIntegralRetryA to s,s_1,I,T_1 and the explicit exponent (or zero). All its premises, including the ordinary fold lower bound, are now proved. It returns a normal pair with exact source-bounded offset, cast and safe checked addition.
The retry constructors simply insert these pairs into a Decimal with \texttt{negative=false} and \texttt{many\_digits=true}, preserving the already constructed k. Every reached loop is normal by a cited scanner or adjustment theorem; every remaining operation has been shown normal in its execution order. Substituting the successful results into the Result monad therefore produces \texttt{ok}(o) in every branch. This excludes both outer failure and divergence.

Lean proof


  set_option maxHeartbeats 1600000 in
  have integralFold : forall (integer tail : List Std.U8),
      (forall b, b ∈ integer -> 48 <= b.val /\ b.val <= 57) ->
      ((integer ++ tail).takeWhile
        (fun b => b == 48#u8 || b == 46#u8)).count 48#u8 + 19 <
          integer.length ->
      1000000000000000000 <=
        integer.foldl (fun a b => 10 * a + (b.val - 48)) 0 := by
    intro integer tail hd hlenSig
    -- The raw prefix may continue beyond the integer digit run.
    have prefixCount : forall xs : List Std.U8,
        (xs.takeWhile (fun b => b == 48#u8)).length <=
          ((xs ++ tail).takeWhile
            (fun b => b == 48#u8 || b == 46#u8)).count 48#u8 := by
      intro xs
      induction xs with
      | nil => simp
      | cons b bs ih =>
        by_cases hb : b = 48#u8
        · simpa [hb, List.takeWhile_cons] using Nat.add_le_add_right ih 1
        · simp [List.takeWhile_cons, hb]
    let zeros := integer.takeWhile (fun b => b == 48#u8)
    let significant := integer.dropWhile (fun b => b == 48#u8)
    have hsplit : integer = zeros ++ significant :=
      List.takeWhile_append_dropWhile.symm
    have hzeroMem : forall b, b ∈ zeros -> b = 48#u8 := by
      intro b hb
      simpa using List.mem_takeWhile_imp hb
    have hsigLen : 19 < significant.length := by
      have hprefix := prefixCount integer
      have hp := congrArg List.length hsplit
      simp only [List.length_append] at hp
      change zeros.length <= _ at hprefix
      omega
    have hzeroFold : zeros.foldl
        (fun a b => 10 * a + (b.val - 48)) 0 = 0 := by
      have hf : forall xs : List Std.U8,
          (forall b, b ∈ xs -> b = 48#u8) ->
          xs.foldl (fun a b => 10 * a + (b.val - 48)) 0 = 0 := by
        intro xs
        induction xs with
        | nil => intro; rfl
        | cons b bs ih =>
          intro hall
          have hb := hall b (by simp)
          have hbs : forall c, c ∈ bs -> c = 48#u8 := by
            intro c hc
            exact hall c (by simp [hc])
          simp [hb, ih hbs]
      exact hf zeros hzeroMem
    have hsigDigits : forall b, b ∈ significant ->
        48 <= b.val /\ b.val <= 57 := by
      intro b hb
      apply hd b
      rw [hsplit]
      exact List.mem_append_right zeros hb
    obtain ⟨head, rest, hsig⟩ := List.exists_cons_of_ne_nil
      (show significant ≠ [] by intro h; simp [h] at hsigLen)
    have hdropNe : integer.dropWhile (fun b => b == 48#u8) ≠ [] := by
      change significant ≠ []
      rw [hsig]
      simp
    have hnot := List.head_dropWhile_not
      (fun b => b == 48#u8) (l := integer) hdropNe
    have hheadNe : head ≠ 48#u8 := by
      intro h
      have hfirst : integer.dropWhile (fun b => b == 48#u8) = head :: rest := hsig
      simpa [hfirst, h] using hnot
    have hheadDigit := hsigDigits head (by rw [hsig]; simp)
    have hheadValNe : head.val ≠ 48 := by
      intro h
      apply hheadNe
      apply UScalar.eq_of_val_eq
      simpa using h
    have hheadPos : 1 <= head.val - 48 := by omega
    let decoded := significant.map (fun b => b.val - 48)
    have hdecoded : forall d, d ∈ decoded -> d < 10 := by
      intro d hd'
      obtain ⟨b, hb, rfl⟩ := List.mem_map.mp hd'
      have hb' := hsigDigits b hb
      omega
    have hbounds := P804_T1_DecimalFoldBounds decoded hdecoded
      (head.val - 48) (rest.map (fun b => b.val - 48))
      (by simp [decoded, hsig]) hheadPos
    have hpow : 1000000000000000000 <= 10 ^ (decoded.length - 1) := by
      have hpower : 19 <= decoded.length - 1 := by
        simp only [decoded, List.length_map]
        omega
      calc
        1000000000000000000 <= 10 ^ 19 := by norm_num
        _ <= 10 ^ (decoded.length - 1) :=
          Nat.pow_le_pow_right (by norm_num : 0 < (10 : Nat)) hpower
    rw [hsplit, List.foldl_append, hzeroFold]
    simpa [decoded, List.foldl_map] using hpow.trans hbounds.1
  have run : forall (integer fraction tail : List Std.U8) (point : Bool),
      s.val = integer ++ (if point then 46#u8 :: (fraction ++ tail) else tail) ->
      (point = false -> fraction = []) ->
      (forall b, b ∈ integer -> 48 <= b.val /\ b.val <= 57) ->
      (forall b, b ∈ fraction -> 48 <= b.val /\ b.val <= 57) ->
      (forall b rest, tail = b :: rest -> ¬ (48 <= b.val /\ b.val <= 57)) ->
      (point = false -> forall b rest, tail = b :: rest -> b ≠ 46#u8) ->
      exists result : Option (num.imp.dec2flt.decimal.Decimal × Std.Usize),
        num.imp.dec2flt.parse.parse_partial_number s = ok result := by
    intro integer fraction tail point hshape hnoFraction hd hf ht hnoPoint
    obtain ⟨intEnd, sigEnd, intWord, word, intCount, fractionCount,
      total, base, hscan, hintEnd, hoffset, hival, hfront, hsigEnd,
      hfval, hbase, hadd, htotal⟩ :=
      P435_T1_SignificandScanA s integer fraction tail point hshape
        hnoFraction hd hf ht hnoPoint hlen
    have hparts : integer.length + fraction.length <= s.val.length := by
      cases hp : point with
      | false => simp [hp, hnoFraction hp, hshape]
      | true => simp [hshape, hp]; omega
    have hsigLen : sigEnd.val.length <= s.val.length := by
      rw [hsigEnd, hshape]
      cases point <;> simp <;> omega
    have hempty : core.slice.Slice.is_empty s = ok false := by
      cases hs : s.val with
      | nil => exact (hne hs).elim
      | cons b bs => simp [core.slice.Slice.is_empty, hs]
    let finish := fun (exponent explicit : Std.I64) (rest : Slice Std.U8) => do
      let offset ← SliceU8.Insts.Dec2flt_modelNumImpDec2fltCommonByteSlice.offset_from rest s
      let len ← lift (IScalar.hcast .Usize offset)
      if total <= 19#isize then
        ok (some (num.imp.dec2flt.decimal.Decimal.mk exponent word false false, len))
      else
        let more ← total - 19#isize
        let adjusted ← num.imp.dec2flt.parse.adjust_many_digit_count s more
        if adjusted > 0#isize then
          let (manyWord, manyExp) ← num.imp.dec2flt.parse.parse_many_digits s intEnd explicit
          ok (some (num.imp.dec2flt.decimal.Decimal.mk manyExp manyWord false true, len))
        else
          ok (some (num.imp.dec2flt.decimal.Decimal.mk exponent word false false, len))
    have hfinish : forall (exponent explicit : Std.I64) (rest : Slice Std.U8),
        rest.val.length <= s.val.length ->
        -5764607523034234879 <= explicit.val ->
        explicit.val <= 5764607523034234879 ->
        exists result, finish exponent explicit rest = ok result := by
      intro exponent explicit rest hrestLen hexpLo hexpHi
      obtain ⟨offset, hoff, hoffval⟩ :=
        P364_T1_NumberHelperOffsetSourceLength s rest (by omega) hrestLen
      have hcastBounds : 0 <= offset.val /\ offset.val <= UScalar.max .Usize := by
        rw [hoffval]
        simp [UScalar.max, UScalarTy.numBits,
          Dec2Flt.P340_T1_selected_target_numBits]
        omega
      obtain ⟨len, hcast, hcastVal⟩ := Aeneas.Std.WP.spec_imp_exists
        (IScalar.hcast_inBounds_spec .Usize offset hcastBounds)
      by_cases hsmall : total.val <= 19
      · exact ⟨some (num.imp.dec2flt.decimal.Decimal.mk exponent word false false, len),
          by simp [finish, hoff, hcast, hsmall]⟩
      · have hsubBounds : IScalar.min .Isize <= total.val - 19 /\
            total.val - 19 <= IScalar.max .Isize := by
          simp [IScalar.min, IScalar.max, IScalarTy.numBits,
            Dec2Flt.P340_T1_selected_target_numBits]
          rw [htotal]
          omega
        obtain ⟨more, hmore, hmoreVal⟩ := Aeneas.Std.WP.spec_imp_exists
          (IScalar.sub_spec (x := total) (y := 19#isize)
            (by norm_num; omega) (by norm_num; omega))
        norm_num at hmoreVal
        obtain ⟨adjusted, hadjust, hadjustVal⟩ :=
          P367_T1_NumberHelperAdjustmentA s more hlen
            (by rw [hmoreVal]; omega) (by rw [hmoreVal, htotal]; omega)
        by_cases hpositive : 0 < adjusted.val
        · have hretry : exists (manyWord : Std.U64) (manyExp : Std.I64),
              num.imp.dec2flt.parse.parse_many_digits s intEnd explicit =
                ok (manyWord, manyExp) := by
            cases hp : point with
            | true =>
              obtain ⟨manyWord, manyExp, consumed, remaining, hmany, _⟩ :=
                P367_T1_NumberHelperFractionalRetryA s intEnd explicit
                  integer fraction tail (by simpa [hp] using hshape)
                  (by simpa [hp] using hintEnd) hd hf ht hlen hexpLo hexpHi
              exact ⟨manyWord, manyExp, hmany⟩
            | false =>
              have hs : s.val = integer ++ tail := by simpa [hp] using hshape
              have hcount : ((integer ++ tail).takeWhile
                  (fun b => b == 48#u8 || b == 46#u8)).count 48#u8 + 19 <
                    integer.length := by
                rw [hadjustVal, hmoreVal, htotal, hnoFraction hp] at hpositive
                simp only [List.length_nil, Nat.add_zero] at hpositive
                rw [hs] at hpositive
                omega
              obtain ⟨manyWord, manyExp, consumed, remaining, hmany, _⟩ :=
                P367_T1_NumberHelperIntegralRetryA s intEnd explicit
                  integer tail hs (by simpa [hp] using hintEnd) hd ht hlen
                  (integralFold integer tail hd hcount) hexpLo hexpHi
              exact ⟨manyWord, manyExp, hmany⟩
          obtain ⟨manyWord, manyExp, hmany⟩ := hretry
          exact ⟨some (num.imp.dec2flt.decimal.Decimal.mk manyExp manyWord false true, len),
            by simp [finish, hoff, hcast, hsmall, hmore, hadjust, hpositive, hmany]⟩
        · exact ⟨some (num.imp.dec2flt.decimal.Decimal.mk exponent word false false, len),
            by simp [finish, hoff, hcast, hsmall, hmore, hadjust, hpositive]⟩
    let scientific := fun (next : Slice Std.U8) => do
      let (value, rest) ← num.imp.dec2flt.parse.parse_scientific next
      let cf ← core.option.Option.Insts.CoreOpsTry_traitTry.branch value
      match cf with
      | core.ops.control_flow.ControlFlow.Continue explicit => do
        let exponent ← base + explicit
        finish exponent explicit rest
      | core.ops.control_flow.ControlFlow.Break residual =>
        core.option.Option.Insts.CoreOpsTry_traitFromResidualOptionInfallible.from_residual
          (num.imp.dec2flt.decimal.Decimal × Std.Usize) residual
    have hscientific : forall next : Slice Std.U8,
        next.val.length <= s.val.length ->
        exists result, scientific next = ok result := by
      intro next hnextLen
      obtain ⟨sign, digits, restTail, value, rest, hs, hd', ht',
        hparse, hrest, hnone, hvalue⟩ := P367_T1_NumberHelperScientificScan next
      have hrestLen : rest.val.length <= s.val.length := by
        have hrestNext : rest.val.length <= next.val.length := by
          rw [hrest, hs]
          simp only [List.length_append]
          omega
        omega
      cases hv : value with
      | none =>
        refine ⟨none, ?_⟩
        simp [scientific, hparse, hv, core.option.Option.Insts.CoreOpsTry_traitTry.branch,
          core.option.Option.Insts.CoreOpsTry_traitFromResidualOptionInfallible.from_residual,
          ModelOptionBranch, ModelOptionFromResidual]
      | some explicit =>
        have hexp := hvalue explicit hv
        obtain ⟨exponent, hexponent, hexponentVal⟩ :=
          P367_T1_NumberHelperExponentAddA base explicit
            (by rw [hbase]; omega) (by rw [hbase]; omega) hexp.1 hexp.2.1
        obtain ⟨result, hresult⟩ := hfinish exponent explicit rest hrestLen hexp.1 hexp.2.1
        refine ⟨result, ?_⟩
        simpa [scientific, hparse, hv, core.option.Option.Insts.CoreOpsTry_traitTry.branch,
          ModelOptionBranch, hexponent] using hresult
    let afterSignificand : Result (Option (num.imp.dec2flt.decimal.Decimal × Std.Usize)) := do
      let o ← core.slice.Slice.split_first sigEnd
      match o with
      | none => finish base 0#i64 sigEnd
      | some (c, next) =>
        if c = 101#u8 then scientific next
        else if c = 69#u8 then scientific next
        else finish base 0#i64 sigEnd
    have hafter : exists result, afterSignificand = ok result := by
      cases htail : tail with
      | nil =>
        have he : sigEnd.val = [] := hsigEnd.trans htail
        have hsplitSig : core.slice.Slice.split_first sigEnd = ok none := by
          let shaped : Slice Std.U8 := ⟨[], by simp⟩
          have heq : sigEnd = shaped := (Slice.eq_iff _ _).2 he
          rw [heq]
          rfl
        obtain ⟨result, hresult⟩ := hfinish base 0#i64 sigEnd hsigLen
          (by norm_num) (by norm_num)
        exact ⟨result, by simpa [afterSignificand, hsplitSig] using hresult⟩
      | cons c cs =>
        have he : sigEnd.val = c :: cs := hsigEnd.trans htail
        let next : Slice Std.U8 := ⟨cs, by
          have hp := sigEnd.property
          rw [he] at hp
          simp only [List.length_cons] at hp
          omega⟩
        have hsplitSig : core.slice.Slice.split_first sigEnd = ok (some (c, next)) := by
          let shaped : Slice Std.U8 := ⟨c :: cs, by rw [← he]; exact sigEnd.property⟩
          have heq : sigEnd = shaped := (Slice.eq_iff _ _).2 he
          rw [heq]
          rfl
        have hnextLen : next.val.length <= s.val.length := by
          dsimp [next]
          rw [he] at hsigLen
          simp only [List.length_cons] at hsigLen
          omega
        by_cases hlower : c = 101#u8
        · obtain ⟨result, hresult⟩ := hscientific next hnextLen
          exact ⟨result, by simpa [afterSignificand, hsplitSig, hlower] using hresult⟩
        · by_cases hupper : c = 69#u8
          · obtain ⟨result, hresult⟩ := hscientific next hnextLen
            exact ⟨result, by simpa [afterSignificand, hsplitSig, hlower, hupper] using hresult⟩
          · obtain ⟨result, hresult⟩ := hfinish base 0#i64 sigEnd hsigLen
              (by norm_num) (by norm_num)
            exact ⟨result, by simpa [afterSignificand, hsplitSig, hlower, hupper] using hresult⟩
    have hparser : num.imp.dec2flt.parse.parse_partial_number s =
        (if total = 0#isize then ok none else afterSignificand) := by
      have hfront' : (do
          let o ← core.slice.Slice.split_first intEnd
          match o with
          | none => ok (intEnd, intWord, 0#isize, 0#i64)
          | some p =>
            let (b, next) := p
            match b with
            | 46#uscalar => do
              let (rest, value) ← num.imp.dec2flt.parse.try_parse_digits next intWord
              let count ← SliceU8.Insts.Dec2flt_modelNumImpDec2fltCommonByteSlice.offset_from rest next
              let neg ← -. count
              let exponent ← lift (IScalar.cast .I64 neg)
              ok (rest, value, count, exponent)
            | _ => ok (intEnd, intWord, 0#isize, 0#i64)) =
          ok (sigEnd, word, fractionCount, base) := by
        convert hfront using 1
        apply congrArg (fun k => Bind.bind (core.slice.Slice.split_first intEnd) k)
        funext o
        cases o with
        | none => rfl
        | some p => cases p; rfl
      unfold num.imp.dec2flt.parse.parse_partial_number
      simp only [hempty, bind_tc_ok, Bool.false_eq_true, not_false_eq_true,
        massert, if_true, hscan]
      dsimp
      simp only [hoffset, bind_tc_ok]
      simp only [Aeneas.Std.uncurry, ← bind_assoc_eq] at hfront' ⊢
      erw [hfront']
      simp only [bind_tc_ok, Aeneas.Std.uncurry_apply_pair]
      simp only [hadd, bind_tc_ok]
      simp only [afterSignificand, scientific, finish, Aeneas.Std.uncurry, bind_assoc_eq]
      congr 1
      apply congrArg (fun k => Bind.bind (core.slice.Slice.split_first sigEnd) k)
      funext o
      cases o with
      | none => rfl
      | some p => cases p; rfl
    rw [hparser]
    by_cases hz : total = 0#isize
    · exact ⟨none, by simp [hz]⟩
    · simpa only [hz, if_false] using hafter
  obtain ⟨integer, intTail, hsplit, hd, ht⟩ := P364_T1_NumberHelperDigitPrefix s.val
  cases intTail with
  | nil =>
    exact run integer [] [] false (by simpa using hsplit) (by simp)
      hd (by simp) (by simp) (by simp)
  | cons b bs =>
    by_cases hp : b = 46#u8
    · obtain ⟨fraction, tail, hfrac, hf, htail⟩ := P364_T1_NumberHelperDigitPrefix bs
      exact run integer fraction tail true (by simpa [hp, hfrac] using hsplit)
        (by simp) hd hf htail (by simp)
    · exact run integer [] (b :: bs) false (by simpa using hsplit)
        (by simp) hd (by simp) ht (by intro _ c cs h; cases h; exact hp)

end dec2flt_model

Download Lean source · Download TeX source

Complete Lean module
import Tablet.NumberHelperDigitScanSourceLength
import Tablet.P364_T1_NumberHelperDigitPrefix
import Tablet.P364_T1_NumberHelperOffsetSourceLength
import Tablet.P367_T1_NumberHelperAdjustmentA
import Tablet.P367_T1_NumberHelperScientificScan
import Tablet.P367_T1_NumberHelperFractionalRetryA
import Tablet.P804_T1_DecimalFoldBounds
import Tablet.ModelSliceSplitFirst
import Tablet.ModelOptionBranch
import Tablet.ModelOptionFromResidual
import Tablet.num_imp_dec2flt_parse_parse_partial_number
import Tablet.P435_T1_SignificandScanA
import Tablet.P367_T1_NumberHelperIntegralRetryA
import Tablet.P367_T1_NumberHelperExponentAddA

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false

namespace dec2flt_model

-- [TABLET NODE: P367_T1_NumberHelperPartialNormalA]
theorem P367_T1_NumberHelperPartialNormalA (s : Slice Std.U8)
    (hne : s.val ≠ []) (hlen : s.val.length <= 3458764513820540928) :
    exists result : Option (num.imp.dec2flt.decimal.Decimal × Std.Usize),
      num.imp.dec2flt.parse.parse_partial_number s = ok result := by
-- BODY
  set_option maxHeartbeats 1600000 in
  have integralFold : forall (integer tail : List Std.U8),
      (forall b, b ∈ integer -> 48 <= b.val /\ b.val <= 57) ->
      ((integer ++ tail).takeWhile
        (fun b => b == 48#u8 || b == 46#u8)).count 48#u8 + 19 <
          integer.length ->
      1000000000000000000 <=
        integer.foldl (fun a b => 10 * a + (b.val - 48)) 0 := by
    intro integer tail hd hlenSig
    -- The raw prefix may continue beyond the integer digit run.
    have prefixCount : forall xs : List Std.U8,
        (xs.takeWhile (fun b => b == 48#u8)).length <=
          ((xs ++ tail).takeWhile
            (fun b => b == 48#u8 || b == 46#u8)).count 48#u8 := by
      intro xs
      induction xs with
      | nil => simp
      | cons b bs ih =>
        by_cases hb : b = 48#u8
        · simpa [hb, List.takeWhile_cons] using Nat.add_le_add_right ih 1
        · simp [List.takeWhile_cons, hb]
    let zeros := integer.takeWhile (fun b => b == 48#u8)
    let significant := integer.dropWhile (fun b => b == 48#u8)
    have hsplit : integer = zeros ++ significant :=
      List.takeWhile_append_dropWhile.symm
    have hzeroMem : forall b, b ∈ zeros -> b = 48#u8 := by
      intro b hb
      simpa using List.mem_takeWhile_imp hb
    have hsigLen : 19 < significant.length := by
      have hprefix := prefixCount integer
      have hp := congrArg List.length hsplit
      simp only [List.length_append] at hp
      change zeros.length <= _ at hprefix
      omega
    have hzeroFold : zeros.foldl
        (fun a b => 10 * a + (b.val - 48)) 0 = 0 := by
      have hf : forall xs : List Std.U8,
          (forall b, b ∈ xs -> b = 48#u8) ->
          xs.foldl (fun a b => 10 * a + (b.val - 48)) 0 = 0 := by
        intro xs
        induction xs with
        | nil => intro; rfl
        | cons b bs ih =>
          intro hall
          have hb := hall b (by simp)
          have hbs : forall c, c ∈ bs -> c = 48#u8 := by
            intro c hc
            exact hall c (by simp [hc])
          simp [hb, ih hbs]
      exact hf zeros hzeroMem
    have hsigDigits : forall b, b ∈ significant ->
        48 <= b.val /\ b.val <= 57 := by
      intro b hb
      apply hd b
      rw [hsplit]
      exact List.mem_append_right zeros hb
    obtain ⟨head, rest, hsig⟩ := List.exists_cons_of_ne_nil
      (show significant ≠ [] by intro h; simp [h] at hsigLen)
    have hdropNe : integer.dropWhile (fun b => b == 48#u8) ≠ [] := by
      change significant ≠ []
      rw [hsig]
      simp
    have hnot := List.head_dropWhile_not
      (fun b => b == 48#u8) (l := integer) hdropNe
    have hheadNe : head ≠ 48#u8 := by
      intro h
      have hfirst : integer.dropWhile (fun b => b == 48#u8) = head :: rest := hsig
      simpa [hfirst, h] using hnot
    have hheadDigit := hsigDigits head (by rw [hsig]; simp)
    have hheadValNe : head.val ≠ 48 := by
      intro h
      apply hheadNe
      apply UScalar.eq_of_val_eq
      simpa using h
    have hheadPos : 1 <= head.val - 48 := by omega
    let decoded := significant.map (fun b => b.val - 48)
    have hdecoded : forall d, d ∈ decoded -> d < 10 := by
      intro d hd'
      obtain ⟨b, hb, rfl⟩ := List.mem_map.mp hd'
      have hb' := hsigDigits b hb
      omega
    have hbounds := P804_T1_DecimalFoldBounds decoded hdecoded
      (head.val - 48) (rest.map (fun b => b.val - 48))
      (by simp [decoded, hsig]) hheadPos
    have hpow : 1000000000000000000 <= 10 ^ (decoded.length - 1) := by
      have hpower : 19 <= decoded.length - 1 := by
        simp only [decoded, List.length_map]
        omega
      calc
        1000000000000000000 <= 10 ^ 19 := by norm_num
        _ <= 10 ^ (decoded.length - 1) :=
          Nat.pow_le_pow_right (by norm_num : 0 < (10 : Nat)) hpower
    rw [hsplit, List.foldl_append, hzeroFold]
    simpa [decoded, List.foldl_map] using hpow.trans hbounds.1
  have run : forall (integer fraction tail : List Std.U8) (point : Bool),
      s.val = integer ++ (if point then 46#u8 :: (fraction ++ tail) else tail) ->
      (point = false -> fraction = []) ->
      (forall b, b ∈ integer -> 48 <= b.val /\ b.val <= 57) ->
      (forall b, b ∈ fraction -> 48 <= b.val /\ b.val <= 57) ->
      (forall b rest, tail = b :: rest -> ¬ (48 <= b.val /\ b.val <= 57)) ->
      (point = false -> forall b rest, tail = b :: rest -> b ≠ 46#u8) ->
      exists result : Option (num.imp.dec2flt.decimal.Decimal × Std.Usize),
        num.imp.dec2flt.parse.parse_partial_number s = ok result := by
    intro integer fraction tail point hshape hnoFraction hd hf ht hnoPoint
    obtain ⟨intEnd, sigEnd, intWord, word, intCount, fractionCount,
      total, base, hscan, hintEnd, hoffset, hival, hfront, hsigEnd,
      hfval, hbase, hadd, htotal⟩ :=
      P435_T1_SignificandScanA s integer fraction tail point hshape
        hnoFraction hd hf ht hnoPoint hlen
    have hparts : integer.length + fraction.length <= s.val.length := by
      cases hp : point with
      | false => simp [hp, hnoFraction hp, hshape]
      | true => simp [hshape, hp]; omega
    have hsigLen : sigEnd.val.length <= s.val.length := by
      rw [hsigEnd, hshape]
      cases point <;> simp <;> omega
    have hempty : core.slice.Slice.is_empty s = ok false := by
      cases hs : s.val with
      | nil => exact (hne hs).elim
      | cons b bs => simp [core.slice.Slice.is_empty, hs]
    let finish := fun (exponent explicit : Std.I64) (rest : Slice Std.U8) => do
      let offset ← SliceU8.Insts.Dec2flt_modelNumImpDec2fltCommonByteSlice.offset_from rest s
      let len ← lift (IScalar.hcast .Usize offset)
      if total <= 19#isize then
        ok (some (num.imp.dec2flt.decimal.Decimal.mk exponent word false false, len))
      else
        let more ← total - 19#isize
        let adjusted ← num.imp.dec2flt.parse.adjust_many_digit_count s more
        if adjusted > 0#isize then
          let (manyWord, manyExp) ← num.imp.dec2flt.parse.parse_many_digits s intEnd explicit
          ok (some (num.imp.dec2flt.decimal.Decimal.mk manyExp manyWord false true, len))
        else
          ok (some (num.imp.dec2flt.decimal.Decimal.mk exponent word false false, len))
    have hfinish : forall (exponent explicit : Std.I64) (rest : Slice Std.U8),
        rest.val.length <= s.val.length ->
        -5764607523034234879 <= explicit.val ->
        explicit.val <= 5764607523034234879 ->
        exists result, finish exponent explicit rest = ok result := by
      intro exponent explicit rest hrestLen hexpLo hexpHi
      obtain ⟨offset, hoff, hoffval⟩ :=
        P364_T1_NumberHelperOffsetSourceLength s rest (by omega) hrestLen
      have hcastBounds : 0 <= offset.val /\ offset.val <= UScalar.max .Usize := by
        rw [hoffval]
        simp [UScalar.max, UScalarTy.numBits,
          Dec2Flt.P340_T1_selected_target_numBits]
        omega
      obtain ⟨len, hcast, hcastVal⟩ := Aeneas.Std.WP.spec_imp_exists
        (IScalar.hcast_inBounds_spec .Usize offset hcastBounds)
      by_cases hsmall : total.val <= 19
      · exact ⟨some (num.imp.dec2flt.decimal.Decimal.mk exponent word false false, len),
          by simp [finish, hoff, hcast, hsmall]⟩
      · have hsubBounds : IScalar.min .Isize <= total.val - 19 /\
            total.val - 19 <= IScalar.max .Isize := by
          simp [IScalar.min, IScalar.max, IScalarTy.numBits,
            Dec2Flt.P340_T1_selected_target_numBits]
          rw [htotal]
          omega
        obtain ⟨more, hmore, hmoreVal⟩ := Aeneas.Std.WP.spec_imp_exists
          (IScalar.sub_spec (x := total) (y := 19#isize)
            (by norm_num; omega) (by norm_num; omega))
        norm_num at hmoreVal
        obtain ⟨adjusted, hadjust, hadjustVal⟩ :=
          P367_T1_NumberHelperAdjustmentA s more hlen
            (by rw [hmoreVal]; omega) (by rw [hmoreVal, htotal]; omega)
        by_cases hpositive : 0 < adjusted.val
        · have hretry : exists (manyWord : Std.U64) (manyExp : Std.I64),
              num.imp.dec2flt.parse.parse_many_digits s intEnd explicit =
                ok (manyWord, manyExp) := by
            cases hp : point with
            | true =>
              obtain ⟨manyWord, manyExp, consumed, remaining, hmany, _⟩ :=
                P367_T1_NumberHelperFractionalRetryA s intEnd explicit
                  integer fraction tail (by simpa [hp] using hshape)
                  (by simpa [hp] using hintEnd) hd hf ht hlen hexpLo hexpHi
              exact ⟨manyWord, manyExp, hmany⟩
            | false =>
              have hs : s.val = integer ++ tail := by simpa [hp] using hshape
              have hcount : ((integer ++ tail).takeWhile
                  (fun b => b == 48#u8 || b == 46#u8)).count 48#u8 + 19 <
                    integer.length := by
                rw [hadjustVal, hmoreVal, htotal, hnoFraction hp] at hpositive
                simp only [List.length_nil, Nat.add_zero] at hpositive
                rw [hs] at hpositive
                omega
              obtain ⟨manyWord, manyExp, consumed, remaining, hmany, _⟩ :=
                P367_T1_NumberHelperIntegralRetryA s intEnd explicit
                  integer tail hs (by simpa [hp] using hintEnd) hd ht hlen
                  (integralFold integer tail hd hcount) hexpLo hexpHi
              exact ⟨manyWord, manyExp, hmany⟩
          obtain ⟨manyWord, manyExp, hmany⟩ := hretry
          exact ⟨some (num.imp.dec2flt.decimal.Decimal.mk manyExp manyWord false true, len),
            by simp [finish, hoff, hcast, hsmall, hmore, hadjust, hpositive, hmany]⟩
        · exact ⟨some (num.imp.dec2flt.decimal.Decimal.mk exponent word false false, len),
            by simp [finish, hoff, hcast, hsmall, hmore, hadjust, hpositive]⟩
    let scientific := fun (next : Slice Std.U8) => do
      let (value, rest) ← num.imp.dec2flt.parse.parse_scientific next
      let cf ← core.option.Option.Insts.CoreOpsTry_traitTry.branch value
      match cf with
      | core.ops.control_flow.ControlFlow.Continue explicit => do
        let exponent ← base + explicit
        finish exponent explicit rest
      | core.ops.control_flow.ControlFlow.Break residual =>
        core.option.Option.Insts.CoreOpsTry_traitFromResidualOptionInfallible.from_residual
          (num.imp.dec2flt.decimal.Decimal × Std.Usize) residual
    have hscientific : forall next : Slice Std.U8,
        next.val.length <= s.val.length ->
        exists result, scientific next = ok result := by
      intro next hnextLen
      obtain ⟨sign, digits, restTail, value, rest, hs, hd', ht',
        hparse, hrest, hnone, hvalue⟩ := P367_T1_NumberHelperScientificScan next
      have hrestLen : rest.val.length <= s.val.length := by
        have hrestNext : rest.val.length <= next.val.length := by
          rw [hrest, hs]
          simp only [List.length_append]
          omega
        omega
      cases hv : value with
      | none =>
        refine ⟨none, ?_⟩
        simp [scientific, hparse, hv, core.option.Option.Insts.CoreOpsTry_traitTry.branch,
          core.option.Option.Insts.CoreOpsTry_traitFromResidualOptionInfallible.from_residual,
          ModelOptionBranch, ModelOptionFromResidual]
      | some explicit =>
        have hexp := hvalue explicit hv
        obtain ⟨exponent, hexponent, hexponentVal⟩ :=
          P367_T1_NumberHelperExponentAddA base explicit
            (by rw [hbase]; omega) (by rw [hbase]; omega) hexp.1 hexp.2.1
        obtain ⟨result, hresult⟩ := hfinish exponent explicit rest hrestLen hexp.1 hexp.2.1
        refine ⟨result, ?_⟩
        simpa [scientific, hparse, hv, core.option.Option.Insts.CoreOpsTry_traitTry.branch,
          ModelOptionBranch, hexponent] using hresult
    let afterSignificand : Result (Option (num.imp.dec2flt.decimal.Decimal × Std.Usize)) := do
      let o ← core.slice.Slice.split_first sigEnd
      match o with
      | none => finish base 0#i64 sigEnd
      | some (c, next) =>
        if c = 101#u8 then scientific next
        else if c = 69#u8 then scientific next
        else finish base 0#i64 sigEnd
    have hafter : exists result, afterSignificand = ok result := by
      cases htail : tail with
      | nil =>
        have he : sigEnd.val = [] := hsigEnd.trans htail
        have hsplitSig : core.slice.Slice.split_first sigEnd = ok none := by
          let shaped : Slice Std.U8 := ⟨[], by simp⟩
          have heq : sigEnd = shaped := (Slice.eq_iff _ _).2 he
          rw [heq]
          rfl
        obtain ⟨result, hresult⟩ := hfinish base 0#i64 sigEnd hsigLen
          (by norm_num) (by norm_num)
        exact ⟨result, by simpa [afterSignificand, hsplitSig] using hresult⟩
      | cons c cs =>
        have he : sigEnd.val = c :: cs := hsigEnd.trans htail
        let next : Slice Std.U8 := ⟨cs, by
          have hp := sigEnd.property
          rw [he] at hp
          simp only [List.length_cons] at hp
          omega⟩
        have hsplitSig : core.slice.Slice.split_first sigEnd = ok (some (c, next)) := by
          let shaped : Slice Std.U8 := ⟨c :: cs, by rw [← he]; exact sigEnd.property⟩
          have heq : sigEnd = shaped := (Slice.eq_iff _ _).2 he
          rw [heq]
          rfl
        have hnextLen : next.val.length <= s.val.length := by
          dsimp [next]
          rw [he] at hsigLen
          simp only [List.length_cons] at hsigLen
          omega
        by_cases hlower : c = 101#u8
        · obtain ⟨result, hresult⟩ := hscientific next hnextLen
          exact ⟨result, by simpa [afterSignificand, hsplitSig, hlower] using hresult⟩
        · by_cases hupper : c = 69#u8
          · obtain ⟨result, hresult⟩ := hscientific next hnextLen
            exact ⟨result, by simpa [afterSignificand, hsplitSig, hlower, hupper] using hresult⟩
          · obtain ⟨result, hresult⟩ := hfinish base 0#i64 sigEnd hsigLen
              (by norm_num) (by norm_num)
            exact ⟨result, by simpa [afterSignificand, hsplitSig, hlower, hupper] using hresult⟩
    have hparser : num.imp.dec2flt.parse.parse_partial_number s =
        (if total = 0#isize then ok none else afterSignificand) := by
      have hfront' : (do
          let o ← core.slice.Slice.split_first intEnd
          match o with
          | none => ok (intEnd, intWord, 0#isize, 0#i64)
          | some p =>
            let (b, next) := p
            match b with
            | 46#uscalar => do
              let (rest, value) ← num.imp.dec2flt.parse.try_parse_digits next intWord
              let count ← SliceU8.Insts.Dec2flt_modelNumImpDec2fltCommonByteSlice.offset_from rest next
              let neg ← -. count
              let exponent ← lift (IScalar.cast .I64 neg)
              ok (rest, value, count, exponent)
            | _ => ok (intEnd, intWord, 0#isize, 0#i64)) =
          ok (sigEnd, word, fractionCount, base) := by
        convert hfront using 1
        apply congrArg (fun k => Bind.bind (core.slice.Slice.split_first intEnd) k)
        funext o
        cases o with
        | none => rfl
        | some p => cases p; rfl
      unfold num.imp.dec2flt.parse.parse_partial_number
      simp only [hempty, bind_tc_ok, Bool.false_eq_true, not_false_eq_true,
        massert, if_true, hscan]
      dsimp
      simp only [hoffset, bind_tc_ok]
      simp only [Aeneas.Std.uncurry, ← bind_assoc_eq] at hfront' ⊢
      erw [hfront']
      simp only [bind_tc_ok, Aeneas.Std.uncurry_apply_pair]
      simp only [hadd, bind_tc_ok]
      simp only [afterSignificand, scientific, finish, Aeneas.Std.uncurry, bind_assoc_eq]
      congr 1
      apply congrArg (fun k => Bind.bind (core.slice.Slice.split_first sigEnd) k)
      funext o
      cases o with
      | none => rfl
      | some p => cases p; rfl
    rw [hparser]
    by_cases hz : total = 0#isize
    · exact ⟨none, by simp [hz]⟩
    · simpa only [hz, if_false] using hafter
  obtain ⟨integer, intTail, hsplit, hd, ht⟩ := P364_T1_NumberHelperDigitPrefix s.val
  cases intTail with
  | nil =>
    exact run integer [] [] false (by simpa using hsplit) (by simp)
      hd (by simp) (by simp) (by simp)
  | cons b bs =>
    by_cases hp : b = 46#u8
    · obtain ⟨fraction, tail, hfrac, hf, htail⟩ := P364_T1_NumberHelperDigitPrefix bs
      exact run integer fraction tail true (by simpa [hp, hfrac] using hsplit)
        (by simp) hd hf htail (by simp)
    · exact run integer [] (b :: bs) false (by simpa using hsplit)
        (by simp) hd (by simp) ht (by intro _ c cs h; cases h; exact hp)

end dec2flt_model

Proof structure

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

Explore this dependency tree

Inspect related source (68)
More program dependencies (35)
Standard-library dependencies (30)

Related source and models come from the extraction records and declared dependencies.

Proof assumptions and review

Lean checks the formal proof. Trellis also reviews how the statement corresponds to the intended requirement.

Transitive assumptions

This list combines the assumptions recorded for this declaration and its dependencies. It may include assumptions used by auxiliary declarations in those modules.

Helper theorems included
All 65 entries
Technical checking records
Local closure summary
{
  "node": "P367_T1_NumberHelperPartialNormalA",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "a6f40eba498830c7a8bb99226cc1c66d058988f44912deb884b84764cd70bb03",
  "active_statement_hash": "2fc7a6a5a34a98c78a41783eb561e7b191ff16b3f17d4f2e051e746ba0a1e25d",
  "kernel_axioms": [
    "Classical.choice",
    "Dec2Flt.P340_T1_selected_target_numBits",
    "Quot.sound",
    "propext"
  ],
  "toolchain_hash": "ce4c4e3d87434b9663f46de25ce34b48a0cf0d392e0a320a0787b4674a2d7b61",
  "lean_executable_hash": "3e0d0d3d801675359f2d4cf9815bfdb417b20b92fdd9d48b3b14c95bbae28bbf",
  "checker_script_hash": "c8e4a03273e23b9a8f2e141020652a4e0b7b0a8ab0883366ea9d031ca3f37aa1",
  "approved_axioms_hash": "576e6bf9480cfd32f53c309c7ac8fb115c1ba6e413f299ed5ff9fa7c647e6769",
  "axcheck_status": "Agreed",
  "accepted_at_snapshot_id": "worker-result-local-closure-issuance-cycle-181",
  "boundary_theorems": {},
  "strict_theorem_deps": {
    "P364_T1_NumberHelperDigitPrefix": "3426b4efc0d98c81",
    "P364_T1_NumberHelperOffsetSourceLength": "de0168dfeba3b802",
    "P367_T1_NumberHelperAdjustmentA": "b90e6cabad3dad3e",
    "P367_T1_NumberHelperExponentAddA": "cd7f7391f1891168",
    "P367_T1_NumberHelperFractionalRetryA": "013dace800a7a0d8",
    "P367_T1_NumberHelperIntegralRetryA": "d66d59fc5c9acf83",
    "P367_T1_NumberHelperScientificScan": "dd4ec9ae0f1aa797",
    "P435_T1_SignificandScanA": "4fa1dfb050285227",
    "P804_T1_DecimalFoldBounds": "9af7ca1186664411",
    "num_imp_dec2flt_parse_parse_partial_number": "854af4cc12136a58"
  },
  "strict_definition_deps": {
    "ModelOptionBranch": "c55e273482c8c0a1",
    "ModelOptionFromResidual": "6d48ecfbc617744f",
    "P367_T1_NumberHelperScientificScan": "28ca0a8ac503ee01",
    "P435_T1_SignificandScanA": "0b89b3e203e9108d",
    "Preamble": "4adf4172ae751d7d",
    "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_partial_number": "5712e484f99eb7aa",
    "num_imp_dec2flt_parse_parse_scientific": "447f722d5841d2c5",
    "num_imp_dec2flt_parse_try_parse_digits": "238b4a73cd46fc56"
  }
}
Prose assessment
{
  "label": "Recorded Sound: VerifierPass",
  "assessment_status": "VerifierPass",
  "fingerprint_relation": "matches current fingerprint",
  "assessment_fingerprint": "sound-v2:326cb0399d614aec8b301a6debc881d728a0660d5a2138e4e85c87ebc734791c",
  "current_fingerprint": "sound-v2:326cb0399d614aec8b301a6debc881d728a0660d5a2138e4e85c87ebc734791c",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "sound_status": "Pass",
  "substantiveness_status": "Pass"
}