import Tablet.DecimalGoalVocabularyDefault import Tablet.P9_T1_ActualDispatchOperations import Tablet.num_imp_dec2flt_dec2flt import Tablet.P13_T1_ParserAccumulatedRounding import Tablet.P9_T1_DispatchComponentCompliance open Aeneas Aeneas.Std Result ControlFlow Error set_option autoImplicit false namespace dec2flt_model -- [TABLET NODE: P13_T1_ParserExactRounding] theorem P13_T1_ParserExactRounding : forall (s : Str) (x : DecimalLexeme) (f : F64), DecimalGoalVocabularyDefault.sourceString s -> s.val.length <= 576460752303421440 -> DecimalGoalVocabularyDefault.validNumeric x -> DecimalGoalVocabularyDefault.renderNumeric x = DecimalGoalVocabularyDefault.bytes s -> num.imp.dec2flt.dec2flt F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64 F64.Insts.CoreOpsArithDivF64F64 F64.Insts.CoreOpsArithMulF64F64 F64.Insts.CoreOpsArithNegF64 s = ok (core.result.Result.Ok f) -> exists magnitude : F64, DecimalGoalVocabularyDefault.roundsMagnitude (DecimalGoalVocabularyDefault.exactMagnitude x) magnitude ∧ DecimalGoalVocabularyDefault.signedMagnitude (DecimalGoalVocabularyDefault.lexicalNegative x) magnitude f := by -- BODY intro s x f hsource hlen hvalid hrender hpublic obtain ⟨magnitude, hroundAccum, hsigned⟩ := P13_T1_ParserAccumulatedRounding s x f hsource (by omega) hvalid hrender hpublic obtain ⟨_C, _hcontracts, _hrefine, _hreached, hexact⟩ := P9_T1_DispatchComponentCompliance have hclassifies : DecimalGoalVocabularyDefault.classifies (DecimalGoalVocabularyDefault.bytes s) (some (Sum.inl x)) := by change DecimalGoalVocabularyDefault.validNumeric x ∧ DecimalGoalVocabularyDefault.renderNumeric x = DecimalGoalVocabularyDefault.bytes s exact ⟨hvalid, hrender⟩ have htransport := (hexact s x hsource hlen hclassifies magnitude).mp hroundAccum refine ⟨magnitude, htransport, hsigned⟩ end dec2flt_model