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 test: benchmarks for simp 2021-03-09 15:09:51 -08:00
arith_eval_nat.lean
arith_eval_uint32.lean
badreset.lean
badupdate1.lean
bigctorfields.lean fix: allow bigger ctor objects 2021-01-29 18:23:38 -08:00
bool_exhaust_test.lean chore: remove save tactic (#7047) 2025-02-12 09:19:30 +00:00
cmdparsertest1.lean chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
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 chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
environment_extension.lean feat: subsume variables under variable 2021-01-22 14:36:05 +01:00
envtest.lean
eval.lean chore: fix spelling mistakes in tests (#5439) 2024-09-24 03:22:53 +00:00
eval2.lean chore: HasToString => ToString 2020-10-27 16:11:48 -07:00
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 chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
forIn2.lean chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
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 feat: subsume variables under variable 2021-01-22 14:36:05 +01:00
levelparsertest1.lean
lowtech_expander.lean chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
map_perf.lean
mapVShmap.lean feat: top-down heuristic delaboration 2021-08-03 09:13:18 +02:00
matchEqs.lean chore: snake-case attributes (part 1) 2022-10-19 09:28:08 -07:00
moddata.lean
modtest1.lean
nnf.lean chore: increase test size 2021-03-04 17:27:24 -08:00
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 test: perf experiments 2021-03-09 13:42:47 -08:00
seq2.lean test: perf experiments 2021-03-09 13:42:47 -08:00
simp_binders.lean test: benchmarks for simp 2021-03-09 15:09:51 -08:00
simpleTypes.lean feat: add inferType for LCNF 2022-08-09 17:33:24 -07:00
sizeof1.lean chore: update tests 2021-01-27 15:17:51 -08:00
sizeof2.lean chore: update tests 2021-01-27 15:17:51 -08:00
sizeof3.lean chore: update tests 2021-01-27 15:17:51 -08:00
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 chore: fix test 2020-06-17 21:28:37 -07:00
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 chore: HasToString => ToString 2020-10-27 16:11:48 -07:00
tst.lean
uf1.lean feat: subsume variables under variable 2021-01-22 14:36:05 +01:00
uf1_new.lean feat: subsume variables under variable 2021-01-22 14:36:05 +01:00
unsafe.lean
usizeBug.lean
view_expander.lean