fix: trace used builtin simprocs even if they are not in the environment

This commit is contained in:
Leonardo de Moura 2024-01-02 06:07:28 -08:00 committed by Sebastian Ullrich
parent 57bc058209
commit 3e11b5fe15
3 changed files with 13 additions and 0 deletions

View file

@ -311,6 +311,12 @@ def mkSimpOnly (stx : Syntax) (usedSimps : UsedSimps) : MetaM Syntax := do
| false, true => `(Parser.Tactic.simpLemma| ↓ ← $decl:term)
| false, false => `(Parser.Tactic.simpLemma| ↓ $decl:term)
args := args.push arg
else if (← Simp.isBuiltinSimproc declName) then
let decl := mkIdent declName
let arg ← match post with
| true => `(Parser.Tactic.simpLemma| $decl:term)
| false => `(Parser.Tactic.simpLemma| ↓ $decl:term)
args := args.push arg
| .fvar fvarId => -- local hypotheses in the context
-- `simp_all` always uses all propositional hypotheses (and it can't use
-- any others). So `simp_all only [h]`, where `h` is a hypothesis, would

View file

@ -0,0 +1,6 @@
def f (_ : Nat) := 10
set_option tactic.simp.trace true
example : f x = (if true then 8 + 2 else 0) := by
simp
rw [f]

View file

@ -0,0 +1 @@
Try this: simp only [↓reduceIte, Nat.reduceAdd]