Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Canonical/Main.lean
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Canonical.Preprocess

namespace Canonical

open Lean Parser Tactic Meta Elab Tactic Core PremiseSelection
open Lean Parser Tactic Meta Elab Tactic Core LibrarySearch PremiseSelection

/-- The return type of Canonical, with the generated `terms`. -/
structure CanonicalResult where
Expand Down Expand Up @@ -49,6 +49,11 @@ elab (name := canonicalSeq) "canonical " timeout_syntax:(num)? config:optConfig

let config ← canonicalConfig config

if config.librarySearch then
let (_, goal) ← (← getMainGoal).intros
goal.withContext do
premises := premises ++ (← librarySearchSymm libSearchFindDecls (← getMainGoal)).map (·.2.1)

if config.premises then
let found ← select (← getMainGoal)
let found := found.insertionSort (fun a b => a.score > b.score)
Expand Down
2 changes: 2 additions & 0 deletions Canonical/TranslationUtil.lean
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ structure CanonicalConfig where
monomorphize: Bool := true
/-- Unpacks structure types in a preprocessing stage. -/
destruct: Bool := true
/-- Add librarySearch lemmas used by `exact?` and `apply?` -/
librarySearch: Bool := true
/-- Add premises from the current premise selector. -/
premises: Bool := false

Expand Down