Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] natural numbers as a datatype and as decimal numerals

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] natural numbers as a datatype and as decimal numerals


Chronological Thread 
  • From: Théo Zimmermann <theo.zimmi AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] natural numbers as a datatype and as decimal numerals
  • Date: Mon, 14 May 2018 15:48:18 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=theo.zimmi AT gmail.com; spf=Pass smtp.mailfrom=theo.zimmi AT gmail.com; spf=None smtp.helo=postmaster AT mail-ua0-f174.google.com
  • Ironport-phdr: 9a23:qBJjcB17xHlGUB7NsmDT+DRfVm0co7zxezQtwd8Zse0eLPad9pjvdHbS+e9qxAeQG9mDsLQc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPbQhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7S60/Vza/4KdxUBLnhykHODw5/m/ZicJ+kbxVrw66qhNl34LZepuYOOZicq7fe94RWGpPXtxWVyxEGo6ycYsPCPAGPelArIb9pl4OrR6gCgm2AePg0DlIhnnr1qA9z+QhER/J3As6E9MPsXTUqdD1NKYJXOC6yanH1zTDb/dM1Tjh74jIdwksrPeRVrx+dsrRzFMgFwLDjliIpozlODSV1usJs2eF9eZvSeWvi2s/pwF+oziv2scsipTSiY4P1l/E8iB5zJ40Jd2+VE50f9qkHIFNuC6EMYZ9X8AsQ3lwtSok1rELvYS3cSsKxZg92RLTdv6Kf5KV7h/hW+ucJypzimh/d7KlnRmy9FCtyu3iWcmw11ZHti9FncPNtnAJzhDT99KIRudk8kevxDqC1Q/e5vtLIUAzkqrbJJohzaAqmpUPtkTDGzf6mETwjKCIakUp4vak5/jjb7n8pZKRN5V4hh/jPqksgMCzHOY1PwcWU2ie4+u81bnj/UPjQLVNi/07irXZsJDEKsQcvKK4Ag5V0oMm6xa+FDqm39EYkmMGLFJBYh6Ik4/pO1TWLPDiEfi/m0iskCtsx/3eIrLhBYzNImHfn7flYLZy8FVRyBEzzNBa/5JbEKsNIPP1Wk/rtdzXFAU1MwKuw7WvNNIo3YQHHGmLH6WxMaXIsFbO6Ph8DfOLYdopuLf6HMok4vvjl3own1lVKbWp0JxRenG9G/VOLECQYH6qidAERzRZ9jEiRfDn3QXRGQVYYGy/Cvplt2MLTbm+BIKGfbiDxbmI3SO1BJpTPzkUBVWFEHOufIKBCa5VNHCiZ/R5mzlBboCPDpc73Ej35gD/wrtjaOHT/39A7M+x5J1O/+TW0CoK23l0AsCaiT/fSmh1miYVTmdz0vkg/QpyzVCM1aU+iPtdR4Re

FYI, there is on-going work to make this more uniform and allow easily extending the types which support such "numeral" notation (see https://github.com/coq/coq/pull/496).

Théo

Le lun. 14 mai 2018 à 12:10, Soegtrop, Michael <michael.soegtrop AT intel.com> a écrit :
Dear Gergely,

SF defines its own nats in a module NatPlayground and then closes this module, so that the standard library nats are used. They do the same trick several times to just explain how things are done but then go back to the library definitions.

The nat notation is pretty hard wired into Coq. In Init.Datatypes at the beginning you find:

Declare ML Module "nat_syntax_plugin".

(note: this is not shown in the HTML dumps of the library sources, you need to look into the .v file). Afaik this does the trick. I can't tell how the nat type is actually connected to this plugin, I think it is simply hard wired by name in the plugin.

I guess this is nothing the Coq community is especially proud of, but it did work so far ...

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928



Archive powered by MHonArc 2.6.18.

Top of Page