fix: trace used builtin simprocs even if they are not in the environment
This commit is contained in:
parent
57bc058209
commit
3e11b5fe15
3 changed files with 13 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
6
tests/lean/builtinSimprocTrace.lean
Normal file
6
tests/lean/builtinSimprocTrace.lean
Normal 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]
|
||||
1
tests/lean/builtinSimprocTrace.lean.expected.out
Normal file
1
tests/lean/builtinSimprocTrace.lean.expected.out
Normal file
|
|
@ -0,0 +1 @@
|
|||
Try this: simp only [↓reduceIte, Nat.reduceAdd]
|
||||
Loading…
Add table
Reference in a new issue