Three-valued logic
   HOME

TheInfoList



OR:

In
logic Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the science of deductively valid inferences or of logical truths. It is a formal science investigating how conclusions follow from premise ...
, a three-valued logic (also trinary logic, trivalent, ternary, or trilean, sometimes abbreviated 3VL) is any of several
many-valued logic Many-valued logic (also multi- or multiple-valued logic) refers to a propositional calculus in which there are more than two truth values. Traditionally, in Aristotle's logical calculus, there were only two possible values (i.e., "true" and "false ...
systems in which there are three
truth value In logic and mathematics, a truth value, sometimes called a logical value, is a value indicating the relation of a proposition to truth, which in classical logic has only two possible values ('' true'' or '' false''). Computing In some pro ...
s indicating ''true'', ''false'' and some indeterminate 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''.
Emil Leon Post Emil Leon Post (; February 11, 1897 – April 21, 1954) was an American mathematician and logician. He is best known for his work in the field that eventually became known as computability theory. Life Post was born in Augustów, Suwałki Govern ...
is credited with first introducing additional logical truth degrees in his 1921 theory of elementary propositions. The conceptual form and basic ideas of three-valued logic were initially published by Jan Łukasiewicz and
Clarence Irving Lewis Clarence Irving Lewis (April 12, 1883 – February 3, 1964), usually cited as C. I. Lewis, was an American academic philosopher. He is considered the progenitor of modern modal logic and the founder of conceptual pragmatism. First a noted logic ...
. 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 Charles Sanders Peirce ( ; September 10, 1839 – April 19, 1914) was an American philosopher, logician, mathematician and scientist who is sometimes known as "the father of pragmatism". Educated as a chemist and employed as a scientist for t ...
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. 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." However, as confident as he was that "Triadic Logic is universally true," he also jotted down that "All this is mighty close to nonsense." 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.


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 ternary numeral system (also called base 3 or trinary) has three as its base. Analogous to a bit, a ternary digit is a trit (trinary digit). One trit is equivalent to log2 3 (about 1.58496) bits of information. Although ''ternary'' m ...
. A few of the more common examples are: * in
balanced ternary Balanced ternary is a ternary numeral system (i.e. base 3 with three digits) that uses a balanced signed-digit representation of the integers in which the digits have the values −1, 0, and 1. This stands in contrast to the standard (unbalanc ...
, each digit has one of 3 values: −1, 0, or +1; these values may also be simplified to −, 0, +, respectively; * in the redundant binary representation, each digit can have a value of −1, 0, 0/1 (the value 0/1 has two different representations); * in the
ternary numeral system A ternary numeral system (also called base 3 or trinary) has three as its base. Analogous to a bit, a ternary digit is a trit (trinary digit). One trit is equivalent to log2 3 (about 1.58496) bits of information. Although ''ternary'' m ...
, each digit is a '' trit'' (trinary digit) having a value of: 0, 1, or 2; * in the
skew binary number system Skew may refer to: In mathematics * Skew lines, neither parallel nor intersecting. * Skew normal distribution, a probability distribution * Skew field or division ring * Skew-Hermitian matrix * Skew lattice * Skew polygon, whose vertices do not l ...
, only the least-significant non-zero digit can have a value of 2, and the remaining digits have a value of 0 or 1; * 1 for ''true'', 2 for ''false'', and 0 for ''unknown'', ''unknowable''/'' undecidable'', ''irrelevant'', or ''both''; * 0 for ''false'', 1 for ''true'', and a third non-integer "maybe" symbol such as ?, #, ½, or xy. Inside a ternary computer, ternary values are represented by
ternary signal In telecommunication, a ternary signal is a signal that can assume, at any given instant, one of three states or significant conditions, such as power level, phase position, pulse duration, or frequency. Examples of ternary signals are (a) a puls ...
s. This article mainly illustrates a system of ternary
propositional logic Propositional calculus is a branch of logic. It is also called propositional logic, statement logic, sentential calculus, sentential logic, or sometimes zeroth-order logic. It deals with propositions (which can be true or false) and relations b ...
using the truth values , and extends conventional Boolean
connectives In logic, a logical connective (also called a logical operator, sentential connective, or sentential operator) is a logical constant. They can be used to connect logical formulas. For instance in the syntax of propositional logic, the binary c ...
to a trivalent context. Ternary
predicate logic First-order logic—also known as predicate logic, quantificational logic, and first-order predicate calculus—is a collection of formal systems used in mathematics, philosophy, linguistics, and computer science. First-order logic uses quantifie ...
s exist as well; these may have readings of the quantifier different from classical (binary) predicate logic and may include alternative quantifiers as well.


Logics

Boolean logic allows 22 = 4
unary operator In mathematics, an unary operation is an operation with only one operand, i.e. a single input. This is in contrast to binary operations, which use two operands. An example is any function , where is a set. The function is a unary operation o ...
s, 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 of the boolean (input) variable there are four different patterns of output (result of the unary operator operating on the variable): TT,TF,FT,FF. Whereas, given three possible values of a ternary variable, and three possible results of a unary operation, there are twenty seven 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×2 = 19,683 such operators. Where we can easily name a significant fraction of the Boolean operators ( NOT, AND, NAND, OR, NOR, XOR, XNOR, equivalence, implication), it is unreasonable to attempt to name all but a small fraction of the possible ternary operators.


Kleene and Priest logics

Below is a set of truth tables showing the logic operations for
Stephen Cole Kleene Stephen Cole Kleene ( ; January 5, 1909 – January 25, 1994) was an American mathematician. One of the students of Alonzo Church, Kleene, along with Rózsa Péter, Alan Turing, Emil Post, and others, is best known as a founder of the branch of ...
's "strong logic of indeterminacy" and
Graham Priest Graham Priest (born 1948) is Distinguished Professor of Philosophy at the CUNY Graduate Center, as well as a regular visitor at the University of Melbourne, where he was Boyce Gibson Professor of Philosophy and also at the University of St Andr ...
's "logic of paradox". 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'', one can infer that ''true'' OR ''unknown'' equals ''true'', as well. In this example, because either bivalent state could be underlying the ''unknown'' state, but either state also yields the same result, a definitive ''true'' results in all three cases. If numeric values, e.g.
balanced ternary Balanced ternary is a ternary numeral system (i.e. base 3 with three digits) that uses a balanced signed-digit representation of the integers in which the digits have the values −1, 0, and 1. This stands in contrast to the standard (unbalanc ...
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: A \rightarrow B \ \overset \ \mbox ( \ \mbox(A), \ B ) , and its truth table is 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. (Note that the
Logic of Paradox A paraconsistent logic is an attempt at a logical system to deal with contradictions in a discriminating way. Alternatively, paraconsistent logic is the subfield of logic that is concerned with studying and developing "inconsistency-tolerant" syste ...
(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).


Ł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. Material implication for Łukasiewicz logic truth table is 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): * * * They have the following truth tables: 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, and 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 In logic, the law of excluded middle (or the principle of excluded middle) states that for every proposition, either this proposition or its negation is true. It is one of the so-called three laws of thought, along with the law of noncontradi ...
, , and the
law of non-contradiction In logic, the law of non-contradiction (LNC) (also known as the law of contradiction, principle of non-contradiction (PNC), or the principle of contradiction) states that contradictory propositions cannot both be true in the same sense at the sa ...
, are not tautologies in Ł3. However, using the operator defined above, it is possible to state tautologies that are their analogues: * ( law of excluded fourth) * ( extended contradiction principle).


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 as a model for studying
intuitionistic logic Intuitionistic logic, sometimes more generally called constructive logic, refers to systems of symbolic logic that differ from the systems used for classical logic by more closely mirroring the notion of constructive proof. In particular, systems ...
, is a three-valued
intermediate logic In mathematical logic, a superintuitionistic logic is a propositional logic extending intuitionistic logic. Classical logic is the strongest consistent superintuitionistic logic; thus, consistent superintuitionistic logics are called intermediate l ...
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. It may be defined either by appending one of the two equivalent axioms or equivalently to the axioms of
intuitionistic logic Intuitionistic logic, sometimes more generally called constructive logic, refers to systems of symbolic logic that differ from the systems used for classical logic by more closely mirroring the notion of constructive proof. In particular, systems ...
, 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


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 modular algebras have been introduced more recently, motivated by circuit problems rather than philosophical issues: * Cohn algebra * Pradhan algebra * Dubrova and Muzio algebra


Applications


SQL

The database structural query language SQL implements ternary logic as a means of handling comparisons with
NULL Null may refer to: Science, technology, and mathematics Computing * Null (SQL) (or NULL), a special marker and keyword in SQL indicating that something has no value * Null character, the zero-valued ASCII character, also designated by , often use ...
field content. NULL was originally intended to be used as a
sentinel value In computer programming, a sentinel value (also referred to as a flag value, trip value, rogue value, signal value, or dummy data) is a special value in the context of an algorithm which uses its presence as a condition of termination, typically in ...
in SQL to represent missing data in a database, i.e. the assumption that an actual value exists, but that the value is not currently recorded in the database. SQL uses a common fragment of the Kleene K3 logic, restricted to AND, OR, and NOT tables. In SQL, the intermediate value is intended to be interpreted as UNKNOWN. Explicit comparisons with NULL, including that of another NULL yields UNKNOWN. However this choice of semantics is abandoned for some set operations, e.g. UNION or INTERSECT, where NULLs are treated as equal with each other. Critics assert that this inconsistency deprives SQL of intuitive semantics in its treatment of NULLs.Ron van der Meyden,
Logical approaches to incomplete information: a survey
in Chomicki, Jan; Saake, Gunter (Eds.) ''Logics for Databases and Information Systems'', Kluwer Academic Publishers , p. 344
PS preprint
(note: page numbering differs in preprint from the published version)
The SQL standard defines an optional feature called F571, which adds some unary operators, among which is IS UNKNOWN corresponding to the Łukasiewicz I in this article. The addition of IS UNKNOWN to the other operators of SQL's three-valued logic makes the SQL three-valued logic functionally complete,C. J. Date, ''Relational database writings, 1991–1994'', Addison-Wesley, 1995, p. 371 meaning its logical operators can express (in combination) any conceivable three-valued logical function.


See also

*
Binary logic (disambiguation) Binary logic may refer to: * Boolean logic, a two-valued formal logic ** Logic gates implementing Boolean logic in digital electronics * Bivalent logic or two-valued logic, a logic satisfying the principle of bivalence See also * Binary numeral sy ...
* Boolean algebra (structure) *
Boolean function In mathematics, a Boolean function is a function whose arguments and result assume values from a two-element set (usually , or ). Alternative names are switching function, used especially in older computer science literature, and truth function ...
* Digital circuit *
Four-valued logic In logic, a four-valued logic is any logic with four truth values. Several types of four-valued logic have been advanced. Belnap Nuel Belnap considered the challenge of question answering by computer in 1975. Noting human fallibility, he was con ...
* * Setun – an experimental Russian computer which was based on ternary logic *
Ternary numeral system A ternary numeral system (also called base 3 or trinary) has three as its base. Analogous to a bit, a ternary digit is a trit (trinary digit). One trit is equivalent to log2 3 (about 1.58496) bits of information. Although ''ternary'' m ...
(and
Balanced ternary Balanced ternary is a ternary numeral system (i.e. base 3 with three digits) that uses a balanced signed-digit representation of the integers in which the digits have the values −1, 0, and 1. This stands in contrast to the standard (unbalanc ...
) *
Three-state logic In digital electronics, a tri-state or three-state buffer is a type of digital buffer that has three stable states: a high output state, a low output state, and a high-impedance state. In the high-impedance state, the output of the buffer is discon ...
(
tri-state buffer In digital electronics, a tri-state or three-state buffer is a type of digital buffer that has three stable states: a high output state, a low output state, and a high-impedance state. In the high-impedance state, the output of the buffer is discon ...
)


References


Further reading

* , chapters 5-9 * Mundici, D. The C*-Algebras of Three-Valued Logic. Logic Colloquium ’88, Proceedings of the Colloquium held in Padova 61–77 (1989). * Reichenbach, Hans (1944). ''Philosophic Foundations of Quantum Mechanics''. University of California Press. Dover 1998: {{DEFAULTSORT:Ternary Logic Many-valued logic Ternary computers