Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/plt-amy/dep

A very small implementation of the Calculus of Constructions for experimentation purposes
https://github.com/plt-amy/dep

type-theory

Last synced: 3 months ago
JSON representation

A very small implementation of the Calculus of Constructions for experimentation purposes

Awesome Lists containing this project

README

        

dep
===

A small implementation of the Calculus of Constructions, a pure type
system (PTS) corresponding to the λΠ corner of Barendgret's
lambda cube. That is, it has:

- terms depending on terms (functions)
- types depending on types (type operators)
- types depending on terms (dependent functions)
- values depending on types (polymorphism)

While simply-typed languages have distinct "type level" and "value
level" grammars, the CoC does away with the stratification by merging
these levels into a single language, expressed by the following Haskell
data type.

```haskell
data Term
= Var String -- x
| Lam String Term Term -- \(x : t). e
| Pi String Term Term -- forall (x : k). t
| Term :$ Term -- f x
| Term ::: Term -- e : t
| Type Int -- type i
deriving (Eq, Ord)
```