3-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 premises ...
, 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 progr ...
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 variable (mathematics), variables are the truth values ''true'' and ''false'', usually denote ...
) 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. He ...
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 algebra) ...
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 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 (unbalance ...
, 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 A redundant binary representation (RBR) is a numeral system that uses more bits than needed to represent a single binary Numerical digit, digit so that most numbers have several representations. An RBR is unlike usual binary numeral systems, includi ...
, 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 Digit may refer to: Mathematics and science * Numerical digit, as used in mathematics or computer science ** Hindu-Arabic numerals, the most common modern representation of numerical digits * Digit (anatomy), the most distal part of a limb, such ...
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 ...
, 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 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 pulse ...
s. This article mainly illustrates a system of ternary propositional logic 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 co ...
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 variable (mathematics), variables are the truth values ''true'' and ''false'', usually denote ...
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 on ...
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 boole ...
, 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 equivalen ...
,
equivalence Equivalence or Equivalent may refer to: Arts and entertainment *Album-equivalent unit, a measurement unit in the music industry *Equivalence class (music) *''Equivalent VIII'', or ''The Bricks'', a minimalist sculpture by Carl Andre *'' Equival ...
, 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 argumen ...
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 (unbalance ...
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 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 other ...
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 indeterminate ...
) * (
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 * Ex ...
).


HT logic

The logic of here and there (HT, also referred as Smetanov logic SmT or as Gödel G3 logic), introduced by
Heyting __NOTOC__ Arend Heyting (; 9 May 1898 – 9 July 1980) was a Dutch mathematician and logician. Biography Heyting was a student of Luitzen Egbertus Jan Brouwer at the University of Amsterdam, and did much to put intuitionistic logic on a foot ...
in 1930 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. It may be defined either by appending one of the two equivalent axioms or equivalently 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


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 algebra Broadly speaking, modularity is the degree to which a system's components may be separated and recombined, often with the benefit of flexibility and variety in use. The concept of modularity is used primarily to reduce complexity by breaking a sy ...
s 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 gen ...
* 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 mathematical ...
* 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 (unbalance ...
) * Three-state logic (
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