///| /// Value of the decimal code points `s`, or -1 if `s` is empty, has a /// non-digit, or is 10^18 or more. pub fn parse_nat( s : FixedArray[Int64], ) -> Int64 where { proof_require: s.length() < 2147483647, proof_ensure: r => parse_post(s, r), proof_ensure: r => valid_or_rejected(r), } { let t = FixedArray::make(s.length() + 1, 0L) for i in 0.. 99999999999999999L || c < 48L || c > 57L { -1L } else { n * 10L + (c - 48L) } } where { proof_invariant: 0 <= i && i <= s.length(), proof_invariant: trace(s, t, i, t[i]), proof_invariant: valid_or_rejected(t[i]), } let r = t[s.length()] proof_assert trace(s, t, s.length(), r) proof_assert decimal(s, r) if s.length() == 0 { -1L } else { r } }