coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jan-Oliver Kaiser <janno AT mpi-sws.org>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] match context and evars
- Date: Thu, 24 Nov 2016 17:09:28 +0100
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=janno AT mpi-sws.org; spf=Pass smtp.mailfrom=janno AT mpi-sws.org; spf=None smtp.helo=postmaster AT hera.mpi-klsb.mpg.de
- Ironport-phdr: 9a23:pqd8Vx1I3jFwABiYsmDT+DRfVm0co7zxezQtwd8ZsewfKPad9pjvdHbS+e9qxAeQG96KsLQe2qGG6ujJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fdbghMijexe61+IRG5oQjSq8UdnJdvJLs2xhbVuHVDZv5YxXlvJVKdnhb84tm/8Zt++ClOuPwv6tBNX7zic6s3UbJXAjImM3so5MLwrhnMURGP5noHXWoIlBdDHhXI4wv7Xpf1tSv6q/Z91SyHNsD4Ubw4RTKv5LptRRT1iikIKiQ5/XnKhMJugqJVoBGvqRJxzIHbYo6aKPVwc7jBfd4YX2dNQtpdWiJDD466coABD/ABPeFdr4Tlo1UBtx2+CRC1CuPryz9ImGH53bcn2OokCw7G3RcgEMwUsH/Jq9j1Nr0dUeazzKnP1jjDautW2Tbk5IjTfBEhuuuAXbVqccre0EQiER7OgFaIqYH9Ij+Y2OAAv3KG4+dkT+6jlnQrpg51rzWp28wikJPGhpgPxVDB7Sh5wJg6Jdm/SENjYd6rDoFQuDuAO4tzWsMiQnhkuCU+yr0dopG3Zi0KyIwoxxLFdvOIbZCE4hPlVOmPPTd1nG9pdby7ihqo7EStzvfwWtSu3FtFqidJitzMuWoM1xzX5MiHUPx9/kK51DaNzQ/T7OdEIUcvmKreM54hw6c8loEdsETYBCP2n1/2jKCOekU+5ueo8/jnYqnhppKEK4B0jRj+Pr0ylcy7HOQ3KRMDX3Ob+OS5zL3s51f1QLRMjv0sk6nWqorWJcoBpv3xPwgA2YE6rh27Ej2O0dICnHBBIkgWVgiAit3LMleLB/T5E/qly3elkSxm3biSPLTnBJLlK2DC1az+ZvB68UEKm1l79sxW+58BUuJJG/n0QEKk7NE=
Hello Jonathan,
Thank you! This will prevent a lot of future headache. My preliminary tests indicate that it is not actually `id` which is unfolded here - it seems to work with all valid names. Am I right in assuming that you took `id` because it is a somewhat canonical choice of an existing name?
Best,
Jan-Oliver
On 11/24/2016 04:56 PM, Jonathan Leivent wrote:
Hi Jan-Oliver,
This will demonstrate the issue:
exvar Type (fun t => unify t nat; idtac t; let t2 := eval lazy delta
[id] in t in idtac t2).
The first idtac will print something like "?X6", while the second will
print "nat". What type of reduction is done is not important
(obviously, there is no id function to delta reduce here, so this
reduction is a no-op). Coq isn't always very good about noticing the
instantiation of an evar through the raw evar itself, so this reduction
step just prods it into doing so.
-- Jonathan
On 11/24/2016 09:59 AM, Jan-Oliver Kaiser wrote:
Hello,
I am trying to find occurrences of an instantiated existential
variable in a bigger term. I have yet to find a way to make this work.
I have, however, identified a rather peculiar minimal failing example
of interaction between evars and match context:
(* Some notation to hide a the overhead associated with evars *)
Tactic Notation "exvar" constr(type) tactic(cnt) :=
let name := fresh in
evar (name : type);
let var := (eval unfold name in name) in
clear name;
cnt var.
Goal True.
exvar Type (fun t => unify t nat; match nat with context f [nat] =>
idtac "yay" end).
Fail exvar Type (fun t => unify t nat; match nat with context f [t]
=> idtac "yay" end).
Abort.
The first call to exvar is just a sanity check to see if the evar
machinery works and the context pattern work as intended. The second
call is what really baffles me. t is successfully unified with nat -
but it cannot be found in the term nat. What is going on here?
Thanks,
Jan-Oliver
- [Coq-Club] match context and evars, Jan-Oliver Kaiser, 11/24/2016
- Re: [Coq-Club] match context and evars, Jonathan Leivent, 11/24/2016
- Re: [Coq-Club] match context and evars, Jan-Oliver Kaiser, 11/24/2016
- Re: [Coq-Club] match context and evars, Jonathan Leivent, 11/24/2016
- Re: [Coq-Club] match context and evars, Jan-Oliver Kaiser, 11/24/2016
- Re: [Coq-Club] match context and evars, Jonathan Leivent, 11/24/2016
Archive powered by MHonArc 2.6.18.