feat: add delta to conv mode

This commit is contained in:
Leonardo de Moura 2021-09-09 07:28:48 -07:00
parent 4087525cba
commit b5b5370181
3 changed files with 19 additions and 0 deletions

View file

@ -25,6 +25,7 @@ syntax (name := congr) "congr" : conv
syntax (name := arg) "arg " num : conv
syntax (name := ext) "ext " (colGt ident)* : conv
syntax (name := change) "change " term : conv
syntax (name := delta) "delta " ident : conv
syntax (name := pattern) "pattern " term : conv
syntax (name := rewrite) "rewrite " rwRuleSeq : conv
syntax (name := erewrite) "erewrite " rwRuleSeq : conv

View file

@ -9,3 +9,4 @@ import Lean.Elab.Tactic.Conv.Rewrite
import Lean.Elab.Tactic.Conv.Change
import Lean.Elab.Tactic.Conv.Simp
import Lean.Elab.Tactic.Conv.Pattern
import Lean.Elab.Tactic.Conv.Delta

View file

@ -0,0 +1,17 @@
/-
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Lean.Elab.Tactic.Delta
import Lean.Elab.Tactic.Conv.Basic
namespace Lean.Elab.Tactic.Conv
open Meta
@[builtinTactic Lean.Parser.Tactic.Conv.delta] def evalDelta : Tactic := fun stx => withMainContext do
let declName ← resolveGlobalConstNoOverload stx[1]
let lhsNew ← deltaExpand (← getLhs) (. == declName)
changeLhs lhsNew
end Lean.Elab.Tactic.Conv