import Tablet.DispatchContracts import Tablet.P9_T1_NormalComponentRefinement import Tablet.P9_T1_ReachedDispatchCall import Tablet.P9_T1_ActualDispatchFrameEquality import Tablet.P13_T1_NativeCorrectOrDefer import Tablet.P14_NativeTotality import Tablet.P616_T1_CompatibleCompletion import Tablet.P616_T1_ExactTransportApplicationsB import Tablet.P661_T1_PrefixRealization open Aeneas Aeneas.Std Result ControlFlow Error set_option autoImplicit false namespace dec2flt_model -- [TABLET NODE: P9_T1_DispatchComponentCompliance] theorem P9_T1_DispatchComponentCompliance : exists C : P9_T1_AbstractComponents, DispatchContracts C /\ P9_T1_NormalComponentRefinement C /\ (forall s : Str, DecimalGoalVocabularyDefault.sourceString s -> s.val.length <= 3458764513820540928 -> forall call : P9_T1_DispatchCall, P9_T1_ReachedDispatchCall s call -> match call with | .number body _ => SourceValidByteSlice body /\ body.val ≠ [] /\ body.val.length <= s.val.length /\ P9_T1_ActualDispatchOperations.parseNumber body = ok (C.parseNumber body) | .special body neg => SourceValidByteSlice body /\ body.val ≠ [] /\ body.val.length <= s.val.length /\ P9_T1_ActualDispatchOperations.parseSpecial body neg = ok (C.parseSpecial body neg) | .native body neg d => SourceValidByteSlice body /\ body.val ≠ [] /\ body.val.length <= s.val.length /\ d.negative = false /\ d.mantissa.val < 10 ^ 19 /\ P9_T1_ActualDispatchOperations.native { d with negative := neg } = ok (C.native { d with negative := neg }) | .first body _ d => SourceValidByteSlice body /\ body.val ≠ [] /\ body.val.length <= s.val.length /\ d.mantissa.val < 10 ^ 19 /\ P9_T1_ActualDispatchOperations.integer d.exponent d.mantissa = ok (C.integer d.exponent d.mantissa) | .increment _ _ d _ => d.mantissa.val < 10 ^ 19 /\ exists next : Std.U64, d.mantissa + 1#u64 = ok next /\ next.val = d.mantissa.val + 1 | .second _ _ d _ next => next.val = d.mantissa.val + 1 /\ P9_T1_ActualDispatchOperations.integer d.exponent next = ok (C.integer d.exponent next) | .compare _ _ _ first second => num.imp.dec2flt.common.BiasedFp.Insts.CoreCmpPartialEqBiasedFp.eq first second = ok (decide (first.m = second.m /\ first.p_biased = second.p_biased)) | .post body _ d _ => SourceValidByteSlice body /\ body.val ≠ [] /\ body.val.length <= s.val.length /\ d.negative = false /\ d.mantissa.val < 10 ^ 19 | .slow body _ _ _ => SourceValidByteSlice body /\ body.val ≠ [] /\ body.val.length <= s.val.length /\ (exists x : DecimalLexeme, x.leadingSign = none /\ DecimalGoalVocabularyDefault.validNumeric x /\ DecimalGoalVocabularyDefault.renderNumeric x = DecimalGoalVocabularyDefault.bytes body) /\ P9_T1_ActualDispatchOperations.slow body = ok (C.slow body) | .assemble _ _ _ selected => P9_T1_ActualDispatchOperations.assemble selected = ok (C.assemble selected) | .negate _ _ _ magnitude => magnitude.val < 2 ^ 63 /\ P9_T1_ActualDispatchOperations.negate magnitude = ok (C.negate magnitude)) /\ (forall (s : Str) (x : DecimalLexeme), DecimalGoalVocabularyDefault.sourceString s -> s.val.length <= 576460752303421440 -> DecimalGoalVocabularyDefault.classifies (DecimalGoalVocabularyDefault.bytes s) (some (Sum.inl x)) -> forall target : F64, DecimalGoalVocabularyDefault.roundsMagnitude (DecimalGoalVocabularyDefault.accumulatedMagnitude x) target ↔ DecimalGoalVocabularyDefault.roundsMagnitude (DecimalGoalVocabularyDefault.exactMagnitude x) target) := by -- BODY obtain ⟨C, hcontracts, hrefine⟩ := P616_T1_CompatibleCompletion refine ⟨C, hcontracts, hrefine, ?_, P616_T1_ExactTransportApplicationsB.2⟩ intro s hsource hA exact P661_T1_PrefixRealization C hcontracts hrefine s hsource hA end dec2flt_model