mixinv2-library 0.2.0.post29.dev0__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.
Files changed (23) hide show
  1. mixinv2_library-0.2.0.post29.dev0/.gitignore +240 -0
  2. mixinv2_library-0.2.0.post29.dev0/PKG-INFO +13 -0
  3. mixinv2_library-0.2.0.post29.dev0/pyproject.toml +45 -0
  4. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/BinNatData.oyaml +13 -0
  5. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/BinNatDecrement.oyaml +45 -0
  6. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/BinNatEquality.oyaml +65 -0
  7. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/BinNatIncrement.oyaml +21 -0
  8. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/BinNatPlus.oyaml +71 -0
  9. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/BinNatVisitor.oyaml +19 -0
  10. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/BooleanAnd.oyaml +15 -0
  11. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/BooleanData.oyaml +5 -0
  12. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/BooleanEquality.oyaml +15 -0
  13. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/BooleanNegation.oyaml +8 -0
  14. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/BooleanOr.oyaml +15 -0
  15. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/BooleanVisitor.oyaml +14 -0
  16. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/NatData.oyaml +10 -0
  17. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/NatDecrement.oyaml +11 -0
  18. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/NatEquality.oyaml +39 -0
  19. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/NatPlus.oyaml +22 -0
  20. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/NatVisitor.oyaml +16 -0
  21. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/NumberIsZero.oyaml +12 -0
  22. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/Builtin/__init__.py +132 -0
  23. mixinv2_library-0.2.0.post29.dev0/src/mixinv2_library/__init__.py +0 -0
@@ -0,0 +1,240 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
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
+ **/docs/api/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+ .jupyter_ystore.db
82
+
83
+ # IPython
84
+ profile_default/
85
+ ipython_config.py
86
+
87
+ # pyenv
88
+ # For a library or package, you might want to ignore these files since the code is
89
+ # intended to run in multiple environments; otherwise, check them in:
90
+ # .python-version
91
+
92
+ # pipenv
93
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
95
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
96
+ # install all needed dependencies.
97
+ #Pipfile.lock
98
+
99
+ # UV
100
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
101
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
102
+ # commonly ignored for libraries.
103
+ #uv.lock
104
+
105
+ # poetry
106
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
107
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
108
+ # commonly ignored for libraries.
109
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
110
+ #poetry.lock
111
+ #poetry.toml
112
+
113
+ # pdm
114
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
115
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
116
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
117
+ #pdm.lock
118
+ #pdm.toml
119
+ .pdm-python
120
+ .pdm-build/
121
+
122
+ # pixi
123
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
124
+ #pixi.lock
125
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
126
+ # in the .venv directory. It is recommended not to include this directory in version control.
127
+ .pixi
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule
134
+ celerybeat.pid
135
+
136
+ # SageMath parsed files
137
+ *.sage.py
138
+
139
+ # Environments
140
+ .env
141
+ .venv
142
+ env/
143
+ venv/
144
+ ENV/
145
+ env.bak/
146
+ venv.bak/
147
+
148
+ # Spyder project settings
149
+ .spyderproject
150
+ .spyproject
151
+
152
+ # Rope project settings
153
+ .ropeproject
154
+
155
+ # mkdocs documentation
156
+ /site
157
+
158
+ # mypy
159
+ .mypy_cache/
160
+ .dmypy.json
161
+ dmypy.json
162
+
163
+ # Pyre type checker
164
+ .pyre/
165
+
166
+ # pytype static type analyzer
167
+ .pytype/
168
+
169
+ # Cython debug symbols
170
+ cython_debug/
171
+
172
+ # PyCharm
173
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
174
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
175
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
176
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
177
+ #.idea/
178
+
179
+ # Abstra
180
+ # Abstra is an AI-powered process automation framework.
181
+ # Ignore directories containing user credentials, local state, and settings.
182
+ # Learn more at https://abstra.io/docs
183
+ .abstra/
184
+
185
+ # Visual Studio Code
186
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
187
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
188
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
189
+ # you could uncomment the following to ignore the entire vscode folder
190
+ # .vscode/
191
+
192
+ # Ruff stuff:
193
+ .ruff_cache/
194
+
195
+ # PyPI configuration file
196
+ .pypirc
197
+
198
+ # Cursor
199
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
200
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
201
+ # refer to https://docs.cursor.com/context/ignore-files
202
+ .cursorignore
203
+ .cursorindexingignore
204
+
205
+ # Marimo
206
+ marimo/_static/
207
+ marimo/_lsp/
208
+ __marimo__/
209
+
210
+ .direnv/
211
+ .devenv/
212
+ result
213
+
214
+ # LaTeX
215
+ *.pdf
216
+ *.aux
217
+ *.fls
218
+ *.fdb_latexmk
219
+ *.synctex.gz
220
+ *.bbl
221
+ *.blg
222
+ *.out
223
+ *.dvi
224
+ *.xcp
225
+
226
+ # Local data
227
+ data/
228
+ trajectory/
229
+ experiment_results.db
230
+
231
+ .playwright-mcp/
232
+ *.local.*
233
+ .envrc.private
234
+ .pre-commit-config.yaml
235
+
236
+ # nixago: ignore-linked-files
237
+ /.vscode/extensions.json
238
+
239
+ /inheritance-calculus/arxiv-submission.tar.gz
240
+ node_modules/
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: mixinv2-library
3
+ Version: 0.2.0.post29.dev0
4
+ Summary: The MIXINv2 standard library — built-in definitions for MIXINv2
5
+ Project-URL: Repository, https://github.com/Atry/overlay
6
+ Author-email: "Yang, Bo" <yang-bo@yang-bo.com>
7
+ License-Expression: MIT
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3.13
11
+ Classifier: Programming Language :: Python :: 3.14
12
+ Requires-Python: >=3.13
13
+ Requires-Dist: mixinv2==0.2.0.post29.dev0
@@ -0,0 +1,45 @@
1
+ [build-system]
2
+ requires = ["hatchling", "uv-dynamic-versioning>=0.7.0", "editables"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [tool.hatch.version]
6
+ source = "uv-dynamic-versioning"
7
+
8
+ [tool.uv-dynamic-versioning]
9
+ vcs = "git"
10
+ style = "pep440"
11
+ bump = false
12
+ fallback-version = "0.1.0"
13
+ metadata = false
14
+
15
+ [project]
16
+ name = "mixinv2-library"
17
+ dynamic = ["version", "dependencies"]
18
+ description = "The MIXINv2 standard library — built-in definitions for MIXINv2"
19
+ license = "MIT"
20
+ requires-python = ">=3.13"
21
+ authors = [
22
+ {name = "Yang, Bo", email = "yang-bo@yang-bo.com"},
23
+ ]
24
+ classifiers = [
25
+ "Development Status :: 3 - Alpha",
26
+ "License :: OSI Approved :: MIT License",
27
+ "Programming Language :: Python :: 3.13",
28
+ "Programming Language :: Python :: 3.14",
29
+ ]
30
+
31
+ [tool.hatch.metadata.hooks.uv-dynamic-versioning]
32
+ dependencies = [
33
+ "mixinv2=={{ version }}",
34
+ ]
35
+
36
+ [tool.uv]
37
+ sources = {mixinv2 = {workspace = true}}
38
+
39
+ [tool.hatch.build.targets.wheel]
40
+ packages = ["src/mixinv2_library"]
41
+ only-include = ["src/mixinv2_library"]
42
+ sources = ["src"]
43
+
44
+ [project.urls]
45
+ Repository = "https://github.com/Atry/overlay"
@@ -0,0 +1,13 @@
1
+ NumberFactory: []
2
+ BinNatFactory:
3
+ - [NumberFactory]
4
+ - Product: []
5
+ Zero:
6
+ - [Product]
7
+ Even:
8
+ - [Product]
9
+ - half: [Product]
10
+ Odd:
11
+ - [Product]
12
+ - halfOfPredecessor: [Product]
13
+ BinNat: [BinNatFactory, Product]
@@ -0,0 +1,45 @@
1
+ - [BinNatVisitor]
2
+ - BinNatFactory:
3
+ Product:
4
+ Decrement:
5
+ decreased: [Product]
6
+ Zero:
7
+ Decrement:
8
+ decreased: [Zero]
9
+ Even:
10
+ half:
11
+ Decrement:
12
+ decreased: [Product]
13
+ Decrement:
14
+ _HalfVisitor:
15
+ - [Even, ~, half, Visitor]
16
+ - VisitZero:
17
+ decreased: [Zero]
18
+ VisitEven:
19
+ decreased:
20
+ - [Odd]
21
+ - halfOfPredecessor: [Even, ~, half, Decrement, decreased]
22
+ VisitOdd:
23
+ decreased:
24
+ - [Odd]
25
+ - halfOfPredecessor: [Even, ~, half, Decrement, decreased]
26
+ Visit:
27
+ decreased: [Product]
28
+ decreased: [_HalfVisitor, Visit, decreased]
29
+ Odd:
30
+ Decrement:
31
+ _HalfVisitor:
32
+ - [Odd, ~, halfOfPredecessor, Visitor]
33
+ - VisitZero:
34
+ decreased: [Zero]
35
+ VisitEven:
36
+ decreased:
37
+ - [Even]
38
+ - half: [Odd, ~, halfOfPredecessor]
39
+ VisitOdd:
40
+ decreased:
41
+ - [Even]
42
+ - half: [Odd, ~, halfOfPredecessor]
43
+ Visit:
44
+ decreased: [Product]
45
+ decreased: [_HalfVisitor, Visit, decreased]
@@ -0,0 +1,65 @@
1
+ - [BinNatVisitor]
2
+ - [BooleanData]
3
+ - BinNatFactory:
4
+ - Product:
5
+ Equal:
6
+ other: [Product]
7
+ equal: [BinNatEquality, ~, Boolean]
8
+ Zero:
9
+ Equal:
10
+ other: [Product]
11
+ _OtherVisitor:
12
+ - [other, Visitor]
13
+ - VisitZero:
14
+ equal: [BinNatEquality, ~, BooleanFactory, "True"]
15
+ VisitEven:
16
+ equal: [BinNatEquality, ~, BooleanFactory, "False"]
17
+ VisitOdd:
18
+ equal: [BinNatEquality, ~, BooleanFactory, "False"]
19
+ Visit:
20
+ equal: [BinNatEquality, ~, Boolean]
21
+ equal: [_OtherVisitor, Visit, equal]
22
+ Even:
23
+ half:
24
+ Equal:
25
+ equal: [BinNatEquality, ~, Boolean]
26
+ Equal:
27
+ other:
28
+ - [Product]
29
+ - half: [Product]
30
+ _recursiveEquality:
31
+ - [Even, ~, half, Equal]
32
+ - other: [Equal, ~, other, half]
33
+ _OtherVisitor:
34
+ - [other, Visitor]
35
+ - VisitZero:
36
+ equal: [BinNatEquality, ~, BooleanFactory, "False"]
37
+ VisitEven:
38
+ equal: [_recursiveEquality, equal]
39
+ VisitOdd:
40
+ equal: [BinNatEquality, ~, BooleanFactory, "False"]
41
+ Visit:
42
+ equal: [BinNatEquality, ~, Boolean]
43
+ equal: [_OtherVisitor, Visit, equal]
44
+ Odd:
45
+ halfOfPredecessor:
46
+ Equal:
47
+ equal: [BinNatEquality, ~, Boolean]
48
+ Equal:
49
+ other:
50
+ - [Product]
51
+ - halfOfPredecessor: [Product]
52
+ _recursiveEquality:
53
+ - [Odd, ~, halfOfPredecessor, Equal]
54
+ - other: [Equal, ~, other, halfOfPredecessor]
55
+ _OtherVisitor:
56
+ - [other, Visitor]
57
+ - VisitZero:
58
+ equal: [BinNatEquality, ~, BooleanFactory, "False"]
59
+ VisitEven:
60
+ equal: [BinNatEquality, ~, BooleanFactory, "False"]
61
+ VisitOdd:
62
+ equal: [_recursiveEquality, equal]
63
+ Visit:
64
+ equal: [BinNatEquality, ~, Boolean]
65
+ equal: [_OtherVisitor, Visit, equal]
@@ -0,0 +1,21 @@
1
+ - [BinNatData]
2
+ - BinNatFactory:
3
+ Product:
4
+ increment: [Product]
5
+ Zero:
6
+ increment:
7
+ - [Odd]
8
+ - halfOfPredecessor:
9
+ - [Zero]
10
+ Even:
11
+ half:
12
+ increment: [Product]
13
+ increment:
14
+ - [Odd]
15
+ - halfOfPredecessor: [Even, ~, half]
16
+ Odd:
17
+ halfOfPredecessor:
18
+ increment: [Product]
19
+ increment:
20
+ - [Even]
21
+ - half: [Odd, ~, halfOfPredecessor, increment]
@@ -0,0 +1,71 @@
1
+ - [BinNatVisitor]
2
+ - [BinNatIncrement]
3
+ - BinNatFactory:
4
+ Product:
5
+ Plus:
6
+ sum: [Product]
7
+ Zero:
8
+ Plus:
9
+ addend: [Product]
10
+ sum: [addend]
11
+ Even:
12
+ half:
13
+ Plus:
14
+ sum: [Product]
15
+ Plus:
16
+ addend:
17
+ - [Product]
18
+ - half: [Product]
19
+ - halfOfPredecessor: [Product]
20
+ _AddendVisitor:
21
+ - [addend, Visitor]
22
+ - VisitZero:
23
+ sum: [Even, ~]
24
+ VisitEven:
25
+ _recursiveAddition:
26
+ - [Even, ~, half, Plus]
27
+ - addend: [Plus, ~, addend, half]
28
+ sum:
29
+ - [Even]
30
+ - half: [_recursiveAddition, sum]
31
+ VisitOdd:
32
+ _recursiveAddition:
33
+ - [Even, ~, half, Plus]
34
+ - addend: [Plus, ~, addend, halfOfPredecessor]
35
+ sum:
36
+ - [Odd]
37
+ - halfOfPredecessor: [_recursiveAddition, sum]
38
+ Visit:
39
+ sum: [Product]
40
+ sum: [_AddendVisitor, Visit, sum]
41
+ Odd:
42
+ halfOfPredecessor:
43
+ Plus:
44
+ sum: [Product]
45
+ increment: [Product]
46
+ Plus:
47
+ addend:
48
+ - [Product]
49
+ - half: [Product]
50
+ - halfOfPredecessor: [Product]
51
+ _AddendVisitor:
52
+ - [addend, Visitor]
53
+ - VisitZero:
54
+ sum: [Odd, ~]
55
+ VisitEven:
56
+ _recursiveAddition:
57
+ - [Odd, ~, halfOfPredecessor, Plus]
58
+ - addend: [Plus, ~, addend, half]
59
+ sum:
60
+ - [Odd]
61
+ - halfOfPredecessor: [_recursiveAddition, sum]
62
+ VisitOdd:
63
+ _recursiveAddition:
64
+ - [Odd, ~, halfOfPredecessor, Plus]
65
+ - addend: [Plus, ~, addend, halfOfPredecessor]
66
+ sum:
67
+ - [Even]
68
+ - half: [_recursiveAddition, sum, increment]
69
+ Visit:
70
+ sum: [Product]
71
+ sum: [_AddendVisitor, Visit, sum]
@@ -0,0 +1,19 @@
1
+ - [BinNatData]
2
+ - BinNatFactory:
3
+ Product:
4
+ Visitor:
5
+ Visit: []
6
+ Zero:
7
+ Visitor:
8
+ - VisitZero: []
9
+ Visit: [VisitZero]
10
+ Even:
11
+ half: [Product]
12
+ Visitor:
13
+ - VisitEven: []
14
+ Visit: [VisitEven]
15
+ Odd:
16
+ halfOfPredecessor: [Product]
17
+ Visitor:
18
+ - VisitOdd: []
19
+ Visit: [VisitOdd]
@@ -0,0 +1,15 @@
1
+ - [BooleanData]
2
+ - BooleanFactory:
3
+ Product:
4
+ And:
5
+ other: [Product]
6
+ and: [Product]
7
+ "True":
8
+ And:
9
+ other: [Product]
10
+ and: [other]
11
+
12
+ "False":
13
+ And:
14
+ other: [Product]
15
+ and: ["False"]
@@ -0,0 +1,5 @@
1
+ BooleanFactory:
2
+ Product: []
3
+ "True": [Product]
4
+ "False": [Product]
5
+ Boolean: [BooleanFactory, Product]
@@ -0,0 +1,15 @@
1
+ - [BooleanNegation]
2
+ - BooleanFactory:
3
+ Product:
4
+ Equal:
5
+ other: [Product]
6
+ equal: [Product]
7
+ "True":
8
+ Equal:
9
+ other: [Product]
10
+ equal: [other]
11
+
12
+ "False":
13
+ Equal:
14
+ other: [Product]
15
+ equal: [other, not]
@@ -0,0 +1,8 @@
1
+ - [BooleanData]
2
+ - BooleanFactory:
3
+ Product:
4
+ not: [Product]
5
+ "True":
6
+ not: ["False"]
7
+ "False":
8
+ not: ["True"]
@@ -0,0 +1,15 @@
1
+ - [BooleanData]
2
+ - BooleanFactory:
3
+ Product:
4
+ Or:
5
+ other: [Product]
6
+ or: [Product]
7
+ "True":
8
+ Or:
9
+ other: [Product]
10
+ or: ["True"]
11
+
12
+ "False":
13
+ Or:
14
+ other: [Product]
15
+ or: [other]
@@ -0,0 +1,14 @@
1
+ - [BooleanData]
2
+ - BooleanFactory:
3
+ Product:
4
+ Visitor:
5
+ Visit: []
6
+ "True":
7
+ Visitor:
8
+ - VisitTrue: []
9
+ Visit: [VisitTrue]
10
+
11
+ "False":
12
+ Visitor:
13
+ - VisitFalse: []
14
+ Visit: [VisitFalse]
@@ -0,0 +1,10 @@
1
+ NumberFactory: []
2
+ NatFactory:
3
+ - [NumberFactory]
4
+ - Product: []
5
+ Zero:
6
+ - [Product]
7
+ Successor:
8
+ - [Product]
9
+ - predecessor: [Product]
10
+ Nat: [NatFactory, Product]
@@ -0,0 +1,11 @@
1
+ - [NatData]
2
+ - NatFactory:
3
+ Product:
4
+ Decrement:
5
+ decreased: [Product]
6
+ Zero:
7
+ Decrement:
8
+ decreased: [Zero]
9
+ Successor:
10
+ Decrement:
11
+ decreased: [Successor, ~, predecessor]
@@ -0,0 +1,39 @@
1
+ - [NatVisitor]
2
+ - NatFactory:
3
+ - Product:
4
+ Equal:
5
+ other: [Product]
6
+ equal: [NatEquality, ~, Boolean]
7
+ Zero:
8
+ Equal:
9
+ other: [Product]
10
+ _OtherVisitor:
11
+ - [other, Visitor]
12
+ - VisitZero:
13
+ equal: [NatEquality, ~, BooleanFactory, "True"]
14
+ VisitSuccessor:
15
+ equal: [NatEquality, ~, BooleanFactory, "False"]
16
+ Visit:
17
+ equal: [NatEquality, ~, Boolean]
18
+ equal: [_OtherVisitor, Visit, equal]
19
+ Successor:
20
+ predecessor:
21
+ Equal:
22
+ equal: [NatEquality, ~, Boolean]
23
+ Equal:
24
+ other:
25
+ - [Product]
26
+ - predecessor: [Product]
27
+ _recursiveEquality:
28
+ - [Successor, ~, predecessor, Equal]
29
+ - other: [Equal, ~, other, predecessor]
30
+ _OtherVisitor:
31
+ - [other, Visitor]
32
+ - VisitZero:
33
+ equal: [NatEquality, ~, BooleanFactory, "False"]
34
+ VisitSuccessor:
35
+ equal: [_recursiveEquality, equal]
36
+ Visit:
37
+ equal: [NatEquality, ~, Boolean]
38
+ equal: [_OtherVisitor, Visit, equal]
39
+ - [BooleanData]
@@ -0,0 +1,22 @@
1
+ - [NatData]
2
+ - NatFactory:
3
+ Product:
4
+ Plus:
5
+ sum: [Product]
6
+ Zero:
7
+ Plus:
8
+ addend: [Product]
9
+ sum: [addend]
10
+ Successor:
11
+ predecessor:
12
+ Plus:
13
+ sum: [Product]
14
+ Plus:
15
+ addend: [Product]
16
+ _increasedAddend:
17
+ - [Successor]
18
+ - predecessor: [addend]
19
+ _recursiveAddition:
20
+ - [Successor, ~, predecessor, Plus]
21
+ - addend: [_increasedAddend]
22
+ sum: [_recursiveAddition, sum]
@@ -0,0 +1,16 @@
1
+ - [NatData]
2
+ - NatFactory:
3
+ Product:
4
+ Visitor:
5
+ Visit: []
6
+ Zero:
7
+ Visitor:
8
+ - VisitZero: []
9
+ Visit: [VisitZero]
10
+
11
+ Successor:
12
+ predecessor: [Product]
13
+
14
+ Visitor:
15
+ - VisitSuccessor: []
16
+ Visit: [VisitSuccessor]
@@ -0,0 +1,12 @@
1
+ - NumberFactory:
2
+ Zero: [Product]
3
+ Product:
4
+ Equal:
5
+ other: [Product]
6
+ equal: [NumberIsZero, ~, Boolean]
7
+ IsZero:
8
+ _equalZero:
9
+ - [Equal]
10
+ - other: [Zero]
11
+ isZero: [_equalZero, equal]
12
+ - [Builtin, BooleanData]
@@ -0,0 +1,132 @@
1
+ from typing import Protocol
2
+
3
+ from mixinv2 import (
4
+ LexicalReference,
5
+ extend,
6
+ merge,
7
+ patch,
8
+ patch_many,
9
+ public,
10
+ scope,
11
+ )
12
+ from mixinv2._core import MappingScopeDefinition
13
+
14
+
15
+ class _NatScope(Protocol):
16
+ pythonValues: frozenset[int]
17
+
18
+
19
+ class _BinNatScope(Protocol):
20
+ pythonValues: frozenset[int]
21
+
22
+
23
+ @public
24
+ @extend(LexicalReference(path=("NatData",)))
25
+ @scope
26
+ class NatToPython:
27
+ @public
28
+ @scope
29
+ class NatFactory:
30
+ @public
31
+ @scope
32
+ class Product:
33
+ @public
34
+ @merge
35
+ @staticmethod
36
+ def pythonValues():
37
+ return frozenset
38
+
39
+ @public
40
+ @scope
41
+ class Zero:
42
+ @public
43
+ @patch
44
+ @staticmethod
45
+ def pythonValues():
46
+ return 0
47
+
48
+ @public
49
+ @scope
50
+ class Successor:
51
+ @public
52
+ @patch_many
53
+ @staticmethod
54
+ def pythonValues(predecessor: _NatScope):
55
+ return (value + 1 for value in predecessor.pythonValues)
56
+
57
+
58
+ @public
59
+ @extend(LexicalReference(path=("BinNatData",)))
60
+ @scope
61
+ class BinNatToPython:
62
+ @public
63
+ @scope
64
+ class BinNatFactory:
65
+ @public
66
+ @scope
67
+ class Product:
68
+ @public
69
+ @merge
70
+ @staticmethod
71
+ def pythonValues():
72
+ return frozenset
73
+
74
+ @public
75
+ @scope
76
+ class Zero:
77
+ @public
78
+ @patch
79
+ @staticmethod
80
+ def pythonValues():
81
+ return 0
82
+
83
+ @public
84
+ @scope
85
+ class Even:
86
+ @public
87
+ @patch_many
88
+ @staticmethod
89
+ def pythonValues(half: _BinNatScope):
90
+ return (value * 2 for value in half.pythonValues)
91
+
92
+ @public
93
+ @scope
94
+ class Odd:
95
+ @public
96
+ @patch_many
97
+ @staticmethod
98
+ def pythonValues(halfOfPredecessor: _BinNatScope):
99
+ return (value * 2 + 1 for value in halfOfPredecessor.pythonValues)
100
+
101
+
102
+ @public
103
+ @extend(LexicalReference(path=("BooleanData",)))
104
+ @scope
105
+ class BooleanToPython:
106
+ BooleanFactory = MappingScopeDefinition(
107
+ inherits=(),
108
+ is_public=True,
109
+ underlying={
110
+ "Product": MappingScopeDefinition(
111
+ inherits=(),
112
+ is_public=True,
113
+ underlying={
114
+ "pythonValues": public(merge(lambda: frozenset)),
115
+ },
116
+ ),
117
+ "True": MappingScopeDefinition(
118
+ inherits=(),
119
+ is_public=True,
120
+ underlying={
121
+ "pythonValues": public(patch(lambda: True)),
122
+ },
123
+ ),
124
+ "False": MappingScopeDefinition(
125
+ inherits=(),
126
+ is_public=True,
127
+ underlying={
128
+ "pythonValues": public(patch(lambda: False)),
129
+ },
130
+ ),
131
+ },
132
+ )