Skip to content

Commit

Permalink
Merge pull request #1119 from lean-ja/Seasawher/issue1118
Browse files Browse the repository at this point in the history
`add_hoge_rules` コマンドに `local` や `scoped` を付与できない
  • Loading branch information
Seasawher authored Nov 16, 2024
2 parents fc892f5 + 5eebbba commit 0caf409
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions LeanByExample/Reference/Declarative/DeclareAesopRuleSets.lean
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ example : True := by
/- `hoge` タクティク用のルールを登録するのは [`add_aesop_rules`](./AddAesopRules.md) コマンドで可能ですが、これに対しても専用のコマンドを用意することができます。-/

/-- `hoge` タクティク用のルールを追加する -/
macro "add_hoge_rules" e:Aesop.rule_expr : command =>
`(command| add_aesop_rules (rule_sets := [HogeRules]) $e)
macro attrKind:attrKind "add_hoge_rules" e:Aesop.rule_expr : command =>
match attrKind with
| `(attrKind| local) => `(command| local add_aesop_rules (rule_sets := [HogeRules]) $e)
| `(attrKind| scoped) => `(command| scoped add_aesop_rules (rule_sets := [HogeRules]) $e)
| _ => `(command| add_aesop_rules (rule_sets := [HogeRules]) $e)

namespace Command --#

Expand All @@ -60,7 +63,7 @@ example : MyTrue := by
apply MyTrue.intro

-- `MyTrue` に関するルールを `hoge` に登録する
add_hoge_rules safe constructors [MyTrue]
local add_hoge_rules safe constructors [MyTrue]

example : MyTrue := by
-- `hoge` で証明できるようになった!
Expand All @@ -82,7 +85,7 @@ macro "hoge" e:Aesop.rule_expr : attr =>
namespace Attr --#

/-- `True` を模して自作した命題 -/
@[hoge safe constructors]
@[local hoge safe constructors]
inductive MyTrue : Prop where
| intro

Expand Down

0 comments on commit 0caf409

Please sign in to comment.