<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">PM</journal-id><journal-title-group><journal-title>Pure  Mathematics</journal-title></journal-title-group><issn pub-type="epub">2160-7583</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.12677/PM.2019.93036</article-id><article-id pub-id-type="publisher-id">PM-30087</article-id><article-categories><subj-group subj-group-type="heading"><subject>PM20190300000_80654354.pdf</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>数学与物理</subject></subj-group></article-categories><title-group><article-title>
 
 
  数理逻辑论证形式有效性算法
  The Algorithms about Validity of Argument Form in Logic Mathematician
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>刘</surname><given-names>巧云</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="aff" rid="aff2"><sup>2</sup></xref></contrib></contrib-group><aff id="aff1"><label>1</label><addr-line>null</addr-line></aff><aff id="aff2"><label>1</label><addr-line>青海民族大学，青海 西宁</addr-line></aff><pub-date pub-type="epub"><day>05</day><month>05</month><year>2019</year></pub-date><volume>09</volume><issue>03</issue><fpage>276</fpage><lpage>281</lpage><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  
    本文讨论了数理逻辑中论证形式有效性的四种判断方法并给出了一种判断有效性的计算机算法。
    It discusses the four methods to judge the validity of argument form in logic mathematician in this paper. In the end it gives the algorithms of judging validity of argument form. 
  
 
</p></abstract><kwd-group><kwd>论证形式有效性，真值表，重言式，推理规则, Validity of Argument Form</kwd><kwd> Truth Table</kwd><kwd> Tautology</kwd><kwd> Induction Rules</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>数理逻辑论证形式有效性算法<sup> </sup></title><p>刘巧云</p><p>青海民族大学，青海 西宁</p><p><img src="//html.hanspub.org/file/6-1250789x1_hanspub.png" /></p><p>收稿日期：2019年4月14日；录用日期：2019年4月25日；发布日期：2019年5月6日</p><disp-formula id="hanspub.30087-formula41"><graphic xlink:href="//html.hanspub.org/file/6-1250789x5_hanspub.png"  xlink:type="simple"/></disp-formula></sec><sec id="s2"><title>摘 要</title><p>本文讨论了数理逻辑中论证形式有效性的四种判断方法并给出了一种判断有效性的计算机算法。</p><p>关键词 :论证形式有效性，真值表，重言式，推理规则</p><disp-formula id="hanspub.30087-formula42"><graphic xlink:href="//html.hanspub.org/file/6-1250789x6_hanspub.png"  xlink:type="simple"/></disp-formula><p>Copyright &#169; 2019 by author(s) and Hans Publishers Inc.</p><p>This work is licensed under the Creative Commons Attribution International License (CC BY).</p><p>http://creativecommons.org/licenses/by/4.0/</p><p><img src="//html.hanspub.org/file/6-1250789x7_hanspub.png" /> <img src="//html.hanspub.org/file/6-1250789x8_hanspub.png" /></p></sec><sec id="s3"><title>1. 引言</title><p>数理逻辑，是由推理组成的。我们假定只讨论或真或假的句子，把这种句子称为简单句或复合句。</p><p>当复合句符号化时，得到了纯语句形式，几个不同的语句可以有共同的语句形式。因此，我们研究语句形式而不是语句含义，从而讨论语句形式的有效性判断方法十分必要。字母 p , q , r, ⋯ 是语句变元，表示任意没有指明的简单语句。</p></sec><sec id="s4"><title>2. 定义</title><p>1) 论证形式定义 [<xref ref-type="bibr" rid="hanspub.30087-ref1">1</xref>] <sup> </sup></p><p>通常，一个论证形式是语句形式的有穷序列，序列最后一项称为结论，其余项称为前提。</p><p>2) 论证形式有效性定义 [<xref ref-type="bibr" rid="hanspub.30087-ref1">1</xref>]</p><p>论证形式 A 1 , A 2 , ⋯ , A n ； ∴ A 是无效的，如果对出现的语句变元的真值指派有可能使 A 1 , A 2 , ⋯ , A n 取值1而 A 取值0；否则论证形式是有效的。</p></sec><sec id="s5"><title>3. 论证形式有效性判断方法</title><p>1) 用真值表判断</p><p>方法 [<xref ref-type="bibr" rid="hanspub.30087-ref1">1</xref>] ：利用定义，对作为前提或结论出现的所有语句形式构造真值表，若所有前提为真时的语句变元赋值使得结论也为真，则说明此论证形式有效。否则，此论证形式无效。</p><p>例1：如果今天周日，那么明天是周一。事实上今天是周日。从而，明天是周一。</p><p>解：设p：今天是周日；q：明天是周一。此论证形式为： p → q , p ; ∴ q 。写出真值表如下：</p><p>前提都取值1的行只有第1行，结论也取值1，从而此论证形式有效。</p><p>2) 用反证法判断</p><p>从上述例子可以看到，如果不同的语句变元数目很多，真值表将变得很庞大，从而是不切实际的。一般情况下，我们并不需要整个真值表就可得到有效或者无效的目的。</p><p>方法 [<xref ref-type="bibr" rid="hanspub.30087-ref1">1</xref>] ：以有规则的方法寻找特殊类型的行，而不用构造整个真值表的带有试探性的易出错误的方法。具体的方法用例2说明。</p><p>例2：对于春秋时期的某国，如果仓禀实或衣食足，则民知礼节或者知荣辱。如果民知礼节或者知荣辱，则或者国富，或者民强。如果民强，则百业兴。事实上该国并非国富，而且并非百业兴。从而，该国并非仓禀实且并非衣食足。</p><p>解：设p：国仓禀实；q：国衣食足；r：民知礼节；s：民知荣辱；t：国富；u：民强；v：国百业兴。从而写出论证形式为： ( p ∨ q ) → ( r ∨ s ) , ( r ∨ s ) → ( t ∨ u ) , u → v , ~   t   ∧ ~   v ; ∴ ~   p   ∧ ~   q 。</p><p>假设结论 ~   p   ∧ ~   q 为假，则p与q必有一个为真。此时， p ∨ q 必为1，前提 ( p ∨ q ) → ( r ∨ s ) 为真时， r ∨ s 值也应该取1。此时 ( r ∨ s ) → ( t ∨ u ) 要为真时， t ∨ u 值应该取1；前提 ~   t   ∧ ~   v 取真，t与v都应该取假；t为假时， t ∨ u 为真，从而u为真。u为真，v为假，从而 u → v 值为0。从而，此论证形式有效。</p><p>3) 用重言式判断</p><p>方法 [<xref ref-type="bibr" rid="hanspub.30087-ref1">1</xref>] ：论证形式 A 1 , A 2 , ⋯ , A n ; ∴ A 是有效的当且仅当命题形式 ( A 1 ∧ A 2 ∧ ⋯ ∧ A n ) → A 是重言式。</p><p>例3：如果a为整数，则它为有理数；如果a为有理数，则它为实数。所以，如果a是整数，则它为实数。</p><p>解：设p：a为整数；q：a为有理数；r：a为实数。从而写出论证形式为： p → q , q → r ; ∴ p → r 。写出语句形式 ( ( p → q ) ∧ ( q → r ) ) → ( p → r ) 的真值表。</p><p>从真值表可以看出不论变元如何赋值，最后的语句都取值1。 ( ( p → q ) ∧ ( q → r ) ) → ( p → r ) 是重言式，所以 p → q , q → r ; ∴ p → r 有效。</p><p>4) 用推理规则判断</p><p>方法 [<xref ref-type="bibr" rid="hanspub.30087-ref2">2</xref>] ：从任意给定的前提出发，应用相应的推理规则进行推演，得到的结论在系统中被认为是有效的。推理规则有前提引入规则、结论引用规则、置换规则、加法式、简化式、假言推理、拒取式、析取三段论、前提三段论、合取式、构造性二难推理和破坏性二难推理。</p><p>例4：小王是工程师或者教师；如果小王是工程师，那么小李是医生；如果小王是教师，那么小李是医生；小王是教师。所以，小王是教师且小李是医生。</p><p>解：设p：小王是工程师；q：小王是教师；r：小李是医生。此论证形式为 p ∨ q , p → r , q → r , q ; ∴ q ∧ r 。</p><p>i) p ∨ q 前提引入</p><p>ii) p → r 前提引入</p><p>iii) q → r 前提引入</p><p>iv) r (1)(2)(3)构造性两难</p><p>v) q 前提引入</p><p>vi) q ∧ r 合取式</p></sec><sec id="s6"><title>4. 论证形式有效性算法</title><p>从上述例子可以看出，利用真值表和重言式来验证论证形式有效性十分繁琐，遇到语句变元较多情况时，花费的时间较多。用反证法容易出错。计算机程序设计越来越普遍，计算机计算节省了很多时间。下面以例题的方式列出论证形式有效性程序：</p><p>例5：如果生产下降或浪费严重，那么将造成物资匮乏。如果物资匮乏，那么或者物价暴涨，或者人民生活贫困。如果人民生活贫困，政府将失去民心。事实上，物价没有暴涨，而且政府赢得了民心。由此可见生产没有下降并且没有浪费严重。</p><p>解：设p：生产下降；q：浪费严重；r：物资匮乏；s：物价暴涨；t：人民生活贫困；u：政府将失去民心。此论证形式为： ( p ∨ q ) → r , r → ( s ∨ t ) , t → u , ~   s   ∧ ~   u ; ∴ ~   p   ∧ ~   q 。利用java程序计算，最后得此论证形式有效。程序如下：</p><p>import java.lang.Math;</p><p>public class love {</p><p>public static int YH(int p, int q){</p><p>if(p == 1 &amp; q == 0){</p><p>return 0;}</p><p>else{return 1;}}//函数YH为蕴含函数定义；</p><p>public static int Y(int array[<xref ref-type="bibr" rid="hanspub.30087-ref"></xref>][<xref ref-type="bibr" rid="hanspub.30087-ref"></xref>],int n,int m){</p><p>int cou = 1;int geshu = 0;</p><p>int p = 0, q = 0,r = 0, s = 0, t = 0, u = 0;</p><p>for(int i = 0; i &lt; n; i ++){</p><p>for(int j = 0;j &lt;= m; j ++){</p><p>switch(j){</p><p>case 0:</p><p>p = array[i][j];</p><p>break;</p><p>case 1:</p><p>q = array[i][j];</p><p>break;</p><p>case 2:</p><p>r = array[i][j];</p><p>break;</p><p>case 3:</p><p>s = array[i][j];</p><p>break;</p><p>case 4:</p><p>t = array[i][j];</p><p>break;</p><p>case 5:</p><p>u = array[i][j];//变元不够时可再进行添加；</p><p>default:</p><p>break;}}</p><p>int y = YH(YH(p|q,r)&amp;YH(r,s|t)&amp;YH(t,u)&amp;((~s)&amp;(~u)),((~p)&amp;(q)));//需要验证的论证形式改写用第三种方法写出的语句形式；</p><p>array[i][<xref ref-type="bibr" rid="hanspub.30087-ref0">0</xref>] = y;</p><p>if(y == 0) cou = 0;}</p><p>for(int x = 0; x &lt; array.length / 2; x ++){</p><p>int temp = array[x][<xref ref-type="bibr" rid="hanspub.30087-ref0">0</xref>];</p><p>array[x][<xref ref-type="bibr" rid="hanspub.30087-ref0">0</xref>] = array[array.length-1-x][<xref ref-type="bibr" rid="hanspub.30087-ref0">0</xref>];</p><p>array[array.length-1-x][<xref ref-type="bibr" rid="hanspub.30087-ref0">0</xref>] = temp;}</p><p>for(int i = 0; i &lt; array.length; i ++){</p><p>if(array[i][<xref ref-type="bibr" rid="hanspub.30087-ref0">0</xref>]==0){</p><p>System.out.print(\n此论证形式无效。\n);break;}//只要遇到赋值时结果为0，此语句形式不是重言式，此论证形式无效；</p><p>else{geshu ++;}}</p><p>if(geshu==n){System.out.print(\n此论证形式有效。\n);}//所有赋值结果都为1时，此语句为重言式，论证形式有效；</p><p>return 0;}</p><p>public static void main(String args[<xref ref-type="bibr" rid="hanspub.30087-ref"></xref>]){</p><p>String str = YH(YH(p|q,r)&amp;YH(r,s|t)&amp;YH(t,u)&amp;((~s)&amp;(~u)),((~p)&amp;(q)))//与int y保持一致；</p><p>char[<xref ref-type="bibr" rid="hanspub.30087-ref"></xref>] cha1 = new char[str.length()];</p><p>char[<xref ref-type="bibr" rid="hanspub.30087-ref"></xref>] cha2 = new char[str.length()];</p><p>for(int i =0; i &lt; str.length(); i ++){</p><p>cha1[i] = str.charAt(i);}</p><p>int count = 0;</p><p>for(int j = 0; j &lt; str.length(); j ++){</p><p>if(((int)(cha1[j]) &gt;= 97 &amp; (int)(cha1[j]) &lt;= 122)){</p><p>for(int k = j+1; k &lt; str.length(); k ++){</p><p>if(cha1[j] == cha1[k]){</p><p>cha2[j] = cha1[j];}}}//计算小写字母个数；</p><p>else{</p><p>if(((int)(cha1[j]) &gt; 122)| ((int)(cha1[j]) &lt; 97)){</p><p>cha2[j] = cha1[j];}}}//计算其它字符个数；</p><p>for(int i =0; i &lt; cha2.length; i ++){</p><p>if((int)(cha2[i]) != 0){</p><p>count ++;} }//计算重复的小写字母个数；</p><p>count = (int) (str.length()) - count;//计算输入的语句形式有几个变元；</p><p>//System.out.print(\n此论证形式变元个数为：+count+\n);此处可输出；</p><p>int[<xref ref-type="bibr" rid="hanspub.30087-ref"></xref>][<xref ref-type="bibr" rid="hanspub.30087-ref"></xref>] cha3 = new int[(int)(Math.pow(2,count))][count+1];</p><p>for(int i = (int)(Math.pow(2,count))-1; i &gt;= 0; i --){</p><p>int s = i;</p><p>int t = i;</p><p>while(s != 0){</p><p>for(int j = 0;j &lt; count;j ++){</p><p>cha3[t][j] = s % 2;</p><p>s = s / 2;}}}//采用变元赋值时每次十进制多1的方法，将十进制改写成2进制形式给变元赋值；</p><p>//System.out.print( +cha3[t][j]);//输出每个变元的赋值；可输出</p><p>//System.out.println();}}</p><p>for(int j = 0;j &lt; count;j ++){</p><p>cha3[<xref ref-type="bibr" rid="hanspub.30087-ref0">0</xref>][j] = 0;}</p><p>//System.out.print( +cha3[<xref ref-type="bibr" rid="hanspub.30087-ref0">0</xref>][j]);//输出每个变元的赋值；可输出</p><p>System.out.println();</p><p>int y= Y(cha3,(int)(Math.pow(2,count)),count+1);} }//调用Y函数计算最后结果。</p></sec><sec id="s7"><title>基金项目</title><p>青海民族大学探究课程项目，项目编号：2018-TJKC-01。</p></sec><sec id="s8"><title>文章引用</title><p>刘巧云. 数理逻辑论证形式有效性算法The Algorithms about Validity of Argument Form in Logic Mathematician[J]. 理论数学, 2019, 09(03): 276-281. https://doi.org/10.12677/PM.2019.93036</p></sec><sec id="s9"><title>参考文献</title></sec></body><back><ref-list><title>References</title><ref id="hanspub.30087-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Hamilton, A.G. Logic for Mathematicians (Revised Edition). 北京: 清华大学出版社, 2003.</mixed-citation></ref><ref id="hanspub.30087-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">王礼萍, 等. 离散数学简明教程[M]. 北京: 清华大学出版社, 2005.</mixed-citation></ref></ref-list></back></article>