This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A simple REPL for lambda calculus

Project Description

A simple REPL for lambda calculus

Use:

when calling churchrepl and new REPL will be opened.

churchrepl [-f --file file [file ...]] [-v --verbose]

Flags:

(optional) Read definitions and expressions from a file before loading the normal REPL.

-f|--file file [file ...]

(optional) print debugging and verbose output.

-v|--verbose

Church repl file structure:

The EBNF grammar is as follows*:

(* church-lambda EBNF *)
                  (* --- meta --- *)
 program = {line};
 line = (define | function);
 define = "@" alias ":" function;

                  (* --- lambdas --- *)
 function = lambda | application;
 lambda = "λ" variable "." expr;
 application = '(' expr  expr ')';
 expr = (lambda | application | variable | alias );

                  (* --- primitives --- *)
 variable = /[a-z]/;
 alias = /[_A-Z][_A-Z0-9]*/;

A simple example program:

@ID: λx.x
@APPLY: λf.λx.(f x)
@TRUE: λx.λy.x
@FALSE: λx.λy.y
@ZERO: λf.λx.x
@SUCC: λn.λf.λx.(f ((n f) x))
@ONE: (SUCC ZERO)
@TWO: (SUCC ONE)
@THREE: (SUCC TWO)
@FOUR: (SUCC THREE)
(SUCC ZERO)
(SUCC ONE)
(SUCC TWO)
(SUCC THREE)
(SUCC FOUR)

Note: The λ (lambda, unicode u03bb) is equivalent to a backslash as far as this program is concerned. When using the repl it may be easier to use a backslash.

Release History

Release History

This version
History Node

1.0.2

History Node

1.0.1.post1

History Node

1.0.1

History Node

1.0.0

History Node

0.2.5

History Node

0.2.4

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2.0

History Node

0.1.10

History Node

0.1.6

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
churchrepl-1.0.2-py2.py3-none-any.whl (9.1 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Jun 28, 2016
churchrepl-1.0.2.tar.gz (7.0 kB) Copy SHA256 Checksum SHA256 Source Jun 28, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting