coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: David Holland <dholland-coq AT netbsd.org>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Question about rewrite: feature or bug?
- Date: Thu, 15 Aug 2019 17:25:59 +0000
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=dholland-coq AT netbsd.org; spf=Pass smtp.mailfrom=dholland AT netbsd.org; spf=None smtp.helo=postmaster AT mail.netbsd.org
- Ironport-phdr: 9a23:K7+DehJ6/+6KQLIyatmcpTZWNBhigK39O0sv0rFitYgRK/jxwZ3uMQTl6Ol3ixeRBMOHsqgC0rGP+Pm5ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTagf79+Ngi6oAvMusUZnIduN7o9wQbVr3VVfOhb2XlmLk+JkRbm4cew8p9j8yBOtP8k6sVNT6b0cbkmQLJBFDgpPHw768PttRnYUAuA/WAcXXkMkhpJGAfK8hf3VYrsvyTgt+p93C6aPdDqTb0xRD+v4btnRAPuhSwaMTMy7WPZhdFqjK9DrhyvpwJxzZPXboGbO/VxYr7SctEUSmdaQsZdSzZMDp+gY4YVEeYMO/tToYnnp1sJqBuzHQeiC/nxyj9Jm3D9wK800+MlEQHCxgMgGc8Bu2nTodroNKcSVuS1zK3SwjXFcvxawCvy6I/Rch06p/GDQ65wftHKyUYyDQ/FiU+QqYP8Mj6Ty+8DsHCb4vJ9We+rj2MrsR99rzahy8s2lIXFm4AYxkra+Sll3Io4I8CzRlRhbt6+CpRQsjmXN4toTcMmRGFloCM6xacHuZ6/ZiQKzoooxwLEZPycboeE+BXjVPyeITtghXJlfqywhwqq/ES9zuDxUtO43EhEoydLiNXAqG0B2h7J5sSZVvdx4l+t2TOV2ADS7uFEL1o0la3eK5M537Ewlp0TsUDHHiDsnkX5kbSbdkM69ei08OvneajpqoWbN49uhQHyKr4uldCnAeQkLggOWHCW9vi71L365EH2XLFKjuAtnaTCq5DbJcEbprajDANP04Yj7Qy/Dza839gCk3kHNgENRBXShI/wflrKPfrQDPGlgl3qni046erBO+jNC4vMIjDjl7PldLBxoxpQyA03ydlZ69dfDagpJv/vUFT98tvCAUlqYESP3+/7BYAlhcslUmWVD/rBaf6AgRqz/usqZtK0SsoVtTL6cqd34vfviTk/lEMXZqXv2oEYOijhT6ZWZn6BaH+pue8vVGIDvw4wVuvv0QfQVzNPbW2+GaUm6WNiUd70PcL4XomoxYe58mKjBJQPPDJAB0yGCnuucJ+LCa8B
On Sun, Aug 11, 2019 at 11:38:35AM +0800, Cao Qinxiang wrote:
> Dear Coq clubbers,
>
> I find that the behavior of "rewrite ... at ..." is quite strange. I am
> wondering whether it is actually a feature or a bug. Here is a tiny
> example.
>
> [...]
I don't know officially, but, as strange as that behavior seems, I
think it's at least mostly what's intended. The understanding I have,
which may be incomplete, is that the idea of "at N" is to pick which
of several matches in the target term you want to operate on...
*after* the matches have been found by instantiating binders and so
on. So you can't use "at N" to tell it whether to operate on x or y or
z.
In your setting, one gets
Goal forall x y, foo x y y.
intros.
rewrite <- app_nil_l with (l := y). (* foo x (nil ++ y) (nil ++ y) *)
rewrite <- app_nil_l with (l := y) at 1. (* foo x (nil ++ y) y *)
rewrite <- app_nil_l with (l := y) at 2. (* foo x y (nil ++ y) *)
and my understanding is that this is the control that "at N" is
supposed to give.
However, I apparently don't have the full picture because one also gets
rewrite <- (@app_nil_l (list _)) at 1. (* foo x (nil ++ y) y *)
rewrite <- (@app_nil_l (list _)) at 2. (* foo x y (nil ++ y) *)
rewrite <- (@app_nil_l (list _)). (* foo x y (nil ++ y) *)
I guess this matching works differently? Maybe someone else can shed
further light.
--
David A. Holland
dholland AT netbsd.org
- [Coq-Club] Question about rewrite: feature or bug?, Cao Qinxiang, 08/11/2019
- Re: [Coq-Club] Question about rewrite: feature or bug?, David Holland, 08/15/2019
- Re: [Coq-Club] Question about rewrite: feature or bug?, Gregory Malecha, 08/19/2019
- Re: [Coq-Club] Question about rewrite: feature or bug?, David Holland, 08/15/2019
Archive powered by MHonArc 2.6.18.