Sebastian Ullrich
7feb583b9e
feat: enable experimental module system in Init ( #8047 )
2025-04-23 17:21:33 +00:00
Kim Morrison
61d7716ad8
feat: UIntX.pow and Pow UIntX Nat instances ( #7886 )
...
This PR adds `UIntX.pow` and `Pow UIntX Nat` instances, and similarly
for signed fixed-width integers. These are currently only the naive
implementation, and will need to be subsequently replaced via
`@[extern]` with fast implementations (tracked at #7887 ).
2025-04-10 00:27:48 +00:00
Markus Himmel
4e51487b1c
chore: cleanup of finite integer lemmas ( #7706 )
...
This PR performs various cleanup tasks on `Init/Data/UInt/*` and
`Init/Data/SInt/*`.
2025-03-28 12:13:07 +00:00
David Thrane Christiansen
aef6c6d518
doc: review docstrings for fixed-width integer types ( #7602 )
...
This PR adds missing docstrings for fixed-width integer operations and
makes their style consistent.
2025-03-21 20:16:28 +00:00
David Thrane Christiansen
c279c088c8
doc: review Int docstrings ( #7568 )
...
This PR adds missing `Int` docstrings and makes the style of all of them
consistent.
2025-03-20 14:04:56 +00:00
David Thrane Christiansen
cbfb9e482f
doc: review of Nat docstrings ( #7552 )
...
This PR adds missing `Nat` docstrings and makes their style consistent.
---------
Co-authored-by: Bhavik Mehta <bm489@cam.ac.uk>
2025-03-20 09:13:36 +00:00
Markus Himmel
4262ea14d6
fix: Repr instance for Int32 ( #7467 )
...
This PR fixes the `Repr Int32` instance, which was previously repeating
the `Repr Int16` instance due to a copy-and-paste error.
2025-03-13 06:24:42 +00:00
David Thrane Christiansen
1bfccf88da
doc: add missing Bool docstrings and review existing ones ( #7246 )
...
This PR updates existing docstrings for Bool and adds the missing ones.
2025-03-08 08:16:13 +00:00
Markus Himmel
d67e0eea47
feat: IntX theory for simprocs and bv_decide ( #7259 )
...
This PR contains theorems about `IntX` that are required for `bv_decide`
and the `IntX` simprocs.
A more comprehensive set of theorems about `IntX` will be part of future
PRs.
2025-02-28 07:04:52 +00:00
Markus Himmel
3a22035dad
feat: IntX.abs ( #7131 )
...
This PR adds `IntX.abs` functions. These are specified by `BitVec.abs`,
so they map `IntX.minValue` to `IntX.minValue`, similar to Rust's
`i8::abs`. In the future we might also have versions which take values
in `UIntX` and/or `Nat`.
2025-02-18 13:16:30 +00:00
Markus Himmel
a26c937650
feat: Repr and Hashable for IntX ( #7128 )
...
This PR adds `Repr` and `Hashable` instances for `IntX`.
2025-02-18 11:03:53 +00:00
Markus Himmel
784444c7a9
feat: IntX.minValue, IntX.maxValue, IntX.ofIntLE, IntX.ofIntTruncate ( #7081 )
...
This PR adds functions `IntX.ofIntLE`, `IntX.ofIntTruncate`, which are
analogous to the unsigned counterparts `UIntX.ofNatLT` and
`UInt.ofNatTruncate`.
2025-02-14 11:59:37 +00:00
Markus Himmel
4a900cc65c
chore: rename IntX.toNat -> IntX.toNatClampNeg ( #7066 )
...
This PR renames `IntX.toNat` to `IntX.toNatClampNeg` (to reduce
surprises) and sets up a deprecation.
2025-02-13 12:14:28 +00:00
Markus Himmel
a3fd2eb0fe
chore: make IntX constructor private, provide UIntX.toIntX ( #7062 )
...
This PR introduces the functions `UIntX.toIntX` as the public API to
obtain the `IntX` that is 2's complement equivalent to a given `UIntX`.
2025-02-13 11:29:31 +00:00
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
Markus Himmel
b08fc5dfda
feat: IntX.ofBitVec ( #7048 )
...
This PR adds the functions `IntX.ofBitVec`.
2025-02-12 14:49:31 +00:00
Henrik Böving
f721f94045
feat: Bool.to(U)IntX ( #6060 )
...
This PR implements conversion functions from `Bool` to all `UIntX` and
`IntX` types.
Note that `Bool.toUInt64` already existed in previous versions of Lean.
2024-11-13 15:49:16 +00:00
Henrik Böving
c77b6a2c64
feat: define ISize and basic operations on it ( #5961 )
2024-11-05 15:08:19 +00:00
Henrik Böving
93dd6f2b36
feat: add Int16/Int32/Int64 ( #5885 )
...
This adds all fixed width integers with the exception of `ssize_t` so
the code is quick to review as everything just behaves the same.
2024-11-04 13:18:05 +00:00
Henrik Böving
193b6f2bec
feat: define Int8 ( #5790 )
2024-10-25 06:06:40 +00:00