Zulip Chat Archive
Stream: lean4
Topic: Aesop dev updates
Jannis Limperg (Jul 07 2022 at 10:26):
Since Aesop now has some users (cc @Asta Halkjær From, @Sebastian Ullrich ), I'll log user-facing changes in this topic. Starting with...
9af09347a
: Aesop can now be used as a non-terminal tactic. It reports the goals which remain after applying safe rules to the root goal, recursively until no safe rules are applicable. Since this is meant to be used only as a debugging aid, Aesop prints a warning for non-terminal calls, but this can be disabled.
Jannis Limperg (Oct 03 2022 at 12:06):
In preparation for the paper submission, I recently made a bunch of changes which clean up Aesop's semantics, but will probably break your code (sorry):
bbe07b
: Aesop now depends onstd
.28b344
: the rule index now uses reducible transparency. This means that, for example, anapply
rule with conclusionP (x :: xs)
will fail on the goalP ([x] ++ xs)
. See discussion at #lean4 > Discrimination tree lookup.9c4b4d
: the builtin introduction rules for product-like types (And
,Prod
, etc.) are now safe rather than unsafe.d96217
: safe rules now fail if they generate multiple rule applications (e.g. a safeconstructors
rule where multiple constructors apply to the goal).6bcfda
: theelim
builder is now calleddestruct
, for consistency with Isabelle's terminology.
Jannis Limperg (Oct 04 2022 at 14:07):
bf3d68
: the builtin rules no longer split hypothesesh : P ↔ Q
intoh1 : P -> Q
andh2 : Q -> P
. Instead, such hypotheses are now treated as equations via propext (likesimp
usually does).
Jannis Limperg (Dec 05 2022 at 12:58):
8cebf2
: new feature: aesop?
outputs a tactic proof as a Try this:
suggestion. The scripts are sometimes still buggy or more cumbersome than necessary, but they work for a large majority of Aesop calls in my test suite.
Scott Morrison (Dec 05 2022 at 20:37):
Perhaps worth mentioning on this thread: aesop now has many more users. It is imported in mathlib4, and being used (experimentally) in the category theory library as a default for structure fields where tidy
used to be used in mathlib3. So far (early days) it looks quite promising.
Marc Huisinga (Dec 05 2022 at 21:28):
I use it as well and it's amazing when configured correctly. I was able to throw out dozens of tedious proofs each with a single aesop invocation the other day.
Heather Macbeth (Jan 02 2023 at 03:28):
@Jannis Limperg I'm experimenting with Aesop, it's really cool!
Could you please give a bit of documentation on the simp_options
available (as mentioned in the readme)? I'd actually like an option to turn off the simplification step entirely, if that exists.
Jannis Limperg (Jan 02 2023 at 13:08):
Glad to hear it! The simp_options
are a superset of the options supported by simp
(i.e. simp (config := { ... })
). Currently the only additional option is use_hyps
as documented in the README. There's currently no option to turn off the simp rule entirely, but I'll implement one.
Jannis Limperg (Jan 02 2023 at 15:58):
72610c
: you can now write aesop (simp_options := { enabled := false })
to disable the simplification rule entirely (@Heather Macbeth ). To make this less cumbersome, you can define a wrapper like aesop_cat
.
Heather Macbeth (Jan 02 2023 at 16:02):
Thank you! Looking forward to trying it!
Jannis Limperg (Feb 24 2023 at 17:34):
aea5b4
: Aesop now supports local and scoped rules. This required a different implementation strategy for rule sets, which has two additional consequences:
- Aesop rule sets must now be declared in a separate file that then gets imported. (They use
initialize
internally.) - When an Aesop rule is erased, e.g. with
attribute [-aesop]
, it is removed only for the current section/file rather than permanently. This brings@[aesop]
in line with other erasable attributes and prevents potential issues where the order ofimport
statements could become semantically relevant.
Jannis Limperg (Jan 22 2024 at 10:28):
82679d
: multiple cosmetic but breaking changes have just landed on Aesop master
.
- The syntax for giving options to rule builder has changed from, e.g.,
@[aesop foo (apply (transparency := reducible))]
to@[aesop foo apply (transparency := reducible)]
. - The
patterns
rule builder option (which can be used to restrictcases
rules) has been renamed tocases_patterns
. - The
(options := { ... })
clause has been renamed to(config := { ... })
, for consistency with tactics likesimp
. - Similarly, the
(simp_options := { ... })
clause has been renamed to(simp_config := { ... })
. - The
enabled
anduseHyps
options ofsimp_config
have moved toconfig
and are now calledenableSimp
anduseSimpAll
. As a result,simp_config
now takes exactly the same options assimp (config := ...)
.
I'll prepare a Mathlib patch. Apologies to non-Mathlib dependents.
There's also a non-breaking change that might be of interest: Aesop now accepts duplicate clauses in @[aesop]
, aesop (add ...)
and so on. For example, @[aesop safe unsafe 1% ]
was previously illegal but now means @[aesop unsafe 1%]
. As a result,@[continuity]
, for example, could now expand to @[aesop safe (rule_sets [Continuity])]
and @[continuity unsafe 1%]
to @[aesop safe (rule_sets [Continuity]) unsafe 1%]
.
Eric Rodriguez (Jan 23 2024 at 12:20):
I don't have the will to fork, but I think the main docstring is out of date: it mentions options := ...
still:
https://github.com/leanprover-community/aesop/blob/2f8ec979f3fa425fc219d635e9aa1487c7b09345/Aesop/Frontend/Tactic.lean#L48
Jannis Limperg (Jan 23 2024 at 12:32):
Fixed on master, thanks!
Jannis Limperg (Feb 22 2024 at 18:48):
bc4363
: Some new convenience features:
- You can now write
aesop (add ... (f x))
to addf x
as aforward
,apply
orsimp
rule.f x
stands for an arbitrary term and can contain hypotheses. The parentheses aroundf x
are mandatory. - You can now write
aesop (add ... (by norm_num))
to add a tactic as a rule.norm_num
stands for an arbitrary sequence of tactics and can contain hypotheses. Again, the parentheses are mandatory. - There's a new command
add_aesop_rules
with the same syntax as theadd
clause, e.g.add_aesop_rules 1% [(by norm_num), apply f]
. This command is particularly useful for adding tactics since, unlike most existing approaches, it works withaesop?
.
To enable these features, I had to make one backward-incompatible change: the rule_sets
clauses are now written (rule_sets := [...])
instead of (rule_sets [...])
. Sorry for the breakage.
Mathlib bump: #10859
Martin Dvořák (Feb 22 2024 at 19:34):
Are the three dots verbatim?
Geoffrey Irving (Feb 22 2024 at 19:47):
^ No, they refer to a list of rule set identifiers, like Continuous, Bound
.
Geoffrey Irving (Feb 22 2024 at 19:48):
Or a list of rule features, if you mean the earlier dots.
Notification Bot (Feb 27 2024 at 18:15):
10 messages were moved from this topic to #lean4 > zetaDelta in Aesop simp by Jannis Limperg.
Last updated: May 02 2025 at 03:31 UTC