fix: specialize
This commit is contained in:
parent
218b9c87b0
commit
bbe6d37109
2 changed files with 12 additions and 1 deletions
|
|
@ -101,7 +101,7 @@ def refineCore (stx : Syntax) (tagSuffix : Name) (allowNaturalHoles : Bool) : Ta
|
|||
@[builtinTactic «specialize»] def evalSpecialize : Tactic := fun stx => withMainContext do
|
||||
match stx with
|
||||
| `(tactic| specialize $e:term) =>
|
||||
let (e, mvarIds') ← elabTermWithHoles e (← getMainTarget) `specialize (allowNaturalHoles := true)
|
||||
let (e, mvarIds') ← elabTermWithHoles e none `specialize (allowNaturalHoles := true)
|
||||
let h := e.getAppFn
|
||||
if h.isFVar then
|
||||
let localDecl ← getLocalDecl h.fvarId!
|
||||
|
|
|
|||
11
tests/lean/run/specialize2.lean
Normal file
11
tests/lean/run/specialize2.lean
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
example : (p → q → False) ↔ (¬ p ∨ ¬ q) := by
|
||||
apply Iff.intro
|
||||
. intro h
|
||||
byCases hp:p <;> byCases hq:q
|
||||
. specialize h hp hq; contradiction
|
||||
. exact Or.inr hq
|
||||
. exact Or.inl hp
|
||||
. exact Or.inr hq
|
||||
. intro
|
||||
| Or.inl hnp => intros; contradiction
|
||||
| Or.inr hnq => intros; contradiction
|
||||
Loading…
Add table
Reference in a new issue