You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default rewriting tactic (rewrite/autorewrite) will refuse to rewrite under binders/arrows. See the manual. Unfortunately, that means that sauto will also not do those rewriting if they are in the rew:db: hint set.
Example:
Parameter A B : Prop.
Parameter ab : A <-> B.
HintRewrite ab : ab.
Lemma test : (forall x : nat, A) -> B.
sauto db:ab. (* fails *)
setoid_rewrite ab.
sauto (* succeeds *)Qed.
The workaround is to define a custom autorewrite with ab with
Ltac ab_simp :=
progress (repeat (rewrite_strat topdown hints ab);
repeat match goal with
| H : _ |- _ => rewrite_strat topdown hints ab in H
end).
Then sauto simp+:ab_simp proves the test lemma.
This is kind of exactly what was done for boolean reflection, but it would be nice if the default sauto rewriting was already as powerful as this. It is possible that this change may break existing proofs with some not-well designed rewriting systems. Therefore, adding it as an extra option like setoid_rew:on might be worthwhile.
The text was updated successfully, but these errors were encountered:
Yes, it would make sense to have this as a separate option. There would be a performance penalty, however, so this should be an option. I think it shouldn't be too hard; I'll take a look sometime in the future, several months perhaps (you can try doing it yourself and submitting a pull request if you don't want to wait).
I may do it myself, but I've never written a Coq plugin, so I have no idea how to call something like setoid_rewrite from OCaml or how to access the hint database. That will require some learning
The default rewriting tactic (
rewrite
/autorewrite
) will refuse to rewrite under binders/arrows. See the manual. Unfortunately, that means thatsauto
will also not do those rewriting if they are in therew:db:
hint set.Example:
The workaround is to define a custom
autorewrite with ab
withThen
sauto simp+:ab_simp
proves thetest
lemma.This is kind of exactly what was done for boolean reflection, but it would be nice if the default
sauto
rewriting was already as powerful as this. It is possible that this change may break existing proofs with some not-well designed rewriting systems. Therefore, adding it as an extra option likesetoid_rew:on
might be worthwhile.The text was updated successfully, but these errors were encountered: