Three-valued logic Contents Representation of values Logics Applications See also References Further...

AlethicAxiologicDeonticDoxasticEpistemicTemporalDegree of truthFuzzy ruleFuzzy setFuzzy finite elementFuzzy set operationsDialetheismThree-valuedFour-valuedŁukasiewicz


Many-valued logicTernary computers


logicmany-valued logictruth valuesbivalentBoolean logicJan ŁukasiewiczC. I. LewisGrigore Moisilternary numeral systemternary computerternary signalspropositional logicconnectivespredicate logicsquantifierBoolean logicunary operatorsnotandornandnorexclusive orequivalenceimplicationtruth tablesKleenebalanced ternaryLogic of Paradoxmodal logicdesignated valuetautologylaw of excluded middlelaw of non-contradictionmodular algebrasSQLNULLfunctionally complete




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 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. Conceptual form and basic ideas were initially created by Jan Łukasiewicz and C. I. Lewis. These were then re-formulated by Grigore Moisil in an axiomatic algebraic form, and also extended to n-valued logics in 1945.




Contents






  • 1 Representation of values


  • 2 Logics


    • 2.1 Kleene and Priest logics


    • 2.2 Łukasiewicz logic


    • 2.3 Bochvar logic


    • 2.4 Ternary Post logic


    • 2.5 Modular algebras




  • 3 Applications


    • 3.1 SQL




  • 4 See also


  • 5 References


  • 6 Further reading


  • 7 External links





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, each digit has one of 3 values: −1, 0, or +1; these values may also be simplified to −, 0, +, respectively;[2]

  • 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 most-significant non-zero digit has a value 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;[3][not in citation given]

  • 0 for false, 1 for true, and a third non-integer "maybe" symbol such as ?, #, ½,[4] or xy.


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. Ternary predicate logics exist as well;[citation needed] these may have readings of the quantifier different from classical (binary) predicate logic and may include alternative quantifiers as well.



Logics


Where Boolean logic has 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. Similarly, where Boolean logic has 222 = 16 distinct binary operators (operators with 2 inputs), ternary logic has 332 = 19,683 such operators. Where we can easily name a significant fraction of the Boolean operators (not, and, or, nand, nor, exclusive or, equivalence, implication), it is unreasonable to attempt to name all but a small fraction of the possible ternary operators.[5]



Kleene and Priest logics



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









(F, false; U, unknown; T, true)





















NOT(A)
A
¬A
F
T
U
U
T
F


































AND(A, B)
A ∧ B
B
F
U
T
A
F
F
F
F
U
F
U
U
T
F
U
T


































OR(A, B)
A ∨ B
B
F
U
T
A
F
F
U
T
U
U
U
T
T
T
T
T









(−1, false; 0, unknown; +1, true)





















NEG(A)
A
¬A
−1
+1
0
0
+1
−1


































MIN(A, B)
A ∧ B
B
−1
0
+1
A
−1
−1
−1
−1
0
−1
0
0
+1
−1
0
+1


































MAX(A, B)
A ∨ B
B
−1
0
+1
A
−1
−1
0
+1
0
0
0
+1
+1
+1
+1
+1


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 at least one unknown operand. For example, since 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, since 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 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→B =def OR( NOT(A), B){displaystyle Arightarrow B {overset {underset {mathrm {def} }{}}{=}} {mbox{OR}}( {mbox{NOT}}(A), B)}, and its truth table is






































IMPK(A, B), OR(¬A, B)
A → B
B
F
U
T
A
F
T
T
T
U
U
U
T
T
F
U
T


































IMPK(A, B), MAX(−A, B)
A → B
B
−1
0
+1
A
−1
+1
+1
+1
0
0
0
+1
+1
−1
0
+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. (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.)[6]



Ł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.[7]


Material implication for Łukasiewicz logic truth table is






































IMPŁ(A, B)
A → B
B
F
U
T
A
F
T
T
T
U
U
T
T
T
F
U
T


































IMPŁ(A, B), MIN(1, 1−A+B)
A → B
B
−1
0
+1
A
−1
+1
+1
+1
0
0
+1
+1
+1
−1
0
+1


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



  • AB = (AB) → B

  • AB = ¬(¬A ∨ ¬ B)

  • AB = (AB) ∧ (BA)


It's also possible to derive a few other useful unary operators (first derived by Tarski in 1921):



  • MA = ¬AA

  • LA = ¬M¬A

  • IA = MA ∧ ¬LA


They have the following truth tables:

























A

MA
F
F
U
T
T
T




















A

LA
F
F
U
F
T
T




















A

IA
F
F
U
T
T
F


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:




  • AIA ∨ ¬A (law of excluded fourth)


  • ¬(A ∧ ¬IA ∧ ¬A) (extended contradiction principle).



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:[8]



  • 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. The original intent of NULL in SQL was 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.[9] 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,[10] meaning its logical operators can express (in combination) any conceivable three-valued logical function.



See also




  • Binary logic (disambiguation)

  • Boolean algebra (structure)

  • Boolean function

  • Digital circuit

  • Four-valued logic

  • Paraconsistent logic § An ideal three-valued paraconsistent logic


  • Setun – an experimental Russian computer which was based on ternary logic


  • Ternary numeral system (and Balanced ternary)


  • Three-state logic (tri-state buffer)



References





  1. ^ "Stanford JavaNLP API". Stanford University. Stanford NLP Group..mw-parser-output cite.citation{font-style:inherit}.mw-parser-output .citation q{quotes:"""""""'""'"}.mw-parser-output .citation .cs1-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Wikisource-logo.svg/12px-Wikisource-logo.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:inherit;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{font-size:100%}.mw-parser-output .cs1-maint{display:none;color:#33aa33;margin-left:0.3em}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration,.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}


  2. ^ Knuth, Donald E. (1981). The Art of Computer Programming Vol. 2. Reading, Mass.: Addison-Wesley Publishing Company. p. 190.


  3. ^ Hayes, Brian (November–December 2001). "Third Base". American Scientist. Sigma Xi, the Scientific Research Society. 89 (6): 490–494. doi:10.1511/2001.6.490.


  4. ^ Nelson, David (2008). The Penguin Dictionary of Mathematics. Fourth Edition. London, England: Penguin Books. Entry for 'three-valued logic'.


  5. ^ Douglas W. Jones, Standard Ternary Logic, Feb. 11, 2013.


  6. ^ http://www.uky.edu/~look/Phi520-Lecture7.pdf


  7. ^ 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


  8. ^ Miller, D. Michael; Thornton, Mitchell A. (2008). Multiple valued logic: concepts and representations. Synthesis lectures on digital circuits and systems. 12. Morgan & Claypool Publishers. pp. 41–42. ISBN 978-1-59829-190-2.


  9. ^ 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
    ISBN 978-0-7923-8129-7, p. 344; PS preprint (note: page numbering differs in preprint from the published version)



  10. ^ C. J. Date, Relational database writings, 1991–1994, Addison-Wesley, 1995, p. 371




Further reading




  • Bergmann, Merrie (2008). An Introduction to Many-Valued and Fuzzy Logic: Semantics, Algebras, and Derivation Systems. Cambridge University Press. ISBN 978-0-521-88128-9. Retrieved 24 August 2013., 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). doi:10.1016/s0049-237x(08)70262-3

  • Reichenbach, Hans (1944). Philosophic Foundations of Quantum Mechanics. University of California Press. Dover 1998:
    ISBN 0-486-40459-5



External links



  • Introduction to Many-Valued Logics by Bertram Fronhöfer. Handout from a 2011 summer class at Technische Universität Dresden. (Despite the title, this is almost entirely about three-valued logics.)








Popular posts from this blog

Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

Simple Scan not detecting my scanner (Brother DCP-7055W)Brother MFC-L2700DW printer can print, can't...