lean4-htt/tests/lean/run/sint_conversions.lean
Markus Himmel 04fe72fee0
feat: missing conversion functions for ISize (#7063)
This PR adds `ISize.toInt8`, `ISize.toInt16`, `Int8.toISize`,
`Int16.toISize`.
2025-02-13 11:02:00 +00:00

51 lines
2.9 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

example : (-2147483649 : Int8).toInt16 = -1 := by native_decide
example : (-2147483649 : Int8).toInt16 = -1 := by rfl
example : (-2147483649 : Int8).toInt32 = -1 := by native_decide
example : (-2147483649 : Int8).toInt32 = -1 := by rfl
example : (-2147483649 : Int8).toInt64 = -1 := by native_decide
example : (-2147483649 : Int8).toInt64 = -1 := by rfl
example : (-2147483649 : Int8).toISize = -1 := by native_decide
-- TODO: add proof once the theory is available
-- example : (-2147483649 : Int8).toISize = -1 := by rfl
example : (-2147483649 : Int16).toInt8 = -1 := by native_decide
example : (-2147483649 : Int16).toInt8 = -1 := by rfl
example : (-2147483649 : Int16).toInt32 = -1 := by native_decide
example : (-2147483649 : Int16).toInt32 = -1 := by rfl
example : (-2147483649 : Int16).toInt64 = -1 := by native_decide
example : (-2147483649 : Int16).toInt64 = -1 := by rfl
example : (-2147483649 : Int16).toISize = -1 := by native_decide
-- TODO: add proof once the theory is available
-- example : (-2147483649 : Int16).toISize = -1 := by rfl
example : (-2147483649 : Int32).toInt8 = -1 := by native_decide
example : (-2147483649 : Int32).toInt8 = -1 := by rfl
example : (-2147483649 : Int32).toInt16 = -1 := by native_decide
example : (-2147483649 : Int32).toInt16 = -1 := by rfl
example : (-2147483649 : Int32).toInt64 = 2147483647 := by native_decide
example : (-2147483649 : Int32).toInt64 = 2147483647 := by rfl
example : (-2147483649 : Int32).toISize = 2147483647 := by native_decide
example : (-2147483649 : Int32).toISize = 2147483647 := by rfl
example : (-2147483649 : Int64).toInt8 = -1 := by native_decide
example : (-2147483649 : Int64).toInt8 = -1 := by rfl
example : (-2147483649 : Int64).toInt16 = -1 := by native_decide
example : (-2147483649 : Int64).toInt16 = -1 := by rfl
example : (-2147483649 : Int64).toInt32 = 2147483647 := by native_decide
example : (-2147483649 : Int64).toInt32 = 2147483647 := by rfl
example : (-2147483649 : Int64).toISize = 2147483647 (-2147483649 : Int64).toISize = -2147483649 := by native_decide
-- TODO: add proof once the theory is available
-- example : (-2147483649 : Int64).toISize = 2147483647 := by rfl
example : (-2147483649 : ISize).toInt8 = -1 := by native_decide
-- TODO: add proof once the theory is available
-- example : (-2147483649 : ISize).toInt8 = -1 := by rfl
example : (-2147483649 : ISize).toInt16 = -1 := by native_decide
-- TODO: add proof once the theory is available
-- example : (-2147483649 : ISize).toInt16 = -1 := by rfl
example : (-2147483649 : ISize).toInt32 = 2147483647 := by native_decide
-- TODO: add proof once the theory is available
-- example : (-2147483649 : ISize).toInt32 = 2147483647 := by rfl
example : (-2147483649 : ISize).toInt64 = 2147483647 (-2147483649 : ISize).toInt64 = -2147483649 := by native_decide
-- TODO: add proof once the theory is available
-- example : (-2147483649 : ISize).toInt64 = 2147483647 := by decide