Correctness or defer

Correctness or defer

Proved
compute_float
Correctness or defer. For all i64 exponents q and all u64 mantissas w, a normal result is either a pair with negative biased exponent (deferral) or a pair whose assembled word is the nonnegative binary64 rounding of the exact value w * 10^q.

View proof and assumptions

Supporting proofs
Inspect related source (87)
More program dependencies (45)
Standard-library dependencies (39)

Related source and models come from the extraction records and declared dependencies.

Lean statement and supporting proof

Proposition checked for this verdict

theorem IntegerCorrectOrDefer :
    ∀ (q : Std.I64) (w : Std.U64) fp,
      num.imp.dec2flt.lemire.compute_float
        F64.Insts.Dec2flt_modelNumImpTraitsFloatU64 q w = ok fp ->
      fp.p_biased.val < 0 ∨ ∃ target : F64,
        DecimalGoalVocabularyDefault.assembledWord fp target ∧
        DecimalGoalVocabularyDefault.roundsMagnitude ((w.val : Real) * (10 : Real) ^ q.val) target := by

The requirement is proved.

Alternate registered target · outside this verdict
theorem IntegerCorrectOrDefer__Refutation : Not
  (∀ (q : Aeneas.Std.I64) (w : Aeneas.Std.U64) (fp : dec2flt_model.num.imp.dec2flt.common.BiasedFp),
    @Eq.{1} (Aeneas.Std.Result.{0} dec2flt_model.num.imp.dec2flt.common.BiasedFp)
        (@dec2flt_model.num.imp.dec2flt.lemire.compute_float dec2flt_model.F64 Aeneas.Std.U64
          dec2flt_model.F64.Insts.Dec2flt_modelNumImpTraitsFloatU64 q w)
        (@Aeneas.Std.Result.ok.{0} dec2flt_model.num.imp.dec2flt.common.BiasedFp fp) →
      Or
        (@LT.lt.{0} Int Int.instLTInt
          (@Aeneas.Std.IScalar.val Aeneas.Std.IScalarTy.I32 (dec2flt_model.num.imp.dec2flt.common.BiasedFp.p_biased fp))
          (@OfNat.ofNat.{0} Int (nat_lit 0) (@instOfNat (nat_lit 0))))
        (@Exists.{1} dec2flt_model.F64 fun (target : dec2flt_model.F64) =>
          And (dec2flt_model.DecimalGoalVocabulary.assembledWord dec2flt_model.DecimalGoalVocabularyDefault fp target)
            (dec2flt_model.DecimalGoalVocabulary.roundsMagnitude dec2flt_model.DecimalGoalVocabularyDefault
              (@HMul.hMul.{0, 0, 0} Real Real Real (@instHMul.{0} Real Real.instMul)
                (@Nat.cast.{0} Real Real.instNatCast (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U64 w))
                (@HPow.hPow.{0, 0, 0} Real Int Real
                  (@instHPow.{0, 0} Real Int (@DivInvMonoid.toZPow.{0} Real Real.instDivInvMonoid))
                  (@OfNat.ofNat.{0} Real (nat_lit 10)
                    (@instOfNatAtLeastTwo.{0} Real (nat_lit 10) Real.instNatCast
                      (@Nat.instAtLeastTwoHAddOfNat (@OfNat.ofNat.{0} Nat (nat_lit 9) (instOfNatNat (nat_lit 9)))
                        (@Nat.instNeZeroSucc (@OfNat.ofNat.{0} Nat (nat_lit 8) (instOfNatNat (nat_lit 8)))))))
                  (@Aeneas.Std.IScalar.val Aeneas.Std.IScalarTy.I64 q)))
              target))) := by
Statement registration
Live polarityprove
Authorityregistered Decide default: prove
Registered targetauthored:IntegerCorrectOrDefer
Closure nodes
  • IntegerCorrectOrDefer

Models and assumptions

Program assumptions and trust

These modeling choices occur in the declared dependencies of this requirement’s proofs.

All 31 entries