Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

feat(tactic/recommend): recommend tactic based on premise selection #16807

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gebner
Copy link
Member

@gebner gebner commented Oct 4, 2022

The recommend tactic searches for lemmas in the current environment that look like they could be useful to prove the current goal.

It is based on premise selection heuristic used in CoqHammer, with a preprocessing step that removes type arguments, type class instances, etc. This heuristic analyzes the proofs of the theorems in the environment: it will suggest lemmas that have been used in proofs of similar theorems as the current goal.

The heuristic is completely syntactic; it won't unfold definitions during the search, and doesn't know about types and type classes.

As requested on Zulip: https://leanprover.zulipchat.com/#narrow/stream/116290-rss/topic/Recent.20Commits.20to.20lean.3Amaster/near/274918133


Open in Gitpod

@gebner
Copy link
Member Author

gebner commented Oct 4, 2022

The code is based on my leanhammer prototype from 2019.

I tried it out on some random parts of mathlib. The results are very uneven. Sometimes it finds just the right lemma (I've added one example in the second commit). In other parts of the library it gets completely confused, for lack of a better word, and doesn't return anything useful or related.

I don't plan on developing the Lean 3 version any further. (The interesting code is in C++ which makes the turnaround pretty slow since we have to do a Lean release for every change.)

@kim-em kim-em added t-meta Tactics, attributes or user commands modifies-tactic-syntax This PR adds a new interactive tactic or modifies the syntax of an existing tactic. labels Oct 5, 2022
@kim-em kim-em added the not-too-late This PR was ready at the point mathlib3 was frozen: we will try to merge it and port it to mathlib4 label Jul 16, 2023
@kim-em
Copy link
Collaborator

kim-em commented Jul 16, 2023

I'm editorialising a little here by marking this as not-too-late, just as a reminder/hope that we'll get around to having this in Lean 4! :-)

@eric-wieser eric-wieser requested a review from a team as a code owner October 16, 2023 15:12
@eric-wieser
Copy link
Member

@semorrison, can we consider this replaced by have??

@kim-em
Copy link
Collaborator

kim-em commented Apr 17, 2024

@semorrison, can we consider this replaced by have??

I don't think so.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies-tactic-syntax This PR adds a new interactive tactic or modifies the syntax of an existing tactic. not-too-late This PR was ready at the point mathlib3 was frozen: we will try to merge it and port it to mathlib4 t-meta Tactics, attributes or user commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants