Skip to content

Commit

Permalink
Add README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
atrn0 committed May 31, 2021
1 parent eec16e9 commit 11dceea
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# lambda

Lambda is an untyped lambda calculus interpreter written in OCaml. This interpreter supports 2 evaluation strategies, Full beta-reduction and Call by Value.

## Usage

```sh
$ dune exec lambda # default strategy is Full beta-reduction
$ dune exec lambda -- -v # output all reduction steps
$ dune exec lambda -- -s value # use Call by Value strategy
$ dune exec lambda -- --help # help
```

## Example

You can use [some macros](./src/cui.ml#L11-L31).

```
$ dune exec lambda
# (\x.x)x
→ x
# test tru v w
→ v
# scc c1
→ (λs. (λz. (s (s z))))
# factorial (times (scc (scc c0)) (scc c1))
→ (λs. (λz. (s (s (s (s (s (s (s (s (s (s (s (s (s (s (s (s (s (s (s (s (s (s (s (s z))))))))))))))))))))))))))
```

0 comments on commit 11dceea

Please sign in to comment.