This module exists to provide the very basic UInt8
etc. definitions required for
Init.Data.Char.Basic
and Init.Data.Array.Basic
. These are very important as they are used in
meta code that is then (transitively) used in Init.Data.UInt.Basic
and Init.Data.BitVec.Basic
.
This file thus breaks the import cycle that would be created by this dependency.
@[reducible, inline]
Equations
Instances For
Equations
- UInt8.instOfNat = { ofNat := UInt8.ofNat n }
@[extern lean_uint16_of_nat]
Equations
- UInt16.ofNat n = { toBitVec := BitVec.ofNat 16 n }
Instances For
@[reducible, inline]
Equations
Instances For
Equations
- UInt16.instOfNat = { ofNat := UInt16.ofNat n }
@[extern lean_uint32_of_nat]
Equations
- UInt32.ofNat n = { toBitVec := BitVec.ofNat 32 n }
Instances For
Converts the given natural number to UInt32
, but returns 2^32 - 1
for natural numbers >= 2^32
.
Equations
- UInt32.ofNatTruncate n = if h : n < UInt32.size then UInt32.ofNat' n h else UInt32.ofNat' (UInt32.size - 1) UInt32.ofNatTruncate.proof_1
Instances For
@[reducible, inline]
Equations
Instances For
Equations
- UInt32.instOfNat = { ofNat := UInt32.ofNat n }
@[extern lean_uint64_of_nat]
Equations
- UInt64.ofNat n = { toBitVec := BitVec.ofNat 64 n }
Instances For
@[reducible, inline]
Equations
Instances For
Equations
- UInt64.instOfNat = { ofNat := UInt64.ofNat n }
@[deprecated usize_size_pos (since := "2024-11-24")]
@[extern lean_usize_of_nat]
Equations
- USize.ofNat n = { toBitVec := BitVec.ofNat System.Platform.numBits n }
Instances For
@[reducible, inline]
Equations
Instances For
Equations
- USize.instOfNat = { ofNat := USize.ofNat n }
Equations
- instDecidableLtUSize a b = a.decLt b
Equations
- instDecidableLeUSize a b = a.decLe b