feat: add tactic macro unhygienic <tactic-seq>

This commit is contained in:
Leonardo de Moura 2021-04-10 16:18:40 -07:00
parent e56bf66d8d
commit 8917e08251
2 changed files with 7 additions and 0 deletions

View file

@ -310,6 +310,8 @@ macro_rules | `(tactic| trivial) => `(tactic| contradiction)
macro_rules | `(tactic| trivial) => `(tactic| apply True.intro)
macro_rules | `(tactic| trivial) => `(tactic| apply And.intro <;> trivial)
macro "unhygienic " t:tacticSeq : tactic => `(set_option tactic.hygienic false in $t:tacticSeq)
end Tactic
namespace Attr

View file

@ -45,3 +45,8 @@ example {p q : Prop} (h₁ : p → q) (h₂ : p q) : q := by
match h₂ with
| Or.inl _ => apply h₁; assumption
| Or.inr h => exact h
example {p q : Prop} (h₁ : p → q) (h₂ : p q) : q := by unhygienic
cases h₂
{ apply h₁; exact h } -- hygiene is disabled
exact h