coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Beta Ziliani <bziliani AT famaf.unc.edu.ar>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Bug or feature?
- Date: Sun, 5 Feb 2017 22:08:10 -0300
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=bziliani AT famaf.unc.edu.ar; spf=None smtp.mailfrom=bziliani AT famaf.unc.edu.ar; spf=None smtp.helo=postmaster AT famaf.unc.edu.ar
- Ironport-phdr: 9a23:zyzduxHqT+Eg4A0j6Cjthp1GYnF86YWxBRYc798ds5kLTJ7zosmwAkXT6L1XgUPTWs2DsrQf2raQ7P6rAjZIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSijewZbx/IA+0oAjQucUbj5VuIbstxxXUpXdFZ/5Yzn5yK1KJmBb86Maw/Jp9/ClVpvks6c1OX7jkcqohVbBXAygoPG4z5M3wqBnMVhCP6WcGUmUXiRVHHQ7I5wznU5jrsyv6su192DSGPcDzULs5Vyiu47ttRRT1kyoMKSI3/3/LhcxxlKJboQyupxpjw47PfYqZMONycr7Bcd8GQGZMWNtaWS5cDYOmd4YADeQBM+ZWoYf+ulUAswexCBK2C+/z0DJFnGP60bE43uknDArI3BYgH9ULsHnMsdj6KrsSXvqox6bLzDXDa/JW1i376IjJbxsspuqDXLNxccrVyEkgDQXFjlSLpIzrJTyV0/4Cs2aB4+p9U+Kgl3QrpB9srTiy3MsjkJPJi5sTx1vZ+yt5x4M1Kse5SE59edOkH5pQtz2aN4trWcwuWX1nuCE/yrEepZG7fDIFyJAixxHBcfyHaJKE4gn9W+uXPDx2h2pldaqhixqu7USs0PDwW8iu3FpXrCdJiMTAumwN2hDL9MSLVv9w8l2i1DuPzQzf9P9ILVwumabGKZMsw7g9nYcJv0vZBC/5gkD2gbeWdko6/uio7PzqYrv8qZ+ZLYB0hBvyMrkomsOjG+g3LBUBX3WB9eumzr3v5Uz5QLNUgf0qiqTVrozWKdgBqqKkAgJZyJsv5hSlAzu7zNgVnWELLFdfdxKGi4jpNUvOIPf9DfqnmFutkTZrx/THPrL7BJXNL2POkLn7crZ48UFcxhA/zc1Z551IEL0OPu/8WlLruNPCFB81Kxa0zPr/CNVhyoMeXnqCDbOeMKPLqFOH+uYvI/SXa4IOozb8K/0l5+b0gnMjmF8de7Op3ZoNZ3yiEPRmORbRXX25qdAYWUwOowB2GOftkRiJVSNZT3e0RaM1oD8hXtGIF4DGE6qgnLXJ7ia/H5RQZygSAEKNFXbhcYSsVf4JYSzUP8lq1DEISP6oUdlyhlmVqAbmxu8/faLv8SoCuMemjYAt6g==
On Sun, Feb 5, 2017 at 5:46 AM, Andreas Abel <abela AT chalmers.se> wrote:
Printing identifiers in a real-world proof assistant setting is a hard problem in the sense that, in practice, people don't get it right.
True, however not really what's under discussion here. Here we are seeing that identifiers are not properly substituted, showing that the semantics for interpreting terms inside Ltac is wrong. It's not a matter of printing.
And this is because it is a "boring" problem. I pay a bottle of Champagne to the next one who gets a paper on printing identifiers in a sound and practically useful way into POPL.
If you want to amuse yourself with problems of that sort on our side, you can start reading here
https://github.com/agda/agda/issues/998
and follow tags like "printing", "display", "shadowing" to dig out more...
Amusing, indeed :)
Best,
Beta
On 03.02.2017 14:34, Beta Ziliani wrote:
Thanks Bruno and Maxime.
It is a bug then, although a tough one to fix, I suppose.
FWIW, In MetaCoq we used to have the de Bruijn context. Recently we
decided to drop it and only use the named context; same as Ltac. But
unlike Ltac, when we introduce the de Bruijn variables in the named
context, we also rename the code, therefore changing x to x0 *inside the
exact*, as should be done.
Best,
Beta
On Fri, Feb 3, 2017 at 10:18 AM, Maxime Dénès <mail AT maximedenes.fr<mailto:mail AT maximedenes.fr>> wrote:
Hi Beta,
I can't answer your question, since I'm not sure how much of Ltac's
binding is documented, but I can try to explain the symptom.
Since your binder clashes with the section variable name, the rooster
renames it on the fly. But then of course "x" designates the section
variable.
The following script should illustrate what goes on under the hood:
Section test.
Variable x : nat.
Definition ex := fun x y:nat=>ltac:(exact (x0 + y)).
Print ex.
Maxime.
On 02/03/17 13:56, Beta Ziliani wrote:
> Hi list,
>
> I stumble across what I think is an odd behavior when mixing named and
> dB contexts, and I’m going to file it as a bug unless someone
convinces
> me that this is a feature:
>
> |Section test. Variable x : nat. Definition ex := fun x
> y:nat=>ltac:(exact (x + y)). Print ex. |
>
> outputs
>
> |ex = fun _ y : nat => x + y : nat -> nat -> nat |
>
> I am expecting, of course,
>
> |ex = fun x y : nat => x + y : nat -> nat -> nat |
>
> Note that defining `x` in a |Section| is important; if I make |x|
a top
> level variable, the example is constructed as expected.
>
> Best,
> Beta
>
>
--
Andreas Abel <>< Du bist der geliebte Mensch.
Department of Computer Science and Engineering
Chalmers and Gothenburg University, Sweden
andreas.abel AT gu.se
http://www.cse.chalmers.se/~abela/
- [Coq-Club] Bug or feature?, Beta Ziliani, 02/03/2017
- Re: [Coq-Club] Bug or feature?, Bruno Barras, 02/03/2017
- Re: [Coq-Club] Bug or feature?, Ralf Jung, 02/03/2017
- Re: [Coq-Club] Bug or feature?, Maxime Dénès, 02/03/2017
- Re: [Coq-Club] Bug or feature?, Beta Ziliani, 02/03/2017
- Re: [Coq-Club] Bug or feature?, Beta Ziliani, 02/03/2017
- Re: [Coq-Club] Bug or feature?, Andreas Abel, 02/05/2017
- Re: [Coq-Club] Bug or feature?, Beta Ziliani, 02/06/2017
- Re: [Coq-Club] Bug or feature?, Andreas Abel, 02/05/2017
- Re: [Coq-Club] Bug or feature?, Bruno Barras, 02/03/2017
Archive powered by MHonArc 2.6.18.