https://github.com/mithrandie/ternary
Three-valued logic based on Kleene's strong logic of indeterminacy
https://github.com/mithrandie/ternary
golang three-valued-logic
Last synced: 2 days ago
JSON representation
Three-valued logic based on Kleene's strong logic of indeterminacy
- Host: GitHub
- URL: https://github.com/mithrandie/ternary
- Owner: mithrandie
- License: mit
- Created: 2017-09-14T01:43:22.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-19T13:59:38.000Z (over 3 years ago)
- Last Synced: 2025-08-13T21:14:07.320Z (about 2 months ago)
- Topics: golang, three-valued-logic
- Language: Go
- Size: 11.7 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ternary
Three-valued logic based on Kleene's strong logic of indeterminacy.
[](https://github.com/mithrandie/ternary/actions/workflows/test.yml)
[](http://godoc.org/github.com/mithrandie/ternary)
[](https://opensource.org/licenses/MIT)## Truth values
- FALSE (-1)
- UNKNOWN (0)
- TRUE (1)## Truth tables
```
NOT(A) - Logical negation
+---+----+
| A | ¬A |
|---+----|
| F | T |
| U | U |
| T | F |
+---+----+AND(A, B) - Logical conjunction. Minimum value of (A, B)
+--------+-----------+
| | B |
| A ∧ B |---+---+---|
| | F | U | T |
|----+---+---+---+---|
| | F | F | F | F |
| A | U | F | U | U |
| | T | F | U | T |
+----+---+---+---+---+OR(A, B) - Logical disjunction. Maximum value of (A, B)
+--------+-----------+
| | B |
| A ∨ B |---+---+---|
| | F | U | T |
|----+---+---+---+---|
| | F | F | U | T |
| A | U | U | U | T |
| | T | T | T | T |
+----+---+---+---+---+IMP(A, B) - Logical implication. OR(NOT(A), B)
+--------+-----------+
| | B |
| A → B |---+---+---|
| | F | U | T |
|----+---+---+---+---|
| | F | T | T | T |
| A | U | U | U | T |
| | T | F | U | T |
+----+---+---+---+---+EQV(A, B) - Logical biconditional. OR(AND(A, B), AND(NOT(A), NOT(B)))
+--------+-----------+
| | B |
| A ↔ B |---+---+---|
| | F | U | T |
|----+---+---+---+---|
| | F | T | U | F |
| A | U | U | U | U |
| | T | F | U | T |
+----+---+---+---+---+
```