项目作者: Ema93sh

项目描述 :
A lambda calculus REPL
高级语言: Haskell
项目地址: git://github.com/Ema93sh/lambda-calculus-interpreter.git
创建时间: 2017-04-30T22:14:06Z
项目社区:https://github.com/Ema93sh/lambda-calculus-interpreter

开源协议:MIT License

下载


Lambda Calculus REPL:

A simple REPL for lambda calculus.

Screencast

Screencapture GIF

Run

To run the REPL, just type in:

  1. cabal run

Examples:

To switch normal order reduction strategy
:n
(λx.xx)((λxy.yx)y)
→(λx.xx)((λxy.yx)y)
→((λxy.yx)y)((λxy.yx)y)
→(λa.ay)((λxy.yx)y)
→((λxy.yx)y)y
→(λa.ay)y
yy

:a
(λx.xx)((λxy.yx)y)
→(\x.xx)((λxy.yx)y)
→(λx.xx)(λa.ay)
yy

— Alpha Equivalence
:eq (\x.xx) (\y.yy)
:eq (\xy.xy) (\yx.yx)
:eq (\xy.xy) (\yx.yy)

— Convert to Debruijn Index
:d (\xysz.xs(ysz))
:d (\x.x(\y.xx))

— Explain
(λx.(λy.xy))y (\x.xx)

TODO
:eq y x not equal