Skip to content

Commit

Permalink
Builder.Apply: suggest alias when warning about apply rule for Iff th…
Browse files Browse the repository at this point in the history
…eorem (#163)
  • Loading branch information
JLimperg authored Oct 1, 2024
1 parent 28fa805 commit 9739358
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Aesop/Builder/Apply.lean
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def checkNoIff (type : Expr) : MetaM Unit := do
if aesop.warn.applyIff.get (← getOptions) then
forallTelescope type λ _ conclusion => do
if ← testHelper conclusion λ e => return e.isAppOf' ``Iff then
logWarning m!"Apply builder was used for a theorem with conclusion A ↔ B. You probably want to use the simp builder.\nUse `set_option aesop.warn.applyIff false` to disable this warning."
logWarning m!"Apply builder was used for a theorem with conclusion A ↔ B.\nYou probably want to use the simp builder or create an alias that applies the theorem in one direction.\nUse `set_option aesop.warn.applyIff false` to disable this warning."

def applyCore (t : ElabRuleTerm) (pat? : Option RulePattern)
(imode? : Option IndexingMode) (md indexMd : TransparencyMode)
Expand Down
3 changes: 2 additions & 1 deletion AesopTest/WarnApplyIff.lean
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import Aesop
set_option aesop.check.all true

/--
warning: Apply builder was used for a theorem with conclusion A ↔ B. You probably want to use the simp builder.
warning: Apply builder was used for a theorem with conclusion A ↔ B.
You probably want to use the simp builder or create an alias that applies the theorem in one direction.
Use `set_option aesop.warn.applyIff false` to disable this warning.
-/
#guard_msgs in
Expand Down

0 comments on commit 9739358

Please sign in to comment.