lean4-htt/src
Paul Reichert b5b34ee054
feat: List slices (#11019)
This PR introduces slices of lists that are available via slice notation
(e.g., `xs[1...5]`).

* Moved the `take` combinator and the `List` iterator producer to
`Init`.
* Introduced a `toTake` combinator: `it.toTake` behaves like `it`, but
it has the same type as `it.take n`. There is a constant cost per
iteration compared to `it` itself.
* Introduced `List` slices. Their iterators are defined as
`suffixList.iter.take n` for upper-bounded slices and
`suffixList.iter.toTake` for unbounded ones.

Performance characteristics of using the slice `list[a...b]`:

* when creating it: `O(a)`
* every iterator step: `O(1)`
* `toList`: `O(b - a + 1)` (given that a <= b)

Because the slice only stores a suffix of `xs` internally, two slices
can be equal even though the underlying lists differ in an irrelevant
prefix. Because the `stop` field is allowed to be beyond the list's
upper bound, the slices `[1][0...1]` and `[1][0...2]` are not equal,
even though they effectively cover the same range of the same list.
Improving this would require us to call `List.length` when building the
slice, which would iterate through the whole list.
2025-11-14 11:33:25 +00:00
..
bin feat: API to avoid deadlocks from dropped promises (#6958) 2025-02-07 15:33:10 +00:00
cmake chore: fix spelling errors (#10042) 2025-08-22 07:23:12 +00:00
include/lean fix: revert the waitAny refactoring (#11000) 2025-10-29 08:27:16 +00:00
Init feat: List slices (#11019) 2025-11-14 11:33:25 +00:00
initialize feat: zero cost BaseIO (#10625) 2025-10-22 10:55:12 +02:00
kernel chore: use String.ofList instead of String.mk in elaborator+kernel (#11048) 2025-11-01 14:44:16 +00:00
lake chore: some String API cleanup in Lake.Util.Version (#11160) 2025-11-14 08:56:56 +00:00
Lean chore: make compilation type mismatch error message from non-exposed defs a lot less mysterious (#11177) 2025-11-14 10:50:43 +00:00
library perf: used hashmaps for symbol lookup in the interpreter (#10927) 2025-10-23 11:45:20 +00:00
runtime fix: make ST.Ref.ptrEq behave as stated in the docs (#11056) 2025-11-02 10:42:33 +00:00
shell refactor: lake: mv tests/examples to top-level tests dir (#10688) 2025-10-06 21:47:57 +00:00
Std feat: List slices (#11019) 2025-11-14 11:33:25 +00:00
util chore: fix C++ warning (#10922) 2025-10-24 11:09:08 +00:00
cadical.mk fix: cadical distribution on Linux (#8201) 2025-05-02 18:25:16 +00:00
CMakeLists.txt chore: begin development cycle for v4.26 (#10884) 2025-10-21 23:22:58 +00:00
config.h.in perf: use mimalloc by default (#7710) 2025-03-30 22:40:41 +00:00
githash.h.in
Init.lean chore: more reorganization of strings (#10928) 2025-10-23 11:56:11 +00:00
lakefile.toml.in feat: USE_LAKE_CACHE CMake option (#10708) 2025-10-08 08:56:53 +00:00
lean-toolchain
Lean.lean chore: use 'library suggestions' rather than 'premise selection' (#11029) 2025-10-31 04:07:49 +00:00
lean.mk.in chore: further split libleanshared on Windows to avoid symbol limit (#10136) 2025-08-26 16:01:57 +00:00
Leanc.lean fix: Unicode path support for Lean Windows executables (#10133) 2025-08-27 11:28:55 +00:00
out feat: ac normalization in grind (#10146) 2025-08-27 03:28:30 +00:00
Std.lean chore: more module system fixes and refinements for finishing batteries port (#10819) 2025-10-21 08:19:50 +00:00
stdlib.make.in chore: further split libleanshared on Windows to avoid symbol limit (#10136) 2025-08-26 16:01:57 +00:00
stdlib_flags.h chore: remove comment from src/stdlib_flags.h (#10409) 2025-09-16 10:39:27 +00:00
version.h.in feat: language reference links and examples in docstrings (#7240) 2025-03-12 09:17:27 +00:00