import Tablet.P9_T1_DispatchCall import Tablet.P9_T1_ActualDispatchOperations import Tablet.num_imp_dec2flt_common_BiasedFp_Insts_CoreCmpPartialEqBiasedFp_eq open Aeneas Aeneas.Std Result ControlFlow Error set_option autoImplicit false namespace dec2flt_model -- [TABLET NODE: P9_T1_ReachedDispatchCall] inductive P9_T1_ReachedDispatchCall (s : Str) : P9_T1_DispatchCall -> Prop where -- BODY | number (c : Std.U8) (tail : List Std.U8) (body : Slice Std.U8) (hs : s.val = c :: tail) (hb : body.val = if c = 45#u8 ∨ c = 43#u8 then tail else s.val) (hne : body.val ≠ []) : P9_T1_ReachedDispatchCall s (.number body (c = 45#u8)) | special (body : Slice Std.U8) (neg : Bool) (hprev : P9_T1_ReachedDispatchCall s (.number body neg)) (h : P9_T1_ActualDispatchOperations.parseNumber body = ok none) : P9_T1_ReachedDispatchCall s (.special body neg) | native (body : Slice Std.U8) (neg : Bool) (d : num.imp.dec2flt.decimal.Decimal) (hprev : P9_T1_ReachedDispatchCall s (.number body neg)) (h : P9_T1_ActualDispatchOperations.parseNumber body = ok (some d)) : P9_T1_ReachedDispatchCall s (.native body neg d) | first (body : Slice Std.U8) (neg : Bool) (d : num.imp.dec2flt.decimal.Decimal) (hprev : P9_T1_ReachedDispatchCall s (.native body neg d)) (h : P9_T1_ActualDispatchOperations.native { d with negative := neg } = ok none) : P9_T1_ReachedDispatchCall s (.first body neg d) | increment (body : Slice Std.U8) (neg : Bool) (d : num.imp.dec2flt.decimal.Decimal) (fp : num.imp.dec2flt.common.BiasedFp) (hprev : P9_T1_ReachedDispatchCall s (.first body neg d)) (h : P9_T1_ActualDispatchOperations.integer d.exponent d.mantissa = ok fp) (hguard : d.many_digits = true ∧ 0 <= fp.p_biased.val) : P9_T1_ReachedDispatchCall s (.increment body neg d fp) | second (body : Slice Std.U8) (neg : Bool) (d : num.imp.dec2flt.decimal.Decimal) (fp : num.imp.dec2flt.common.BiasedFp) (next : Std.U64) (hprev : P9_T1_ReachedDispatchCall s (.increment body neg d fp)) (h : d.mantissa + 1#u64 = ok next) : P9_T1_ReachedDispatchCall s (.second body neg d fp next) | compare (body : Slice Std.U8) (neg : Bool) (d : num.imp.dec2flt.decimal.Decimal) (fp second : num.imp.dec2flt.common.BiasedFp) (next : Std.U64) (hprev : P9_T1_ReachedDispatchCall s (.second body neg d fp next)) (h : P9_T1_ActualDispatchOperations.integer d.exponent next = ok second) : P9_T1_ReachedDispatchCall s (.compare body neg d fp second) | post_direct (body : Slice Std.U8) (neg : Bool) (d : num.imp.dec2flt.decimal.Decimal) (fp : num.imp.dec2flt.common.BiasedFp) (hprev : P9_T1_ReachedDispatchCall s (.first body neg d)) (h : P9_T1_ActualDispatchOperations.integer d.exponent d.mantissa = ok fp) (hguard : ¬ (d.many_digits = true ∧ 0 <= fp.p_biased.val)) : P9_T1_ReachedDispatchCall s (.post body neg d fp) | post_compared (body : Slice Std.U8) (neg : Bool) (d : num.imp.dec2flt.decimal.Decimal) (fp second : num.imp.dec2flt.common.BiasedFp) (equal : Bool) (hprev : P9_T1_ReachedDispatchCall s (.compare body neg d fp second)) (h : num.imp.dec2flt.common.BiasedFp.Insts.CoreCmpPartialEqBiasedFp.eq fp second = ok equal) : P9_T1_ReachedDispatchCall s (.post body neg d (if equal then fp else { fp with p_biased := (-1)#i32 })) | slow (body : Slice Std.U8) (neg : Bool) (d : num.imp.dec2flt.decimal.Decimal) (post : num.imp.dec2flt.common.BiasedFp) (hprev : P9_T1_ReachedDispatchCall s (.post body neg d post)) (hguard : post.p_biased.val < 0) : P9_T1_ReachedDispatchCall s (.slow body neg d post) | assemble_direct (body : Slice Std.U8) (neg : Bool) (d : num.imp.dec2flt.decimal.Decimal) (post : num.imp.dec2flt.common.BiasedFp) (hprev : P9_T1_ReachedDispatchCall s (.post body neg d post)) (hguard : 0 <= post.p_biased.val) : P9_T1_ReachedDispatchCall s (.assemble body neg d post) | assemble_slow (body : Slice Std.U8) (neg : Bool) (d : num.imp.dec2flt.decimal.Decimal) (post selected : num.imp.dec2flt.common.BiasedFp) (hprev : P9_T1_ReachedDispatchCall s (.slow body neg d post)) (h : P9_T1_ActualDispatchOperations.slow body = ok selected) : P9_T1_ReachedDispatchCall s (.assemble body neg d selected) | negate (body : Slice Std.U8) (d : num.imp.dec2flt.decimal.Decimal) (selected : num.imp.dec2flt.common.BiasedFp) (magnitude : F64) (hprev : P9_T1_ReachedDispatchCall s (.assemble body true d selected)) (h : P9_T1_ActualDispatchOperations.assemble selected = ok magnitude) : P9_T1_ReachedDispatchCall s (.negate body d selected magnitude) end dec2flt_model