Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Anybody uses the Quote plugin?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Anybody uses the Quote plugin?


Chronological Thread 
  • From: Jason Gross <jasongross9 AT gmail.com>
  • To: coq-club AT inria.fr
  • Cc: Tej Chajed <tchajed AT mit.edu>, John Wiegley <johnw AT newartisans.com>
  • Subject: Re: [Coq-Club] Anybody uses the Quote plugin?
  • Date: Fri, 27 Jul 2018 11:13:08 -0400
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jasongross9 AT gmail.com; spf=Pass smtp.mailfrom=jasongross9 AT gmail.com; spf=None smtp.helo=postmaster AT mail-qt0-f180.google.com
  • Ironport-phdr: 9a23:uY54Ax3neeUhIFGGsmDT+DRfVm0co7zxezQtwd8Zse0eKvad9pjvdHbS+e9qxAeQG9mDtbQc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPYghEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7Vq4/Vyi84Kh3SR/okCYHOCA/8GHLkcx7kaZXrAu8qxBj34LYZYeYP+d8cKzAZ9MXXWVOXshTWCJBDI2ybJYBAfQdMutDtYbxu0EDoAGiCQWwBu7izCJDiH/s3a091uQsCQXI0xY7H9IJtnTfsdT7NL0VUeCu16nD0DLOb/FM1jfm74jIdB8hoeuLXbJrasrczVIiFwzAjlqKqIzlOymZ2fgKs2ie9udtU/+khWAgqwF0uDevx8Esh5HGhoIU1lDE9Th5z50vKdKkT057ZNipG4ZTuSGCL4Z6XN8uTmVytCs5yrAKo4C3cDULxZg92hLSaOCLfo6V6Rz5TumROy13hHd9dbK/mRmy9U+gx/X5Vsau0VZKqjNJksDQtnwRzhDT5NWLR/hh8ku71jaP0AfT6u5AIU8qj6bUN5khwrsompoSt0TMADP2lV3ogKOKckgo4Oul5uT9brn4u5ORNpV4hhz9P6gygsC/BP43MgkKX2iV4+S807jj8FX7QLpQlf02la/ZsJ/AJcQcva65GAtY350s6xa6FTim0dAYkWMbI1JCfRKLl5LpNE3WIPDkEfe/hEyhnytsx/DfJ7HuHpHNLmXYn7r6ZrZ860tcyBIpwtxF5pJUDKsBIPPpVUPrutzYFExxDwvhyOH+Td55y4k2WGSVA6bfPrmBn0WP47cNKvKLYsc6ojHmMLBx5ff1ink2g1gGZviB0p4eaXT+FfNjdRbKKUHwi8sMRD9Z9jE1S/bn3RjbCWYKNiSCGpkk7zR+M7qISILKR4SjmruEhX7pEZhfZ2QAAVeJQy6xK9e0HswUYSfXGfdP1yQeXOH4GYAk3BCq8gT9zug/d7eGymgjrZvmkeNNyajTmBU1r2ImCs2c1ySUUzkxkDpYH3k526dwpUE7wVCGg/B1

Somewhat belatedly responding to this:
> this quote function almost
> already exists, it is "pattern". Then, what about going in the
> direction of providing a variant of "pattern" which encapsulates the
> boilerplate of the technique and which, maybe, also abstracts over the
> foreign subterms?

I'd be quite interested in this.  In particular, there are two useful things I'd like to see here, which have different degrees of difficulty:
(1) The `pattern` tactic currently abstracts over terms, and then applies the result to the terms that are abstracted over.  I'd like a version that does not create the application node.  If `pattern` is implemented by sequencing these two, this should be as simple as exposing the first step to the tactic layer
(2) The only thing `quote` supports that reification by parametricity doesn't is, as you say, foreign subterms.  I think it would be useful to have a version of pattern that does this.

> I think Template-Coq should allow you to program your quotation mechanism as you wish (baring potential performance problems).

I actually don't see how this would work in Template-Coq.  In particular, I'm not aware of any Gallina denotation function for template-coq terms, so it seems like there'd need to be a separate tactic phase where I denote the map of foreign terms.

> performance is close to the “pattern” option, as far as I could tell.

This is true, though template-coq stack overflows on reifying enormous terms in a way that pattern does not.




On Mon, Jul 23, 2018 at 1:48 PM Matthieu Sozeau <mattam AT mattam.org> wrote:
Hi,

A somewhat generic solution is provided by RTac (Malecha and Bengston) and is quite elaborate. I think Template-Coq should allow you to program your quotation mechanism as you wish (baring potential performance problems). At least using this you’d have direct access to the syntax of your term, no typechecking involved. According to J. Gross et al ITP paper performance is close to the “pattern” option, as far as I could tell.

My 2 cents,
— Matthieu
Le dim. 22 juil. 2018 à 11:36, Hugo Herbelin <Hugo.Herbelin AT inria.fr> a écrit :
Hi,

Somehow, a question is also whether it would be worth that someone
eventually provides a generic-enough quote function in Coq, for use at
both the vernac level or the plugin level.

My understanding of the Gross-Erbsen-Chlipala ITP 2018
reification-by-parametricity paper is that this quote function almost
already exists, it is "pattern". Then, what about going in the
direction of providing a variant of "pattern" which encapsulates the
boilerplate of the technique and which, maybe, also abstracts over the
foreign subterms?

Idem at the plugin level. Already e.g. ring, micromega, btauto have
their own reification mechanisms (sometimes even in Ltac) and this
seems suboptimal.

Best,

Hugo

On Fri, Jul 20, 2018 at 11:45:32AM -0700, John Wiegley wrote:
> I would also support dropping Quote; each time I've been able to use it, I
> ended up just copying Ltac macros from existing templates so I would have the
> configurability needed for future changes.

On Fri, Jul 20, 2018 at 08:41:28AM -0400, Tej Chajed wrote:
> I definitely support getting rid of Quote. I used it once and then ran into an
> issue: my unquote function took a type parameter, which is unsupported, even if
> you try specializing it. I talked to Jason Gross, copied some code from their 
> reification-by-parametricity paper, and got it working fairly easily in pure
> Ltac.
>
> It would be great to have some examples from that paper coped into the Coq test
> suite and try to give it visibility, instead of maintaining Quote. It's a more
> powerful technique and I believe with just a little boilerplate can replace
> uses of Quote (if anybody actually weighs in and is using it).
>
> On Fri, Jul 20, 2018 at 3:20 AM Maxime Dénès <mail AT maximedenes.fr> wrote:
>
>     Dear Coq-clubbers,
>
>     I'm trying to clean up the set of plugins shipped with Coq, so that we
>     can make the maintenance done by the development team more focused and
>     effective.
>
>     I was wondering if anybody was using the Quote plugin in real-world
>     developments. See https://github.com/coq/coq/pull/7894 for more context.
>
>     Thank you in advance for your feedback!
>
>     Maxime.
>



Archive powered by MHonArc 2.6.18.

Top of Page