Zulip Chat Archive
Stream: metaprogramming / tactics
Topic: Aesop RuleTac restricted to a particular pattern
Geoffrey Irving (Feb 15 2024 at 15:27):
Is there a way to make an Aesop tactic rule that participates in DiscrTree
filtering, so that it only costs significant time if the goal matches a certain pattern? As an example, is it possible to make decide
fire exactly if the goal looks like a < b
where a b : Interval
(a computational interval analysis type)?
Jannis Limperg (Feb 15 2024 at 16:05):
Yes, see here for an example that fires on goals of the form _ = _
(up to reducible defeq). For your use case, I guess the annotation would be (index := [target (_ : Interval) < (_ : Interval)])
.
Geoffrey Irving (Feb 15 2024 at 16:06):
Perfect, thank you!
Jannis Limperg (Feb 15 2024 at 16:21):
You can also do this as a simproc
, which would probably be even more efficient. Here's a similar simproc I wrote to run decide
on equations of string literals:
Jannis Limperg (Feb 15 2024 at 16:21):
This might need a more recent Aesop than is currently in mathlib though.
Geoffrey Irving (Feb 15 2024 at 16:29):
Hmm, actually I may need something more than this, since I also want to produce nice error messages: if I fail to prove a < b
using interval arithmetic I want to report what the intervals were, so that it's more obvious what went wrong.
Is there some way to report error messages from inside Aesop, if I run a tactic and I know its failure means the rest of the search has to fail? I think if I fail out of a RuleTac
it'll bury any error message in the search, but possibly there is a way out of that?
Jannis Limperg (Feb 15 2024 at 16:35):
No, I'm afraid this is not currently supported. I'll note it down as a feature request.
Geoffrey Irving (Feb 15 2024 at 16:36):
I may just be doing something that is inappropriate for Aesop, and better for a custom DiscrTree thing.
Jannis Limperg (Feb 15 2024 at 16:39):
Jannis Limperg (Feb 15 2024 at 16:41):
I don't dislike this request. With another project, I've been exploring how Aesop could be used to build automation that doesn't necessarily close the goal but just makes some progress and then hands the reigns over to the user again. This feature fits nicely into that program.
Last updated: May 02 2025 at 03:31 UTC