lean4-htt/tests/lean/run/premise_selection_mepo.lean
Kim Morrison 0807f73171
feat: basic premise selection algorithm based on MePo (#7844)
This PR adds a simple implementation of MePo, from "Lightweight
relevance filtering for machine-generated resolution problems" by Meng
and Paulson.

This needs tuning, but is already useful as a baseline or test case.

---------

Co-authored-by: Thomas Zhu <thomas.zhu.sh@hotmail.com>
2025-09-23 06:40:22 +00:00

26 lines
678 B
Text

import Lean.PremiseSelection.MePo
set_premise_selector Lean.PremiseSelection.mepoSelector (useRarity := false)
example (a b : Int) : a + b = b + a := by
suggest_premises
sorry
-- #time
example (x y z : List Int) : x ++ y ++ z = x ++ (y ++ z) := by
suggest_premises
sorry
-- `useRarity` is too slow in practice: it requires analyzing all the types in the environment.
-- It would need to be cached.
-- set_premise_selector Lean.PremiseSelection.mepoSelector (useRarity := true)
-- example (a b : Int) : a + b = b + a := by
-- suggest_premises
-- sorry
-- #time
-- example (x y z : List Int) : x ++ y ++ z = x ++ (y ++ z) := by
-- suggest_premises
-- sorry