lean4-htt/tests/playground
Joachim Breitner ccb8568756
feat: linear-size DecidableEq instance (#10152)
This PR introduces an alternative construction for `DecidableEq`
instances that avoids the quadratic overhead of the default
construction.

The usual construction uses a `match` statement that looks at each pair
of constructors, and thus is necessarily quadratic in size. For
inductive data type with dozens of constructors or more, this quickly
becomes slow to process.

The new construction first compares the constructor tags (using the
`.ctorIdx` introduced in #9951), and handles the case of a differing
constructor tag quickly. If the constructor tags match, it uses the
per-constructor-eliminators (#9952) to create a linear-size instance. It
does so by creating a custom “matcher” for a parallel match on the data
types and the `h : x1.ctorIdx = x2.ctorIdx` assumption; this behaves
(and delaborates) like a normal `match` statement, but is implemented in
a bespoke way. This same-constructor-matcher will be useful for
implementing other instances as well.

The new construction produces less efficient code at the moment, so we
use it only for inductive types with 10 or more constructors by default.
The option `deriving.decEq.linear_construction_threshold` can be used to
adjust the threshold; set it to 0 to always use the new construction.
2025-09-03 06:31:49 +00:00
..
forthelean chore: snake-case attributes (part 1) 2022-10-19 09:28:08 -07:00
parser feat: align take/drop/extract across List/Array/Vector (#6860) 2025-01-30 01:24:25 +00:00
pldi chore: snake-case attributes (part 1) 2022-10-19 09:28:08 -07:00
webserver chore: snake-case attributes (part 1) 2022-10-19 09:28:08 -07:00
.gitignore
add_zeros.lean
arith_eval_nat.lean
arith_eval_uint32.lean
badreset.lean
badupdate1.lean
bigctorfields.lean
bool_exhaust_test.lean chore: remove save tactic (#7047) 2025-02-12 09:19:30 +00:00
cmdparsertest1.lean
compile.sh
deriving.lean refactor: migrate all usages of old slice notation (#9000) 2025-06-27 18:52:07 +00:00
dir.lean
DiscrTree.lean
environment_extension.lean
envtest.lean
eval.lean chore: fix spelling mistakes in tests (#5439) 2024-09-24 03:22:53 +00:00
eval2.lean
expander.lean
file.lean
filemap.lean
fix.lean
fix1.lean
flat_parser.lean chore: snake-case attributes (part 1) 2022-10-19 09:28:08 -07:00
flat_parser2.lean perf: Use flat ByteArrays in Trie (#2529) 2023-09-20 13:22:37 +02:00
forIn.lean
forIn2.lean
frontend1.lean
gen.lean
hash.lean
hashable.lean chore: snake-case attributes (part 1) 2022-10-19 09:28:08 -07:00
ir.lean
lazylist.lean
levelparsertest1.lean
lowtech_expander.lean
map_perf.lean
mapVShmap.lean
matchEqs.lean chore: snake-case attributes (part 1) 2022-10-19 09:28:08 -07:00
moddata.lean
modtest1.lean
nnf.lean
noConfusionDecEqExp.lean feat: linear-size DecidableEq instance (#10152) 2025-09-03 06:31:49 +00:00
oldcompile.sh
oldrun.sh
opts.lean
parser1.lean
parser2.lean
partial_eq_lemma.lean
patch.lean
patcheqnspace.lean
patcheqnspace2.lean
perf.lean
persistentarray.lean
pge.lean chore: eliminate uses of intros x y z (#9983) 2025-08-19 06:09:13 +00:00
phashmap.lean
primes.hs
qsort64.lean
rand.lean
reelab.lean
ref2.lean
run.sh
seq1.lean
seq2.lean
simp_binders.lean
simpleTypes.lean feat: add inferType for LCNF 2022-08-09 17:33:24 -07:00
sizeof1.lean
sizeof2.lean
sizeof3.lean
sleep_save.lean fix: save when used as last tactic 2023-06-07 14:29:45 -07:00
smap.lean
som.lean feat: sum of monomials normal form by reflection 2022-04-22 18:51:48 -07:00
split.lean
task_test.lean
task_test2.lean
task_test3.lean
task_test4.lean
termParserAttr.lean chore: snake-case attributes (part 1) 2022-10-19 09:28:08 -07:00
termparsertest1.lean
tst.lean
uf1.lean
uf1_new.lean
unsafe.lean
usizeBug.lean
view_expander.lean