boring-math.recursive-functions 0.7.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.
@@ -0,0 +1,50 @@
1
+ # Copyright 2016-2025 Geoffrey R. Scheller
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ Recursive Functions Package
17
+ ===========================
18
+
19
+ Package to explore efficient ways to implement recursive functions.
20
+
21
+ Example recursive functions
22
+ ---------------------------
23
+
24
+ - module: bm.recursive_functions.examples
25
+
26
+ - Ackermann's function
27
+
28
+ - with list
29
+
30
+ - function: bm.recursive_functions.examples.ackermann_list
31
+
32
+ - Fibonacci sequences
33
+
34
+ - with generators
35
+
36
+ - function: bm.recursive_functions.examples.fibonacci_generator
37
+ - function: bm.recursive_functions.examples.rev_fibonacci_generator
38
+
39
+ CLI program entry points
40
+ ------------------------
41
+
42
+ - package: bm.recursive_functions.cli
43
+
44
+ - module: bm.recursive_functions.cli.ackermann
45
+
46
+ """
47
+
48
+ __author__ = 'Geoffrey R. Scheller'
49
+ __copyright__ = 'Copyright (c) 2016-2025 Geoffrey R. Scheller'
50
+ __license__ = 'Apache License 2.0'
@@ -0,0 +1,32 @@
1
+ # Copyright 2016-2025 Geoffrey R. Scheller
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ Entry points for automatically generated CLI scripts
17
+ ----------------------------------------------------
18
+
19
+ The CGI package automatically generates Python scripts in an OS independent way
20
+ using the packaging build backend. This is configured by the `[project.scripts]`
21
+ section in the project's pyproject.toml file.
22
+
23
+ Example applications
24
+ --------------------
25
+
26
+ - Ackermann program: ackermann
27
+
28
+ - bm.recursive_functions.cli.ackermann
29
+
30
+ - uses a Python list to implement recursion
31
+
32
+ """
@@ -0,0 +1,62 @@
1
+ # Copyright 2023-2025 Geoffrey R. Scheller
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ ### Programs to evaluate Ackermann's function
17
+
18
+ .. note::
19
+ The version of the Ackermann's function being used is defined recursively by
20
+
21
+ ackermann(0,n) = n+1 for n >= 0
22
+ ackermann(m,0) = ackermann(m-1,1) for m >= 0
23
+ ackermann(m,n) = ackermann(m-1, ackermann(m, n-1)) for m,n > 0
24
+
25
+ Ackermann's function is an example of a computable but not primitively
26
+ recursive function.
27
+
28
+ - program **ackermann** uses a Python List to implement recursion
29
+
30
+ """
31
+
32
+ from __future__ import annotations
33
+
34
+ import sys
35
+ from boring_math.recursive_functions.examples import ackermann_list
36
+
37
+
38
+ def ackermann_cli() -> None:
39
+ """Evaluate Ackermann's function simulating recursion with a Python list.
40
+
41
+ Usage: ``ackermann m n``
42
+
43
+ - gets installed into the virtual environment
44
+ - becomes numerically intractable after m=4 n=1
45
+
46
+ """
47
+ args = sys.argv[1:]
48
+ if len(args) == 2:
49
+ try:
50
+ m = int(args[0])
51
+ n = int(args[1])
52
+ if m < 0 or n < 0:
53
+ print('Error: Negative integer argument given', file=sys.stderr)
54
+ sys.exit(1)
55
+ except ValueError:
56
+ print('Error: Non-integer argument given', file=sys.stderr)
57
+ sys.exit(1)
58
+ else:
59
+ print('Error: ackermann.py takes 2 arguments', file=sys.stderr)
60
+ sys.exit(1)
61
+
62
+ print(ackermann_list(m, n))
File without changes
@@ -0,0 +1,114 @@
1
+ # Copyright 2016-2025 Geoffrey R. Scheller
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ Examples of recursive functions
17
+ ===============================
18
+
19
+ Examples implementations for various recursive functions.
20
+
21
+ Ackermann function
22
+ ------------------
23
+
24
+ Ackermann's function is an example of a function that is computable
25
+ but not primitively recursive. It quickly becomes computationally
26
+ intractable for relatively small values of m.
27
+
28
+ Ackermann function is defined recursively by
29
+
30
+ - ``ackermann(0,n)=n+1 for n >= 0``
31
+ - ``ackermann(m,0)=ackermann(m-1,1) for m >= 0``
32
+ - ``ackermann(m,n)=ackermann(m-1, ackermann(m,n-1)) for m,n > 0``
33
+
34
+ Fibonacci sequences
35
+ -------------------
36
+
37
+ The Fibonacci sequence is usually taught in grade school as the
38
+ first recursive function that is not either an arithmetic or geometric
39
+ sequence.
40
+
41
+ The Fibonacci sequence is traditionally defined as
42
+
43
+ - ``f₁ = 1``
44
+ - ``f₂ = 1``
45
+ - ``fₙ₊₂ = fₙ₊₁ + fₙ``
46
+
47
+ Actually, a Fibonacci extends can extend in both directions.
48
+
49
+ - ..., 13, -8, 5, -3, 2, -1, 1, 0, 1, 1, 2, 3, 5, 6, 13, ...
50
+
51
+ """
52
+
53
+ from __future__ import annotations
54
+
55
+ from collections.abc import Iterator
56
+
57
+ __all__ = ['ackermann_list', 'fibonacci_generator', 'rev_fibonacci_generator']
58
+
59
+
60
+ def ackermann_list(m: int, n: int) -> int:
61
+ """Ackermann's Function.
62
+
63
+ Evaluate Ackermann's function simulating recursion with a list.
64
+
65
+ .. note::
66
+ This implementation models the recursion with a Python list instead of Python's
67
+ "call stack". It then evaluates the innermost ackermann function first. To
68
+ naively use call stack recursion would result in the loss of stack safety.
69
+
70
+ """
71
+ acker = [m, n]
72
+
73
+ while len(acker) > 1:
74
+ mm, nn = acker[-2:]
75
+ if mm < 1:
76
+ acker[-1] = acker.pop() + 1
77
+ elif nn < 1:
78
+ acker[-2] = acker[-2] - 1
79
+ acker[-1] = 1
80
+ else:
81
+ acker[-2] = mm - 1
82
+ acker[-1] = mm
83
+ acker.append(nn - 1)
84
+ return acker[0]
85
+
86
+
87
+ def fibonacci_generator(fib0: int = 0, fib1: int = 1) -> Iterator[int]:
88
+ """Fibonacci iterator.
89
+
90
+ Generate a Fibonacci sequence instead of recursively evaluating it.
91
+
92
+ - returns an iterator to a Fibonacci sequence
93
+ - beginning fib0, fib1, fib0+fib1, ...
94
+ - default yields 0, 1, 1. 2, 3, 5, 8, 13, ...
95
+
96
+ """
97
+ while True:
98
+ yield fib0
99
+ fib0, fib1 = fib1, fib0 + fib1
100
+
101
+
102
+ def rev_fibonacci_generator(fib0: int = 0, fib1: int = 1) -> Iterator[int]:
103
+ """Reverse Fibonacci iterator.
104
+
105
+ Generate a reverse Fibonacci sequence instead of recursively evaluating it.
106
+
107
+ - Returns iterator iterating over the Fibonacci sequence in reverse order
108
+ - beginning fib1, fib0, fib1-fib0, ...
109
+ - default yields 1, -1, 2, -3, 5, -8, 13, ...
110
+
111
+ """
112
+ while True:
113
+ fib0, fib1 = fib1, fib0 - fib1
114
+ yield fib0
File without changes
@@ -0,0 +1,117 @@
1
+ Metadata-Version: 2.4
2
+ Name: boring-math.recursive-functions
3
+ Version: 0.7.0
4
+ Summary: Recursive Functions Package
5
+ Keywords: ackermann,fibonacci,recursive,recursive functions
6
+ Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
7
+ Requires-Python: >=3.12
8
+ Description-Content-Type: text/markdown
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Framework :: Pytest
11
+ Classifier: Intended Audience :: Education
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Typing :: Typed
16
+ License-File: LICENSE
17
+ Project-URL: Changelog, https://github.com/grscheller/bm-recursive-functions/blob/main/CHANGELOG.md
18
+ Project-URL: Documentation, https://grscheller.github.io/bm-docs/recursive-functions/
19
+ Project-URL: Homepage, https://github.com/grscheller/bm-docs/blob/main/README.md
20
+ Project-URL: Source, https://github.com/grscheller/bm-recursive-functions
21
+
22
+ # Boring Math Library - Recursive functions
23
+
24
+ The purpose of this project is to explore different ways to efficiently
25
+ implement recursive functions in Python.
26
+
27
+ ## Repos and Documentation
28
+
29
+ ### Repositories
30
+
31
+ - [boring-math.recursive-functions][1] project on *PyPI*
32
+ - [Source code][2] on *GitHub*
33
+
34
+ ### Detailed documentation
35
+
36
+ - [Detailed API documentation][3] on *GH-Pages*
37
+
38
+ ## Overview
39
+
40
+ - Recursive functions
41
+ - [Ackermann Function](#ackermanns-function)
42
+ - [Fibonacci Sequences](#fibonacci-sequences)
43
+ - CLI applications
44
+ - [Ackermann CGI programs](#ackermann-cli-programs)
45
+
46
+ This project is part of the [Boring Math][4] **boring-math** namespace project.
47
+
48
+ ### Recursive functions
49
+
50
+ Computable recursive functions can be defined with previously defined or not yet
51
+ defined values. Functions defined using previously defined values having
52
+ "base cases" are called "primitively recursive functions." Not all
53
+ computable functions are primitively recursive.
54
+
55
+ #### Ackermann's Function
56
+
57
+ - Function **ackermann_list**(m: int, n: int) -> int
58
+ - is a total computable function that is not primitive recursive
59
+ - becomes numerically intractable after `m=4`
60
+ - see [CLI section](#ackermann-cli-programs) below for a mathematical definition
61
+
62
+ #### Fibonacci Sequences
63
+
64
+ - Function **fibonacci**(f0: int=0, f1: int=1) -> Iterator[int]
65
+
66
+ - returns a *Fibonacci* sequence iterator where
67
+ - `f(0) = f0` and `f(1) = f1`
68
+ - `f(n) = f(n-1) + f(n-2)`
69
+ - yield defaults to `0, 1, 1, 2, 3, 5, 8, 13, 21, ...`
70
+
71
+ - Function **rev_fibonacci**(f0: int=0, f1: int=1) -> Iterator[int]
72
+
73
+ - returns a *Reverse Fibonacci* sequence iterator where
74
+ - `rf(0) = f0` and `rf(1) = f1`
75
+ - `rf(n) = rf(n-1) - rf(n-2)`
76
+ - `rf(0) = fib(-1) = 1`
77
+ - `rf(1) = fib(-2) = -1`
78
+ - `rf(2) = fib(-3) = 2`
79
+ - `rf(3) = fib(-4) = -3`
80
+ - `rf(4) = fib(-5) = 5`
81
+ - yield defaults to `1, -1, 2, -3, 5, -8, 13, -21, ...`
82
+
83
+ ______________________________________________________________________
84
+
85
+ ## CLI Applications
86
+
87
+ Implemented in an OS and package build tool independent way via the
88
+ project.scripts section of pyproject.toml.
89
+
90
+ ### Ackermann CLI programs
91
+
92
+ Ackermann, a student of Hilbert, discovered early examples of totally
93
+ computable functions that are not primitively recursive.
94
+
95
+ A [fairly standard][5] definition of the Ackermann function is
96
+ recursively defined for `m,n >= 0` by
97
+
98
+ ```
99
+ ackermann(0,n) = n+1
100
+ ackermann(m,0) = ackermann(m-1,1)
101
+ ackermann(m,n) = ackermann(m-1, ackermann(m, n-1))
102
+ ```
103
+
104
+ #### CLI program **ackermann_list**
105
+
106
+ - Given two non-negative integers, evaluates Ackermann's function
107
+ - Implements the recursion via a Python array
108
+ - **Usage:** `ackerman_list m n`
109
+
110
+ ______________________________________________________________________
111
+
112
+ [1]: https://pypi.org/project/boring-math.recursive-functions/
113
+ [2]: https://github.com/grscheller/bm-recursive-functions/
114
+ [3]: https://grscheller.github.io/boring-math/recursive-functions/development/build/html/
115
+ [4]: https://grscheller.github.io/boring-math/
116
+ [5]: https://mathworld.wolfram.com/AckermannFunction.html
117
+
@@ -0,0 +1,11 @@
1
+ boring_math/recursive_functions/__init__.py,sha256=v_D6C0wPzRAvM7O--eAjpUpgkbJWl3EZZC00r8Q_XEM,1405
2
+ boring_math/recursive_functions/examples.py,sha256=IurNEeUDffsY-F-0znC2v6l_qmtoFJjiDSgiy6Ce798,3419
3
+ boring_math/recursive_functions/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ boring_math/recursive_functions/cli/__init__.py,sha256=9Oxu8i0RhCEhV-3_38tV69eJQC_6Q38QUCZxq201M5Q,1079
5
+ boring_math/recursive_functions/cli/ackermann.py,sha256=FIfIfUyjX4dxpjZrrRuN67yoTKWQlQMgJEXT5ZAQD88,2002
6
+ boring_math/recursive_functions/cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ boring_math_recursive_functions-0.7.0.dist-info/entry_points.txt,sha256=0pGiMcvZOj2HzilcQew9vqsPmqnLu_2n8eF33GFDBAE,80
8
+ boring_math_recursive_functions-0.7.0.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
9
+ boring_math_recursive_functions-0.7.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
10
+ boring_math_recursive_functions-0.7.0.dist-info/METADATA,sha256=IOy1Jt_iYB0WJ-GKCkXtfLxu86xZb_cOH1RQKdK3Y4Y,4034
11
+ boring_math_recursive_functions-0.7.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: flit 3.12.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ ackermann=bm.recursive_functions.cli.ackermann:ackermann_cli
3
+
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS