Basic lambda expression parser.
Blep is a simple command-line tool for parsing and evaluating untyped lambda expressions.
1. Example
A definiton of Church booleans and basic logic operators as λ-terms:
blep> TRUE := \x.\y.x blep> FALSE := \x.\y.y blep> AND := \p q.(p q p) blep> (AND TRUE FALSE) FALSE blep> NOT := \p.p FALSE TRUE blep> AND (NOT FALSE) (AND TRUE (NOT FALSE)) TRUE
2. Overview
This project is currently a work in progress. As of version 0.1.0, blep has the ability to construct an abstract syntax tree from the users input.
The parser currently provides some syntactic sugar to make the λ-expressions less cumbersome to read, for instance relying less on parentheses and more on expression associativity, as well abbreviating a sequence of λ-expressions to a single λ-expression with multiple parameters. The parser supports UTF-8 encoding for variable names, but it also allows the user to substitute the lambda symbol for the similar looking, more keyboard-friendly backslash.
3. Goals
- Familiar conventions for the notation of the λ-expressions,
- Evaluation under various, pre-defined reduction strategies,
- Environments used for associating λ-expressions with a name for later use,
- Descriptive error messages,
- Interactive REPL prompt.
4. Source
5. Installation
cargo install --path .
6. License
This software is licensed under the MIT license.