lambda-calculus 3.0.0__py3-none-any.whl → 3.1.0__py3-none-any.whl
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/__init__.py +1 -1
- lambda_calculus/terms/__init__.py +2 -3
- lambda_calculus/terms/abc.py +17 -0
- lambda_calculus/visitors/normalisation.py +2 -2
- {lambda_calculus-3.0.0.dist-info → lambda_calculus-3.1.0.dist-info}/METADATA +7 -6
- {lambda_calculus-3.0.0.dist-info → lambda_calculus-3.1.0.dist-info}/RECORD +8 -8
- {lambda_calculus-3.0.0.dist-info → lambda_calculus-3.1.0.dist-info}/WHEEL +1 -2
- lambda_calculus-3.0.0.dist-info/top_level.txt +0 -1
- {lambda_calculus-3.0.0.dist-info → lambda_calculus-3.1.0.dist-info/licenses}/LICENSE +0 -0
lambda_calculus/__init__.py
CHANGED
|
@@ -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")
|
|
@@ -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
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 3.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: lambda_calculus
|
|
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,20 +1,20 @@
|
|
|
1
|
-
lambda_calculus/__init__.py,sha256=
|
|
1
|
+
lambda_calculus/__init__.py,sha256=4HEzc-fklHdsxdB5vQY8Goxpay2xomfhpIVG_EEY3y4,340
|
|
2
2
|
lambda_calculus/errors.py,sha256=WVoIbibq6Ey-nzr99fUdITneGBxR871xnvGKWWhG37E,1185
|
|
3
3
|
lambda_calculus/py.typed,sha256=rVxfNzv1aKmfThIlRztkUwWiKeYa4XTdtNMh3FV-dGM,25
|
|
4
|
-
lambda_calculus/terms/__init__.py,sha256=
|
|
4
|
+
lambda_calculus/terms/__init__.py,sha256=tHVY4J7MaDWqpkOrxgcIqYuKn38drbjIm2lPFdZjhrU,12440
|
|
5
|
+
lambda_calculus/terms/abc.py,sha256=PyJDArUZM4TzskF7LqPx6luG34ptUawYUChkBlM2az0,510
|
|
5
6
|
lambda_calculus/terms/arithmetic.py,sha256=0-vvpTvioTfVLiMNt1MazrO28eMZAxHZudzt0IUoel0,2934
|
|
6
7
|
lambda_calculus/terms/combinators.py,sha256=OXbOKIA1V-7UYpPsx8HW8vA0-07ZtV72-OjXWK8wZgQ,1525
|
|
7
8
|
lambda_calculus/terms/logic.py,sha256=40tunDbyjQlm6ENse3psuosfJEsp1jR5hZPrEEruisE,1246
|
|
8
9
|
lambda_calculus/terms/pairs.py,sha256=h1OwLxda7FVxQ0mDYuTVHbJ28WuZPQnus4mIzc8UCUc,1045
|
|
9
10
|
lambda_calculus/visitors/__init__.py,sha256=jQoqB86o5gBuVbIFaG_-Zhiyk39ttHWqScGn85zSNfU,5033
|
|
10
|
-
lambda_calculus/visitors/normalisation.py,sha256=
|
|
11
|
+
lambda_calculus/visitors/normalisation.py,sha256=EUFaA1xIssJVL7MDAK3IWuLEArk3HdVjSP2lKr9Dz-s,4471
|
|
11
12
|
lambda_calculus/visitors/walking.py,sha256=01QgvJ-zjhQCF2r7zJQB__49WekGiNEa55JuZoF5v0g,1889
|
|
12
13
|
lambda_calculus/visitors/substitution/__init__.py,sha256=hBAKMal-mhx4wL0m-TJUEK2ZNwKIvnIXfFgYkf058tk,4326
|
|
13
14
|
lambda_calculus/visitors/substitution/checked.py,sha256=ZP9lEFyEvNXlJPh6-wXoMC_IK_h3IoLdtjTa-N8DW7o,4445
|
|
14
15
|
lambda_calculus/visitors/substitution/renaming.py,sha256=4m-OEbOw8ibkUkF7rk-0vpf3WP_44gXjrgSCVE4lvDk,7707
|
|
15
16
|
lambda_calculus/visitors/substitution/unsafe.py,sha256=aholWL9aBuC_R4BuPRLZr6oodRKSFPrYvCHQZotkFTY,2419
|
|
16
|
-
lambda_calculus-3.
|
|
17
|
-
lambda_calculus-3.
|
|
18
|
-
lambda_calculus-3.
|
|
19
|
-
lambda_calculus-3.
|
|
20
|
-
lambda_calculus-3.0.0.dist-info/RECORD,,
|
|
17
|
+
lambda_calculus-3.1.0.dist-info/METADATA,sha256=Tk5GxJZlkZLwdZXIkQwTRwaq2z4fepsqzvnzfa_ve60,3790
|
|
18
|
+
lambda_calculus-3.1.0.dist-info/WHEEL,sha256=as-1oFTWSeWBgyzh0O_qF439xqBe6AbBgt4MfYe5zwY,87
|
|
19
|
+
lambda_calculus-3.1.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
20
|
+
lambda_calculus-3.1.0.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
lambda_calculus
|
|
File without changes
|