chore: add numBitsEq
This commit is contained in:
parent
2daeb195b5
commit
1c01bd59be
1 changed files with 10 additions and 2 deletions
|
|
@ -9,12 +9,20 @@ import Init.Data.Nat.Basic
|
|||
namespace System
|
||||
namespace Platform
|
||||
|
||||
@[extern "lean_system_platform_nbits"] constant getNumBits : Unit → Nat
|
||||
@[extern "lean_system_platform_nbits"] constant getNumBits : Unit → { n : Nat // n = 32 ∨ n = 64 } :=
|
||||
fun _ => ⟨64, Or.inr rfl⟩ -- inhabitant
|
||||
|
||||
@[extern "lean_system_platform_windows"] constant getIsWindows : Unit → Bool
|
||||
@[extern "lean_system_platform_osx"] constant getIsOSX : Unit → Bool
|
||||
|
||||
def numBits : Nat := getNumBits ()
|
||||
def numBits : Nat := getNumBits () $.val
|
||||
|
||||
theorem numBitsEq : numBits = 32 ∨ numBits = 64 :=
|
||||
getNumBits () $.property
|
||||
|
||||
def isWindows : Bool := getIsWindows ()
|
||||
|
||||
|
||||
def isOSX : Bool := getIsOSX ()
|
||||
|
||||
end Platform
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue