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

https://github.com/timcsy/lambda


https://github.com/timcsy/lambda

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

# Lambda Calculus Interpreter

Reference:
- https://en.wikipedia.org/wiki/Lambda_calculus_definition#Syntax_definition_in_BNF
- https://ruslanspivak.com/lsbasi-part1/
- https://tromp.github.io/cl/Binary_lambda_calculus.html
- https://cs.stackexchange.com/questions/109954/writing-a-grammar-for-lambda-calculus
- https://stackoverflow.com/questions/22390641/read-file-by-bits-c

## BNF used for Normal Lambda Calculus in this project
```
::=
|
::= ( )
|
::= (^[\^\.\(\)\s])+
::= ^ .
::=
| ( | )
```

## BNF used for De Bruijn indexed Lambda Calculus in this project
```
::=
|
::= ( )
|
::= [0-9]+
::= ^
::=
| ( | )
```

## BNF used for Binary Lambda Calculus in this project
```
::= 00
| 01
| 1+0
```

## Ussage
Note
```
l lambda calculus
i De Bruijn indexed lambda calculus
bt Binary Lambda Calculus in text format
b Binary Lambda Calculus in binary format
```

From (l, i, bt, b) convert to (l, i, bt, b)
```
bin/lc [--i=type] [input file [...]] [--o=type] [output file [...]]
```

with std input
```
bin/lc [--i=x] [input file [...]] [--o=y] [output file [...]] < type
> whatever you want
> to type
> EOF
```