A ternary, three-valued or trivalent logic is a multi-valued logic in which there are three truth values indicating true, false and some third value, often called possible, unknown, uncertain, neither true nor false (see fuzzy logic), or paraconsistent.
This is contrasted with traditional Aristotlean logic which only provides for True and False.
The rest of this article discusses a system of ternary propositional logic using the above representations of truth values. Other systems assign different truth tables to the various connectives, and may even include other connectives.
Ternary predicate logics exist as well; these may have readings of the quantifier different from classical (binary) predicate logic, and may include alternative quantifiers as well.
The operations from boolean logic can be extended to work with ternary logic. In general, the result of an operation op on the unknown value is determined by:
Note that this rule does not generalize from operators to arbitrary boolean functions. For example, the formula , commonly called the law of the excluded middle, has the value 'true' (i.e. 1) when A is true or false (i.e. 1 or 2), and is therefore a tautology in the standard two-valued Boolean logic. However, in the usual ternary logic, its value is 0 (unknown).
| P | Q | ¬P | P Q | P Q | P Q | P Q |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 | 1 | 1 | 0 |
| 0 | 2 | 0 | 2 | 0 | 0 | 0 |
| 1 | 0 | 2 | 0 | 1 | 0 | 0 |
| 1 | 1 | 2 | 1 | 1 | 1 | 1 |
| 1 | 2 | 2 | 2 | 1 | 2 | 2 |
| 2 | 0 | 1 | 2 | 0 | 1 | 0 |
| 2 | 1 | 1 | 2 | 1 | 1 | 2 |
| 2 | 2 | 1 | 2 | 2 | 1 | 1 |
The 27 unary operators in ternary logic are represented in the following table. Some of them are given names:
| 0 | 1 | 2 | 0 | 1 | 2 | 0 | 1 | 2 | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| f0, "clear to 0" | 0 | 0 | 0 | f9 | 1 | 0 | 0 | f18 | 2 | 0 | 0 |
| f1, "shift down" | 0 | 0 | 1 | f10 | 1 | 0 | 1 | f19, "rotate down" | 2 | 0 | 1 |
| f2 | 0 | 0 | 2 | f11, "swap 0/1" | 1 | 0 | 2 | f20 | 2 | 0 | 2 |
| f3 | 0 | 1 | 0 | f12 | 1 | 1 | 0 | f21, "swap 0/2" | 2 | 1 | 0 |
| f4 | 0 | 1 | 1 | f13, "clear to 1" | 1 | 1 | 1 | f22 | 2 | 1 | 1 |
| f5, "identity" | 0 | 1 | 2 | f14 | 1 | 1 | 2 | f23 | 2 | 1 | 2 |
| f6 | 0 | 2 | 0 | f15, "rotate up" | 1 | 2 | 0 | f24 | 2 | 2 | 0 |
| f7. "NOT" | 0 | 2 | 1 | f16 | 1 | 2 | 1 | f25 | 2 | 2 | 1 |
| f8 | 0 | 2 | 2 | f17, "shift up" | 1 | 2 | 2 | f26, "clear to 2" | 2 | 2 | 2 |
The number of functions for a given number of variables for trinary logic can be calculated by the equation , where v represents the number of variables. This gives us
As stated above, there are 19,683 dyadic ternary functions. However, only of these are commutative. Of the four functions defined above, OR, AND, and EQUIV are commutative, while IF/THEN is not. For comparison, there are 8 commutative two-argument binary functions.
Also Umberto Eco discusses Aymara in The Search for the Perfect Language.
Dreiwertige Logik | Logika trójwartościowa | Троичная логика
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Ternary logic".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world