Statement
This explanation was written alongside the formalization to describe the statement and its reasoning.
Lemma · Exact common decimal-sequence finalization
start and rest be modeled byte slices, let
scan and out be decimal-sequence records, let S,R,X,Y,T
be finite lists of natural numbers, let q be natural, let P,E be integers,
and let f map I32 values to modeled results. Assume all of the following:
- the natural values in
startare X\mathbin{++}Y\mathbin{++}T and those inrestare T; - X is empty or has the form X_0\mathbin{++}[b] with b\ne48 and b\ne46, every member of Y is 48 or 46, and Y.\operatorname{count}(48)=q;
- \texttt{scan.num\_digits.val}=|S| and, for some integer k,\texttt{scan.decimal\_point.val}+q+|R|=P+k2^{32};
- \texttt{scan.truncated}=\mathsf{false} and S=R\mathbin{++}[0]^q;
- after taking the first \min(|S|,768) cells of
scan.digitsand replacing each modeled byte by its natural value, the resulting list is S.\operatorname{take}(\min(|S|,768)); - for every I32 values
baseandresult, f(\texttt{base})=\operatorname{ok}(\texttt{result}) implies \texttt{result.val}=\texttt{base.val}+E; and - the following checked monadic computation returns \operatorname{ok}(\texttt{out}): subtract the two slice lengths; count trailing zeroes in
startup to that difference; cast that count to I32 and add it toscan.decimal_point; subtract the count fromscan.num_digits; cast the retained count to I32 and add it to the intermediate point; cap the count at 768 and set the flag to true exactly in the branch where the retained count is greater than 768, otherwise keep the count andscan.truncated; apply f to the point; run extracted fill loop~1 onscan.digitsfrom the selected count toMAX_DIGITS_WITHOUT_OVERFLOW; and constructoutfrom the selected count, final point, selected flag, and returned array.
out.num_digits.val cells equal
R.\operatorname{take}(\texttt{out.num\_digits.val}),
\texttt{out.truncated}=\mathsf{true} if and only if 768<|R|, and there
is an integer k such that
Lean statement
Trellis authored these statements and proofs. Lean checks the formal proofs; the assumptions used by each proof are listed below.
import Tablet.DecimalSeqTrailingZeroValues
import Tablet.DecimalSeqFillPrefixPreserved
import Tablet.DecimalSeqI32HCastCongruence
import Tablet.DecimalSeqDuplicateLoops
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxHeartbeats 2000000
namespace dec2flt_model
-- [TABLET NODE: DecimalSeqFinalizationExact]
theorem DecimalSeqFinalizationExact (start rest : Slice Std.U8)
(scan out : num.imp.dec2flt.decimal_seq.DecimalSeq)
(sig trim : List Nat) (prefx suffix tail : List Nat) (q : Nat)
(P E : Int) (suffixEval : Std.I32 -> Result Std.I32)
(hstart : start.val.map (fun b => b.val) = prefx ++ suffix ++ tail)
(hrest : rest.val.map (fun b => b.val) = tail)
(hprefx : prefx = [] ∨ exists pre b,
prefx = pre ++ [b] /\ b ≠ 48 /\ b ≠ 46)
(hsuffix : forall b, b ∈ suffix -> b = 48 ∨ b = 46)
(hq : suffix.count 48 = q)
(hscanCount : scan.num_digits.val = sig.length)
(hscanPoint : exists k : Int,
scan.decimal_point.val + (q : Int) + (trim.length : Int) =
P + k * 4294967296)
(hscanTrunc : scan.truncated = false)
(hsig : sig = trim ++ List.replicate q 0)
(hscanDigits :
(scan.digits.val.take (min sig.length 768)).map (fun b => b.val) =
sig.take (min sig.length 768))
(hsuffixValue : forall base result,
suffixEval base = ok result -> result.val = base.val + E)
(hcore :
(do
let consumed <- Slice.len start - Slice.len rest
let trailing <-
num.imp.dec2flt.decimal_seq.count_trailing_zeros start consumed
let p1 <- scan.decimal_point + UScalar.hcast .I32 trailing
let kept <- scan.num_digits - trailing
let point <- p1 + UScalar.hcast .I32 kept
let (nDigits, flag) <-
if kept > num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS
then ok (num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS, true)
else ok (kept, scan.truncated)
let finalPoint <- suffixEval point
let a <- num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1
{ start := nDigits,
«end» :=
num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS_WITHOUT_OVERFLOW }
scan.digits
ok (num.imp.dec2flt.decimal_seq.DecimalSeq.mk
nDigits finalPoint flag a)) = ok out) :
out.num_digits.val = min trim.length 768 /\
(out.digits.val.take out.num_digits.val).map (fun z => z.val) =
trim.take out.num_digits.val /\
(out.truncated = true <-> 768 < trim.length) /\
exists k : Int,
out.decimal_point.val = P + E + k * 4294967296 := 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
scan.decimal_point shows that the point passed
to f is congruent to P modulo 2^{32}. The supplied equation for every
successful result of f then adds E. The cap branch returns 768 and true
exactly when 768<|R|; otherwise it returns |R| and preserves the supplied
false scan flag. Since S=R\mathbin{++}[0]^q, taking no more than |R|
entries from the stored prefix of S gives the corresponding prefix of R.
Finally DecimalSeqFillPrefixPreserved shows that fill loop~1 does not
change that prefix. These facts give all four conclusions.Lean proof
have hlenStart : start.val.length =
prefx.length + suffix.length + tail.length := by
have h := congrArg List.length hstart
simpa [Nat.add_assoc] using h
have hlenRest : rest.val.length = tail.length := by
have h := congrArg List.length hrest
simpa using h
have hsubbound : (Slice.len rest).val <= (Slice.len start).val := by
simp [Slice.len, hlenStart, hlenRest]
obtain ⟨consumed, hconsumed, hconsumedVal, _⟩ :=
Aeneas.Std.WP.spec_imp_exists
(UScalar.sub_spec (x := Slice.len start) (y := Slice.len rest) hsubbound)
have hconsumedPrefix : consumed.val = (prefx ++ suffix).length := by
simpa [Slice.len, hlenStart, hlenRest] using hconsumedVal
have htrailBound : suffix.count 48 <= UScalar.max .Usize := by
have hle : suffix.count 48 <= start.val.length := by
rw [hlenStart]
have hc : suffix.count 48 <= suffix.length := List.count_le_length
omega
have hsmax : start.val.length <= UScalar.max .Usize := by
simpa [UScalar.max, Usize.max, Usize.numBits,
Dec2Flt.configured_x86_64_numBits] using start.property
exact le_trans hle hsmax
obtain ⟨trailing, htrailLoop, htrailingVal⟩ :=
DecimalSeqTrailingZeroValues start prefx suffix tail 0#usize consumed
hstart hprefx hsuffix hconsumedPrefix (by simpa using htrailBound)
have htrailingQ : trailing.val = q := by
simpa [hq] using htrailingVal
have htrail :
num.imp.dec2flt.decimal_seq.count_trailing_zeros start consumed =
ok trailing := by
unfold num.imp.dec2flt.decimal_seq.count_trailing_zeros
simpa using htrailLoop
rw [hconsumed] at hcore
simp only [bind_tc_ok] at hcore
rw [htrail] at hcore
simp only [bind_tc_ok, Aeneas.Std.lift] at hcore
have hqle : q <= sig.length := by
have h := congrArg List.length hsig
simp at h
omega
have htrailLe : trailing.val <= scan.num_digits.val := by
rw [htrailingQ, hscanCount]
exact hqle
obtain ⟨kept, hkeep, hkeepVal, _⟩ :=
Aeneas.Std.WP.spec_imp_exists
(UScalar.sub_spec (x := scan.num_digits) (y := trailing) htrailLe)
have hkeepTrim : kept.val = trim.length := by
rw [hkeepVal, htrailingQ, hscanCount]
have h := congrArg List.length hsig
simp at h
omega
cases ha : scan.decimal_point + UScalar.hcast .I32 trailing with
| fail err => rw [ha] at hcore; simp at hcore
| div => rw [ha] at hcore; simp at hcore
| ok p1 =>
rw [ha] at hcore
simp only [bind_tc_ok] at hcore
rw [hkeep] at hcore
simp only [bind_tc_ok, Aeneas.Std.lift] at hcore
cases hp : p1 + UScalar.hcast .I32 kept with
| fail err => rw [hp] at hcore; simp at hcore
| div => rw [hp] at hcore; simp at hcore
| ok point =>
rw [hp] at hcore
simp only [bind_tc_ok] at hcore
cases he : suffixEval point with
| fail err =>
rw [he] at hcore
split at hcore <;> simp_all
| div =>
rw [he] at hcore
split at hcore <;> simp_all
| ok finalPoint =>
rw [he] at hcore
simp only [bind_tc_ok] at hcore
obtain ⟨kq, hkq⟩ := DecimalSeqI32HCastCongruence trailing
obtain ⟨kt, hkt⟩ := DecimalSeqI32HCastCongruence kept
have haVal : p1.val = scan.decimal_point.val +
(UScalar.hcast .I32 trailing).val := by
have hh := IScalar.add_equiv scan.decimal_point
(UScalar.hcast .I32 trailing)
rw [ha] at hh
exact hh.2.1
have hpVal : point.val = p1.val +
(UScalar.hcast .I32 kept).val := by
have hh := IScalar.add_equiv p1 (UScalar.hcast .I32 kept)
rw [hp] at hh
exact hh.2.1
have heVal : finalPoint.val = point.val + E :=
hsuffixValue point finalPoint he
rcases hscanPoint with ⟨kb, hkb⟩
have hpointCong : exists k : Int,
finalPoint.val = P + E + k * 4294967296 := by
refine ⟨kb + kq + kt, ?_⟩
rw [heVal, hpVal, haVal, hkq, hkt, htrailingQ, hkeepTrim]
push_cast
ring_nf at hkb ⊢
omega
have hdigitPrefix :
(scan.digits.val.take (min trim.length 768)).map
(fun b => b.val) =
trim.take (min trim.length 768) := by
have htrimLe : trim.length <= sig.length := by
rw [hsig]
simp
have hm : min trim.length 768 <= min sig.length 768 := by omega
have hd := congrArg (List.take (min trim.length 768)) hscanDigits
rw [← List.map_take] at hd
simp only [List.take_take, min_eq_left hm] at hd
rw [hsig] at hd
simpa [List.take_append_of_le_length (Nat.min_le_left _ _)] using hd
by_cases hcap : 768 < trim.length
· obtain ⟨a', hfill, hpref⟩ := DecimalSeqFillPrefixPreserved
num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS scan.digits
simp [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def,
hkeepTrim, hcap, hscanTrunc] at hcore
have hfill768 :
num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1
{ start := 768#usize,
«end» :=
num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS_WITHOUT_OVERFLOW }
scan.digits = ok a' := by
simpa [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def]
using hfill
rw [hfill768] at hcore
simp at hcore
subst out
refine ⟨?_, ?_, ?_, hpointCong⟩
· change 768 = min trim.length 768
omega
· change (a'.val.take 768).map (fun z => z.val) = trim.take 768
have hpref768 : a'.val.take 768 =
scan.digits.val.take 768 := by
simpa [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def]
using hpref
rw [hpref768]
have hd := hdigitPrefix
rw [Nat.min_eq_right (by omega)] at hd
exact hd
· simp only [Bool.true_eq, true_iff]
exact hcap
· obtain ⟨a', hfill, hpref⟩ :=
DecimalSeqFillPrefixPreserved kept scan.digits
have hle : trim.length <= 768 := by omega
simp [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def,
hkeepTrim, hcap, hscanTrunc] at hcore
rw [hfill] at hcore
simp at hcore
subst out
refine ⟨?_, ?_, ?_, hpointCong⟩
· change kept.val = min trim.length 768
rw [hkeepTrim, Nat.min_eq_left hle]
· rw [hpref]
simpa [hkeepTrim, Nat.min_eq_left hle] using hdigitPrefix
· simp
exact hle
end dec2flt_model
Download Lean source · Download TeX source
Complete Lean module
import Tablet.DecimalSeqTrailingZeroValues
import Tablet.DecimalSeqFillPrefixPreserved
import Tablet.DecimalSeqI32HCastCongruence
import Tablet.DecimalSeqDuplicateLoops
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxHeartbeats 2000000
namespace dec2flt_model
-- [TABLET NODE: DecimalSeqFinalizationExact]
theorem DecimalSeqFinalizationExact (start rest : Slice Std.U8)
(scan out : num.imp.dec2flt.decimal_seq.DecimalSeq)
(sig trim : List Nat) (prefx suffix tail : List Nat) (q : Nat)
(P E : Int) (suffixEval : Std.I32 -> Result Std.I32)
(hstart : start.val.map (fun b => b.val) = prefx ++ suffix ++ tail)
(hrest : rest.val.map (fun b => b.val) = tail)
(hprefx : prefx = [] ∨ exists pre b,
prefx = pre ++ [b] /\ b ≠ 48 /\ b ≠ 46)
(hsuffix : forall b, b ∈ suffix -> b = 48 ∨ b = 46)
(hq : suffix.count 48 = q)
(hscanCount : scan.num_digits.val = sig.length)
(hscanPoint : exists k : Int,
scan.decimal_point.val + (q : Int) + (trim.length : Int) =
P + k * 4294967296)
(hscanTrunc : scan.truncated = false)
(hsig : sig = trim ++ List.replicate q 0)
(hscanDigits :
(scan.digits.val.take (min sig.length 768)).map (fun b => b.val) =
sig.take (min sig.length 768))
(hsuffixValue : forall base result,
suffixEval base = ok result -> result.val = base.val + E)
(hcore :
(do
let consumed <- Slice.len start - Slice.len rest
let trailing <-
num.imp.dec2flt.decimal_seq.count_trailing_zeros start consumed
let p1 <- scan.decimal_point + UScalar.hcast .I32 trailing
let kept <- scan.num_digits - trailing
let point <- p1 + UScalar.hcast .I32 kept
let (nDigits, flag) <-
if kept > num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS
then ok (num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS, true)
else ok (kept, scan.truncated)
let finalPoint <- suffixEval point
let a <- num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1
{ start := nDigits,
«end» :=
num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS_WITHOUT_OVERFLOW }
scan.digits
ok (num.imp.dec2flt.decimal_seq.DecimalSeq.mk
nDigits finalPoint flag a)) = ok out) :
out.num_digits.val = min trim.length 768 /\
(out.digits.val.take out.num_digits.val).map (fun z => z.val) =
trim.take out.num_digits.val /\
(out.truncated = true <-> 768 < trim.length) /\
exists k : Int,
out.decimal_point.val = P + E + k * 4294967296 := by
-- BODY
have hlenStart : start.val.length =
prefx.length + suffix.length + tail.length := by
have h := congrArg List.length hstart
simpa [Nat.add_assoc] using h
have hlenRest : rest.val.length = tail.length := by
have h := congrArg List.length hrest
simpa using h
have hsubbound : (Slice.len rest).val <= (Slice.len start).val := by
simp [Slice.len, hlenStart, hlenRest]
obtain ⟨consumed, hconsumed, hconsumedVal, _⟩ :=
Aeneas.Std.WP.spec_imp_exists
(UScalar.sub_spec (x := Slice.len start) (y := Slice.len rest) hsubbound)
have hconsumedPrefix : consumed.val = (prefx ++ suffix).length := by
simpa [Slice.len, hlenStart, hlenRest] using hconsumedVal
have htrailBound : suffix.count 48 <= UScalar.max .Usize := by
have hle : suffix.count 48 <= start.val.length := by
rw [hlenStart]
have hc : suffix.count 48 <= suffix.length := List.count_le_length
omega
have hsmax : start.val.length <= UScalar.max .Usize := by
simpa [UScalar.max, Usize.max, Usize.numBits,
Dec2Flt.configured_x86_64_numBits] using start.property
exact le_trans hle hsmax
obtain ⟨trailing, htrailLoop, htrailingVal⟩ :=
DecimalSeqTrailingZeroValues start prefx suffix tail 0#usize consumed
hstart hprefx hsuffix hconsumedPrefix (by simpa using htrailBound)
have htrailingQ : trailing.val = q := by
simpa [hq] using htrailingVal
have htrail :
num.imp.dec2flt.decimal_seq.count_trailing_zeros start consumed =
ok trailing := by
unfold num.imp.dec2flt.decimal_seq.count_trailing_zeros
simpa using htrailLoop
rw [hconsumed] at hcore
simp only [bind_tc_ok] at hcore
rw [htrail] at hcore
simp only [bind_tc_ok, Aeneas.Std.lift] at hcore
have hqle : q <= sig.length := by
have h := congrArg List.length hsig
simp at h
omega
have htrailLe : trailing.val <= scan.num_digits.val := by
rw [htrailingQ, hscanCount]
exact hqle
obtain ⟨kept, hkeep, hkeepVal, _⟩ :=
Aeneas.Std.WP.spec_imp_exists
(UScalar.sub_spec (x := scan.num_digits) (y := trailing) htrailLe)
have hkeepTrim : kept.val = trim.length := by
rw [hkeepVal, htrailingQ, hscanCount]
have h := congrArg List.length hsig
simp at h
omega
cases ha : scan.decimal_point + UScalar.hcast .I32 trailing with
| fail err => rw [ha] at hcore; simp at hcore
| div => rw [ha] at hcore; simp at hcore
| ok p1 =>
rw [ha] at hcore
simp only [bind_tc_ok] at hcore
rw [hkeep] at hcore
simp only [bind_tc_ok, Aeneas.Std.lift] at hcore
cases hp : p1 + UScalar.hcast .I32 kept with
| fail err => rw [hp] at hcore; simp at hcore
| div => rw [hp] at hcore; simp at hcore
| ok point =>
rw [hp] at hcore
simp only [bind_tc_ok] at hcore
cases he : suffixEval point with
| fail err =>
rw [he] at hcore
split at hcore <;> simp_all
| div =>
rw [he] at hcore
split at hcore <;> simp_all
| ok finalPoint =>
rw [he] at hcore
simp only [bind_tc_ok] at hcore
obtain ⟨kq, hkq⟩ := DecimalSeqI32HCastCongruence trailing
obtain ⟨kt, hkt⟩ := DecimalSeqI32HCastCongruence kept
have haVal : p1.val = scan.decimal_point.val +
(UScalar.hcast .I32 trailing).val := by
have hh := IScalar.add_equiv scan.decimal_point
(UScalar.hcast .I32 trailing)
rw [ha] at hh
exact hh.2.1
have hpVal : point.val = p1.val +
(UScalar.hcast .I32 kept).val := by
have hh := IScalar.add_equiv p1 (UScalar.hcast .I32 kept)
rw [hp] at hh
exact hh.2.1
have heVal : finalPoint.val = point.val + E :=
hsuffixValue point finalPoint he
rcases hscanPoint with ⟨kb, hkb⟩
have hpointCong : exists k : Int,
finalPoint.val = P + E + k * 4294967296 := by
refine ⟨kb + kq + kt, ?_⟩
rw [heVal, hpVal, haVal, hkq, hkt, htrailingQ, hkeepTrim]
push_cast
ring_nf at hkb ⊢
omega
have hdigitPrefix :
(scan.digits.val.take (min trim.length 768)).map
(fun b => b.val) =
trim.take (min trim.length 768) := by
have htrimLe : trim.length <= sig.length := by
rw [hsig]
simp
have hm : min trim.length 768 <= min sig.length 768 := by omega
have hd := congrArg (List.take (min trim.length 768)) hscanDigits
rw [← List.map_take] at hd
simp only [List.take_take, min_eq_left hm] at hd
rw [hsig] at hd
simpa [List.take_append_of_le_length (Nat.min_le_left _ _)] using hd
by_cases hcap : 768 < trim.length
· obtain ⟨a', hfill, hpref⟩ := DecimalSeqFillPrefixPreserved
num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS scan.digits
simp [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def,
hkeepTrim, hcap, hscanTrunc] at hcore
have hfill768 :
num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1
{ start := 768#usize,
«end» :=
num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS_WITHOUT_OVERFLOW }
scan.digits = ok a' := by
simpa [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def]
using hfill
rw [hfill768] at hcore
simp at hcore
subst out
refine ⟨?_, ?_, ?_, hpointCong⟩
· change 768 = min trim.length 768
omega
· change (a'.val.take 768).map (fun z => z.val) = trim.take 768
have hpref768 : a'.val.take 768 =
scan.digits.val.take 768 := by
simpa [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def]
using hpref
rw [hpref768]
have hd := hdigitPrefix
rw [Nat.min_eq_right (by omega)] at hd
exact hd
· simp only [Bool.true_eq, true_iff]
exact hcap
· obtain ⟨a', hfill, hpref⟩ :=
DecimalSeqFillPrefixPreserved kept scan.digits
have hle : trim.length <= 768 := by omega
simp [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def,
hkeepTrim, hcap, hscanTrunc] at hcore
rw [hfill] at hcore
simp at hcore
subst out
refine ⟨?_, ?_, ?_, hpointCong⟩
· change kept.val = min trim.length 768
rw [hkeepTrim, Nat.min_eq_left hle]
· rw [hpref]
simpa [hkeepTrim, Nat.min_eq_left hle] using hdigitPrefix
· simp
exact hle
end dec2flt_model
Proof structure
Follow the declared dependencies to read the supporting statements and proofs.
Uses
Inspect related source (77)
- 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
More program dependencies (44)
- 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
- from_u64 · dec2flt/mod.rs:263 Program Rust
- read_u64 · dec2flt/common.rs:18 Program Rust
- write_u64 · dec2flt/common.rs:25 Program Rust
- FloatErrorKind · num/mod.rs:18 Program Rust
- ParseFloatError · num/mod.rs:13 Program Rust
- Dec2FltAssemblyTrace · dec2flt/mod.rs:329 Program Rust
- Dec2FltTrace · dec2flt/mod.rs:295 Program Rust
- Lemire · dec2flt/mod.rs:115 Program Rust
- BiasedFp · dec2flt/common.rs:52 Program Rust
- ByteSlice · dec2flt/common.rs:4 Program Rust
- is_8digits · dec2flt/common.rs:40 Program Rust
- Decimal · dec2flt/decimal.rs:32 Program Rust
- DecimalSeq · dec2flt/decimal_seq.rs:21 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
- 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
- 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
- CastInto · traits.rs:18 Program Rust
- Float · traits.rs:74 Program Rust
- FloatExt · traits.rs:170 Program Rust
- Int · traits.rs:27 Program Rust
- try_add_digit · dec2flt/decimal_seq.rs:73 Program Rust
Standard-library dependencies (30)
- clone · core/src/clone.rs:698 Rust library
- div · core/src/ops/arith.rs:515 Rust library
- mul · core/src/ops/arith.rs:350 Rust library
- neg · core/src/ops/arith.rs:719 Rust library
- bitand · core/src/ops/bit.rs:178 Rust library
- bitor · core/src/ops/bit.rs:282 Rust library
- shl · core/src/ops/bit.rs:489 Rust library
- shr · core/src/ops/bit.rs:612 Rust library
- EXPONENT_MASK · core/src/num/f64.rs:615 Rust library
- INFINITY · core/src/num/f64.rs:512 Rust library
- MANTISSA_DIGITS · core/src/num/f64.rs:412 Rust library
- MANTISSA_MASK · core/src/num/f64.rs:637 Rust library
- NAN · core/src/num/f64.rs:509 Rust library
- NEG_INFINITY · core/src/num/f64.rs:515 Rust library
- classify · core/src/num/f64.rs:782 Rust library
- from_bits · core/src/num/f64.rs:1269 Rust library
- to_bits · core/src/num/f64.rs:1223 Rust library
- is_ascii_digit · core/src/num/mod.rs:958 Rust library
- from_residual · core/src/option.rs:2793 Rust library
- branch · core/src/option.rs:2779 Rust library
- first · core/src/slice/mod.rs:155 Rust library
- split_first · core/src/slice/mod.rs:198 Rust library
- as_bytes · core/src/str/mod.rs:498 Rust library
- FpCategory · core/src/num/mod.rs:1522 Rust library
- Div · core/src/ops/arith.rs:460 Rust library
- Mul · core/src/ops/arith.rs:322 Rust library
- Neg · core/src/ops/arith.rs:690 Rust library
- BitOr · core/src/ops/bit.rs:254 Rust library
- Shl · core/src/ops/bit.rs:461 Rust library
- Shr · core/src/ops/bit.rs:584 Rust library
Related source and models come from the extraction records and declared dependencies.
Proof assumptions and review
Lean checks the formal proof. Trellis also reviews how the statement corresponds to the intended requirement.
Transitive assumptions
- Classical.choice
- Dec2Flt.configured_x86_64_numBits
- Quot.sound
- propext
This list combines the assumptions recorded for this declaration and its dependencies. It may include assumptions used by auxiliary declarations in those modules.
Helper theorems included
- DecimalSeqFillPrefixPreserved
- DecimalSeqFinalizationExact
- DecimalSeqI32HCastCongruence
- DecimalSeqTrailingZeroLoopExact
- DecimalSeqTrailingZeroValues
- SliceU8 Insts Dec2flt modelNumImpDec2fltCommonByteSlice read u64
All 17 entries
- DecimalSeqFillPrefixPreserved
- DecimalSeqFinalizationExact
- DecimalSeqI32HCastCongruence
- DecimalSeqTrailingZeroLoopExact
- DecimalSeqTrailingZeroValues
- SliceU8 Insts Dec2flt modelNumImpDec2fltCommonByteSlice read u64
- SliceU8 Insts Dec2flt modelNumImpDec2fltCommonByteSlice write u64
- num imp dec2flt common is 8digits
- num imp dec2flt decimal seq DecimalSeq
- 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 try add digit
- num imp dec2flt decimal seq count trailing zeros
- 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
Technical checking records
Local closure summary
{
"node": "DecimalSeqFinalizationExact",
"closure_version": "patch_c_v1",
"active_decl_hash": "fe6730bda071d74b0b931bcbd12f4a6de936a0c721bb94eeb82e9335b9ed9410",
"active_statement_hash": "04328448af6518e5b0e6ede2dc89c45741bb75973ca10845085544608642620d",
"kernel_axioms": [
"Classical.choice",
"Dec2Flt.configured_x86_64_numBits",
"Quot.sound",
"propext"
],
"toolchain_hash": "ce4c4e3d87434b9663f46de25ce34b48a0cf0d392e0a320a0787b4674a2d7b61",
"lean_executable_hash": "3e0d0d3d801675359f2d4cf9815bfdb417b20b92fdd9d48b3b14c95bbae28bbf",
"checker_script_hash": "c8e4a03273e23b9a8f2e141020652a4e0b7b0a8ab0883366ea9d031ca3f37aa1",
"approved_axioms_hash": "ab64d13f256386ee0e494a5abcc6a5db49512cf3d90bbdfcabd6327793a31f95",
"axcheck_status": "Agreed",
"accepted_at_snapshot_id": "worker-result-local-closure-issuance-cycle-169",
"boundary_theorems": {},
"strict_theorem_deps": {
"DecimalSeqFillPrefixPreserved": "4eabf1d65bab5e95",
"DecimalSeqI32HCastCongruence": "bedcc032e9d40104",
"DecimalSeqTrailingZeroValues": "9bf98eea90c6e7c3",
"num_imp_dec2flt_decimal_seq_DecimalSeq_MAX_DIGITS": "0eb6fb2627d0ff5c"
},
"strict_definition_deps": {
"num_imp_dec2flt_decimal_seq_DecimalSeq": "c43614ff2149ecf2",
"num_imp_dec2flt_decimal_seq_DecimalSeq_MAX_DIGITS": "39f6cb231ef80388",
"num_imp_dec2flt_decimal_seq_DecimalSeq_MAX_DIGITS_WITHOUT_OVERFLOW": "65634ac95536dcca",
"num_imp_dec2flt_decimal_seq_count_trailing_zeros": "7a77bc9e01c1a09b",
"num_imp_dec2flt_decimal_seq_parse_decimal_seq": "9f2c4f5675cad683"
}
}Prose assessment
{
"label": "Lean proof closed; predictive prose review no longer required",
"assessment_status": null,
"fingerprint_relation": "unknown",
"assessment_fingerprint": null,
"current_fingerprint": "sound-v2:9701e0bb35c31aa2d2b6cf01908fd1d576a9e9c69b6a0b780120205d0b0d7970",
"superseded_for_theorem_closure": false
}Review verdicts
{
"corr_status": "Pass",
"substantiveness_status": "Pass"
}