Metadata-Version: 2.0
Name: churchrepl
Version: 1.0.2
Summary: A simple REPL for lambda calculus
Home-page: https://github.com/CodeGrimoire/ChurchREPL
Author: Luke Smith
Author-email: lsmith@zenoscave.com
License: BSD
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows :: Windows 7
Requires-Dist: coverage
Requires-Dist: flake8
Requires-Dist: future
Requires-Dist: grako
Requires-Dist: mock
Requires-Dist: nose
Requires-Dist: pylint

CHURCH-REPL
===========

A simple REPL for lambda calculus

.. image:: https://travis-ci.org/CodeGrimoire/ChurchREPL.svg?branch=master
    :target: https://travis-ci.org/CodeGrimoire/ChurchREPL

Use:
----
when calling churchrepl and new REPL will be opened.

.. code-block::

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

Flags:

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

.. code-block::

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


(optional) print debugging and verbose output.

.. code-block::

    -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.


