Documentation

Mathlib.Tactic.ClickSuggestions.FindPremises

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

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:

  1. Looping through the environment, and computing all of the discrimination tree entries is expensive, and is done in parallel to speed it up.
  2. 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.

A choice of which discrimination trees to build.

  • rw : Bool

    Build the rw discrimination tree?

  • grw : Bool

    Build the grw discrimination tree?

  • app : Bool

    Build the apply discrimination tree?

  • appAt : Bool

    Build the apply at discrimination tree?

Instances For

    Structure used for constructing the root nodes of the 4 discrimination trees.

    Instances For

      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.
              Instances For