Record bounds

Record bounds

Proved
parse_number
Record bounds. For every nonempty byte slice, any returned record has negative = false and mantissa < 10^19.

View proof and assumptions

Supporting proofs
Inspect related source (71)
More program dependencies (36)
Standard-library dependencies (32)

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

Lean statement and supporting proof

Proposition checked for this verdict

theorem NumberHelperRecordBounds :
    ∀ (s : Slice Std.U8) d, SourceValidByteSlice s -> s.val ≠ [] ->
      num.imp.dec2flt.parse.parse_number s = ok (some d) ->
      d.negative = false ∧ d.mantissa.val < 10 ^ 19 := by

The requirement is proved.

Alternate registered target · outside this verdict
theorem NumberHelperRecordBounds__Refutation : Not
  (∀ (s : Aeneas.Std.Slice.{0} Aeneas.Std.U8) (d : dec2flt_model.num.imp.dec2flt.decimal.Decimal),
    dec2flt_model.SourceValidByteSlice s →
      @Ne.{1} (List.{0} Aeneas.Std.U8)
          (@Subtype.val.{1} (List.{0} Aeneas.Std.U8)
            (fun (l : List.{0} Aeneas.Std.U8) =>
              @LE.le.{0} Nat instLENat (@List.length.{0} Aeneas.Std.U8 l) Aeneas.Std.Usize.max)
            s)
          (@List.nil.{0} Aeneas.Std.U8) →
        @Eq.{1} (Aeneas.Std.Result.{0} (Option.{0} dec2flt_model.num.imp.dec2flt.decimal.Decimal))
            (dec2flt_model.num.imp.dec2flt.parse.parse_number s)
            (@Aeneas.Std.Result.ok.{0} (Option.{0} dec2flt_model.num.imp.dec2flt.decimal.Decimal)
              (@Option.some.{0} dec2flt_model.num.imp.dec2flt.decimal.Decimal d)) →
          And (@Eq.{1} Bool (dec2flt_model.num.imp.dec2flt.decimal.Decimal.negative d) Bool.false)
            (@LT.lt.{0} Nat instLTNat
              (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U64
                (dec2flt_model.num.imp.dec2flt.decimal.Decimal.mantissa d))
              (@HPow.hPow.{0, 0, 0} Nat Nat Nat (@instHPow.{0, 0} Nat Nat (@Monoid.toPow.{0} Nat Nat.instMonoid))
                (@OfNat.ofNat.{0} Nat (nat_lit 10) (instOfNatNat (nat_lit 10)))
                (@OfNat.ofNat.{0} Nat (nat_lit 19) (instOfNatNat (nat_lit 19)))))) := by
Statement registration
Live polarityprove
Authorityregistered Decide default: prove
Registered targetauthored:NumberHelperRecordBounds
Closure nodes
  • NumberHelperRecordBounds

Models and assumptions

Program assumptions and trust

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

All 29 entries