import Tablet.Assumptions import Tablet.DecimalGoalVocabularyDefault import Tablet.ModelOptionBranch import Tablet.ModelOptionFromResidual import Tablet.NumberHelperPartialNumberSafeLength import Tablet.SourceValidByteSlice import Tablet.SliceU8_Insts_Dec2flt_modelNumImpDec2fltCommonByteSlice_offset_from import Tablet.SliceU8_Insts_Dec2flt_modelNumImpDec2fltCommonByteSlice_read_u64 import Tablet.num_imp_dec2flt_common_is_8digits import Tablet.num_imp_dec2flt_parse_MIN_19DIGIT_INT import Tablet.num_imp_dec2flt_parse_adjust_many_digit_count import Tablet.num_imp_dec2flt_parse_parse_8digits import Tablet.num_imp_dec2flt_parse_parse_many_digits import Tablet.num_imp_dec2flt_parse_parse_number import Tablet.num_imp_dec2flt_parse_parse_partial_number import Tablet.num_imp_dec2flt_parse_parse_scientific import Tablet.num_imp_dec2flt_parse_try_parse_19digits import Tablet.num_imp_dec2flt_parse_try_parse_digits open Aeneas Aeneas.Std Result ControlFlow Error set_option autoImplicit false namespace dec2flt_model -- [TABLET NODE: NumberHelperRejectionSafeLength] theorem NumberHelperRejectionSafeLength : forall s : Slice Std.U8, SourceValidByteSlice s -> s.val != [] -> s.val.length <= 9223372036854120459 -> (Not (exists x : DecimalLexeme, x.leadingSign = none /\ DecimalGoalVocabularyDefault.validNumeric x /\ DecimalGoalVocabularyDefault.bytes s = DecimalGoalVocabularyDefault.renderNumeric x)) -> num.imp.dec2flt.parse.parse_number s = ok none := by -- BODY intro s hvalid hnonempty hlen hinvalid obtain ⟨o, hparse, hpartial⟩ := NumberHelperPartialNumberSafeLength s hvalid hnonempty hlen hinvalid cases o with | none => simpa [num.imp.dec2flt.parse.parse_number, hparse] | some p => rcases p with ⟨d, r⟩ simp [num.imp.dec2flt.parse.parse_number, hparse] intro heq apply hpartial d r rfl apply UScalar.eq_of_val_eq simpa [Slice.len, Slice.length] using heq end dec2flt_model