Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] is |x| a viable notation?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] is |x| a viable notation?


Chronological Thread 
  • From: Jonathan Leivent <jonikelee AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] is |x| a viable notation?
  • Date: Wed, 4 May 2016 17:17:24 -0400
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jonikelee AT gmail.com; spf=Pass smtp.mailfrom=jonikelee AT gmail.com; spf=None smtp.helo=postmaster AT mail-qk0-f170.google.com
  • Ironport-phdr: 9a23:96VQnxHFsiVKKFrpHmQ7ZJ1GYnF86YWxBRYc798ds5kLTJ75pMWwAkXT6L1XgUPTWs2DsrQf27uQ6/urATdIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4Ov7yUtaLyZ/nhqbqoNaLOE1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv50IbaKvdKMhCLdcET4OMmYv5cStuwOQYxGI4y4+VWMfjhpBBUDh4RDkU5Ht+n/4sex82ySeMMDeQrU9WDDk5KBuHky7wBwbPiI0pTmEwvd7i7hW9Uqs



On 05/04/2016 04:56 PM, James Lottes wrote:
I've been using
Notation "| x |" := (abs x) (at level 50, format "| x |").
Though it's not without problems. It works well enough for me in most
parsing contexts (certainly not all), but tends to display with extra
parentheses: (|x|). For example, this works for me:

Lemma abs_triangle : |x+y| ≤ |x|+|y|.

I'll also be keen to hear if there's a better way.

Cheers,
James

Interesting. Apparently, it works for levels >= 10, but not for levels < 10. OK - I will try 10.

Thanks,
-- Jonathan



On Wed, May 4, 2016 at 10:38 AM, Jonathan Leivent
<jonikelee AT gmail.com>
wrote:
I would like to have:

Notation "| x |" := (length x) (at level 0) : nat_scope.

However, it seems that using vertical bars this way causes problems for the
parser (Syntax error: [constr:operconstr level 200] expected after '|' (in
[constr:operconstr])). Putting the notation at level 200 means I'd have to
parenthesize it for virtually all uses. I thought by restricting this
notation to nat_scope, I would get around the parser problems, but I can't
get this to work.

Is this just not possible? If it is possible, what is the proper
incantation?

This is in 8.5pl1.

-- Jonathan






Archive powered by MHonArc 2.6.18.

Top of Page