https://github.com/statebox/idris-ct
formally verified category theory library
https://github.com/statebox/idris-ct
category-theory formal-proofs formal-verification
Last synced: 5 months ago
JSON representation
formally verified category theory library
- Host: GitHub
- URL: https://github.com/statebox/idris-ct
- Owner: statebox
- License: agpl-3.0
- Created: 2019-03-26T19:42:25.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-23T14:34:39.000Z (almost 6 years ago)
- Last Synced: 2025-05-01T15:42:14.750Z (about 1 year ago)
- Topics: category-theory, formal-proofs, formal-verification
- Language: Idris
- Homepage:
- Size: 376 KB
- Stars: 263
- Watchers: 19
- Forks: 23
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-category-theory - idris-ct - Formally verified category theory library written in Idris (Software Libraries)
- awesome-applied-ct - idris-ct - a formally verified category theory library written in [Idris](https://www.idris-lang.org/) (Table of contents / Software libraries)
README
[](https://travis-ci.com/statebox/idris-ct) [](https://www.gnu.org/licenses/agpl-3.0)
# Idris category theory
This repository contains several definitions from category theory.
The project is written in [Idris](https://idris-lang.org/), which allows us to
state properties (logical propositions) of the code, along with their formal
proofs, in the code itself. These provide guarantees that the code is
correct by construction.
Moreover, we are using *literate* Idris, so that we can seamlessly integrate
code and documentation, and produce prose documentation alongside the compiled
artifacts.
If you want a more detailed and slow introduction to the library, please have a look at the series of blog posts we are writing:
- https://blog.statebox.org/fun-with-categories-70c64649b8e0
- https://blog.statebox.org/concrete-categories-af444d5f055e
- https://blog.statebox.org/fun-with-functors-95e4e8d60d87
## Nix build
If you have [Nix](https://nixos.org/nix/) installed, you can build the project just by doing
```
nix-build
```
For additional targets, have a look at the instructions in [default.nix](default.nix).
If you get an error message like `error: cloning builder process: Operation not permitted`, run
```
sysctl kernel.unprivileged_userns_clone=1
```
as suggested in https://github.com/NixOS/nix/issues/2633
## Manual build
### Prerequisites
You'll need [lhs2tex](https://github.com/kosmikus/lhs2tex/blob/master/INSTALL), [latexmk](https://mg.readthedocs.io/latexmk.html) and [Idris](https://www.idris-lang.org/).
### Generate documentation
Use `make` to generate the PDF documentation. You will find it in the
`docs` directory.
Look directly in the [Makefile](Makefile) for additional options.
You can also consult the documentation directly [here](https://github.com/statebox/idris-ct-docs/blob/master/idris-ct-docs.pdf).
### Generate comparaison data with Idris2
Use `make compare` to output which files have not been converted to Idris2.
If the executable has already been generated, simply execute `./compare src/ idris2/` to rerun the
comparaison between the two file trees.
### Build code
You can build manually all the code using
```
idris --checkpkg idris-ct.ipkg
```
## Build with Elba
Alternatively you can build the library with [elba](https://github.com/elba/elba) using
```
elba build
```
## Use as a dependency
The preferred way to use this library as a dependency for another project is using [elba](https://github.com/elba/elba).
It should be enough to add the following section
```
[dependencies]
"statebox/idris-ct" = { git = "https://github.com/statebox/idris-ct" }
```
to the `elba.toml` file of your project.
### License
Unless explicitly stated otherwise all files in this repository are licensed under the GNU Affero General Public License.
Copyright © 2019 [Stichting Statebox](https://statebox.nl).