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 prem ...
, a three-valued logic (also trinary logic, trivalent, ternary, or trilean, sometimes abbreviated 3VL) is any of several many-valued logic 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 Bivalent may refer to: * Bivalent (chemistry), a molecule formed from two or more atoms bound together *Bivalent (engine), an engine that can operate on two different types of fuel *Bivalent (genetics), a pair of homologous chromosomes *Bivalent log ...
logics (such as classical sentential or
Boolean logic 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 ...
) which provide only for ''true'' and ''false''. Emil Leon Post 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 Jan Łukasiewicz (; 21 December 1878 – 13 February 1956) was a Polish logician and philosopher who is best known for Polish notation and Łukasiewicz logic His work centred on philosophical logic, mathematical logic and history of logic. ...
and Clarence Irving Lewis. These were then re-formulated by
Grigore Constantin Moisil Grigore Constantin Moisil (; 10 January 1906 – 21 May 1973) was a Romanian mathematician, computer pioneer, and titular member of the Romanian Academy. His research was mainly in the fields of mathematical logic ( Łukasiewicz–Moisil algebr ...
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 ...
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 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, each digit is a '' trit'' (trinary digit) having a value of: 0, 1, or 2; * in the skew binary number system, 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 A ternary computer, also called trinary computer, is one that uses ternary logic (i.e., base 3) instead of the more common binary system (i.e., base 2) in its calculations. This means it uses trits (instead of bits, as most computers do). Types ...
, ternary values are represented by ternary signals. 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 to a trivalent context. 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.


Logics

Boolean logic 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 ...
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 or AND may refer to: Logic, grammar, and computing * Conjunction (grammar), connecting two words, phrases, or clauses * Logical conjunction in mathematical logic, notated as "∧", "⋅", "&", or simple juxtaposition * Bitwise AND, a boolea ...
, NAND, OR, NOR,
XOR Exclusive or or exclusive disjunction is a logical operation that is true if and only if its arguments differ (one is true, the other is false). It is symbolized by the prefix operator J and by the infix operators XOR ( or ), EOR, EXOR, , ...
,
XNOR The XNOR gate (sometimes XORN'T, ENOR, EXNOR or NXOR and pronounced as Exclusive NOR. Alternatively XAND, pronounced Exclusive AND) is a digital logic gate whose function is the logical complement of the Exclusive OR (XOR) gate. It is equivale ...
, 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 table 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 arg ...
s showing the logic operations for Stephen Cole Kleene's "strong logic of indeterminacy" and Graham Priest'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 (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 Modal logic is a collection of formal systems developed to represent statements about necessity and possibility. It plays a major role in philosophy of language, epistemology, metaphysics, and natural language semantics. Modal logics extend ot ...
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 Designation (from Latin ''designatio'') is the process of determining an incumbent's successor. A candidate that won an election for example, is the ''designated'' holder of the office the candidate has been elected to, up until the candidate's i ...
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, , and the law of non-contradiction, 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 In logic, a three-valued logic (also trinary logic, trivalent, ternary, or trilean, sometimes abbreviated 3VL) is any of several many-valued logic systems in which there are three truth values indicating ''true'', ''false'' and some indeterminat ...
) * (
extended contradiction principle Extension, extend or extended may refer to: Mathematics Logic or set theory * Axiom of extensionality * Extensible cardinal * Extension (model theory) * Extension (predicate logic), the set of tuples of values that satisfy the predicate * Ext ...
).


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 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 field content. NULL was originally intended to be used as a sentinel value 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 In logic, a functionally complete set of logical connectives or Boolean operators is one which can be used to express all possible truth tables by combining members of the set into a Boolean expression.. ("Complete set of logical connectives").. ( ...
,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) *
Boolean algebra (structure) 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 ge ...
* Boolean function *
Digital circuit In theoretical computer science, a circuit is a model of computation in which input values proceed through a sequence of gates, each of which computes a function. Circuits of this kind provide a generalization of Boolean circuits and a mathemati ...
* Four-valued logic * *
Setun Setun (russian: Сетунь) was a computer developed in 1958 at Moscow State University. It was built under the leadership of Sergei Sobolev and Nikolay Brusentsov. It was the most modern ternary computer, using the balanced ternary numeral sys ...
– an experimental Russian computer which was based on ternary logic * Ternary numeral system (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 ( tri-state buffer)


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