-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
disable rejection of perm
simp lemmas, or override perm
field for a simp lemma
#1743
Comments
I'll briefly summarise here Mario's response to this in a meeting today, and then close later if there's no further discussion. This use case probably counts as mis-use of the simplifier, because it is using side conditions to control flow. One should imagine an alternate version of the simplifier, which instead of checking side conditions as they arose, collected them all and only checked them at the end. This version would loop in this example without the Mario suggested as a possible alternative, relevant for the application I had in mind, a way of specifying a custom term order to the simplifier (i.e. to use at https://github.com/leanprover/lean4/blob/master/src/Lean/Meta/Tactic/Simp/Rewrite.lean#L73), as an alternative to the side conditions. I still think it would be nice to have a hook to disable this term order check entirely, for people who want to play with fire, but I appreciate the reason to be hesitant. :-) A separate issue that came up in this conversation was that this example relies on the simplifier using decidability to discharge side conditions, which is potentially extremely expensive, and will probably be turned off as the default behaviour in future. |
By the way, if the term order was a user function, then you could supply |
I had a quick look at this possibility. Unfortunately one couldn't add a |
Not |
Prerequisites
Description
The simplifier identifies some simp lemmas as
perm
utation lemmas (if the lhs and rhs differ only by a permutation of variables), and then rejects some rewrites by these lemmas.This has undesirable effects, in particular when using simp lemmas with side conditions that independently prevent looping. It would be helpful to either be able to disable the check that rejects rewrites by
perm
lemmas, or on a per-lemma basis to override theperm
field.(This is a feature request, not a bug report.)
Steps to Reproduce
Note here the two examples are identical, except that I have replaced
c
with37
in the second example.The intention here is that
simp only [comm, comm_assoc, add_assoc]
should sort a sum off a i
terms according to the value ofi
.Expected behavior:
Both examples to succeed. I'd be happy if I needed to add some annotation that tells
simp
thatcomm
should not be considered aperm
lemma (because of the side condition), or to specify a configuration object forsimp
that disables theperm
check.Actual behavior:
The first example succeeds, tracing:
The second example fails with unsolved goals, tracing:
Versions
Lean (version 4.0.0-nightly-2022-10-12, commit aa845de, Release)
The text was updated successfully, but these errors were encountered: