lambda-calculus 3.0.0__tar.gz → 3.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lambda_calculus-3.1.0/.flake8 +3 -0
- lambda_calculus-3.1.0/.gitignore +164 -0
- lambda_calculus-3.1.0/.readthedocs.yaml +20 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0}/PKG-INFO +6 -5
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0}/README.md +1 -0
- lambda_calculus-3.1.0/docs/Makefile +20 -0
- lambda_calculus-3.1.0/docs/api/errors.rst +8 -0
- lambda_calculus-3.1.0/docs/api/terms/abc.rst +8 -0
- lambda_calculus-3.1.0/docs/api/terms/arithmetic.rst +8 -0
- lambda_calculus-3.1.0/docs/api/terms/combinators.rst +8 -0
- lambda_calculus-3.1.0/docs/api/terms/logic.rst +8 -0
- lambda_calculus-3.1.0/docs/api/terms/pairs.rst +8 -0
- lambda_calculus-3.1.0/docs/api/terms.rst +15 -0
- lambda_calculus-3.1.0/docs/api/visitors/normalisation.rst +8 -0
- lambda_calculus-3.1.0/docs/api/visitors/substitution/checked.rst +8 -0
- lambda_calculus-3.1.0/docs/api/visitors/substitution/renaming.rst +8 -0
- lambda_calculus-3.1.0/docs/api/visitors/substitution/unsafe.rst +8 -0
- lambda_calculus-3.1.0/docs/api/visitors/substitution.rst +12 -0
- lambda_calculus-3.1.0/docs/api/visitors/walking.rst +8 -0
- lambda_calculus-3.1.0/docs/api/visitors.rst +12 -0
- lambda_calculus-3.1.0/docs/api.rst +23 -0
- lambda_calculus-3.1.0/docs/conf.py +17 -0
- lambda_calculus-3.1.0/docs/index.rst +25 -0
- lambda_calculus-3.1.0/docs/installation.rst +33 -0
- lambda_calculus-3.1.0/docs/requirements.txt +3 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0}/pyproject.toml +61 -5
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/__init__.py +1 -1
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/terms/__init__.py +2 -3
- lambda_calculus-3.1.0/src/lambda_calculus/terms/abc.py +17 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/visitors/normalisation.py +2 -2
- lambda_calculus-3.1.0/tests/__init__.py +0 -0
- lambda_calculus-3.1.0/tests/terms/__init__.py +219 -0
- lambda_calculus-3.1.0/tests/terms/test_abc.py +24 -0
- lambda_calculus-3.1.0/tests/terms/test_arithmetic.py +165 -0
- lambda_calculus-3.1.0/tests/terms/test_combinators.py +96 -0
- lambda_calculus-3.1.0/tests/terms/test_logic.py +80 -0
- lambda_calculus-3.1.0/tests/terms/test_pairs.py +64 -0
- lambda_calculus-3.1.0/tests/test_errors.py +35 -0
- lambda_calculus-3.1.0/tests/test_readme.py +70 -0
- lambda_calculus-3.1.0/tests/visitors/__init__.py +0 -0
- lambda_calculus-3.1.0/tests/visitors/substitution/__init__.py +0 -0
- lambda_calculus-3.1.0/tests/visitors/substitution/test_checked.py +64 -0
- lambda_calculus-3.1.0/tests/visitors/substitution/test_renaming.py +185 -0
- lambda_calculus-3.1.0/tests/visitors/test_normalisation.py +158 -0
- lambda_calculus-3.1.0/tests/visitors/test_walking.py +57 -0
- lambda_calculus-3.0.0/lambda_calculus.egg-info/PKG-INFO +0 -114
- lambda_calculus-3.0.0/lambda_calculus.egg-info/SOURCES.txt +0 -22
- lambda_calculus-3.0.0/lambda_calculus.egg-info/dependency_links.txt +0 -1
- lambda_calculus-3.0.0/lambda_calculus.egg-info/top_level.txt +0 -1
- lambda_calculus-3.0.0/setup.cfg +0 -4
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0}/LICENSE +0 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/errors.py +0 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/py.typed +0 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/terms/arithmetic.py +0 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/terms/combinators.py +0 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/terms/logic.py +0 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/terms/pairs.py +0 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/visitors/__init__.py +0 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/visitors/substitution/__init__.py +0 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/visitors/substitution/checked.py +0 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/visitors/substitution/renaming.py +0 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/visitors/substitution/unsafe.py +0 -0
- {lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/visitors/walking.py +0 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# poetry
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
+
#poetry.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
110
|
+
.pdm.toml
|
|
111
|
+
|
|
112
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
113
|
+
__pypackages__/
|
|
114
|
+
|
|
115
|
+
# Celery stuff
|
|
116
|
+
celerybeat-schedule
|
|
117
|
+
celerybeat.pid
|
|
118
|
+
|
|
119
|
+
# SageMath parsed files
|
|
120
|
+
*.sage.py
|
|
121
|
+
|
|
122
|
+
# Environments
|
|
123
|
+
.env
|
|
124
|
+
.venv
|
|
125
|
+
.direnv
|
|
126
|
+
env/
|
|
127
|
+
venv/
|
|
128
|
+
ENV/
|
|
129
|
+
env.bak/
|
|
130
|
+
venv.bak/
|
|
131
|
+
|
|
132
|
+
# Spyder project settings
|
|
133
|
+
.spyderproject
|
|
134
|
+
.spyproject
|
|
135
|
+
|
|
136
|
+
# Rope project settings
|
|
137
|
+
.ropeproject
|
|
138
|
+
|
|
139
|
+
# mkdocs documentation
|
|
140
|
+
/site
|
|
141
|
+
|
|
142
|
+
# mypy
|
|
143
|
+
.mypy_cache/
|
|
144
|
+
.dmypy.json
|
|
145
|
+
dmypy.json
|
|
146
|
+
|
|
147
|
+
# Pyre type checker
|
|
148
|
+
.pyre/
|
|
149
|
+
|
|
150
|
+
# pytype static type analyzer
|
|
151
|
+
.pytype/
|
|
152
|
+
|
|
153
|
+
# Cython debug symbols
|
|
154
|
+
cython_debug/
|
|
155
|
+
|
|
156
|
+
# PyCharm
|
|
157
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
158
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
159
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
160
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
161
|
+
#.idea/
|
|
162
|
+
|
|
163
|
+
# VSCode
|
|
164
|
+
.vscode/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
|
|
3
|
+
build:
|
|
4
|
+
os: "ubuntu-22.04"
|
|
5
|
+
tools:
|
|
6
|
+
python: "3.10"
|
|
7
|
+
|
|
8
|
+
formats:
|
|
9
|
+
- pdf
|
|
10
|
+
- epub
|
|
11
|
+
|
|
12
|
+
sphinx:
|
|
13
|
+
configuration: docs/conf.py
|
|
14
|
+
fail_on_warning: true
|
|
15
|
+
|
|
16
|
+
python:
|
|
17
|
+
install:
|
|
18
|
+
- requirements: docs/requirements.txt
|
|
19
|
+
- method: pip
|
|
20
|
+
path: .
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: lambda_calculus
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.1.0
|
|
4
4
|
Summary: Implementation of the Lambda calculus
|
|
5
|
-
Author-email: Eric Niklas Wolf <eric_niklas.wolf@mailbox.tu-dresden.de>
|
|
6
5
|
Project-URL: Repository, https://github.com/Deric-W/lambda_calculus
|
|
7
6
|
Project-URL: Documentation, http://lambda-calculus.readthedocs.io/
|
|
8
7
|
Project-URL: Bugtracker, https://github.com/Deric-W/lambda_calculus/issues
|
|
8
|
+
Author-email: Eric Niklas Wolf <eric_niklas.wolf@mailbox.tu-dresden.de>
|
|
9
|
+
License-File: LICENSE
|
|
9
10
|
Classifier: Intended Audience :: Education
|
|
10
11
|
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
11
12
|
Classifier: Operating System :: OS Independent
|
|
@@ -15,10 +16,10 @@ Classifier: Topic :: Utilities
|
|
|
15
16
|
Classifier: Typing :: Typed
|
|
16
17
|
Requires-Python: >=3.10
|
|
17
18
|
Description-Content-Type: text/markdown
|
|
18
|
-
License-File: LICENSE
|
|
19
19
|
|
|
20
20
|
# lambda_calculus
|
|
21
21
|
|
|
22
|
+
[](https://github.com/pypa/hatch)
|
|
22
23
|

|
|
23
24
|
[](https://codecov.io/gh/Deric-W/lambda_calculus)
|
|
24
25
|
[](https://lambda-calculus.readthedocs.io/en/stable/?badge=stable)
|
|
@@ -111,4 +112,4 @@ assert BetaNormalisingVisitor().skip_intermediate(term) == Application.with_argu
|
|
|
111
112
|
Variable("+"),
|
|
112
113
|
(Variable("4"), Variable("3"))
|
|
113
114
|
)
|
|
114
|
-
```
|
|
115
|
+
```
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# lambda_calculus
|
|
2
2
|
|
|
3
|
+
[](https://github.com/pypa/hatch)
|
|
3
4
|

|
|
4
5
|
[](https://codecov.io/gh/Deric-W/lambda_calculus)
|
|
5
6
|
[](https://lambda-calculus.readthedocs.io/en/stable/?badge=stable)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR = .
|
|
9
|
+
BUILDDIR = _build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Package API
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
.. toctree::
|
|
5
|
+
:maxdepth: 2
|
|
6
|
+
|
|
7
|
+
api/terms
|
|
8
|
+
api/visitors
|
|
9
|
+
api/errors
|
|
10
|
+
|
|
11
|
+
.. automodule:: lambda_calculus
|
|
12
|
+
|
|
13
|
+
.. autoclass:: Variable
|
|
14
|
+
|
|
15
|
+
Reference to :class:`.terms.Variable` for convenience
|
|
16
|
+
|
|
17
|
+
.. autoclass:: Abstraction
|
|
18
|
+
|
|
19
|
+
Reference to :class:`.terms.Abstraction` for convenience
|
|
20
|
+
|
|
21
|
+
.. autoclass:: Application
|
|
22
|
+
|
|
23
|
+
Reference to :class:`.terms.Application` for convenience
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Sphinx configuration"""
|
|
4
|
+
|
|
5
|
+
import sys
|
|
6
|
+
import os.path
|
|
7
|
+
from sphinx_pyproject import SphinxConfig
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
sys.path.append(os.path.abspath(".."))
|
|
11
|
+
|
|
12
|
+
config = SphinxConfig("../pyproject.toml", globalns=globals())
|
|
13
|
+
|
|
14
|
+
intersphinx_mapping = {
|
|
15
|
+
"python": ("https://docs.python.org/3/", None),
|
|
16
|
+
"sphinx": ("https://www.sphinx-doc.org/en/stable/", None),
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
lambda_calculus
|
|
2
|
+
===============
|
|
3
|
+
|
|
4
|
+
Welcome to lambda_calculus`s documentation.
|
|
5
|
+
|
|
6
|
+
This project implements basic operations of the `Lambda calculus <https://en.wikipedia.org/wiki/Lambda_calculus>`_
|
|
7
|
+
as a python package and contains helpers to define custom ones.
|
|
8
|
+
|
|
9
|
+
It is intended to be used for educational purposes and is not optimized for speed.
|
|
10
|
+
Furthermore, it expects all terms to be finite, which means the absence of cycles.
|
|
11
|
+
:py:class:`RecursionError` may be raised when using an infinite term or the evaluation is too complex.
|
|
12
|
+
|
|
13
|
+
.. toctree::
|
|
14
|
+
:maxdepth: 2
|
|
15
|
+
|
|
16
|
+
installation
|
|
17
|
+
api
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
Indices and tables
|
|
21
|
+
==================
|
|
22
|
+
|
|
23
|
+
* :ref:`genindex`
|
|
24
|
+
* :ref:`modindex`
|
|
25
|
+
* :ref:`search`
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Installation
|
|
2
|
+
============
|
|
3
|
+
|
|
4
|
+
.. toctree::
|
|
5
|
+
:maxdepth: 2
|
|
6
|
+
|
|
7
|
+
Overview over the most common ways of installing this project.
|
|
8
|
+
|
|
9
|
+
Installation from PyPI
|
|
10
|
+
----------------------
|
|
11
|
+
|
|
12
|
+
If you just want to get started or receive updates you can use
|
|
13
|
+
the package available on `PyPI <https://pypi.org/project/lambda-calculus/>`_ and
|
|
14
|
+
install it with the following command:
|
|
15
|
+
|
|
16
|
+
.. code:: bash
|
|
17
|
+
|
|
18
|
+
python3 -m pip install lambda-calculus
|
|
19
|
+
|
|
20
|
+
`Sematic Versioning <https://semver.org/>`_ is is attempted to be adhered to.
|
|
21
|
+
|
|
22
|
+
Installation from source
|
|
23
|
+
------------------------
|
|
24
|
+
|
|
25
|
+
This project adheres to `PEP 517 <https://peps.python.org/pep-0517>`_ and
|
|
26
|
+
can be build using `build <https://pypi.org/project/build/>`_:
|
|
27
|
+
|
|
28
|
+
.. code:: bash
|
|
29
|
+
|
|
30
|
+
python3 -m build
|
|
31
|
+
|
|
32
|
+
The resulting wheel should be platform and machine independent
|
|
33
|
+
because this is a pure python project.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "lambda_calculus"
|
|
3
|
-
version = "3.
|
|
3
|
+
version = "3.1.0"
|
|
4
4
|
description = "Implementation of the Lambda calculus"
|
|
5
5
|
requires-python = ">=3.10"
|
|
6
6
|
keywords = []
|
|
@@ -28,11 +28,59 @@ Documentation = "http://lambda-calculus.readthedocs.io/"
|
|
|
28
28
|
Bugtracker = "https://github.com/Deric-W/lambda_calculus/issues"
|
|
29
29
|
|
|
30
30
|
[build-system]
|
|
31
|
-
requires = ["
|
|
32
|
-
build-backend = "
|
|
31
|
+
requires = ["hatchling"]
|
|
32
|
+
build-backend = "hatchling.build"
|
|
33
33
|
|
|
34
|
-
[tool.
|
|
35
|
-
|
|
34
|
+
[tool.hatch.envs.test]
|
|
35
|
+
dependencies = [
|
|
36
|
+
"coverage[toml] == 7.*"
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[tool.hatch.envs.test.scripts]
|
|
40
|
+
test = "python -m unittest discover {args}"
|
|
41
|
+
cov-run = "coverage run -m unittest discover {args}"
|
|
42
|
+
cov-report = [
|
|
43
|
+
"- coverage combine",
|
|
44
|
+
"coverage report"
|
|
45
|
+
]
|
|
46
|
+
cov = [
|
|
47
|
+
"cov-run",
|
|
48
|
+
"cov-report"
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
[[tool.hatch.envs.test.matrix]]
|
|
52
|
+
python = ["3.10", "3.11", "3.12"]
|
|
53
|
+
|
|
54
|
+
[tool.hatch.envs.lint]
|
|
55
|
+
dependencies = [
|
|
56
|
+
"mypy >= 1.0.0",
|
|
57
|
+
"pylint >= 2.12.2",
|
|
58
|
+
"flake8 >= 5.0.0",
|
|
59
|
+
"isort >= 5.10.1"
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
[tool.hatch.envs.lint.scripts]
|
|
63
|
+
lint = [
|
|
64
|
+
"- flake8 src/lambda_calculus",
|
|
65
|
+
"- pylint src/lambda_calculus"
|
|
66
|
+
]
|
|
67
|
+
typecheck = "mypy -p lambda_calculus"
|
|
68
|
+
release = [
|
|
69
|
+
"typecheck"
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
[tool.hatch.envs.docs]
|
|
73
|
+
dependencies = [
|
|
74
|
+
"sphinx ~= 5.2.0",
|
|
75
|
+
"sphinx-pyproject ~= 0.1.0",
|
|
76
|
+
"sphinx-rtd-theme ~= 1.0.0"
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
[tool.hatch.envs.docs.scripts]
|
|
80
|
+
build = "sphinx-build {args} docs docs/_build"
|
|
81
|
+
|
|
82
|
+
[tool.hatch.build.targets.sdist]
|
|
83
|
+
exclude = ["/.github"]
|
|
36
84
|
|
|
37
85
|
[tool.mypy]
|
|
38
86
|
disallow_any_unimported = true
|
|
@@ -45,6 +93,14 @@ warn_unused_ignores = true
|
|
|
45
93
|
warn_return_any = true
|
|
46
94
|
warn_unreachable = true
|
|
47
95
|
|
|
96
|
+
[tool.pylint]
|
|
97
|
+
max-line-length = 100
|
|
98
|
+
|
|
99
|
+
[tool.coverage.run]
|
|
100
|
+
source_pkgs = ["lambda_calculus"]
|
|
101
|
+
branch = true
|
|
102
|
+
parallel = true
|
|
103
|
+
|
|
48
104
|
[tool.sphinx-pyproject]
|
|
49
105
|
project = "lambda_calculus"
|
|
50
106
|
copyright = "2022 Eric Wolf"
|
|
@@ -17,6 +17,7 @@ __all__ = (
|
|
|
17
17
|
"Variable",
|
|
18
18
|
"Abstraction",
|
|
19
19
|
"Application",
|
|
20
|
+
"abc",
|
|
20
21
|
"arithmetic",
|
|
21
22
|
"logic",
|
|
22
23
|
"pairs",
|
|
@@ -280,7 +281,7 @@ class Abstraction(Term[V]):
|
|
|
280
281
|
)
|
|
281
282
|
raise CollisionError("new variable would bind free variable in body", (new,))
|
|
282
283
|
|
|
283
|
-
def eta_reduction(self) -> Term[V]:
|
|
284
|
+
def eta_reduction(self) -> Term[V]:
|
|
284
285
|
"""
|
|
285
286
|
Remove a useless abstraction.
|
|
286
287
|
|
|
@@ -291,8 +292,6 @@ class Abstraction(Term[V]):
|
|
|
291
292
|
case Application(f, Variable(x)) if x == self.bound and x not in f.free_variables():
|
|
292
293
|
return f
|
|
293
294
|
case _:
|
|
294
|
-
# mypy detects missing returns
|
|
295
|
-
# because of https://github.com/python/mypy/issues/12534
|
|
296
295
|
raise ValueError("abstraction is not useless")
|
|
297
296
|
|
|
298
297
|
def accept(self, visitor: visitors.Visitor[T, V]) -> T:
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
|
|
3
|
+
"""Predefined Variables for all ASCII letters"""
|
|
4
|
+
|
|
5
|
+
from string import ascii_letters
|
|
6
|
+
from . import Variable
|
|
7
|
+
|
|
8
|
+
__all__ = tuple(ascii_letters)
|
|
9
|
+
|
|
10
|
+
# better IDE autocompletion
|
|
11
|
+
a, b, c, d, e, f, g, h, i, j = map(Variable, "abcdefghij")
|
|
12
|
+
k, l, m, n, o, p, q, r, s, t = map(Variable, "klmnopqrst")
|
|
13
|
+
u, v, w, x, y, z = map(Variable, "uvwxyz")
|
|
14
|
+
|
|
15
|
+
A, B, C, D, E, F, G, H, I, J = map(Variable, "ABCDEFGHIJ")
|
|
16
|
+
K, L, M, N, O, P, Q, R, S, T = map(Variable, "KLMNOPQRST")
|
|
17
|
+
U, V, W, X, Y, Z = map(Variable, "UVWXYZ")
|
{lambda_calculus-3.0.0 → lambda_calculus-3.1.0/src}/lambda_calculus/visitors/normalisation.py
RENAMED
|
@@ -46,7 +46,7 @@ class BetaNormalisingVisitor(Visitor[Iterator[Step], str]):
|
|
|
46
46
|
def skip_intermediate(self, term: terms.Term[str]) -> terms.Term[str]:
|
|
47
47
|
"""
|
|
48
48
|
Calculate the beta normal form directly.
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
:param term: term which should be transformed into ist beta normal form
|
|
51
51
|
:return: new term representing the beta normal form if it exists
|
|
52
52
|
"""
|
|
@@ -77,7 +77,7 @@ class BetaNormalisingVisitor(Visitor[Iterator[Step], str]):
|
|
|
77
77
|
def beta_reducation(self, abstraction: terms.Abstraction[str], argument: terms.Term[str]) -> Generator[Step, None, terms.Term[str]]:
|
|
78
78
|
"""
|
|
79
79
|
Perform beta reduction of an application.
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
:param abstraction: abstraction of the application
|
|
82
82
|
:param argument: argument of the application
|
|
83
83
|
:return: Generator yielding steps and returning the reduced term
|
|
File without changes
|