{"id":24528172,"url":"https://github.com/deric-w/lambda_calculus","last_synced_at":"2025-10-09T18:09:51.516Z","repository":{"id":60654286,"uuid":"527676942","full_name":"Deric-W/lambda_calculus","owner":"Deric-W","description":"Python package for the lambda calculus","archived":false,"fork":false,"pushed_at":"2024-11-20T03:59:15.000Z","size":143,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T09:51:57.515Z","etag":null,"topics":["education","lambda-calculus","python3"],"latest_commit_sha":null,"homepage":"https://lambda-calculus.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Deric-W.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-22T17:59:41.000Z","updated_at":"2024-12-06T22:48:45.000Z","dependencies_parsed_at":"2024-02-07T14:39:52.051Z","dependency_job_id":"3b7452b0-0cee-4067-a36f-4eb9ee17fab5","html_url":"https://github.com/Deric-W/lambda_calculus","commit_stats":{"total_commits":54,"total_committers":1,"mean_commits":54.0,"dds":0.0,"last_synced_commit":"4dbc4cd181f5275d6b11c6e01354fb40506b334a"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deric-W%2Flambda_calculus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deric-W%2Flambda_calculus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deric-W%2Flambda_calculus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deric-W%2Flambda_calculus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Deric-W","download_url":"https://codeload.github.com/Deric-W/lambda_calculus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248911100,"owners_count":21182037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["education","lambda-calculus","python3"],"created_at":"2025-01-22T06:34:06.405Z","updated_at":"2025-10-09T18:09:46.495Z","avatar_url":"https://github.com/Deric-W.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lambda_calculus\n\n[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)\n![Tests](https://github.com/Deric-W/lambda_calculus/actions/workflows/Tests.yaml/badge.svg)\n[![codecov](https://codecov.io/gh/Deric-W/lambda_calculus/branch/main/graph/badge.svg?token=SU3982mC17)](https://codecov.io/gh/Deric-W/lambda_calculus)\n[![Documentation Status](https://readthedocs.org/projects/lambda-calculus/badge/?version=stable)](https://lambda-calculus.readthedocs.io/en/stable/?badge=stable)\n\nThe [`lambda_calculus`](https://pypi.org/project/lambda-calculus/) package contains classes which implement basic operations of the lambda calculus.\n\nTo use it, simply import the classes `Variable`, `Abstraction` and `Application` from this package\nand nest them to create more complex lambda terms.\n\nYou can also use the `visitors` subpackage to define your own operations on terms or\nuse predefined ones from the `terms` subpackage.\n\nMore information is available on [Read the Docs](https://lambda-calculus.readthedocs.io/).\n\n## Notice\n\nThis package is intended to be used for educational purposes and is not optimized for speed.\n\nFurthermore, it expects all terms to be finite, which means the absence of cycles.\n\n`RecursionError` may be raised if the visitors get passed an infinite term or the evaluation is too complex.\n\n## Requirements\n\nPython \u003e= 3.10 is required to use this package.\n\n## Installation\n\n```sh\npython3 -m pip install lambda-calculus\n```\n\n## Examples\n\n(λy.(λx.(λy. + x y)) y 3) 4\n\n### Nesting\n\n```python\nfrom lambda_calculus import Variable, Abstraction, Application\n\nterm = Application(Variable(\"+\"), Variable(\"x\"))\nterm = Application(term, Variable(\"y\"))\nterm = Abstraction(\"y\", term)\nterm = Abstraction(\"x\", term)\nterm = Application(term, Variable(\"y\"))\nterm = Application(term, Variable(\"3\"))\nterm = Abstraction(\"y\", term)\nterm = Application(term, Variable(\"4\"))\n```\n\n### Utility Methods\n\n```python\nfrom lambda_calculus import Variable, Abstraction, Application\n\nx = Variable.with_valid_name(\"x\")\ny = Variable.with_valid_name(\"y\")\n\nterm = Application.with_arguments(Variable.with_valid_name(\"+\"), (x, y))\nterm = Abstraction.curried((\"x\", \"y\"), term)\nterm = Application.with_arguments(term, (y, Variable.with_valid_name(\"3\")))\nterm = Abstraction(\"y\", term)\nterm = Application(term, Variable.with_valid_name(\"4\"))\n```\n\n### Method Chaining\n\n```python\nfrom lambda_calculus import Variable, Abstraction, Application\n\nx = Variable.with_valid_name(\"x\")\ny = Variable.with_valid_name(\"y\")\n\nterm = Variable(\"+\") \\\n    .apply_to(x, y) \\\n    .abstract(\"x\", \"y\") \\\n    .apply_to(y, Variable(\"3\")) \\\n    .abstract(\"y\") \\\n    .apply_to(Variable(\"4\"))\n```\n\n### Evaluation\n\n```python\nfrom lambda_calculus import Variable, Application\nfrom lambda_calculus.visitors.normalisation import BetaNormalisingVisitor\n\nassert BetaNormalisingVisitor().skip_intermediate(term) == Application.with_arguments(\n    Variable(\"+\"),\n    (Variable(\"4\"), Variable(\"3\"))\n)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderic-w%2Flambda_calculus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderic-w%2Flambda_calculus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderic-w%2Flambda_calculus/lists"}