Generating a shortlist of candidate lemmas for suggestions #
Discrimination tree lookup #
This file defines how to build and match with the discrimination trees, for premises that are
- imported
- from the current module
- local hypotheses
Performance note #
When importing all of mathlib, building the discrimination trees takes on the order of 10-15 seconds. This is because of two distinct performance bottlenecks:
- Looping through the environment, and computing all of the discrimination tree entries is expensive, and is done in parallel to speed it up.
- Building the final discrimination tree by inserting all of the computed entries is less expensive, but it cannot be done in parallel, because a single datastructure is being built.
These two bottlenecks cost about the same amount of time. Luckily, we can already start doing (2) as soon as any of the parallel tasks from (1) have finished. So, we build the discrimination tree (on the main thread) at the same time that the entries are being computed on various parallel threads.
The global ref for looking up rw lemmas.
The global ref for looking up grw lemmas.
The global ref for looking up apply lemmas.
The global ref for looking up apply at lemmas.
Compute the discrimination trees for import theorems.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compute the discrimination trees for the theorems in the current file.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compute the discrimination trees for the local variables in lctx.
We restrict to the varaibles in lctx to avoid using introduced bound variables.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Get the discrimination tree matches with theorems from imported files.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Get the discrimination tree matches from tree.
Equations
- One or more equations did not get rendered due to their size.