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: José Manuel Rodriguez Caballero <josephcmac 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 16:31:50 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=josephcmac AT gmail.com; spf=Pass smtp.mailfrom=josephcmac AT gmail.com; spf=None smtp.helo=postmaster AT mail-it0-f48.google.com
  • Ironport-phdr: 9a23:xsqwLRL6EuRe8hNVKtmcpTZWNBhigK39O0sv0rFitYgeKvjxwZ3uMQTl6Ol3ixeRBMOHs6kC07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffwtFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QLYpUjqg8qhrUgflhyUJNzA5/m/ZidF+grxHrx+6vRNz35TZbZuJOPZifK7Qe84RS2pbXsZWUixMGoeyb4wUD+0bJelWqJPyp10TrRSgAQmjHP/hyjhViX/s3K063PkhHh/H3QM4Ad8Bqm/bo8/xNKcWT++11q7IxijEYvNU3jf985bHcgghof6QWLJ/a9bexFIgFwPAlFqQqIjlMymJ2eQKtmiW9uxtXv+hhW4grgF+uDmvxsE0h4nGgYIVzV/E9SFnz4ovOdK4T0t7bcalEJtWqyGVKY92Ttk/TG52visx174IuYajcSQU1JgqwwTTZv+HfoSS/B7vSemcLS13iX9mfr+0mgy8/lK6yuLmU8m5yFZKoTRBktnLrn0N0gbc6smDSvdk/0ehxSqD2xnd6uxLIk04j6XbK5kmwr4/kpocr17PETPxmEXzlKOWd0Mk9fa06+n/fLnqupuRO5V3hwz+KKgihNGzDOsiPgUBXGWX4eG826fi/U39TrVKlPo2kqzBvZDYIsQbvbC2AxdV0ok/7hawFSup3c8XnXkCNl1FeRaHg5L1NFHJJfD0Fe2/jEi0kDd32/DGOaXsDYnKLnjaibvuYbJ961NHxwco1tBe55dUCqkbL/7pW0/xssbYDh4jPACuzebnEoY16oRLUmWWR6SdLan6sFmS5+tpLfPfSpUSvWPfLOOk0Nvni2I0nWgneqWz3JQKZWKPNf1sKkGdbGDryoMDFnwHpgo1SeXhoFKHWD9XIX21WvRvtXkAFIu6ANKbFciWi7ub0XLjR8wEViV9ElmJVEzQWcCBUvYIZjiVJ5Y4wDMBXLmlDYQm0EP37VOo+/9cNuPRvxYgm9f7ztEsvr/ckBgz8Xp/CMHPizjQHVExpXsBQnoN5I46oUF5zQ3eg61xgvgdFMALov0VAkE1MpnTy+E8ANf3CFrM

Gergely Buday said
in Software Foundations' first file, Basics.v, the file defines
Inductive nat : Type :=
  | O : nat
  | S : nat -> nat.
and then, magically, uses decimal numerals, 3, 5 and so on for it.

This is not the case when you work with the library UniMath. For example,

When I write "Eval compute in  2 + 2" I obtain the answer "= 4: nat". But when I write "Eval compute in  2 + 222" I obtain the answer "Error: No interpretation for numeral 222".



2018-05-14 16:24 GMT+02:00 Théo Zimmermann <theo.zimmi AT gmail.com>:
I don't think there are anything planned for strings yet but feel free to open a feature request if you think that would be valuable ;-)

Le lun. 14 mai 2018 à 16:11, Soegtrop, Michael <michael.soegtrop AT intel.com> a écrit :

Dear Théo,

 

Interesting! One question: is there also something planned for quoted character strings? These are also somehow “magically” converted to Coq string objects. It might be interesting to convert strings to arbitrary objects with a parsing function depending on scope in a similar way as numbers are converted in the PR you mentioned. E.g. the Software Foundations “ImpParser.v” shows how to parse strings with simple programs to data structures. Since Menhir can generate Coq parsers (Afaik) this might be a powerful feature.

 

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