{"id":994,"date":"2010-08-24T20:20:15","date_gmt":"2010-08-25T00:20:15","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/?p=994"},"modified":"2010-08-24T20:20:15","modified_gmt":"2010-08-25T00:20:15","slug":"introducing-three-valued-logic","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2010\/08\/24\/introducing-three-valued-logic\/","title":{"rendered":"Introducing Three-Valued Logic"},"content":{"rendered":"<p>So, finally, I&#8217;m getting around to three-valued logic!<\/p>\n<p>To start, why are we even looking at three-valued logic? We want to get to fuzzy reasoning, and three valued logic really doesn&#8217;t do the job. But it&#8217;s a useful starting point, because in general, most of us have only worked with standard logics where statements are either true or false. In Fuzzy logic, we&#8217;re don&#8217;t have that &#8211; and that can lead to a lot of complexity. So looking at something simple that shows us how something either than &#8220;true&#8221; or &#8220;false&#8221; can actually make sense in logic.<\/p>\n<p><!--more--><\/p>\n<p>The idea of three-valued logic is, quite simply, to add an alternative to true or false: neither. We usually abbreviate the truth values to T, F, and N. What does N mean? It depends on exactly <em>which<\/em> three-valued logic you choose. And already, we can start to see where some of the complexity is going to come from.<\/p>\n<p>In traditional propositional or predicate logic, we can take statements, and assign them a truth value: either they&#8217;re true, or they&#8217;re false. Once we know whether they&#8217;re true or false, we can use that knowledge to infer whether other statements are true or false. In general, in classical logic, the inference rules seem obvious. If you know that <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> is true, then you know <img src='http:\/\/l.wordpress.com\/latex.php?latex=A%20lor%20B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A lor B' style='vertical-align:1%' class='tex' alt='A lor B' \/> is true. It doesn&#8217;t matter what <img src='http:\/\/l.wordpress.com\/latex.php?latex=B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='B' style='vertical-align:1%' class='tex' alt='B' \/> is; if <img src='http:\/\/l.wordpress.com\/latex.php?latex=B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='B' style='vertical-align:1%' class='tex' alt='B' \/> is false, then <img src='http:\/\/l.wordpress.com\/latex.php?latex=A%20lor%20B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A lor B' style='vertical-align:1%' class='tex' alt='A lor B' \/> is true; if <img src='http:\/\/l.wordpress.com\/latex.php?latex=B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='B' style='vertical-align:1%' class='tex' alt='B' \/> is true, then <img src='http:\/\/l.wordpress.com\/latex.php?latex=A%20lor%20B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A lor B' style='vertical-align:1%' class='tex' alt='A lor B' \/> is true. No matter what, if you know that <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> is true, then <img src='http:\/\/l.wordpress.com\/latex.php?latex=A%20lor%20B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A lor B' style='vertical-align:1%' class='tex' alt='A lor B' \/> <em>must<\/em> be true.<\/p>\n<p>In a three valued logic, that isn&#8217;t necessarily the case. It all depends on what <img src='http:\/\/l.wordpress.com\/latex.php?latex=N&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='N' style='vertical-align:1%' class='tex' alt='N' \/> means. For example, you can define a three-valued logic where <img src='http:\/\/l.wordpress.com\/latex.php?latex=N&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='N' style='vertical-align:1%' class='tex' alt='N' \/> means &#8220;I don&#8217;t know&#8221;. In that case, you&#8217;d have inference rules like <img src='http:\/\/l.wordpress.com\/latex.php?latex=Gamma%20%3A-%20A%3D%7Bbf%20T%7D%20Rightarrow%20Gamma%20%3A-%20%28A%20lor%20B%29%3D%7Bbf%20T%7D&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='Gamma :- A={bf T} Rightarrow Gamma :- (A lor B)={bf T}' style='vertical-align:1%' class='tex' alt='Gamma :- A={bf T} Rightarrow Gamma :- (A lor B)={bf T}' \/> &#8211; meaning that if I know that <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> is true, then I can infer that <img src='http:\/\/l.wordpress.com\/latex.php?latex=A%20lor%20B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A lor B' style='vertical-align:1%' class='tex' alt='A lor B' \/> is also true. If <img src='http:\/\/l.wordpress.com\/latex.php?latex=N&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='N' style='vertical-align:1%' class='tex' alt='N' \/> means &#8220;I don&#8217;t know&#8221;, then <img src='http:\/\/l.wordpress.com\/latex.php?latex=A%20lor%20N&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A lor N' style='vertical-align:1%' class='tex' alt='A lor N' \/> is still true.<\/p>\n<p>But <img src='http:\/\/l.wordpress.com\/latex.php?latex=N&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='N' style='vertical-align:1%' class='tex' alt='N' \/> doesn&#8217;t have to mean &#8220;I don&#8217;t know&#8221;. It could mean &#8220;maybe&#8221;. It could mean &#8220;neither&#8221; (in the sense of vagueness; Ann isn&#8217;t really tall, but she isn&#8217;t really <em>not tall<\/em> either). Or it could mean &#8220;nonsense&#8221;, as in an invalid statement that can&#8217;t be assigned a truth value. If it means &#8220;nonsense&#8221;, then <img src='http:\/\/l.wordpress.com\/latex.php?latex=%28A%20lor%20%7Bbf%20N%7D%29%20%3D%20%7Bbf%20N%7D&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='(A lor {bf N}) = {bf N}' style='vertical-align:1%' class='tex' alt='(A lor {bf N}) = {bf N}' \/> &#8211; that is, <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> or meaningless nonsense is meaningless nonsense.<\/p>\n<p>So there are many three-valued logics, depending on exactly what you want <img src='http:\/\/l.wordpress.com\/latex.php?latex=N&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='N' style='vertical-align:1%' class='tex' alt='N' \/> to mean, and how you want it to behave. Let&#8217;s look at one particular three-valued logic, just to see how it works. We&#8217;ll start with Kleene&#8217;s strong three valued logic &#8211; generally written <img src='http:\/\/l.wordpress.com\/latex.php?latex=K%5ES_3&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='K^S_3' style='vertical-align:1%' class='tex' alt='K^S_3' \/>. <img src='http:\/\/l.wordpress.com\/latex.php?latex=K%5ES_3&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='K^S_3' style='vertical-align:1%' class='tex' alt='K^S_3' \/> is a three valued logic where <img src='http:\/\/l.wordpress.com\/latex.php?latex=N&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='N' style='vertical-align:1%' class='tex' alt='N' \/> means &#8220;unknown&#8221; or &#8220;uncertain&#8221;. The basic logical operators in <img src='http:\/\/l.wordpress.com\/latex.php?latex=K%5ES_3&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='K^S_3' style='vertical-align:1%' class='tex' alt='K^S_3' \/> behave according to the truth table below:<\/p>\n<p><center><img src='http:\/\/l.wordpress.com\/latex.php?latex=%20begin%7Barray%7D%7B%7Cc%7Cc%7Cc%7Cc%7Cc%7C%7D%20hline%7Bbf%20A%7D%20%5C%20hlineT%20%26amp%3B%20T%20%26amp%3B%20T%20%26amp%3B%20T%20%26amp%3B%20F%5C%20hlineT%20%26amp%3B%20N%20%26amp%3B%20T%20%26amp%3B%20N%20%26amp%3B%20F%5C%20hlineT%20%26amp%3B%20F%20%26amp%3B%20T%20%26amp%3B%20F%20%26amp%3B%20F%20%5C%20hlineN%20%26amp%3B%20T%20%26amp%3B%20T%20%26amp%3B%20N%20%26amp%3B%20N%20%5C%20hlineN%20%26amp%3B%20N%20%26amp%3B%20N%20%26amp%3B%20N%20%26amp%3B%20N%20%5C%20hlineN%20%26amp%3B%20F%20%26amp%3B%20N%20%26amp%3B%20F%20%26amp%3B%20N%20%5C%20hlineF%20%26amp%3B%20T%20%26amp%3B%20T%20%26amp%3B%20F%20%26amp%3B%20T%20%5C%20hlineF%20%26amp%3B%20N%20%26amp%3B%20N%20%26amp%3B%20F%20%26amp%3B%20T%20%5C%20hlineF%20%26amp%3B%20F%20%26amp%3B%20F%20%26amp%3B%20F%20%26amp%3B%20T%20%5C%20hlineend%7Barray%7D&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title=' begin{array}{|c|c|c|c|c|} hline{bf A} \\ hlineT &amp; T &amp; T &amp; T &amp; F\\ hlineT &amp; N &amp; T &amp; N &amp; F\\ hlineT &amp; F &amp; T &amp; F &amp; F \\ hlineN &amp; T &amp; T &amp; N &amp; N \\ hlineN &amp; N &amp; N &amp; N &amp; N \\ hlineN &amp; F &amp; N &amp; F &amp; N \\ hlineF &amp; T &amp; T &amp; F &amp; T \\ hlineF &amp; N &amp; N &amp; F &amp; T \\ hlineF &amp; F &amp; F &amp; F &amp; T \\ hlineend{array}' style='vertical-align:1%' class='tex' alt=' begin{array}{|c|c|c|c|c|} hline{bf A} \\ hlineT &amp; T &amp; T &amp; T &amp; F\\ hlineT &amp; N &amp; T &amp; N &amp; F\\ hlineT &amp; F &amp; T &amp; F &amp; F \\ hlineN &amp; T &amp; T &amp; N &amp; N \\ hlineN &amp; N &amp; N &amp; N &amp; N \\ hlineN &amp; F &amp; N &amp; F &amp; N \\ hlineF &amp; T &amp; T &amp; F &amp; T \\ hlineF &amp; N &amp; N &amp; F &amp; T \\ hlineF &amp; F &amp; F &amp; F &amp; T \\ hlineend{array}' \/><\/center><\/p>\n<p>So N behaves pretty much as you&#8217;d expect unknown to behave. If you know something is true, then true or unknown is true, because the unknown could be true or it could be false &#8211; and in either case, it makes sense that the result of a logical or should result in true.<\/p>\n<p>Setting things up this way has some interesting effects. In <img src='http:\/\/l.wordpress.com\/latex.php?latex=K%5ES_3&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='K^S_3' style='vertical-align:1%' class='tex' alt='K^S_3' \/>, there are no tautologies. (A tautology is a statement that is always true.)  Take a look at one of the classic ones: <img src='http:\/\/l.wordpress.com\/latex.php?latex=A%20lor%20lnot%20A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A lor lnot A' style='vertical-align:1%' class='tex' alt='A lor lnot A' \/>. If <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> is true, then it&#8217;s true. If <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> is false, then it&#8217;s true. But if $A$ is <img src='http:\/\/l.wordpress.com\/latex.php?latex=N&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='N' style='vertical-align:1%' class='tex' alt='N' \/>, then it&#8217;s <img src='http:\/\/l.wordpress.com\/latex.php?latex=N&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='N' style='vertical-align:1%' class='tex' alt='N' \/>. Similarly, there are no contradictions: <img src='http:\/\/l.wordpress.com\/latex.php?latex=A%20land%20not%20A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A land not A' style='vertical-align:1%' class='tex' alt='A land not A' \/> isn&#8217;t false when <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> is <img src='http:\/\/l.wordpress.com\/latex.php?latex=N&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='N' style='vertical-align:1%' class='tex' alt='N' \/>.<\/p>\n<p>So just by adding this simple <img src='http:\/\/l.wordpress.com\/latex.php?latex=N&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='N' style='vertical-align:1%' class='tex' alt='N' \/> value, some of the most basic things that we&#8217;ve come to expect from logical reasoning, some of our most basic logical intuitions <em>no longer  work<\/em>. We&#8217;re going to have to get used to that as we get fuzzier.<\/p>\n<p>So there are some unexpected things in our three-valued logic. But some things continue to work as we expect. One of the nice properties of  <img src='http:\/\/l.wordpress.com\/latex.php?latex=K%5ES_3&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='K^S_3' style='vertical-align:1%' class='tex' alt='K^S_3' \/> is that its connectives are <em>normal<\/em> &#8211; which just means that if we limit ourselves to true and false, they&#8217;ll behave the same way as they do in two-valued logic.<\/p>\n<p>But normality doesn&#8217;t give us as much as it might seem. We can take some pretty innocuous looking proofs from two-valued logic, and they&#8217;ll fall apart in <img src='http:\/\/l.wordpress.com\/latex.php?latex=K%5ES_3&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='K^S_3' style='vertical-align:1%' class='tex' alt='K^S_3' \/>, even though they&#8217;re built on normal connectives.<\/p>\n<p>Consider one simple argument from propositional argument. Suppose that we know <img src='http:\/\/l.wordpress.com\/latex.php?latex=lnot%20%28A%20leftrightarrow%20B%29&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='lnot (A leftrightarrow B)' style='vertical-align:1%' class='tex' alt='lnot (A leftrightarrow B)' \/>. In two-valued propositional logic, from that, we can infer that for any proposition P, either <img src='http:\/\/l.wordpress.com\/latex.php?latex=P%20leftrightarrow%20A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='P leftrightarrow A' style='vertical-align:1%' class='tex' alt='P leftrightarrow A' \/>, or <img src='http:\/\/l.wordpress.com\/latex.php?latex=P%20leftrightarrow%20B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='P leftrightarrow B' style='vertical-align:1%' class='tex' alt='P leftrightarrow B' \/>. That&#8217;s not true in <img src='http:\/\/l.wordpress.com\/latex.php?latex=K%5ES_3&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='K^S_3' style='vertical-align:1%' class='tex' alt='K^S_3' \/>: suppose that A is N, and B is T. P could then be F.<\/p>\n<p>This is, obviously, just a quick taste. But <img src='http:\/\/l.wordpress.com\/latex.php?latex=K%5ES_3&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='K^S_3' style='vertical-align:1%' class='tex' alt='K^S_3' \/> is pretty simple &#8211; you can figure out most of its properties just from this little bit here. But there are several other ways of defining three-valued logics. In the next post, we&#8217;ll take a quick look at two others: <img src='http:\/\/l.wordpress.com\/latex.php?latex=L_3&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='L_3' style='vertical-align:1%' class='tex' alt='L_3' \/>, which is similar to <img src='http:\/\/l.wordpress.com\/latex.php?latex=K%5ES_3&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='K^S_3' style='vertical-align:1%' class='tex' alt='K^S_3' \/> but modifies the definition of implication so that <img src='http:\/\/l.wordpress.com\/latex.php?latex=N%20leftrightarrow%20N&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='N leftrightarrow N' style='vertical-align:1%' class='tex' alt='N leftrightarrow N' \/> is true; and <img src='http:\/\/l.wordpress.com\/latex.php?latex=B_3&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='B_3' style='vertical-align:1%' class='tex' alt='B_3' \/>, which is built on the idea that <img src='http:\/\/l.wordpress.com\/latex.php?latex=N&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='N' style='vertical-align:1%' class='tex' alt='N' \/> means something like <em>undefined<\/em>. <img src='http:\/\/l.wordpress.com\/latex.php?latex=B_3&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='B_3' style='vertical-align:1%' class='tex' alt='B_3' \/> also builds up some more interesting structure around the three-valued logic.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, finally, I&#8217;m getting around to three-valued logic! To start, why are we even looking at three-valued logic? We want to get to fuzzy reasoning, and three valued logic really doesn&#8217;t do the job. But it&#8217;s a useful starting point, because in general, most of us have only worked with standard logics where statements are [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[87,33],"tags":[164,195],"class_list":["post-994","post","type-post","status-publish","format-standard","hentry","category-fuzzy-logic","category-logic","tag-fuzziness","tag-logic-4"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-g2","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/994","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/comments?post=994"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/994\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=994"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}