feat: implement USize.toUInt64 model
This commit is contained in:
parent
18ccc01cf1
commit
e51d892fc2
1 changed files with 10 additions and 1 deletions
|
|
@ -3203,7 +3203,16 @@ This is lossless because `USize.size` is either `2^32` or `2^64`.
|
|||
This function is overridden with a native implementation.
|
||||
-/
|
||||
@[extern "lean_usize_to_uint64"]
|
||||
opaque USize.toUInt64 (u : USize) : UInt64
|
||||
def USize.toUInt64 (u : USize) : UInt64 where
|
||||
val := {
|
||||
val := u.val.val
|
||||
isLt :=
|
||||
let ⟨n, h⟩ := u
|
||||
show LT.lt n _ from
|
||||
match USize.size, usize_size_eq, h with
|
||||
| _, Or.inl rfl, h => Nat.lt_trans h (by decide)
|
||||
| _, Or.inr rfl, h => h
|
||||
}
|
||||
|
||||
/-- An opaque hash mixing operation, used to implement hashing for tuples. -/
|
||||
@[extern "lean_uint64_mix_hash"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue