Documentation

Mathlib.Tactic.ClickSuggestions

Point & click suggestions #

This file defines #click_suggestions, a command that enables an interactive interface that gives lemma/tactic suggestions for any expression selected by the user.

The library search uses a (lazy) RefinedDiscrTree to lookup a list of candidate rewrite lemmas. It excludes lemmas that are automatically generated. Each lemma is then checked one by one (in parallel) to see whether it is applicable. For each lemma that works, the corresponding rw/apply/apply at/grw tactic is constructed, so that it can be pasted into the editor when selected by the user.

The RefinedDiscrTree lookup groups the results by match pattern and gives a score to each pattern. This is used to display the results in sections. The sections are ordered by this score. Within each section, the lemmas are sorted by

The lemmas are optionally filtered to avoid duplicate rewrites, or trivial rewrites. This is controlled by the filter button on the top right of the results.

When a rewrite lemma introduces new goals, these are shown after a .

TODO #

Compute the suggestions. Use token for the output.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    Rpc function for the #click_suggestions widget.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      The component called by the #click_suggestions command.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        #click_suggestions enables a widget in the infoview that gives tactic suggestions for the expression in the tactic state that was (most recently) selected with shift-click. Each suggestion has an insert button for pasting it into the editor, at the position of the cursor.

        Theorems are searched for use in apply, apply at, rw and grw. These suggestions are grouped and sorted by the pattern that the lemmas match with. Rewrites that don't change the goal and rewrites that create the same goal as another rewrite are filtered out, as well as suggestions that create new goal(s) with metavariables in them. To see all suggestions, click on the filter button (▼) in the top right.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For