coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Samuel Gruetter <gruetter AT mit.edu>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] structural specification of where to unfold
- Date: Wed, 3 Oct 2018 19:08:45 +0000
- Accept-language: en-US
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gruetter AT mit.edu; spf=Pass smtp.mailfrom=gruetter AT mit.edu; spf=None smtp.helo=postmaster AT dmz-mailsec-scanner-6.mit.edu
- Ironport-phdr: 9a23:ukuFyBTp46/kIf2xaFmceQIjidpsv+yvbD5Q0YIujvd0So/mwa6yZBSN2/xhgRfzUJnB7Loc0qyK6/+mATRIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfbF/IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbDVwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4qF2QxHqlSgHLSY0/mHJhMJtkKJVrhGvpxJ9zI7VfI6aO+FzcbnBcd4AX2dNQtpdWi5HD4ihb4UPFe0BPeNAoofgvVQOqAa+CheoBOjyyzFInGL20rMm0+Q9Dw7GxhErEtUBsHTOsdX6KrsSUfyrw6nS1jjDavJW2Svn5IfWbx8hvOiBULRtesTfzkkvEhnKjlSWqYH9IzyV0f4Ns26F4OpkUeKjkXAopBxsojWp28wiiZHJi5oIxl3H7yl0wpw5KNy7RUJhb9OpEINcuzyEO4Z1WM8vTX1ktDw+x7EcuJO2cjAGxIkmyhPbcfCLbYiF7x35WOqMOzt0mWxpdK65ih2v60av0Pf8WdOx0FtSripKjN3MtncV2hPO78iGS+Jx/kK71jaO0wDT8f9LLlwtmarAN5Eu2LgwlpwNvkTZByP7mV/6jKqXdkU44OSn9fnoYqj+qp+dMY97lB3+P7wzlsG8G+g1MBICUmmY9Oim2rDu/VX1QLBQgf03lqnZvoraJcMepqOhDA9VyJsj5AijDze6ztsYh2IKLFdEeBKblYTmJUzBIO3gAfeln1usiCtrx+zBPrD5HprNKWHDnK79crZ59k5T0xE+zctf5pJRErEOOuj/Wk73tNzCDx82KRa4w+j9CIY16oRLE2mIG+qSNL7YmV6O/OMmZeeWLsdBszHkbvMh+vTGjHkjmFZbc7P/jrUNb3XtJf1jPkidKVX2n9odDWoQ9l4xVvHnlEGPSxZWZmr0Uq4hsGJoQLm6BJvOE9j+yIeK2z22S8UPNzJ2T2uUGHKtTL2qHvIFaSacOMhkw24BVKTnRoM8h0j36F3KjoF/J++RwRU28Ir53Ykn4uzP0xw+6G4sVpnP4yS2V2hx21gwaXo20aR4+hUvxlKRlK1xgvhDGNcW/PhAVAE3L9uCiel7F5b/Vh+TJto=
I sometimes do this (which is probably similar to what Matthieu meant):
Definition foo(n: nat): nat := n + 3.
Goal forall x, foo x + 978 <> foo x.
intros.
match goal with
| |- context[?p] =>
match p with
| ?x + 978 =>
let p' := eval unfold foo in p in
change p with p'
end
end.
On Fri, 2018-09-28 at 21:58 -0400, Matthieu Sozeau wrote:
Hi Abishek, ssreflect’s rewrite supports contextual patterns and unfolding with “/“. Maybe with `pattern` and `eval unfold in` and `change` you could program this in Ltac as well.
Best,
— Matthieu
Le ven. 28 sept. 2018 à 15:14, Abhishek Anand <abhishek.anand.iitg AT gmail.com> a écrit :
Many times, we wish to unfold only certain occurrences of a definition.The unfold tactic takes the occurrence number as an integer.However, using an integer to refer to occurrence seems less robust and the integer provides less useful information when proofs break.
Is there a way to more structurally specify where to unfold?For example, is there a way to specify where to unfold as follows:
match goal with
[|- context[?x+978]] => unfold foo in ?xendThanks,
- Re: [Coq-Club] structural specification of where to unfold, Samuel Gruetter, 10/03/2018
Archive powered by MHonArc 2.6.18.