sublation 0.2.0__tar.gz → 0.3.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.
- sublation-0.3.0/MANIFEST.in +3 -0
- {sublation-0.2.0/src/sublation.egg-info → sublation-0.3.0}/PKG-INFO +8 -10
- {sublation-0.2.0 → sublation-0.3.0}/README.md +3 -4
- sublation-0.3.0/pyproject.toml +35 -0
- sublation-0.3.0/setup.cfg +4 -0
- {sublation-0.2.0 → sublation-0.3.0}/src/sublation/__init__.py +1 -1
- {sublation-0.2.0 → sublation-0.3.0}/src/sublation/core.py +12 -10
- {sublation-0.2.0 → sublation-0.3.0/src/sublation.egg-info}/PKG-INFO +8 -10
- {sublation-0.2.0 → sublation-0.3.0}/src/sublation.egg-info/SOURCES.txt +4 -4
- {sublation-0.2.0 → sublation-0.3.0}/src/sublation.egg-info/requires.txt +1 -0
- sublation-0.3.0/tests/test_core.py +64 -0
- sublation-0.3.0/tests/test_properties.py +62 -0
- sublation-0.3.0/tests/test_validation.py +65 -0
- sublation-0.2.0/MANIFEST.in +0 -4
- sublation-0.2.0/requirements.txt +0 -33
- sublation-0.2.0/setup.cfg +0 -46
- sublation-0.2.0/setup.py +0 -3
- sublation-0.2.0/tests/test_core.py +0 -34
- {sublation-0.2.0 → sublation-0.3.0}/LICENSE +0 -0
- {sublation-0.2.0 → sublation-0.3.0}/src/sublation/py.typed +0 -0
- {sublation-0.2.0 → sublation-0.3.0}/src/sublation/truths.py +0 -0
- {sublation-0.2.0 → sublation-0.3.0}/src/sublation.egg-info/dependency_links.txt +0 -0
- {sublation-0.2.0 → sublation-0.3.0}/src/sublation.egg-info/top_level.txt +0 -0
- {sublation-0.2.0 → sublation-0.3.0}/tests/test_truths.py +0 -0
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sublation
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Non-boolean truth structures for dialectical reasoning, an alternative to boolean binarism, inspired by Hegelian logic.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
License: MIT
|
|
5
|
+
Author-email: Germano Castanho <germanocastanho@proton.me>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/germanocastanho/sublation-lib
|
|
9
8
|
Classifier: Development Status :: 3 - Alpha
|
|
10
9
|
Classifier: Intended Audience :: Science/Research
|
|
11
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
12
10
|
Classifier: Programming Language :: Python :: 3
|
|
13
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
12
|
Classifier: Programming Language :: Python :: 3.13
|
|
@@ -19,13 +17,14 @@ Description-Content-Type: text/markdown
|
|
|
19
17
|
License-File: LICENSE
|
|
20
18
|
Provides-Extra: dev
|
|
21
19
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
20
|
+
Requires-Dist: hypothesis>=6.0; extra == "dev"
|
|
22
21
|
Requires-Dist: build; extra == "dev"
|
|
23
22
|
Requires-Dist: twine; extra == "dev"
|
|
24
23
|
Dynamic: license-file
|
|
25
24
|
|
|
26
25
|
# 🧠 Sublation
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
Inspired by Hegel's dialectical logic, this library formalizes dialectical logic as a case of four-valued reasoning (true / false / contradictory / indeterminate), grounded in Belnap–Dunn logic (FDE) and the bilattice structure behind paraconsistent annotated logics such as Eτ.
|
|
29
28
|
|
|
30
29
|
# ✨ Main Features
|
|
31
30
|
|
|
@@ -37,10 +36,9 @@ This library formalizes dialectical logic as a case of four-valued reasoning (tr
|
|
|
37
36
|
# ✅ Prerequisites
|
|
38
37
|
|
|
39
38
|
- Python 3.12+ installed on your machine
|
|
40
|
-
- Astral uv package manager (optional)
|
|
41
39
|
- Dependencies listed in `requirements.txt`
|
|
42
40
|
|
|
43
|
-
# ⚙️ Installation
|
|
41
|
+
# ⚙️ Local Installation
|
|
44
42
|
|
|
45
43
|
### For regular use:
|
|
46
44
|
|
|
@@ -83,7 +81,7 @@ pip install -e ".[dev]"
|
|
|
83
81
|
pytest
|
|
84
82
|
```
|
|
85
83
|
|
|
86
|
-
# 🚀
|
|
84
|
+
# 🚀 Getting Started
|
|
87
85
|
|
|
88
86
|
```python
|
|
89
87
|
from sublation import Thesis, Antithesis, Synthesis
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 🧠 Sublation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Inspired by Hegel's dialectical logic, this library formalizes dialectical logic as a case of four-valued reasoning (true / false / contradictory / indeterminate), grounded in Belnap–Dunn logic (FDE) and the bilattice structure behind paraconsistent annotated logics such as Eτ.
|
|
4
4
|
|
|
5
5
|
# ✨ Main Features
|
|
6
6
|
|
|
@@ -12,10 +12,9 @@ This library formalizes dialectical logic as a case of four-valued reasoning (tr
|
|
|
12
12
|
# ✅ Prerequisites
|
|
13
13
|
|
|
14
14
|
- Python 3.12+ installed on your machine
|
|
15
|
-
- Astral uv package manager (optional)
|
|
16
15
|
- Dependencies listed in `requirements.txt`
|
|
17
16
|
|
|
18
|
-
# ⚙️ Installation
|
|
17
|
+
# ⚙️ Local Installation
|
|
19
18
|
|
|
20
19
|
### For regular use:
|
|
21
20
|
|
|
@@ -58,7 +57,7 @@ pip install -e ".[dev]"
|
|
|
58
57
|
pytest
|
|
59
58
|
```
|
|
60
59
|
|
|
61
|
-
# 🚀
|
|
60
|
+
# 🚀 Getting Started
|
|
62
61
|
|
|
63
62
|
```python
|
|
64
63
|
from sublation import Thesis, Antithesis, Synthesis
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sublation"
|
|
7
|
+
version = "0.3.0"
|
|
8
|
+
description = "Non-boolean truth structures for dialectical reasoning, an alternative to boolean binarism, inspired by Hegelian logic."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.12"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "Germano Castanho", email = "germanocastanho@proton.me" }]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Science/Research",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Programming Language :: Python :: 3.13",
|
|
20
|
+
"Programming Language :: Python :: 3.14",
|
|
21
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Homepage = "https://github.com/germanocastanho/sublation-lib"
|
|
26
|
+
|
|
27
|
+
[project.optional-dependencies]
|
|
28
|
+
dev = ["pytest>=7.0", "hypothesis>=6.0", "build", "twine"]
|
|
29
|
+
|
|
30
|
+
[tool.setuptools.packages.find]
|
|
31
|
+
where = ["src"]
|
|
32
|
+
exclude = ["tests", "tests.*"]
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.package-data]
|
|
35
|
+
sublation = ["py.typed"]
|
|
@@ -45,15 +45,16 @@ class Dialectical:
|
|
|
45
45
|
|
|
46
46
|
class Thesis(Dialectical):
|
|
47
47
|
"""
|
|
48
|
-
Thesis: a proposition asserted as posited.
|
|
48
|
+
Thesis: a proposition asserted as posited. A bool thesis infers its complement (asserting the thesis denies its antithesis), a continuous degree does not (it asserts nothing against). Either inference can be overridden by passing antithesis explicitly.
|
|
49
49
|
"""
|
|
50
50
|
|
|
51
51
|
def __init__(
|
|
52
52
|
self,
|
|
53
|
-
thesis: bool = True,
|
|
54
|
-
antithesis: bool | None = None,
|
|
53
|
+
thesis: bool | float = True,
|
|
54
|
+
antithesis: bool | float | None = None,
|
|
55
55
|
) -> None:
|
|
56
|
-
|
|
56
|
+
if antithesis is None:
|
|
57
|
+
antithesis = (not thesis) if isinstance(thesis, bool) else 0.0
|
|
57
58
|
|
|
58
59
|
self.value = TruthValue(mu=float(thesis), lam=float(antithesis))
|
|
59
60
|
self.thesis = self.value.mu >= THRESHOLD
|
|
@@ -62,15 +63,16 @@ class Thesis(Dialectical):
|
|
|
62
63
|
|
|
63
64
|
class Antithesis(Dialectical):
|
|
64
65
|
"""
|
|
65
|
-
Antithesis: a proposition asserted as the negation of a thesis.
|
|
66
|
+
Antithesis: a proposition asserted as the negation of a thesis. A bool antithesis infers its complement (asserting the antithesis denies the thesis), a continuous degree does not (it asserts nothing for). Either inference can be overridden by passing thesis explicitly.
|
|
66
67
|
"""
|
|
67
68
|
|
|
68
69
|
def __init__(
|
|
69
70
|
self,
|
|
70
|
-
antithesis: bool = False,
|
|
71
|
-
thesis: bool | None = None,
|
|
71
|
+
antithesis: bool | float = False,
|
|
72
|
+
thesis: bool | float | None = None,
|
|
72
73
|
) -> None:
|
|
73
|
-
|
|
74
|
+
if thesis is None:
|
|
75
|
+
thesis = (not antithesis) if isinstance(antithesis, bool) else 0.0
|
|
74
76
|
|
|
75
77
|
self.value = TruthValue(mu=float(thesis), lam=float(antithesis))
|
|
76
78
|
self.thesis = self.value.mu >= THRESHOLD
|
|
@@ -91,8 +93,8 @@ class Synthesis(Dialectical):
|
|
|
91
93
|
|
|
92
94
|
def as_thesis(self) -> Thesis:
|
|
93
95
|
"""
|
|
94
|
-
|
|
96
|
+
Re-posits this synthesis as the thesis of the next round. Both degrees are passed explicitly, so the new thesis carries the synthesis's exact `mu`/`lam` rather than a thresholded bool — intermediate certainty survives the chaining. The next round evaluates it against a fresh antithesis.
|
|
95
97
|
"""
|
|
96
98
|
|
|
97
|
-
next_round = Thesis(thesis=self.
|
|
99
|
+
next_round = Thesis(thesis=self.value.mu, antithesis=self.value.lam)
|
|
98
100
|
return next_round
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sublation
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Non-boolean truth structures for dialectical reasoning, an alternative to boolean binarism, inspired by Hegelian logic.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
License: MIT
|
|
5
|
+
Author-email: Germano Castanho <germanocastanho@proton.me>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/germanocastanho/sublation-lib
|
|
9
8
|
Classifier: Development Status :: 3 - Alpha
|
|
10
9
|
Classifier: Intended Audience :: Science/Research
|
|
11
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
12
10
|
Classifier: Programming Language :: Python :: 3
|
|
13
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
12
|
Classifier: Programming Language :: Python :: 3.13
|
|
@@ -19,13 +17,14 @@ Description-Content-Type: text/markdown
|
|
|
19
17
|
License-File: LICENSE
|
|
20
18
|
Provides-Extra: dev
|
|
21
19
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
20
|
+
Requires-Dist: hypothesis>=6.0; extra == "dev"
|
|
22
21
|
Requires-Dist: build; extra == "dev"
|
|
23
22
|
Requires-Dist: twine; extra == "dev"
|
|
24
23
|
Dynamic: license-file
|
|
25
24
|
|
|
26
25
|
# 🧠 Sublation
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
Inspired by Hegel's dialectical logic, this library formalizes dialectical logic as a case of four-valued reasoning (true / false / contradictory / indeterminate), grounded in Belnap–Dunn logic (FDE) and the bilattice structure behind paraconsistent annotated logics such as Eτ.
|
|
29
28
|
|
|
30
29
|
# ✨ Main Features
|
|
31
30
|
|
|
@@ -37,10 +36,9 @@ This library formalizes dialectical logic as a case of four-valued reasoning (tr
|
|
|
37
36
|
# ✅ Prerequisites
|
|
38
37
|
|
|
39
38
|
- Python 3.12+ installed on your machine
|
|
40
|
-
- Astral uv package manager (optional)
|
|
41
39
|
- Dependencies listed in `requirements.txt`
|
|
42
40
|
|
|
43
|
-
# ⚙️ Installation
|
|
41
|
+
# ⚙️ Local Installation
|
|
44
42
|
|
|
45
43
|
### For regular use:
|
|
46
44
|
|
|
@@ -83,7 +81,7 @@ pip install -e ".[dev]"
|
|
|
83
81
|
pytest
|
|
84
82
|
```
|
|
85
83
|
|
|
86
|
-
# 🚀
|
|
84
|
+
# 🚀 Getting Started
|
|
87
85
|
|
|
88
86
|
```python
|
|
89
87
|
from sublation import Thesis, Antithesis, Synthesis
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
LICENSE
|
|
2
2
|
MANIFEST.in
|
|
3
3
|
README.md
|
|
4
|
-
|
|
5
|
-
setup.cfg
|
|
6
|
-
setup.py
|
|
4
|
+
pyproject.toml
|
|
7
5
|
src/sublation/__init__.py
|
|
8
6
|
src/sublation/core.py
|
|
9
7
|
src/sublation/py.typed
|
|
@@ -14,4 +12,6 @@ src/sublation.egg-info/dependency_links.txt
|
|
|
14
12
|
src/sublation.egg-info/requires.txt
|
|
15
13
|
src/sublation.egg-info/top_level.txt
|
|
16
14
|
tests/test_core.py
|
|
17
|
-
tests/
|
|
15
|
+
tests/test_properties.py
|
|
16
|
+
tests/test_truths.py
|
|
17
|
+
tests/test_validation.py
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from sublation import Antithesis, Synthesis, Thesis
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_matches_original_signature_defaults():
|
|
5
|
+
assert Thesis().thesis is True
|
|
6
|
+
assert Thesis().antithesis is False
|
|
7
|
+
assert Antithesis().thesis is True
|
|
8
|
+
assert Antithesis().antithesis is False
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def test_contradiction_is_detectable():
|
|
12
|
+
t = Thesis(True)
|
|
13
|
+
a = Antithesis(True)
|
|
14
|
+
s = Synthesis(t, a)
|
|
15
|
+
assert s.contradiction() is True
|
|
16
|
+
assert s.becoming() is False
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def test_empty_antithesis_resolves_without_tension():
|
|
20
|
+
t = Thesis(True)
|
|
21
|
+
a = Antithesis(False)
|
|
22
|
+
s = Synthesis(t, a)
|
|
23
|
+
assert s.contradiction() is False
|
|
24
|
+
assert s.becoming() is True
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_continuous_thesis_keeps_its_degree_without_inferring_a_complement():
|
|
28
|
+
t = Thesis(0.7)
|
|
29
|
+
assert (t.value.mu, t.value.lam) == (0.7, 0.0)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def test_continuous_antithesis_keeps_its_degree_without_inferring_a_complement():
|
|
33
|
+
a = Antithesis(0.7)
|
|
34
|
+
assert (a.value.mu, a.value.lam) == (0.0, 0.7)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def test_continuous_degrees_are_taken_verbatim_when_both_are_given():
|
|
38
|
+
t = Thesis(0.7, 0.2)
|
|
39
|
+
assert (t.value.mu, t.value.lam) == (0.7, 0.2)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def test_float_zero_is_indeterminate_unlike_bool_false():
|
|
43
|
+
quiet = Thesis(0.0)
|
|
44
|
+
denied = Thesis(False)
|
|
45
|
+
assert (quiet.value.mu, quiet.value.lam) == (0.0, 0.0)
|
|
46
|
+
assert quiet.sublation() is False
|
|
47
|
+
assert (denied.value.mu, denied.value.lam) == (0.0, 1.0)
|
|
48
|
+
assert denied.sublation() is True
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def test_synthesis_chains_into_new_thesis():
|
|
52
|
+
t1 = Thesis(True)
|
|
53
|
+
a1 = Antithesis(False)
|
|
54
|
+
s1 = Synthesis(t1, a1)
|
|
55
|
+
t2 = s1.as_thesis()
|
|
56
|
+
assert isinstance(t2, Thesis)
|
|
57
|
+
assert t2.thesis == s1.thesis
|
|
58
|
+
assert t2.antithesis == s1.antithesis
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def test_as_thesis_preserves_continuous_degrees():
|
|
62
|
+
s = Synthesis(Thesis(0.7), Antithesis(0.2))
|
|
63
|
+
t = s.as_thesis()
|
|
64
|
+
assert (t.value.mu, t.value.lam) == (0.7, 0.2)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Property-based invariants for TruthValue. The four combining operations are
|
|
3
|
+
defined by min/max alone, so results are exact degrees of the inputs and can
|
|
4
|
+
be compared without float tolerance. Values are compared as (mu, lam) tuples,
|
|
5
|
+
since TruthValue defines no __eq__.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from hypothesis import given
|
|
9
|
+
from hypothesis import strategies as st
|
|
10
|
+
|
|
11
|
+
from sublation.truths import TruthValue
|
|
12
|
+
|
|
13
|
+
_degree = st.floats(min_value=0.0, max_value=1.0, allow_nan=False)
|
|
14
|
+
_values = st.builds(TruthValue, _degree, _degree)
|
|
15
|
+
|
|
16
|
+
COMBINING = ["conjunction", "disjunction", "consensus", "accumulate"]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _deg(value: TruthValue) -> tuple[float, float]:
|
|
20
|
+
return (value.mu, value.lam)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@given(a=_values, op=st.sampled_from(COMBINING))
|
|
24
|
+
def test_combining_is_idempotent(a, op):
|
|
25
|
+
combine = getattr(a, op)
|
|
26
|
+
assert _deg(combine(a)) == _deg(a)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@given(a=_values, b=_values, op=st.sampled_from(COMBINING))
|
|
30
|
+
def test_combining_is_commutative(a, b, op):
|
|
31
|
+
assert _deg(getattr(a, op)(b)) == _deg(getattr(b, op)(a))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@given(a=_values, b=_values, c=_values, op=st.sampled_from(COMBINING))
|
|
35
|
+
def test_combining_is_associative(a, b, c, op):
|
|
36
|
+
left = getattr(getattr(a, op)(b), op)(c)
|
|
37
|
+
right = getattr(a, op)(getattr(b, op)(c))
|
|
38
|
+
assert _deg(left) == _deg(right)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@given(a=_values)
|
|
42
|
+
def test_invert_is_involutive(a):
|
|
43
|
+
assert _deg(a.invert().invert()) == _deg(a)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@given(a=_values, b=_values)
|
|
47
|
+
def test_invert_satisfies_de_morgan(a, b):
|
|
48
|
+
na, nb = a.invert(), b.invert()
|
|
49
|
+
assert _deg(a.conjunction(b).invert()) == _deg(na.disjunction(nb))
|
|
50
|
+
assert _deg(a.disjunction(b).invert()) == _deg(na.conjunction(nb))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@given(a=_values, b=_values, op=st.sampled_from(["consensus", "accumulate"]))
|
|
54
|
+
def test_invert_commutes_with_the_knowledge_order(a, b, op):
|
|
55
|
+
combined = getattr(a, op)(b).invert()
|
|
56
|
+
separately = getattr(a.invert(), op)(b.invert())
|
|
57
|
+
assert _deg(combined) == _deg(separately)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def test_invert_fixes_the_non_classical_corners():
|
|
61
|
+
assert _deg(TruthValue(1.0, 1.0).invert()) == (1.0, 1.0)
|
|
62
|
+
assert _deg(TruthValue(0.0, 0.0).invert()) == (0.0, 0.0)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Validation against three canonical cases: the liar paradox, the sorites,
|
|
3
|
+
and Hegel's Being/Nothing/Becoming triad. Each test encodes only what the
|
|
4
|
+
library actually models, and comments where the mapping is interpretive.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from itertools import pairwise
|
|
8
|
+
|
|
9
|
+
from sublation import Antithesis, Synthesis, Thesis, TruthValue
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_liar_is_a_stable_contradiction_not_an_explosion():
|
|
13
|
+
"""
|
|
14
|
+
"This sentence is false": its truth entails its falsity and vice versa,
|
|
15
|
+
so evidence lands on both sides at once. That is the contradictory corner,
|
|
16
|
+
and `invert` (its own negation) is a fixed point there — the paradox is
|
|
17
|
+
recorded as a determinate state instead of blowing the logic up.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
liar = TruthValue(mu=1.0, lam=1.0)
|
|
21
|
+
assert liar.is_contradictory() is True
|
|
22
|
+
|
|
23
|
+
negated = liar.invert()
|
|
24
|
+
assert (negated.mu, negated.lam) == (liar.mu, liar.lam)
|
|
25
|
+
|
|
26
|
+
assert Thesis(True, True).sublation() is True
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def test_sorites_passes_through_indeterminacy_without_a_sharp_cutoff():
|
|
30
|
+
"""
|
|
31
|
+
Removing grains one at a time: as evidence-for a heap fades from 1.0 to
|
|
32
|
+
0.0, the verdict does not flip crisply true -> false. A middle band reads
|
|
33
|
+
indeterminate, which is the sorites' point — there is no single grain at
|
|
34
|
+
which "heap" becomes "not a heap".
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
gradient = [i / 10 for i in range(10, -1, -1)]
|
|
38
|
+
verdicts = [Thesis(mu).becoming() for mu in gradient]
|
|
39
|
+
|
|
40
|
+
assert verdicts[0] is True
|
|
41
|
+
assert verdicts[-1] is False
|
|
42
|
+
|
|
43
|
+
middle = [Thesis(mu) for mu in gradient if 0.0 < mu < 0.5]
|
|
44
|
+
assert all(t.sublation() is False for t in middle)
|
|
45
|
+
|
|
46
|
+
transitions = sum(1 for a, b in pairwise(verdicts) if a != b)
|
|
47
|
+
assert transitions == 1
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def test_being_and_nothing_are_indeterminate_becoming_is_their_unity():
|
|
51
|
+
"""
|
|
52
|
+
Being and Nothing are each pure and empty — nothing determinate is
|
|
53
|
+
asserted either way — which is the indeterminate corner. Their unity as
|
|
54
|
+
a synthesis is likewise undetermined: the movement is real, but no side
|
|
55
|
+
has yet settled it. (Interpretive mapping of Hegel's opening triad.)
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
being = Thesis(0.0)
|
|
59
|
+
nothing = Antithesis(0.0)
|
|
60
|
+
assert being.value.is_indeterminate() is True
|
|
61
|
+
assert nothing.value.is_indeterminate() is True
|
|
62
|
+
|
|
63
|
+
becoming = Synthesis(being, nothing)
|
|
64
|
+
assert becoming.value.is_indeterminate() is True
|
|
65
|
+
assert becoming.sublation() is False
|
sublation-0.2.0/MANIFEST.in
DELETED
sublation-0.2.0/requirements.txt
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
build==1.5.0
|
|
2
|
-
certifi==2026.6.17
|
|
3
|
-
cffi==2.1.0
|
|
4
|
-
charset-normalizer==3.4.9
|
|
5
|
-
cryptography==50.0.0
|
|
6
|
-
docutils==0.23
|
|
7
|
-
id==1.6.1
|
|
8
|
-
idna==3.18
|
|
9
|
-
iniconfig==2.3.0
|
|
10
|
-
jaraco-classes==3.4.0
|
|
11
|
-
jaraco-context==6.1.2
|
|
12
|
-
jaraco-functools==4.6.0
|
|
13
|
-
jeepney==0.9.0
|
|
14
|
-
keyring==25.7.0
|
|
15
|
-
markdown-it-py==4.2.0
|
|
16
|
-
mdurl==0.1.2
|
|
17
|
-
more-itertools==11.1.0
|
|
18
|
-
nh3==0.3.6
|
|
19
|
-
packaging==26.2
|
|
20
|
-
pluggy==1.6.0
|
|
21
|
-
pycparser==3.0
|
|
22
|
-
pygments==2.20.0
|
|
23
|
-
pyproject-hooks==1.2.0
|
|
24
|
-
pytest==9.1.1
|
|
25
|
-
readme-renderer==45.0
|
|
26
|
-
requests==2.34.2
|
|
27
|
-
requests-toolbelt==1.0.0
|
|
28
|
-
rfc3986==2.0.0
|
|
29
|
-
rich==15.0.0
|
|
30
|
-
secretstorage==3.5.0
|
|
31
|
-
setuptools==83.0.0
|
|
32
|
-
twine==6.2.0
|
|
33
|
-
urllib3==2.7.0
|
sublation-0.2.0/setup.cfg
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
[metadata]
|
|
2
|
-
name = sublation
|
|
3
|
-
version = 0.2.0
|
|
4
|
-
description = Non-boolean truth structures for dialectical reasoning, an alternative to boolean binarism, inspired by Hegelian logic.
|
|
5
|
-
long_description = file: README.md
|
|
6
|
-
long_description_content_type = text/markdown
|
|
7
|
-
author = Germano Castanho
|
|
8
|
-
author_email = germanocastanho@proton.me
|
|
9
|
-
url = https://github.com/germanocastanho/sublation-lib
|
|
10
|
-
license = MIT
|
|
11
|
-
license_files = LICENSE
|
|
12
|
-
classifiers =
|
|
13
|
-
Development Status :: 3 - Alpha
|
|
14
|
-
Intended Audience :: Science/Research
|
|
15
|
-
License :: OSI Approved :: MIT License
|
|
16
|
-
Programming Language :: Python :: 3
|
|
17
|
-
Programming Language :: Python :: 3.12
|
|
18
|
-
Programming Language :: Python :: 3.13
|
|
19
|
-
Programming Language :: Python :: 3.14
|
|
20
|
-
Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
-
|
|
22
|
-
[options]
|
|
23
|
-
package_dir =
|
|
24
|
-
= src
|
|
25
|
-
packages = find:
|
|
26
|
-
python_requires = >=3.12
|
|
27
|
-
|
|
28
|
-
[options.packages.find]
|
|
29
|
-
where = src
|
|
30
|
-
exclude =
|
|
31
|
-
tests
|
|
32
|
-
tests.*
|
|
33
|
-
|
|
34
|
-
[options.package_data]
|
|
35
|
-
sublation = py.typed
|
|
36
|
-
|
|
37
|
-
[options.extras_require]
|
|
38
|
-
dev =
|
|
39
|
-
pytest>=7.0
|
|
40
|
-
build
|
|
41
|
-
twine
|
|
42
|
-
|
|
43
|
-
[egg_info]
|
|
44
|
-
tag_build =
|
|
45
|
-
tag_date = 0
|
|
46
|
-
|
sublation-0.2.0/setup.py
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
from sublation import Antithesis, Synthesis, Thesis
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def test_matches_original_signature_defaults():
|
|
5
|
-
assert Thesis().thesis is True
|
|
6
|
-
assert Thesis().antithesis is False
|
|
7
|
-
assert Antithesis().thesis is True
|
|
8
|
-
assert Antithesis().antithesis is False
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def test_contradiction_is_detectable():
|
|
12
|
-
t = Thesis(True)
|
|
13
|
-
a = Antithesis(True)
|
|
14
|
-
s = Synthesis(t, a)
|
|
15
|
-
assert s.contradiction() is True
|
|
16
|
-
assert s.becoming() is False
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def test_empty_antithesis_resolves_without_tension():
|
|
20
|
-
t = Thesis(True)
|
|
21
|
-
a = Antithesis(False)
|
|
22
|
-
s = Synthesis(t, a)
|
|
23
|
-
assert s.contradiction() is False
|
|
24
|
-
assert s.becoming() is True
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def test_synthesis_chains_into_new_thesis():
|
|
28
|
-
t1 = Thesis(True)
|
|
29
|
-
a1 = Antithesis(False)
|
|
30
|
-
s1 = Synthesis(t1, a1)
|
|
31
|
-
t2 = s1.as_thesis()
|
|
32
|
-
assert isinstance(t2, Thesis)
|
|
33
|
-
assert t2.thesis == s1.thesis
|
|
34
|
-
assert t2.antithesis == s1.antithesis
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|