lean4-htt/src
Leonardo de Moura b25bb78e2a feat: improve DiscrTree
Try to improve the performance issue described at #587.

The issue is that Mathlib contains thousands of theorems where the
associated key for the discrimination tree is just
`Key.other`. The indexing is not effective for them. This happens because

1- Lambda expressions are indexed using `Key.other`. The
   discrimination tree mainly focus on the first-order structure.

2- It unfolds reducible constants when inserting and retrieving
   entries. The motivation is that users expect simp theorems to fire
   modulo reducible constants.

Then, we have many theorems such as
```lean
map ?g ∘ map ?f = map (?g ∘ ?f)
```
when we expand the function composition on the left-hand side, we get
```lean
fun (x : List ?α) => map ?g (map ?f x)
```
Which is indexed as `Key.other`.

We should not avoid the `Array`s in the discrimination tree nodes
If the index is working effectively, these arrays are all very small.

In this commit, we try to address the problem by using a different
approach. When processing the root of a pattern, we interrupt
reduction as soon as the we hit something that would be indexed
as `Key.other`. Note that, in Lean 3, the root of a pattern also
receives special treatment.
2021-07-29 16:08:26 -07:00
..
bin feat: add --print-prefix, --print-libdir flags 2021-06-11 17:53:51 -07:00
cmake chore: delete more CMake cruft 2020-10-14 19:08:06 +02:00
include/lean feat: zero-copy GMP deserialization 2021-07-26 07:11:05 -07:00
Init perf: add workaround for perf issue 2021-07-29 08:29:09 -07:00
initialize chore: document io_mark_end_initialization setup 2021-06-13 17:32:35 -07:00
kernel perf: change is_def_eq_proof_irrel type to lbool 2021-07-26 07:11:55 -07:00
Lean feat: improve DiscrTree 2021-07-29 16:08:26 -07:00
Leanpkg fix: leanpkg: actually detect import cycles 2021-06-12 10:09:55 +02:00
library chore: remove obsolete serializer code 2021-07-22 18:59:39 +02:00
runtime fix: mark MPZ objects in compacted regions as persistent 2021-07-27 16:35:42 +02:00
shared chore: src/init ==> src/initialize 2019-11-22 04:59:13 -08:00
shell feat: user-defined attributes 2021-07-26 18:24:10 -07:00
Std chore: fix codebase and tests 2021-06-29 17:14:52 -07:00
util chore: remove obsolete serializer code 2021-07-22 18:59:39 +02:00
CMakeLists.txt chore: add bcrypt in CMakeLists 2021-07-24 10:45:28 +02:00
config.h.in chore: document simplified object header and remove obsolete cmake options 2021-07-20 10:42:28 -07:00
githash.h.in
Init.lean fix: Not should not be reducible, special support for Ne 2021-02-15 17:36:11 -08:00
Lean.lean feat: environment extension for storing declaration ranges 2021-01-10 18:25:56 -08:00
lean.mk.in feat: Lean.js can compile itself 2021-06-06 15:34:44 +02:00
Leanpkg.lean fix: IO.Error.alreadyExists may have an optional file name 2021-07-27 07:00:06 -07:00
Std.lean chore: move nondet to Std/Control/Nondet.lean 2021-03-02 07:57:25 -08:00
stdlib.make.in chore: restore prefer_native flag 2021-06-21 10:17:26 -07:00
version.h.in feat: version information API 2020-12-29 14:42:48 -08:00