lean4-htt/stage0/src
Joachim Breitner afcf52e623
feat: .ctorIdx for all inductives (#9951)
This PR generates `.ctorIdx` functions for all inductive types, not just
enumeration types. This can be a building block for other constructions
(`BEq`, `noConfusion`) that are size-efficient even for large
inductives.

It also renames it from `.toCtorIdx` to `.ctorIdx`, which is the more
idiomatic naming.
The old name exists as an alias, with a deprecation attribute to be
added after the next
stage0 update.

These functions can arguably compiled down to a rather efficient tag
lookup, rather than a `case` statement. This is future work (but
hopefully near future).

For a fair number of basic types the compiler is not able to compile a
function using `casesOn` until further definitions have been defined.
This therefore (ab)uses the `genInjectivity` flag and
`gen_injective_theorems%` command to also control the generation of this
construct.

For (slightly) more efficient kernel reduction one could use `.rec`
rather than `.casesOn`. I did not do that yet, also because it
complicates compilation.
2025-08-25 10:47:06 +00:00
..
bin chore: update stage0 2025-02-10 11:58:06 +00:00
cmake chore: update stage0 2025-08-22 08:30:43 +00:00
include/lean chore: update stage0 2025-08-12 05:06:58 +00:00
initialize chore: update stage0 2025-07-11 08:18:55 +00:00
kernel chore: update stage0 2025-08-12 21:07:52 +00:00
lake chore: update stage0 2025-05-14 16:03:07 +00:00
Lean chore: update stage0 2025-06-24 05:02:20 +00:00
library chore: update stage0 2025-07-26 15:58:53 +00:00
runtime chore: update stage0 2025-08-06 16:54:50 +00:00
shell chore: update stage0 2025-04-21 18:40:11 +02:00
util chore: update stage0 2025-07-11 08:18:55 +00:00
cadical.mk chore: update stage0 2025-05-03 00:16:43 +00:00
CMakeLists.txt chore: update stage0 2025-08-22 08:30:43 +00:00
config.h.in chore: update stage0 2025-04-03 03:26:05 +00:00
githash.h.in
lakefile.toml.in chore: update stage0 2025-08-23 23:33:05 +00:00
lean-toolchain chore: update stage0 (#3041) 2023-12-08 12:14:47 +00:00
lean.mk.in chore: update stage0 2025-03-17 19:01:29 +00:00
stdlib.make.in chore: update stage0 2025-08-03 04:34:00 +00:00
stdlib_flags.h feat: .ctorIdx for all inductives (#9951) 2025-08-25 10:47:06 +00:00
version.h.in chore: update stage0 2025-03-12 10:19:24 +00:00