https://github.com/sr-lab/coq-number-rendering
Coq number rendering library.
https://github.com/sr-lab/coq-number-rendering
casting coq numbers-to-text stringify text-to-number
Last synced: 5 months ago
JSON representation
Coq number rendering library.
- Host: GitHub
- URL: https://github.com/sr-lab/coq-number-rendering
- Owner: sr-lab
- License: mit
- Created: 2018-09-19T18:15:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-21T13:25:27.000Z (over 6 years ago)
- Last Synced: 2025-03-01T00:29:30.906Z (12 months ago)
- Topics: casting, coq, numbers-to-text, stringify, text-to-number
- Language: Coq
- Size: 6.84 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Coq Number Renderer
Coq number rendering library.
## Overview
Turning numbers into strings and vice-versa was a common problem in my Coq projects, so I built this to save me coding this up about a million times. Not every numeric data type is renderable as a string (as far as I know), so more specifically this library offers:
* `z_to_string`: Converts a binary number in Z to a string.
* `q_to_string`: Converts a rational number in Q to a string.
* `z_of_string`: Converts a string to a whole number or 0 if it does not make sense.
* `n_of_string`: Converts a string to a binary natural number or 0 if it does not make sense.
* `pos_of_string`: Converts a string to a positive number or 1 if it does not make sense.
* `nat_of_string`: Converts a string to a natural number or 0 if it does not make sense.
## Limitations
This library does not have any accompanying proofs. This may be addresed in the future. Not every numeric data type can be rendered as a string (numbers in R are a prime exmaple of this), but the methods implemented here are not exhaustive either. This library will expand as needed.