Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Overloading the forall notation

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Overloading the forall notation


Chronological Thread 
  • From: Jason Gross <jasongross9 AT gmail.com>
  • To: coq-club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Overloading the forall notation
  • Date: Wed, 22 Apr 2020 11:36:03 -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-ed1-f41.google.com
  • Ironport-phdr: 9a23:ad3i2xckdCdABqjHSntDHyWmlGMj4u6mDksu8pMizoh2WeGdxcS7Zh7h7PlgxGXEQZ/co6odzbaP7ua8BidQu96oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9vLBi6twrcu8sZjYZhNKo61wfErGZPd+lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2466svrtQLeTQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUjms86tnVBnlgzoAODAk7WHXkdRwg7xHrxK9qRJ/xIvUb5uUNPp4Y6jRedwXSG5EUstXSidPAJ6zb5EXAuUOM+ZXrYnzqVUNoxWjGwejGPjixSVUinLsx6A2z/gtHAPA0Qc9H9wOqnPUrNDtOakWS++1167IzTPeZP1Xwzf975PIcgs8qvyLX7J/a9HRyU4pFwPKlFWQrpflPyiR2+kWvGib6vBvVeOri2I9tw5xpT2vy94qh4LUiIwVzVXE+j94wIYzPdC4R097YcKkEJtNrC6WLZd5QsQnQ21wtyY6y6EGuZ6mfCcR0pgnxhnfZvqaeIaL+hLuTPidLSt8iX5/e7+yhwy+/Va8xuD/TMW530tGoyxYmdfWrH8NzQbc6s2fR/t94Eih3TGP2hjW6u5eIEA0kbPXJIA8zbItj5YTv0vOEjLslEX5i6+WcUok+uy25Oj9frrmoZqcO5d1igH4LKsuhtSyDfokPgUKRWSW+uSx2Kf98UHlQ7hGlPI7nrTBvJDfP8sbp6q5AwFP0oYk7hayFzWm384DnXkAKlJFdwiHj4/yO1HVJP31Fvi/g1G2nzdqw/DKJKHuApLILnTbirfuYa5961JAyAo01d1Q+5VUCqgYLP3vXk/xqcfXAwQiMw20xubnEM9y2pkfWWKJGK+ZMbndvUWG5uI1cKGwY9oevy+4IPw47ba6hngg3FQZYKOB3J0NaXn+EO4wcGuDZn+5oN4aFmFCkRA5V/ei3F+LSjlVaGy1RLltzj4+AYOiS4zEQ9b+0/S6wC6nE8gONSh9AVeWHCK0JtzVCcdJUzqbJ4paqhJBULGgT4E70hT37V31zrNmKqzf/ShK7Mu+hugw3PXakFQJzRIxD8mZ1DvQHWR9n2dNSjNvma4j+ApyzVCM1aU+iPtdR4QKu6F5FzwiPJuZ9NRUTsjoU1uYLNiMQVeiBN6hBGNpQw==

As far as I'm aware, overloading builtin notations (or tactic notations) with an identity notation is the standard way to keep them accessible after overloading them.  I think the only even-slightly-sketchy thing is that your `%type` is, I think, both unnecessary and stronger than the existing built-in notation.  (I think you also want to say `y` binder, though?  I'm not sure if it's needed.)  See https://github.com/coq/coq/issues/12157 for some details about the two different kinds of scope stacks.

On Tue, Apr 21, 2020 at 11:34 PM Gregory Malecha <gmalecha AT gmail.com> wrote:
Hello --

I'm working on notation for an embedded logic and I'm wondering how sketchy the following is with respect to any special handling that Coq might do when parsing "forall".

Notation "'forall' x .. y , P" :=
  (forall x, .. (forall y, P%type) ..) (at level 200, x binder, right associativity, only parsing) : type_scope.

Notation "'forall' x .. y , P" :=
  (bi_forall (fun x => .. (bi_forall (fun y => P%I)) ..)) (at level 200, x binder, right associativity, only parsing) : bi_scope.


Without the first rule, I seem to completely loose access to Coq's primitive forall.

I tried the following alternative where I don't put forall in single quotes:

Notation "forall x .. y , P" :=
  (bi_forall (fun x => .. (bi_forall (fun y => P%I)) ..)) (at level 200, x binder, right associativity, only parsing) : bi_scope.

But this doesn't seem to work, it either silently ignores the rule, or it ignores the %I annotation on P and attempts to parse the body using type scope.

Thanks!

--
gregory malecha



Archive powered by MHonArc 2.6.18.

Top of Page