{ "info": { "author": "Jack Rosenthal", "author_email": "jack@rosenth.al", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Education", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Interpreters" ], "description": "``lc``: The Lambda Calculus Beta Reducer\n========================================\n\nThis tool helps you \u03b2-reduce terms in the \u03bb-calculus by providing you with a\nREPL::\n\n \u03bb> (\u03bbc.c(\u03bbx.\u03bby.x))((\u03bbx.\u03bby.\u03bbf.fxy)(\u03bbf.\u03bbx.f(fx))(\u03bbf.\u03bbx.f(f(fx))))\n INPUT (\u03bbc.c(\u03bbx.\u03bby.x))((\u03bbx.\u03bby.\u03bbf.fxy)(\u03bbf.\u03bbx.f(fx))(\u03bbf.\u03bbx.f(f(fx))))\n \u03b2 ==> (\u03bbx.\u03bby.\u03bbf.fxy)(\u03bbf.\u03bbx.f(fx))(\u03bbf.\u03bbx.f(f(fx)))(\u03bbx.\u03bby.x)\n \u03b2 ==> (\u03bby.\u03bbf.f(\u03bbf.\u03bbx.f(fx))y)(\u03bbf.\u03bbx.f(f(fx)))(\u03bbx.\u03bby.x)\n \u03b2 ==> (\u03bbf.f(\u03bbf.\u03bbx.f(fx))(\u03bbf.\u03bbx.f(f(fx))))(\u03bbx.\u03bby.x)\n \u03b2 ==> (\u03bbx.\u03bby.x)(\u03bbf.\u03bbx.f(fx))(\u03bbf.\u03bbx.f(f(fx)))\n \u03b2 ==> (\u03bby.\u03bbf.\u03bbx.f(fx))(\u03bbf.\u03bbx.f(f(fx)))\n \u03b2 ==> \u03bbf.\u03bbx.f(fx)\n\n Potential shorthand representations:\n -> As Church numeral 2\n\nInput\n-----\n\nNotice the pretty unicode ``\u03bb`` in the input: this REPL uses Readline to input\na ``\u03bb`` when you type backslash (``\\``).\n\nShorthands\n----------\n\n You can start any 'Monty Python' routine and people finish it for you.\n Everyone knows it like shorthand.\n\n -- Robin Williams\n\n\nNotice above the input was converted to its corresponding shorthand Church\nnumeral at the end. This interpreter has the notion of shorthand notations:\n\n1. Shorthands are written in braces (``{}``) and are *case insensitive*.\n\n2. Church numerals, as well as many other common shorthands, are predefined for\n you.\n\n3. Braces can be omitted on church numerals, as digits are not allowed to be\n used as variables.\n\n4. Use ``=`` operator to define a shorthand.\n\n::\n\n \u03bb> {ABC}=\u03bbf.\u03bbx.x\n \u03bb> {ABC}\n INPUT \u03bbf.\u03bbx.x\n\n Potential shorthand representations:\n -> As Church numeral 0\n -> As {FALSE}\n -> As {ABC}\n \u03bb> {IF}{FALSE}1{ABC}\n INPUT (\u03bbp.\u03bba.\u03bbb.pab)(\u03bbx.\u03bby.y)(\u03bbf.\u03bbx.fx)(\u03bbf.\u03bbx.x)\n \u03b2 ==> (\u03bba.\u03bbb.(\u03bbx.\u03bby.y)ab)(\u03bbf.\u03bbx.fx)(\u03bbf.\u03bbx.x)\n \u03b2 ==> (\u03bbb.(\u03bbx.\u03bby.y)(\u03bbf.\u03bbx.fx)b)(\u03bbf.\u03bbx.x)\n \u03b2 ==> (\u03bbx.\u03bby.y)(\u03bbf.\u03bbx.fx)(\u03bbf.\u03bbx.x)\n \u03b2 ==> (\u03bby.y)(\u03bbf.\u03bbx.x)\n \u03b2 ==> \u03bbf.\u03bbx.x\n\n Potential shorthand representations:\n -> As Church numeral 0\n -> As {FALSE}\n -> As {ABC}\n\nBuiltin Shorthands\n~~~~~~~~~~~~~~~~~~\n\nBesides a countably infinite number of Church numerals, the following\nshorthands come builtin to the interpreter::\n\n {succ}=\u03bbn.\u03bbf.\u03bbx.f(nfx)\n {add}=\u03bbm.\u03bbn.(m{succ}n)\n {mult}=\u03bbm.\u03bbn.(m({add}n)0)\n {true}=\u03bbx.\u03bby.x\n {false}=\u03bbx.\u03bby.y\n {and}=\u03bbp.\u03bbq.pqp\n {or}=\u03bbp.\u03bbq.ppq\n {not}=\u03bbp.p{false}{true}\n {if}=\u03bbp.\u03bba.\u03bbb.pab\n {cons}=\u03bbx.\u03bby.\u03bbf.fxy\n {car}=\u03bbc.c{true}\n {cdr}=\u03bbc.c{false}\n {nil}=\u03bbx.{true}\n {pred}=\u03bbn.\u03bbf.\u03bbx.n(\u03bbg.\u03bbh.h(gf))(\u03bbu.x)(\u03bbu.u)\n {sub}=\u03bbm.\u03bbn.n{pred}m\n {zero?}=\u03bbn.n(\u03bbx.{false}){true}\n {nil?}=\u03bbp.p(\u03bbx.\u03bby.{false})\n {lte?}=\u03bbm.\u03bbn.{zero?}({sub}mn)\n\nBugs\n----\n\n None. Mutts have fleas, not bugs.\n\n -- Mutt Manual Page\n\n* ``{pred}`` (and, consequently, ``{sub}``) appear to have some sort of issue.\n\n* When variables conflict as a result of application, they will display as the\n same variable, but the interpreter will still treat them as separate\n variables. What needs to be done is some sort of detection mechanism when\n this happens, and an automatic \u03b1-rename of the variable.\n\nIf you solve either of these, a PR is much appreciated!", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jackrosenthal/lambdacalc", "keywords": "lambda calculus teaching", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "lc", "package_url": "https://pypi.org/project/lc/", "platform": "", "project_url": "https://pypi.org/project/lc/", "project_urls": { "Homepage": "https://github.com/jackrosenthal/lambdacalc" }, "release_url": "https://pypi.org/project/lc/0.1/", "requires_dist": null, "requires_python": ">=3.4, <4", "summary": "Beta reducer and shorthand representer for the \u03bb-calculus", "version": "0.1" }, "last_serial": 4213640, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "7783743964d51e98157605a6de478bbc", "sha256": "4d3f76ebce605ef8193e737d4f767a12b483be7c3541bb0b292a5770622a41de" }, "downloads": -1, "filename": "lc-0.1.tar.gz", "has_sig": true, "md5_digest": "7783743964d51e98157605a6de478bbc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4, <4", "size": 5663, "upload_time": "2018-08-28T05:15:39", "url": "https://files.pythonhosted.org/packages/fd/c8/03f5ab776150d9be8cc6ef4f1d57aaf2fa88bfc27f08b2428c148e565d10/lc-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7783743964d51e98157605a6de478bbc", "sha256": "4d3f76ebce605ef8193e737d4f767a12b483be7c3541bb0b292a5770622a41de" }, "downloads": -1, "filename": "lc-0.1.tar.gz", "has_sig": true, "md5_digest": "7783743964d51e98157605a6de478bbc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4, <4", "size": 5663, "upload_time": "2018-08-28T05:15:39", "url": "https://files.pythonhosted.org/packages/fd/c8/03f5ab776150d9be8cc6ef4f1d57aaf2fa88bfc27f08b2428c148e565d10/lc-0.1.tar.gz" } ] }