feat: include current file in default premise selector (#11168)
This PR changes the default library suggestions (e.g. for `grind +suggestions` or `simp_all? +suggestions) to include the theorems from the current file in addition to the output of Sine Qua Non.
This commit is contained in:
parent
46ff76aabd
commit
bc9cc05082
2 changed files with 12 additions and 6 deletions
|
|
@ -11,15 +11,17 @@ import all Lean.LibrarySuggestions.SineQuaNon
|
|||
/-!
|
||||
# Default library suggestions engine
|
||||
|
||||
This module sets the default library suggestions engine to Sine Qua Non.
|
||||
This module sets the default library suggestions engine to "Sine Qua Non",
|
||||
along with the theorems from the current file.
|
||||
.
|
||||
Any module that imports this (directly or transitively) will have library suggestions enabled.
|
||||
-/
|
||||
|
||||
namespace Lean.LibrarySuggestions
|
||||
|
||||
open Lean LibrarySuggestions SineQuaNon
|
||||
|
||||
-- Set the default library suggestions engine to Sine Qua Non
|
||||
set_library_suggestions Lean.LibrarySuggestions.sineQuaNonSelector
|
||||
-- Set the default library suggestions engine to
|
||||
-- a combination of "Sine Qua Non" and the theorems from the current file.
|
||||
-- For now we just intersperse the results, but in future we should re-rank them.
|
||||
set_library_suggestions open Lean.LibrarySuggestions in sineQuaNonSelector.intersperse currentFile
|
||||
|
||||
end Lean.LibrarySuggestions
|
||||
|
|
|
|||
|
|
@ -13,7 +13,11 @@ already be set from importing Lean.LibrarySuggestions (which imports Default).
|
|||
-/
|
||||
|
||||
/--
|
||||
info: ✓ Selector found in imported state: `Lean.LibrarySuggestions.sineQuaNonSelector
|
||||
info: ✓ Selector found in imported state: (Term.open
|
||||
"open"
|
||||
(Command.openSimple [`Lean.LibrarySuggestions])
|
||||
"in"
|
||||
(Term.app `sineQuaNonSelector.intersperse [`currentFile]))
|
||||
---
|
||||
info: ✓ Successfully retrieved selector using getSelector!
|
||||
-/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue