Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Bug or feature?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Bug or feature?


Chronological Thread 
  • From: Andreas Abel <abela AT chalmers.se>
  • To: <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Bug or feature?
  • Date: Sun, 5 Feb 2017 09:46:49 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=abela AT chalmers.se; spf=None smtp.mailfrom=andreas.abel AT cse.gu.se; spf=None smtp.helo=postmaster AT targaryen.ita.chalmers.se
  • Ironport-phdr: 9a23:AJZWZRKUQsvo+C1lINmcpTZWNBhigK39O0sv0rFitYgeKfvxwZ3uMQTl6Ol3ixeRBMOAuq4C1Lad6vq+EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQtFiT6ybL9oLhi7ogrdutQIjYZjN6081gbHrnxUdupM2GhmP0iTnxHy5sex+J5s7SFdsO8/+sBDTKv3Yb02QaRXAzo6PW814tbrtQTYQguU+nQcSGQWnQFWDAXD8Rr3Q43+sir+tup6xSmaIcj7Rq06VDi+86tmTgLjhSEaPDA77W7XkNR9gr9FrhKvvRxxw43abo+bO/VxfKzSYdwURWtaU8ZNVCFMGJ+wY5cBAucDO+tTsonzp0EJrRu7HQShGOXvxSJShnDox6I6yPkqHB3d0wM+G9IFrXPZo8/uO6gMVeC61rLFwinDb/xM3Tf97ZbHcgo6of2WRrJ/b9PcxE8yHA3LiVWQrJbqPzKT1ukVvGib7vZgVeKyi2E8sQ1+vj+vxsI0hobVhoIa0FTE9SBnz4YvPt20UlV7bsCiHZBNtC+aL5N7Tt48T2xsoio217wLtYSlcCQUyZkr3QPTZvKJfoSQ/x7vSuKcLS1liH9kYr6zmgq+/VK+xuDzVsS51ktBoDBfndnWrH8N0gTe6siZRft5+UeswSqP2BrJ6uFLO080j6raJIAnwrIql5oTrV7MEjXql0X2lqCWckAk9fay6+T8eLnmvYGTO5d1igH4LKsuhtSyDfkmPgUKRWSX5OWx2Kf98UHnQbhGlOA6n6fXvZzCIMQUvK+5Awtb0oY57Ba/Ci+r384enXYaNlJKZgiIj5PzN17UO//3E/O/jk+wnzdw2f/KJLLhAojXInjYjrjtZax95FJEyAov0dBf4IpZBa0GIPLqQ0P+qNjYDgIiPAGv2ObmCNB91psEVm6VA6+ZNrnSsV6S6e41LemMftxdhDGof/Mi/rvliWIzsV4bZ6igm5UNPiOCE+xiMnmeNC7lhNsbHG4R+AM0QejCh0DESjMFNFioWKdpzzc3Eo+vFs/qTI2pyOiI1iq/F7VdZmlCD12WCjHzetPXCL83dCuOL5o5wXQ/Xr+7Rtp52A==

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. 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...

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/



Archive powered by MHonArc 2.6.18.

Top of Page