Rust library
is_ascii_digit
This is Rust standard-library source from the compiler version used in the run.
955 #[stable(feature = "ascii_ctype_on_intrinsics", since = "1.24.0")]956 #[rustc_const_stable(feature = "const_ascii_ctype_on_intrinsics", since = "1.47.0")]957 #[inline]958 pub const fn is_ascii_digit(&self) -> bool {959 matches!(*self, b'0'..=b'9')960 }961 Aeneas declaration
Aeneas generated this declaration for a Rust library operation. Any authored model recorded for this operation is shown below.
@[rust_fun "core::num::{u8}::is_ascii_digit"]
axiom core.num.U8.is_ascii_digit : Std.U8 → Result BoolAuthored Lean model
Trellis authored this Lean model for an operation outside the mechanical extraction. Modeling choices explains its behavior and review.
import Aeneas
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: ModelU8IsAsciiDigit]
def ModelU8IsAsciiDigit (x : Std.U8) : Result Bool :=
-- BODY
ok (decide (48 <= x.val ∧ x.val <= 57))
end dec2flt_model
Source details
| Declaration | core.num.U8.is_ascii_digit |
|---|---|
| File | /rustc/library/core/src/num/mod.rs |
| Lines | 958:4–958:46 |
| Program version | Revised program |