https://github.com/totbwf/pine
A small, dependently typed language
https://github.com/totbwf/pine
dependent-types interpreter language proof-assistant repl
Last synced: 3 months ago
JSON representation
A small, dependently typed language
- Host: GitHub
- URL: https://github.com/totbwf/pine
- Owner: TOTBWF
- License: other
- Created: 2017-11-22T07:54:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-19T17:33:01.000Z (over 8 years ago)
- Last Synced: 2025-01-17T02:35:07.884Z (over 1 year ago)
- Topics: dependent-types, interpreter, language, proof-assistant, repl
- Language: Haskell
- Size: 878 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pine
Pine is a small, dependently typed language. It is meant to be used as the basis for an interactive
proof assistant.
# Usage
```
Top Level Commands:
:quit Quits
:help Prints this message
:context Prints the Current Set Of Parameters and Definitions
:: Declares a variable to be of type
:= Defines a variable to be
:type Checks the type of an expression
:eval Evaluates an
```
# Samples
Addition of Natural Numbers
```
inductive Nat :: Type 1 := Z :: Nat | S :: Nat -> Nat
natRec :: forall (m :: Nat -> Type 1), m Z -> (forall (l :: Nat), m l -> m (S l)) -> (forall (k :: Nat), m k)
let plus := natRec (fun (n :: Nat) => Nat -> Nat) (fun (n :: Nat) => n) (fun (k :: Nat) (rec :: Nat -> Nat) (n :: Nat) => S (rec n))
```
Length-Indexed vectors
```
inductive Vect (a :: Type 1) (n :: Nat) :: Type 1 := vnil :: forall a :: Type 1, Vect a z | vcons :: forall a :: Type 1, forall k :: Nat, a -> Vect a k -> Vect a (s k)
```
Dependent Pairs
```
inductive DPair (a :: Type 1) (p :: a -> Type 1) := mkPair :: forall a :: Type 1, forall p :: (a -> Type 1), forall x :: a, forall pf :: p x, DPair a p
```
# Building
```
stack build
stack exec pine
```