Three-valued logic

Last updated

In logic, a three-valued logic (also trinary logic, trivalent, ternary, or trilean, [1] sometimes abbreviated 3VL) is any of several many-valued logic systems in which there are three truth values indicating true, false, and some third value. This is contrasted with the more commonly known bivalent logics (such as classical sentential or Boolean logic) which provide only for true and false.

Contents

Emil Leon Post is credited with first introducing additional logical truth degrees in his 1921 theory of elementary propositions. [2] The conceptual form and basic ideas of three-valued logic were initially published by Jan Łukasiewicz and Clarence Irving Lewis. These were then re-formulated by Grigore Constantin Moisil in an axiomatic algebraic form, and also extended to n-valued logics in 1945.

Pre-discovery

Around 1910, Charles Sanders Peirce defined a many-valued logic system. He never published it. In fact, he did not even number the three pages of notes where he defined his three-valued operators. [3] Peirce soundly rejected the idea all propositions must be either true or false; boundary-propositions, he writes, are "at the limit between P and not P." [4] However, as confident as he was that "Triadic Logic is universally true," [5] he also jotted down that "All this is mighty close to nonsense." [6] Only in 1966, when Max Fisch and Atwell Turquette began publishing what they rediscovered in his unpublished manuscripts, did Peirce's triadic ideas become widely known. [7]

Motivation

Broadly speaking, the primary motivation for research of three valued logic is to represent the truth value of a statement that cannot be represented as true or false. [8] Łukasiewicz initially developed three valued logic for the problem of future contingents to represent the truth value of statements about the undetermined future. [9] [10] [11] Bruno de Finetti used a third value to represent when "a given individual does not know the [correct] response, at least at a given moment." [12] [8] Hilary Putnam used it to represent values that cannot physically be decided: [13]

For example, if we have verified (by using a speedometer) that the velocity of a motor car is such and such, it might be impossible in such a world to verify or falsify certain statements concerning its position at that moment. If we know by reference to a physical law together with certain observational data that a statement as to the position of a motor car can never be falsified or verified, then there may be some point to not regarding the statement as true or false, but regarding it as "middle". It is only because, in macrocosmic experience, everything that we regard as an empirically meaningful statement seems to be at least potentially verifiable or falsifiable that we prefer the convention according to which we say that every such statement is either true or false, but in many cases we don't know which.

Similarly, Stephen Cole Kleene used a third value to represent predicates that are "undecidable by [any] algorithms whether true or false" [14] [8]

Representation of values

As with bivalent logic, truth values in ternary logic may be represented numerically using various representations of the ternary numeral system. A few of the more common examples are:

Inside a ternary computer, ternary values are represented by ternary signals.

This article mainly illustrates a system of ternary propositional logic using the truth values {false, unknown, true}, and extends conventional Boolean connectives to a trivalent context.

Logics

Boolean logic allows 22 = 4 unary operators; the addition of a third value in ternary logic leads to a total of 33 = 27 distinct operators on a single input value. (This may be made clear by considering all possible truth tables for an arbitrary unary operator. Given 2 possible values TF of the single Boolean input, there are four different patterns of output TT, TF, FT, FF resulting from the following unary operators acting on each value: always T, Identity, NOT, always F. Given three possible values of a ternary variable, each times three possible results of a unary operation, there are 27 different output patterns: TTT, TTU, TTF, TUT, TUU, TUF, TFT, TFU, TFF, UTT, UTU, UTF, UUT, UUU, UUF, UFT, UFU, UFF, FTT, FTU, FTF, FUT, FUU, FUF, FFT, FFU, and FFF.) Similarly, where Boolean logic has 22×2 = 16 distinct binary operators (operators with 2 inputs) possible, ternary logic has 33×3 = 19,683 such operators. Where the nontrival Boolean operators can be named (AND, NAND, OR, NOR, XOR, XNOR (equivalence), and 4 variants of implication or inequality), with six trivial operators considering 0 or 1 inputs only, it is unreasonable to attempt to name all but a small fraction of the possible ternary operators. [18] Just as in bivalent logic, where not all operators are given names and subsets of functionally complete operators are used, there may be functionally complete sets of ternary-valued operators.

Kleene and Priest logics

Below is a set of truth tables showing the logic operations for Stephen Cole Kleene's "strong logic of indeterminacy" and Graham Priest's "logic of paradox".

(F, false; U, unknown; T, true)
NOT(A)
A¬A
FT
UU
TF
AND(A, B)
A ∧ BB
FUT
AFFFF
UFUU
TFUT
OR(A, B)
A ∨ BB
FUT
AFFUT
UUUT
TTTT
XOR(A, B)
A ⊕ BB
FUT
AFFUT
UUUU
TTUF
(−1, false; 0, unknown; +1, true)
NEG(A)
A¬A
−1+1
00
+1−1
MIN(A, B)
A ∧ BB
−10+1
A−1−1−1−1
0−100
+1−10+1
MAX(A, B)
A ∨ BB
−10+1
A−1−10+1
000+1
+1+1+1+1
MIN(MAX(A, B), NEG(MIN(A, B)))
A ⊕ BB
−10+1
A−1−10+1
0000
+1+10−1

If the truth values 1, 0, and -1 are interpreted as integers, these operations may be expressed with the ordinary operations of arithmetic (where x + y uses addition, xy uses multiplication, and x2 uses exponentiation), or by the minimum/maximum functions:

In these truth tables, the unknown state can be thought of as neither true nor false in Kleene logic, or thought of as both true and false in Priest logic. The difference lies in the definition of tautologies. Where Kleene logic's only designated truth value is T, Priest logic's designated truth values are both T and U. In Kleene logic, the knowledge of whether any particular unknown state secretly represents true or false at any moment in time is not available. However, certain logical operations can yield an unambiguous result, even if they involve an unknown operand. For example, because true OR true equals true, and true OR false also equals true, then true OR unknown equals true as well. In this example, because either bivalent state could be underlying the unknown state, and either state also yields the same result, true results in all three cases.

If numeric values, e.g. balanced ternary values, are assigned to false, unknown and true such that false is less than unknown and unknown is less than true, then A AND B AND C... = MIN(A, B, C ...) and A OR B OR C ... = MAX(A, B, C...).

Material implication for Kleene logic can be defined as:

, and its truth table is

IMPK(A, B), OR(¬A, B)
A → BB
FUT
AFTTT
UUUT
TFUT
IMPK(A, B), MAX(−A, B)
A → BB
−10+1
A−1+1+1+1
000+1
+1−10+1

which differs from that for Łukasiewicz logic (described below).

Kleene logic has no tautologies (valid formulas) because whenever all of the atomic components of a well-formed formula are assigned the value Unknown, the formula itself must also have the value Unknown. (And the only designated truth value for Kleene logic is True.) However, the lack of valid formulas does not mean that it lacks valid arguments and/or inference rules. An argument is semantically valid in Kleene logic if, whenever (for any interpretation/model) all of its premises are True, the conclusion must also be True. (The Logic of Paradox (LP) has the same truth tables as Kleene logic, but it has two designated truth values instead of one; these are: True and Both (the analogue of Unknown), so that LP does have tautologies but it has fewer valid inference rules). [19]

Łukasiewicz logic

The Łukasiewicz Ł3 has the same tables for AND, OR, and NOT as the Kleene logic given above, but differs in its definition of implication in that "unknown implies unknown" is true. This section follows the presentation from Malinowski's chapter of the Handbook of the History of Logic, vol 8. [20]

Material implication for Łukasiewicz logic truth table is

IMPŁ(A, B)
A → BB
FUT
AFTTT
UUTT
TFUT
IMPŁ(A, B), MIN(1, 1−A+B)
A → BB
−10+1
A−1+1+1+1
00+1+1
+1−10+1

In fact, using Łukasiewicz's implication and negation, the other usual connectives may be derived as:

It is also possible to derive a few other useful unary operators (first derived by Tarski in 1921): [ citation needed ]

They have the following truth tables:

AMA
FF
UT
TT
ALA
FF
UF
TT
AIA
FF
UT
TF

M is read as "it is not false that..." or in the (unsuccessful) Tarski–Łukasiewicz attempt to axiomatize modal logic using a three-valued logic, "it is possible that..." L is read "it is true that..." or "it is necessary that..." Finally I is read "it is unknown that..." or "it is contingent that..."

In Łukasiewicz's Ł3 the designated value is True, meaning that only a proposition having this value everywhere is considered a tautology. For example, AA and AA are tautologies in Ł3 and also in classical logic. Not all tautologies of classical logic lift to Ł3 "as is". For example, the law of excluded middle, A ∨ ¬A, and the law of non-contradiction, ¬(A ∧ ¬A) are not tautologies in Ł3. However, using the operator I defined above, it is possible to state tautologies that are their analogues:

RM3 logic

The truth table for the material implication of R-mingle 3 (RM3) is

IMPRM3(A, B)
A → BB
FUT
AFTTT
UFUT
TFFT

A defining characteristic of RM3 is the lack of the axiom of Weakening:

which, by adjointness, is equivalent to the projection from the product:

RM3 is a non-cartesian symmetric monoidal closed category; the product, which is left-adjoint to the implication, lacks valid projections, and has U as the monoid identity. This logic is equivalent to an "ideal" paraconsistent logic which also obeys the contrapositive.

HT logic

The logic of here and there (HT, also referred as Smetanov logic SmT or as Gödel G3 logic), introduced by Heyting in 1930 [21] as a model for studying intuitionistic logic, is a three-valued intermediate logic where the third truth value NF (not false) has the semantics of a proposition that can be intuitionistically proven to not be false, but does not have an intuitionistic proof of correctness.

(F, false; NF, not false; T, true)
NOTHT(A)
A¬A
FT
NFF
TF
IMPHT(A, B)
A → BB
FNFT
AFTTT
NFFTT
TFNFT

It may be defined either by appending one of the two equivalent axioms qp) → (((pq) → p) → p) or equivalently p∨(¬q)∨(pq) to the axioms of intuitionistic logic, or by explicit truth tables for its operations. In particular, conjunction and disjunction are the same as for Kleene's and Łukasiewicz's logic, while the negation is different.

HT logic is the unique coatom in the lattice of intermediate logics. In this sense it may be viewed as the "second strongest" intermediate logic after classical logic.

Bochvar logic

This logic is also known as a weak form of Kleene's three-valued logic.

Ternary Post logic

not(a) = (a + 1) mod 3, or
not(a) = (a + 1) mod (n), where (n) is the value of a logic

Modular algebras

Some 3VL modulars arithmetics have been introduced more recently, motivated by circuit problems rather than philosophical issues: [22]

Applications

SQL

The database query language SQL implements ternary logic as a means of handling comparisons with NULL field content. SQL uses a common fragment of the Kleene K3 logic, restricted to AND, OR, and NOT tables.

See also

Related Research Articles

<span class="mw-page-title-main">Boolean algebra (structure)</span> Algebraic structure modeling logical operations

In abstract algebra, a Boolean algebra or Boolean lattice is a complemented distributive lattice. This type of algebraic structure captures essential properties of both set operations and logic operations. A Boolean algebra can be seen as a generalization of a power set algebra or a field of sets, or its elements can be viewed as generalized truth values. It is also a special case of a De Morgan algebra and a Kleene algebra.

<span class="mw-page-title-main">Logical conjunction</span> Logical connective AND

In logic, mathematics and linguistics, and is the truth-functional operator of conjunction or logical conjunction. The logical connective of this operator is typically represented as or or (prefix) or or in which is the most modern and widely used.

<span class="mw-page-title-main">Logical connective</span> Symbol connecting sentential formulas in logic

In logic, a logical connective is a logical constant. Connectives can be used to connect logical formulas. For instance in the syntax of propositional logic, the binary connective can be used to join the two atomic formulas and , rendering the complex formula .

The propositional calculus is a branch of logic. It is also called propositional logic, statement logic, sentential calculus, sentential logic, or sometimes zeroth-order logic. Sometimes, it is called first-order propositional logic to contrast it with System F, but it should not be confused with first-order logic. It deals with propositions and relations between propositions, including the construction of arguments based on them. Compound propositions are formed by connecting propositions by logical connectives representing the truth functions of conjunction, disjunction, implication, biconditional, and negation. Some sources include other connectives, as in the table below.

In logic, the semantic principleof bivalence states that every declarative sentence expressing a proposition has exactly one truth value, either true or false. A logic satisfying this principle is called a two-valued logic or bivalent logic.

<span class="mw-page-title-main">Sheffer stroke</span> Logical operation

In Boolean functions and propositional calculus, the Sheffer stroke denotes a logical operation that is equivalent to the negation of the conjunction operation, expressed in ordinary language as "not both". It is also called non-conjunction, or alternative denial, or NAND. In digital electronics, it corresponds to the NAND gate. It is named after Henry Maurice Sheffer and written as or as or as or as in Polish notation by Łukasiewicz.

Many-valued logic is a propositional calculus in which there are more than two truth values. Traditionally, in Aristotle's logical calculus, there were only two possible values for any proposition. Classical two-valued logic may be extended to n-valued logic for n greater than 2. Those most popular in the literature are three-valued, four-valued, nine-valued, the finite-valued with more than three values, and the infinite-valued (infinitely-many-valued), such as fuzzy logic and probability logic.

In mathematics, a Heyting algebra (also known as pseudo-Boolean algebra) is a bounded lattice (with join and meet operations written ∨ and ∧ and with least element 0 and greatest element 1) equipped with a binary operation ab called implication such that (ca) ≤ b is equivalent to c ≤ (ab). From a logical standpoint, AB is by this definition the weakest proposition for which modus ponens, the inference rule AB, AB, is sound. Like Boolean algebras, Heyting algebras form a variety axiomatizable with finitely many equations. Heyting algebras were introduced by Arend Heyting (1930) to formalize intuitionistic logic.

In logic, a truth function is a function that accepts truth values as input and produces a unique truth value as output. In other words: the input and output of a truth function are all truth values; a truth function will always output exactly one truth value, and inputting the same truth value(s) will always output the same truth value. The typical example is in propositional logic, wherein a compound statement is constructed using individual statements connected by logical connectives; if the truth value of the compound statement is entirely determined by the truth value(s) of the constituent statement(s), the compound statement is called a truth function, and any logical connectives used are said to be truth functional.

Laws of Form is a book by G. Spencer-Brown, published in 1969, that straddles the boundary between mathematics and philosophy. LoF describes three distinct logical systems:

In abstract algebra, a branch of pure mathematics, an MV-algebra is an algebraic structure with a binary operation , a unary operation , and the constant , satisfying certain axioms. MV-algebras are the algebraic semantics of Łukasiewicz logic; the letters MV refer to the many-valued logic of Łukasiewicz. MV-algebras coincide with the class of bounded commutative BCK algebras.

In mathematical logic, a tautology is a formula that is true regardless of the interpretation of its component terms, with only the logical constants having a fixed meaning. For example, a formula that states, "the ball is green or the ball is not green," is always true, regardless of what a ball is and regardless of its colour. Tautology is usually, though not always, used to refer to valid formulas of propositional logic.

In logic, a functionally complete set of logical connectives or Boolean operators is one that can be used to express all possible truth tables by combining members of the set into a Boolean expression. A well-known complete set of connectives is { AND, NOT }. Each of the singleton sets { NAND } and { NOR } is functionally complete. However, the set { AND, OR } is incomplete, due to its inability to express NOT.

In mathematics and philosophy, Łukasiewicz logic is a non-classical, many-valued logic. It was originally defined in the early 20th century by Jan Łukasiewicz as a three-valued modal logic; it was later generalized to n-valued as well as infinitely-many-valued (0-valued) variants, both propositional and first order. The ℵ0-valued version was published in 1930 by Łukasiewicz and Alfred Tarski; consequently it is sometimes called the Łukasiewicz–Tarski logic. It belongs to the classes of t-norm fuzzy logics and substructural logics.

The logic alphabet, also called the X-stem Logic Alphabet (XLA), constitutes an iconic set of symbols that systematically represents the sixteen possible binary truth functions of logic. The logic alphabet was developed by Shea Zellweger. The major emphasis of his iconic "logic alphabet" is to provide a more cognitively ergonomic notation for logic. Zellweger's visually iconic system more readily reveals, to the novice and expert alike, the underlying symmetry relationships and geometric properties of the sixteen binary connectives within Boolean algebra.

T-norm fuzzy logics are a family of non-classical logics, informally delimited by having a semantics that takes the real unit interval [0, 1] for the system of truth values and functions called t-norms for permissible interpretations of conjunction. They are mainly used in applied fuzzy logic and fuzzy set theory as a theoretical basis for approximate reasoning.

A truth table is a mathematical table used in logic—specifically in connection with Boolean algebra, Boolean functions, and propositional calculus—which sets out the functional values of logical expressions on each of their functional arguments, that is, for each combination of values taken by their logical variables. In particular, truth tables can be used to show whether a propositional expression is true for all legitimate input values, that is, logically valid.

Łukasiewicz–Moisil algebras were introduced in the 1940s by Grigore Moisil in the hope of giving algebraic semantics for the n-valued Łukasiewicz logic. However, in 1956 Alan Rose discovered that for n ≥ 5, the Łukasiewicz–Moisil algebra does not model the Łukasiewicz logic. A faithful model for the ℵ0-valued (infinitely-many-valued) Łukasiewicz–Tarski logic was provided by C. C. Chang's MV-algebra, introduced in 1958. For the axiomatically more complicated (finite) n-valued Łukasiewicz logics, suitable algebras were published in 1977 by Revaz Grigolia and called MVn-algebras. MVn-algebras are a subclass of LMn-algebras, and the inclusion is strict for n ≥ 5. In 1982 Roberto Cignoli published some additional constraints that added to LMn-algebras produce proper models for n-valued Łukasiewicz logic; Cignoli called his discovery proper Łukasiewicz algebras.

In mathematics and mathematical logic, Boolean algebra is a branch of algebra. It differs from elementary algebra in two ways. First, the values of the variables are the truth values true and false, usually denoted 1 and 0, whereas in elementary algebra the values of the variables are numbers. Second, Boolean algebra uses logical operators such as conjunction (and) denoted as , disjunction (or) denoted as , and negation (not) denoted as ¬. Elementary algebra, on the other hand, uses arithmetic operators such as addition, multiplication, subtraction, and division. Boolean algebra is therefore a formal way of describing logical operations in the same way that elementary algebra describes numerical operations.

In logic, a finite-valued logic is a propositional calculus in which truth values are discrete. Traditionally, in Aristotle's logic, the bivalent logic, also known as binary logic was the norm, as the law of the excluded middle precluded more than two possible values for any proposition. Modern three-valued logic allows for an additional possible truth value.

References

  1. "Trilean (Stanford JavaNLP API)". Stanford University. Stanford NLP Group. Archived from the original on May 3, 2023.
  2. Post, Emil L. (1921). "Introduction to a General Theory of Elementary Propositions". American Journal of Mathematics. 43 (3): 163–185. doi: 10.2307/2370324 . hdl: 2027/uiuo.ark:/13960/t9j450f7q . ISSN   0002-9327. JSTOR   2370324 .
  3. "Peirce's Deductive Logic > Peirce's Three-Valued Logic (Stanford Encyclopedia of Philosophy/Summer 2020 Edition)". plato.stanford.edu. Retrieved 2024-05-15.
  4. Lane, R. (2001). "Triadic Logic". Commens. Archived from the original on Dec 6, 2023.
  5. Peirce, Charles S. (1839–1914). "Logic : autograph manuscript notebook, November 12, 1865-November 1, 1909". hollisarchives.lib.harvard.edu/repositories/24/digital_objects/63983. Houghton Library, Harvard University. Retrieved May 15, 2023. Triadic Logic is universally true. But Dyadic Logic is not aboslutely false
  6. Peirce, Charles S. (1839–1914). "Logic : autograph manuscript notebook, November 12, 1865-November 1, 1909". hollisarchives.lib.harvard.edu/repositories/24/digital_objects/63983. Houghton Library, Harvard University. Retrieved May 15, 2023.
  7. Lane, Robert. "Triadic Logic". www.digitalpeirce.fee.unicamp.br. Retrieved 2020-07-30.
  8. 1 2 3 Cobreros, Pablo; Égré, Paul; Ripley, David; Rooij, Robert van (2 January 2014). "Foreword: Three-valued logics and their applications". Journal of Applied Non-Classical Logics. 24 (1–2): 1–11. doi:10.1080/11663081.2014.909631.
  9. Prior, A. N. (1953). "Three-Valued Logic and Future Contingents". The Philosophical Quarterly. 3 (13): 317–326. doi:10.2307/2217099. ISSN   0031-8094.
  10. Taylor, Richard (1957). "The Problem of Future Contingencies". The Philosophical Review. 66 (1): 1–28. doi:10.2307/2182851. ISSN   0031-8108.
  11. Rybaříková, Zuzana (1 May 2021). "Łukasiewicz, determinism, and the four-valued system of logic". Semiotica. 2021 (240): 129–143. doi:10.1515/sem-2019-0115.
  12. de Finetti, Bruno (1 January 1995). "The logic of probability (translated)". Philosophical Studies. 77 (1): 181–190. doi:10.1007/BF00996317. But there is a second possible way to conceive of many-valued logics: that while a proposition, in itself, can have only two values, true or false, that is to say two responses, yes or no, it may happen that a given individual does not know the [correct] response, at least at a given moment; therefore, for the individual there is a third attitude possible toward a proposition. This third attitude does not correspond to a distinct third value of yes or of no, but simply to a doubt between yes or no
  13. Putnam, Hilary (1 October 1957). "Three-valued logic". Philosophical Studies. 8 (5): 73–80. doi:10.1007/BF02304905. However, it is not the case that 'middle' means "neither verified nor falsified at the present time". As we have seen, 'verified' and 'falsified' are epistemic predicates--that is to say, they are relative to the evidence at a particular time--whereas 'middle,' like 'true' and 'false' is not relative to the evidence.
  14. Kleene, Stephen Cole (1952). Introduction to metamathematics. North-Holland Publishing Co., Amsterdam, and P. Noordhoff, Groningen. p. 336. The strong 3-valued logic can be applied to completely defined predicates Q(x) and R(x), from which composite predicates are formed using ̅, V, &, ->, ≡ in the usual 2-valued meanings, thus, (iii) Suppose that there are fixed algorithms which decide the truth or falsity of Q(x) and of R(x), each on a subset of the natural numbers (as occurs e.g. after completing the definitions of any two partial recursive predicates classically). Let t, f, u mean 'decidable by the algorithms (i.e. by use of only such information about Q(x) and R(x) as can be obtained by the algorithms) to be true', 'decidable by the algorithms to be false', 'undecidable by the algorithms whether true or false'. (iv) Assume a fixed state of knowledge about Q(x) and R(x) (as occurs e.g. after pursuing algorithms for each of them up to a given stage). Let t, f, u mean 'known to be true', 'known to be false', 'unknown whether true or false'.
  15. Knuth, Donald E. (1981). The Art of Computer Programming Vol. 2. Reading, Mass.: Addison-Wesley Publishing Company. p. 190.
  16. Hayes, Brian (November–December 2001). "Third base" (PDF). American Scientist . 89 (6). Sigma Xi, the Scientific Research Society: 490–494. doi:10.1511/2001.40.3268. Archived (PDF) from the original on 2019-10-30. Retrieved 2020-04-12.
  17. Nelson, David (2008). The Penguin Dictionary of Mathematics. Fourth Edition. London, England: Penguin Books. Entry for 'three-valued logic'. ISBN   9780141920870.
  18. Douglas W. Jones, Standard Ternary Logic, Feb. 11, 2013.
  19. "Beyond Propositional Logic"
  20. Grzegorz Malinowski, "Many-valued Logic and its Philosophy" in Dov M. Gabbay, John Woods (eds.) Handbook of the History of Logic Volume 8. The Many Valued and Nonmonotonic Turn in Logic, Elsevier, 2009
  21. Heyting (1930). "Die formalen Regeln der intuitionistischen Logik". Sitz. Berlin. 42–56.
  22. Miller, D. Michael; Thornton, Mitchell A. (2008). Multiple valued logic: concepts and representations. Synthesis lectures on digital circuits and systems. Vol. 12. Morgan & Claypool Publishers. pp. 41–42. ISBN   978-1-59829-190-2.
  23. Dubrova, Elena (2002). Multiple-Valued Logic Synthesis and Optimization, in Hassoun S. and Sasao T., editors, Logic Synthesis and Verification, Kluwer Academic Publishers, pp. 89-114

Further reading