lean4-htt/tests
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
..
bench chore: set experimental.module=true when running grind benchmarks (#10041) 2025-08-22 03:15:36 +00:00
compiler fix: make lcAny-producing arrow types lower to tobj rather than obj (#9972) 2025-08-18 22:18:26 +00:00
elabissues
ir
lean feat: .ctorIdx for all inductives (#9951) 2025-08-25 10:47:06 +00:00
pkg perf: make macro scope numbering less dependent on surrounding context (#10027) 2025-08-22 13:16:02 +00:00
playground chore: eliminate uses of intros x y z (#9983) 2025-08-19 06:09:13 +00:00
plugin
simpperf
.gitignore
common.sh
lakefile.toml
lean-toolchain