Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vikraman/descartes
An implementation of the λλ~ calculus
https://github.com/vikraman/descartes
Last synced: 3 days ago
JSON representation
An implementation of the λλ~ calculus
- Host: GitHub
- URL: https://github.com/vikraman/descartes
- Owner: vikraman
- License: mit
- Created: 2024-01-10T22:41:37.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-10-16T11:44:11.000Z (3 months ago)
- Last Synced: 2024-10-19T06:16:48.129Z (3 months ago)
- Language: OCaml
- Homepage:
- Size: 26.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# descartes
[![tests](https://github.com/vikraman/descartes/actions/workflows/workflow.yml/badge.svg)](https://github.com/vikraman/descartes/actions/workflows/workflow.yml)
[![opam](https://github.com/vikraman/descartes/actions/workflows/opam-dependency-submission.yml/badge.svg)](https://github.com/vikraman/descartes/actions/workflows/opam-dependency-submission.yml)This is an Ocaml implementation of the $\lambda\widetilde{\lambda}$ calculus.
## Usage
To build and test, use opam and dune:
``` bash
$ opam install . --deps-only --with-test
$ opam exec -- dune build
$ opam exec -- dune runtest
```To use the repl:
```bash
$ dune exec bin/main.exe
λλ~> (\x:int.x+1) 2
(fn (x : int) => x + 1) 2 : int
~> 3 : int
λλ~> \~x:co int.x
cofn (x : co int) => x : (int + co int)
~> cofn (x : co int) => x : (int + co int)
λλ~> case (\~x:co int.x) of x.0 | y.1
case cofn (x : co int) => x of inl x => 0 | inr y => 1 : int
~> 1 : int
```The syntax closely follows the syntax used in the code samples in the paper.
The test suite contains several examples.## Acknowledgements
gpt-4-1106 was used to generate the parser for the syntax of the language.
## Related
- https://github.com/dignissimus/coexp
- https://github.com/vikraman/sml-coexp
- https://github.com/vikraman/hs-coexp
- https://github.com/vikraman/agda-coexp## Trivia
The name is a tribute to Descartes for his theory of Cartesian dualism.