文章目录
第一章 命题逻辑
1.1 命题与逻辑联结词 Propositional Logic
-
命题定义:
- 陈述句 Declaration Sentence
- True or false, Not Both
注意:疑问句 × \times ×,祈使句 × \times ×,无法判断对错 × \times ×( 1 + 1 = 2 × 1+1=2\times 1+1=2×无法判断十进制还是二进制???),主观感受 × \times ×,若有上下文可判断对错。
-
命题变量 Propositional variables: p , q , r , s p,q,r,s p,q,r,s
-
关系命题 Compound Propositional:
- 非,否 lnotation: ¬ p \lnot p ¬p
- 合取 Conjunction: p ∧ q p\land q p∧q ( a n d and and,并且)
- 析取 Disjunction,容斥合 Inclusive Or: p ∨ q p\lor q p∨q ( o r or or,或)
- 排斥合 Exclusive Or: p ⊕ q p\oplus q p⊕q ( x o r xor xor,异或)
-
条件联结词 Implication/ Conditional Statement:
- 单条件: p ( 条 件 ) → q ( 结 论 ) p(条件)\rightarrow q(结论) p(条件)→q(结论) . (韦恩图中 p − q ‾ \color{red}\overline{p-q} p−q)
- 双条件 Biconditional: p ⟷ q p \longleftrightarrow q p⟷q (韦恩图中 ( p ⋂ q ) ⋃ ( p ⋃ q ) ‾ \color{red}(p\bigcap q)\bigcup \overline{(p\bigcup q)} (p⋂q)⋃(p⋃q))(=if and only if 当且仅当 = necessary and sufficient 充分必要条件 = 反之亦然) ⟺ ¬ ( p ⊕ q ) \iff \neg(p\oplus q) ⟺¬(p⊕q)
p q p → q p\rightarrow q p→q p ⟷ q p \longleftrightarrow q p⟷q T T T T T F F \color{red}F F F \color{red}F F F T T F \color{red}F F F F T T 注意: p , q p,q p,q之间不需要有关, p → q p\rightarrow q p→q 仅确定形式,不确定内容
记忆:p 代表人诚实,q 代表话对错, p → q p\rightarrow q p→q 代表推理看法
Different Ways of Expressing p → q p\rightarrow q p→q pq if p, then q 11 if p, q 11 Star \color{white}\colorbox{red}{Star} Star:q unless ¬ \lnot ¬ p (q 为真除非 ¬ \lnot ¬p 为假)(unless 记为 if not) 11 q if p 11 q whenever p 01,11 q follows from p 11,00 p implies q 11,00 Star \color{white}\colorbox{red}{Star} Star:p only if q (p 为真仅当 q 为真) 11 q when p 11 p is sufficient for q / q is necessary for p / 必要条件 Necessary Condition,充分条件 Sufficient Condition
- p → q p\rightarrow q p→q 逆命题 Converse: p → q p\rightarrow q p→q
- p → q p\rightarrow q p→q 逆反命题 Contrapositive: ¬ q → ¬ p \lnot q\rightarrow \lnot p ¬q→¬p
- p → q p\rightarrow q p→q 反命题 Inverse: ¬ p → ¬ q \lnot p\rightarrow \lnot q ¬p→¬q
- 举例:p 表示不下雨,q 表示去逛街
- p → q p\rightarrow q p→q:不下雨,就去逛街
- 逆命题 p → q p\rightarrow q p→q:去逛街,就(一定是因为)不下雨
- 逆反命题 ¬ q → ¬ p \lnot q\rightarrow \lnot p ¬q→¬p:不逛街,就是(因为)下雨(了)
- 反命题 ¬ p → ¬ q \lnot p\rightarrow \lnot q ¬p→¬q:下雨,就不去逛街
-
复合命题的真值表 Truth table for Compound Propositions:
- 等价命题 Equivalent Propositons:有相同的真值表
- 逆反命题与原命题等价
- 逆命题与反命题等价
p q ¬ \lnot ¬p ¬ \lnot ¬q 原命题 p → q p\rightarrow q p→q 逆命题 q → p q\rightarrow p q→p 逆反命题 ¬ q → ¬ p \lnot q\rightarrow \lnot p ¬q→¬p 反命题 ¬ p → ¬ q \lnot p\rightarrow \lnot q ¬p→¬q T T F F T T T T T F F T F \color{red}F F T F \color{red}F F T F T T F T F \color{red}F F T F \color{red}F F F F T T T T T T - 行数:n 个变量的真值表有 2 n 2^n 2n 行
- 既然一个命题 n 个变量有 2 n 2^n 2n种情况,那 n 个变量的 2 n 2^n 2n种结果可构成 2 2 n 2^{2^n} 22n种不同真值表。
- 等价命题 Equivalent Propositons:有相同的真值表
-
优先级 Precedence:若没有括号, ¬ \lnot ¬ 最高,其余优先级相同,从左向右读取。
-
位运算 Bit Operations:按位(bitwise)计算
1.2 命题公式及其赋值 Application of Propositional Logic
-
自然语言符号化 Translating:
- 找到原子(不可再分)命题 atomic propositional
- 确定合适的关系,注意格式
例:“You cannot ride the roller coaster(过山车) if you are under 4 feet tall unless you are older than 16 years old.”
解:
p : “ You can ride the roller coaster ” q : “ You are under 4 feet tall ” r : “ You are older than 16 years old ” . ( q ∧ ¬ r ) → ¬ p . p:“\text{You can ride the roller coaster}” \\q:“\text{You are under 4 feet tall}” \\r:“\text{You are older than 16 years old}”. \\ \color{red}(q\land \lnot r)\rightarrow \lnot p. p:“You can ride the roller coaster”q:“You are under 4 feet tall”r:“You are older than 16 years old”.(q∧¬r)→¬p. -
系统规范说明 System Specificatons:
- 一致性 Consistent:不能前后矛盾
例:$(1)p\lor q;(2)\lnot p;(3)p\rightarrow q;(4)\lnot q $
解: ( 4 ) × (4)\color{red}\times (4)×
解释:若一致,要找到一种变量的可能情况,使命题均满足
-
Logic Puzzles
-
Logic Circuits
1.3 命题公式的等价 Propositional Equivalences
- 定义1:
- 永真式(重言式) Tautology:例 p ∨ ¬ p p\lor \lnot p p∨¬p
- 永假式(矛盾式) Contradiction:例 p ∧ ¬ p p\land \lnot p p∧¬p
- 可满足式(可能式) Contingency:例 p p p
p | ¬ \lnot ¬p | p ∨ ¬ p p\lor \lnot p p∨¬p | p ∧ ¬ p p\land \lnot p p∧¬p |
---|---|---|---|
T | F | T | F |
F | T | T | F |
-
定理1.3: p ↔ q p\leftrightarrow q p↔q为永真式(Tautology) ⟺ \iff ⟺两个复合命题逻辑等价(Equivalent),真值表相同。记为 p ⟺ q p\iff q p⟺q 或 p ≡ q p\equiv q p≡q。
证明:充分性,必要性(运用了永真式,等价,双条件的定义)
注意 ⟺ \iff ⟺ 与 ⟷ \longleftrightarrow ⟷ 的区别:
⟷ \longleftrightarrow ⟷ ⟺ \iff ⟺ **双条件词(**逻辑连结词) **逻辑等价(**等价关系) p ⟷ q p\longleftrightarrow q p⟷q 是命题公式 p ⟺ q p\iff q p⟺q 不是命题公式 -
常见等价命题:
名称 | 等式 | 等式 |
---|---|---|
同一律 Identity laws | E 13 : p ∨ T ⟺ p E_{13}:\;p\lor T\iff p E13:p∨T⟺p | E 14 : p ∧ F ⟺ p E_{14}:\;p\land F\iff p E14:p∧F⟺p |
零律 Dominaton laws | E 15 : p ∨ F ⟺ F E_{15}:\;p\lor F\iff F E15:p∨F⟺F | E 16 : p ∧ T ⟺ T E_{16}:\;p\land T\iff T E16:p∧T⟺T |
幂等律 Idempotent laws | E 3 : p ∨ p ⟺ p E_3:\;p\lor p\iff p E3:p∨p⟺p | E 4 : p ∧ p ⟺ p E_4:\;p\land p\iff p E4:p∧p⟺p |
双重否定律 Double lnotation laws | E 19 : ¬ ( ¬ p ) ⟺ p E_{19}:\;\lnot(\lnot p)\iff p E19:¬(¬p)⟺p | p ⟺ ¬ ( ¬ p ) p\iff \lnot(\lnot p) p⟺¬(¬p) |
交换律 Commutative laws | E 5 : p ∨ q ⟺ q ∨ p E_5:\;p\lor q\iff q\lor p E5:p∨q⟺q∨p | E 6 : p ∧ q ⟺ q ∧ p E_6:\;p\land q\iff q\land p E6:p∧q⟺q∧p |
结合律 Associative laws | E 7 : ( p ∨ q ) ∨ r ⟺ p ∨ ( q ∨ r ) E_7:\;(p\lor q)\lor r\iff p\lor (q\lor r) E7:(p∨q)∨r⟺p∨(q∨r) | E 8 : ( p ∧ q ) ∧ r ⟺ p ∧ ( q ∧ r ) E_8:\;(p\land q)\land r\iff p\land (q\land r) E8:(p∧q)∧r⟺p∧(q∧r) |
Star \color{white}\colorbox{red}{Star} Star:分配律 Distributive laws | E 11 : p ∨ ( q ∧ r ) ⟺ ( p ∨ q ) ∧ ( p ∨ r ) E_{11}:\;p\lor (q\land r)\iff (p\lor q)\land (p\lor r) E11:p∨(q∧r)⟺(p∨q)∧(p∨r) | E 12 : p ∧ ( q ∨ r ) ⟺ ( p ∧ q ) ∨ ( p ∧ r ) E_{12}:\;p\land (q\lor r)\iff (p\land q)\lor (p\land r) E12:p∧(q∨r)⟺(p∧q)∨(p∧r) |
德摩根定律 De Morgan’s laws | E 23 : ¬ ( p ∨ q ) ⟺ ¬ p ∧ ¬ q E_{23}:\;\lnot(p\lor q)\iff \lnot p\land \lnot q E23:¬(p∨q)⟺¬p∧¬q | E 24 : ¬ ( p ∧ q ) ⟺ ¬ p ∨ ¬ q E_{24}:\;\lnot(p\land q)\iff \lnot p\lor \lnot q E24:¬(p∧q)⟺¬p∨¬q |
吸收律 Absorption laws | E 9 : ( p ∨ ( p ∧ q ) ⟺ p E_9:\;(p\lor (p\land q)\iff p E9:(p∨(p∧q)⟺p | E 10 : ( p ∧ ( p ∨ q ) ⟺ p E_{10}:\;(p\land (p\lor q)\iff p E10:(p∧(p∨q)⟺p |
矛盾律 lnotation laws | E 17 : p ∨ ¬ p ⟺ T E_{17}:\;p\lor \lnot p\iff T E17:p∨¬p⟺T | E 18 : p ∧ ¬ p ⟺ F E_{18}:\;p\land \lnot p\iff F E18:p∧¬p⟺F |
输出律 | E 20 : ( G ∧ H ) → S ⟺ G → ( H → S ) E_{20}:(G\land H)\rightarrow S\iff G\rightarrow(H\rightarrow S) E20:(G∧H)→S⟺G→(H→S) | / |
排中律 | E 21 : ( G ∨ H ) ⟺ ( ¬ G ∧ H ) ∨ ( G ∧ ¬ H ) E_{21}:(G\lor H)\iff (\neg G\land H)\lor(G\land \neg H) E21:(G∨H)⟺(¬G∧H)∨(G∧¬H) | / |
逆反律 | E 22 : P → Q ⟺ ¬ Q → ¬ P E_{22}:P\rightarrow Q\iff\neg Q\rightarrow \neg P E22:P→Q⟺¬Q→¬P | / |
- 必背等式:
Star E 2 {\color{white}\colorbox{red}{Star}}\;E_2\; StarE2: p → q ⟺ ¬ p ∨ q p\rightarrow q\iff\lnot p\lor q p→q⟺¬p∨q | E 1 : p ↔ q ⟺ ( p → q ) ∧ ( q → p ) E_1:\;p \leftrightarrow q\iff (p\rightarrow q)\land(q\rightarrow p) E1:p↔q⟺(p→q)∧(q→p) |
---|---|
( p → q ) ∧ ( p → r ) ⟺ p → ( q ∧ r ) (p\rightarrow q)\land(p\rightarrow r)\iff p\rightarrow(q\land r) (p→q)∧(p→r)⟺p→(q∧r) | ( p → q ) ∨ ( p → r ) ⟺ p → ( q ∨ r ) (p\rightarrow q)\lor(p\rightarrow r)\iff p\rightarrow(q\lor r) (p→q)∨(p→r)⟺p→(q∨r) |
( p → r ) ∧ ( q → r ) ⟺ ( p ∨ q ) → r (p\rightarrow r)\land(q\rightarrow r)\iff (p\lor q)\rightarrow r (p→r)∧(q→r)⟺(p∨q)→r | ( p → r ) ∨ ( q → r ) ⟺ ( p ∧ q ) → r (p\rightarrow r)\lor(q\rightarrow r)\iff (p\land q)\rightarrow r (p→r)∨(q→r)⟺(p∧q)→r |
记忆:一指多不变(号),多指一变(号)
1.4 联结词的完备集
- 其他联结词:
- 与非:
- 或非:
- 条件否定:
- 联结词的内在联系:
- 功能完备集:
- 最小功能完备集:
1.5 命题公式的范式表示
1.6 命题公式的蕴涵
-
定义1.18:若 A A A 为真时 B B B 也为真( A A A 为假时不考虑),则称** A A A蕴含 B B B**,并记为 A ⇒ B A\Rightarrow B A⇒B.(韦恩图中 A ⊃ B \color{red}A\supset B A⊃B)
-
定理1.11: ( A ⟹ B ) ⟺ ( A ⟶ B (A\Longrightarrow B)\iff (A\longrightarrow B (A⟹B)⟺(A⟶B 为永真式)
注意 ⟹ \Longrightarrow ⟹ 与 ⟶ \longrightarrow ⟶ 的区别:
⟶ \longrightarrow ⟶ ⟹ \Longrightarrow ⟹ 命题联结词 公式间关系符 A ⟶ B A\longrightarrow B A⟶B 是命题公式 A ⟹ B A\Longrightarrow B A⟹B 不是命题公式,仅表示蕴含关系 -
性质:
-
自反性: A ⟹ A A\Longrightarrow A A⟹A
-
反对称性:若 A ⟹ B A\Longrightarrow B A⟹B 且 B ⟹ A B\Longrightarrow A B⟹A,则有 A ⟺ B A\Longleftrightarrow B A⟺B
-
A ⟹ B A\Longrightarrow B A⟹B 且 A A A 为永真式,则 B B B 必为永真式
-
传递性:若 A ⟹ B A\Longrightarrow B A⟹B 且 B ⟹ C B\Longrightarrow C B⟹C,则有 A ⟹ C A\Longrightarrow C A⟹C
-
Star \color{white}\colorbox{red}{Star} Star:若 A ⟹ B A\Longrightarrow B A⟹B 且 A ⟹ C A\Longrightarrow C A⟹C,则有 A ⟹ B ∧ C A\Longrightarrow B\land C A⟹B∧C,反之亦然
-
Star \color{white}\colorbox{red}{Star} Star:若 A ⟹ C A\Longrightarrow C A⟹C 且 B ⟹ C B\Longrightarrow C B⟹C,则有 A ∨ B ⟹ C A\lor B\Longrightarrow C A∨B⟹C,反之亦然
证明:
A ⟹ C 且 B ⟹ C ( A → C ) ∧ ( B → C ) 是 永 真 式 ( A ∨ B ) → C 是 永 真 式 A ∨ B ⟹ C \begin{aligned} &A\Longrightarrow C且B\Longrightarrow C \\ &(A\rightarrow C)\land(B\rightarrow C)是永真式 \\&(A\lor B)\rightarrow C是永真式 \\&A\lor B\Longrightarrow C \end{aligned} A⟹C且B⟹C(A→C)∧(B→C)是永真式(A∨B)→C是永真式A∨B⟹C -
C P CP CP规则基础: A ∧ B ⟹ C A\land B\Longrightarrow C A∧B⟹C 当且仅当 A ⟹ B → C A\Longrightarrow B\rightarrow C A⟹B→C
-
反证法基础: ( A ⟹ B ) ⟺ ( A ∧ ¬ B ) (A\Longrightarrow B)\iff (A\land\neg B) (A⟹B)⟺(A∧¬B) 是矛盾式
-
逆向思维基础: ( A ⟹ B ) ⟺ ( ¬ B ⟹ ¬ A ) (A\Longrightarrow B)\iff (\neg B\Longrightarrow \neg A) (A⟹B)⟺(¬B⟹¬A)
-
-
蕴含定律(基本关系式):
- Star \color{white}\colorbox{red}{Star} Star 扩充法则(析取引入律) I 1 I_1 I1: P ⟹ P ∨ Q P\Longrightarrow P\lor Q P⟹P∨Q, Q ⟹ P ∨ Q Q\Longrightarrow P\lor Q Q⟹P∨Q, ¬ P ⟹ P → Q \neg P\Longrightarrow P\rightarrow Q ¬P⟹P→Q, Q ⟹ P → Q Q\Longrightarrow P\rightarrow Q Q⟹P→Q
- Star \color{white}\colorbox{red}{Star} Star 化简法则(合取消去律) I 2 I_2 I2: P ∧ Q ⟹ P P\land Q\Longrightarrow P P∧Q⟹P, P ∧ Q ⟹ Q P\land Q\Longrightarrow Q P∧Q⟹Q, ¬ ( P → Q ) ⟹ P \neg(P\rightarrow Q)\Longrightarrow P ¬(P→Q)⟹P, P → Q ⟹ Q P\rightarrow Q\Longrightarrow Q P→Q⟹Q
- Star \color{white}\colorbox{red}{Star} Star 假言推论(分离规则) I 3 I_3 I3: P ∧ ( P → Q ) ⟹ Q P\land(P\rightarrow Q)\Longrightarrow Q P∧(P→Q)⟹Q
- 否定式假言推论(拒取式) I 4 I_4 I4: ¬ Q ∧ ( P → Q ) ⟹ ¬ P \neg Q\land(P\rightarrow Q)\Longrightarrow \neg P ¬Q∧(P→Q)⟹¬P
- 析取三段论(选言三段论) I 5 I_5 I5: ¬ P ∧ ( P ∨ Q ) ⟹ Q \neg P\land(P\lor Q)\Longrightarrow Q ¬P∧(P∨Q)⟹Q
- Star \color{white}\colorbox{red}{Star} Star 假言三段论(前提条件) I 6 I_6 I6: ( P → Q ) ∧ ( Q → R ) ⟹ ( P → R ) (P\rightarrow Q)\land(Q\rightarrow R)\Longrightarrow (P\rightarrow R) (P→Q)∧(Q→R)⟹(P→R)
- 二难推论 I 7 I_7 I7: ( P ∨ Q ) ∧ ( P → R ) ∧ ( Q → R ) ⟹ R (P\lor Q)\land(P\rightarrow R)\land(Q\rightarrow R) \Longrightarrow R (P∨Q)∧(P→R)∧(Q→R)⟹R
- I 8 I_8 I8: ( P → Q ) ∧ ( R → S ) ⟹ ( P ∧ R ) → ( Q ∧ S ) (P\rightarrow Q)\land(R\rightarrow S)\Longrightarrow (P\land R)\rightarrow (Q\land S) (P→Q)∧(R→S)⟹(P∧R)→(Q∧S)
- I 9 I_9 I9: ( P ↔ Q ) ∧ ( Q ↔ R ) ⟹ ( P ↔ R ) (P\leftrightarrow Q)\land(Q\leftrightarrow R)\Longrightarrow (P\leftrightarrow R) (P↔Q)∧(Q↔R)⟹(P↔R)
- 归结原理 I 10 I_{10} I10: ( P ∨ Q ) ∧ ( ¬ P ∨ R ) ⟹ ( Q ∨ R ) (P\lor Q)\land(\neg P\lor R)\Longrightarrow (Q\lor R) (P∨Q)∧(¬P∨R)⟹(Q∨R)
1.7 命题逻辑的推理方法
-
演绎/形式证明:依据推理规则从一些前提中推导出一个结论
- 定义1.19:若 G 1 ∧ G 2 ∧ . . . ∧ G n ⟹ H G_1\land G_2\land...\land G_n\Longrightarrow H G1∧G2∧...∧Gn⟹H,称 H H H 是前提 G 1 , G 2 , . . . , G n G_1,G_2,...,G_n G1,G2,...,Gn 的逻辑结果/有效结论。
- 定理: H H H 是 G = { G 1 , G 2 , . . . , G n } G=\{G_1,G_2,...,G_n\} G={G1,G2,...,Gn} 的逻辑结果 ⟺ G 1 ∧ G 2 ∧ . . . ∧ G n ⟶ H \iff G_1\land G_2\land...\land G_n\longrightarrow H ⟺G1∧G2∧...∧Gn⟶H 为永真式。
- 注意:结论的真实性与推理的有效性无关。若前提为真,有效结论才为真。
-
推理规则:
- P P P 规则(前提引用规则):引入前提集合中任一前提
- T T T 规则(逻辑结果引用规则):利用基本等价式和蕴涵式将中间公式变出新公式。若依据等价式,标明为 T E TE TE;若依据蕴涵式,标明为 T I TI TI。
- C P CP CP 规则(附加前提规则):若目标结果形如 P ⟶ Q P\longrightarrow Q P⟶Q,则将 P P P 作为附加前提。
-
推理方法:
-
真值表法:构造 G 1 ∧ G 2 ∧ . . . ∧ G n ⟶ H G_1\land G_2\land...\land G_n\longrightarrow H G1∧G2∧...∧Gn⟶H 的真值表,判断是否为永真式。但命题变元数量多时,实用难度大。
-
演绎法:从前提出发,依据推理规则,导出结论。
-
直接证明法:利用 P P P 规则和 T T T 规则
例题 \color{White}\colorbox{Fuchsia}{例题} 例题:求证 I 7 : I_7: I7: S ∨ R S\lor R S∨R 是前提 { P ∨ Q , P → R , Q → R } \{P\lor Q,P\rightarrow R,Q\rightarrow R\} {P∨Q,P→R,Q→R} 的有效结论。
证明:
( 1 ) P ∨ Q P ( 2 ) ¬ P → Q T , ( 1 ) , E 2 ( 3 ) Q → S P ( 4 ) ¬ P → S T , ( 2 ) , ( 3 ) , I 6 ( 5 ) ¬ S → P T , ( 4 ) , E 22 ( 6 ) P → R P ( 7 ) ¬ S → R T , ( 5 ) , ( 6 ) , I 6 ( 8 ) S ∨ R T , ( 7 ) , E 2 ∴ { P ∨ Q , P → R , Q → R } ⟹ S ∨ R \begin{aligned} &(1)&&P\lor Q &&P\\ &(2)&&\neg P\rightarrow Q && T,(1),E_2\\ &(3)&&Q\rightarrow S&&P\\ &(4)&&\neg P\rightarrow S&&T,(2),(3),I_6\\ &(5)&&\neg S\rightarrow P&&T,(4),E_{22}\\ &(6)&&P\rightarrow R&& P\\ &(7)&&\neg S\rightarrow R&&T,(5),(6),I_6\\ &(8)&&S\lor R&&T,(7),E_2 \end{aligned}\\ \therefore \{P\lor Q,P\rightarrow R,Q\rightarrow R\}\Longrightarrow S\lor R (1)(2)(3)(4)(5)(6)(7)(8)P∨Q¬P→QQ→S¬P→S¬S→PP→R¬S→RS∨RPT,(1),E2PT,(2),(3),I6T,(4),E22PT,(5),(6),I6T,(7),E2∴{P∨Q,P→R,Q→R}⟹S∨R -
利用CP规则:
例题 \color{White}\colorbox{Fuchsia}{例题} 例题:求证 R → S R\rightarrow S R→S 是前提 { P → ( Q → S ) , ¬ R ∨ P , Q } \{P\rightarrow (Q\rightarrow S),\neg R\lor P,Q\} {P→(Q→S),¬R∨P,Q} 的有效结论。
证明:
( 1 ) R P ( 附 加 前 提 ) ( 2 ) ¬ R ∨ P P ( 3 ) P P , ( 1 ) , ( 2 ) , I 5 ( 4 ) P → ( Q → S ) P ( 5 ) Q → S T , ( 3 ) , ( 4 ) , I 3 ( 6 ) Q P ( 7 ) S T , ( 5 ) , ( 6 ) , I 3 ( 8 ) R → S C P , ( 1 ) , ( 7 ) ∴ { P → ( Q → S ) , ¬ R ∨ P , Q } ⟹ R → S \begin{aligned} &(1)&&R&&P(附加前提)\\ &(2)&&\neg R\lor P &&P\\ &(3)&&P&&P,(1),(2),I_5 \\ &(4)&&P\rightarrow (Q\rightarrow S) &&P\\ &(5)&&Q\rightarrow S &&T,(3),(4),I_3 \\ &(6)&&Q&& P\\ &(7)&&S&&T,(5),(6),I_3\\ &(8)&&R\rightarrow S &&CP,(1),(7) \end{aligned}\\ \therefore \{P\rightarrow (Q\rightarrow S),\neg R\lor P,Q\}\Longrightarrow R\rightarrow S (1)(2)(3)(4)(5)(6)(7)(8)R¬R∨PPP→(Q→S)Q→SQSR→SP(附加前提)PP,(1),(2),I5PT,(3),(4),I3PT,(5),(6),I3CP,(1),(7)∴{P→(Q→S),¬R∨P,Q}⟹R→S
-
-
间接证明法:反证,矛盾,归谬法
-
反证法:将结论的否定加入到前提,证明新前提集合不相容(蕴含矛盾式)。即 ( A ⟹ B ) ⟺ ( A ∧ ¬ B ⟹ F ) (A\Longrightarrow B)\iff (A\land\neg B\Longrightarrow F) (A⟹B)⟺(A∧¬B⟹F)
例题 \color{White}\colorbox{Fuchsia}{例题} 例题:n证明下面论述的有效性。在意甲比赛中,假如有四只球队,其比赛情况如下:如果国际米兰队获得冠军,则AC米兰队或尤文图斯队获得亚军;若尤文图斯队获得亚军,国际米兰队不能获得冠军;若拉齐奥队获得亚军,则AC米兰队不能获得亚军;最后,国际米兰队获得冠军。所以,拉齐奥队不能获得亚军。
证明:
设 P : P: P: 国际米兰队获得冠军; Q : Q: Q: AC米兰队获得亚军; R : R: R: 尤文图斯队获得亚军; S : S: S: 拉齐奥队获得亚军。则原命题可符号化为: P → Q ∨ R , R → ¬ P , S → ¬ Q , P ⟹ ¬ S P\rightarrow Q\lor R,R\rightarrow \neg P,S\rightarrow \neg Q,P\Longrightarrow \neg S P→Q∨R,R→¬P,S→¬Q,P⟹¬S
( 1 ) ¬ ( ¬ S ) P ( 附 加 前 提 ) ( 2 ) S T , ( 1 ) , E 19 ( 3 ) S → ¬ Q P ( 4 ) ¬ Q T , ( 2 ) , ( 3 ) , I 3 ( 5 ) P → Q ∨ R P ( 6 ) P P ( 7 ) Q ∨ R T , ( 5 ) , ( 6 ) , I 3 ( 8 ) R T , ( 4 ) , ( 7 ) , I 5 ( 9 ) R → ¬ P P ( 10 ) ¬ P T , ( 8 ) , ( 9 ) , I 3 ( 11 ) P ∧ ¬ P ⟺ F T , ( 6 ) , ( 10 ) , E 18 ∴ 拉 齐 奥 队 不 能 获 得 亚 军 \begin{aligned} &(1)&& \neg(\neg S) &&P(附加前提)\\ &(2)&& S &&T,(1),E_{19}\\ &(3)&& S\rightarrow \neg Q&&P\\ &(4)&& \neg Q &&T,(2),(3),I_3 \\ &(5)&& P\rightarrow Q\lor R&P \\ &(6)&& P&& P\\ &(7)&& Q\lor R&&T,(5),(6),I_3\\ &(8)&& R&&T,(4),(7),I_5\\ &(9)&& R\rightarrow \neg P&&P\\ &(10)&& \neg P&&T,(8),(9),I_3\\ &(11)&& P\land \neg P\iff F&&T,(6),(10),E_{18} \end{aligned}\\ \therefore 拉齐奥队不能获得亚军 (1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11)¬(¬S)SS→¬Q¬QP→Q∨RPQ∨RRR→¬P¬PP∧¬P⟺FPP(附加前提)T,(1),E19PT,(2),(3),I3PT,(5),(6),I3T,(4),(7),I5PT,(8),(9),I3T,(6),(10),E18∴拉齐奥队不能获得亚军
-
-
消解法(归结推理法):机械(无脑)推理法
-
消解原理(归结原理):根据 I 10 : ( P ∨ Q ) ∧ ( ¬ P ∨ R ) ⟹ ( Q ∨ R ) I_{10}:(P\lor Q)\land(\neg P\lor R)\Longrightarrow (Q\lor R) I10:(P∨Q)∧(¬P∨R)⟹(Q∨R)
-
推理过程:对子句集合求消解式的过程
- ⨀ \color{red}\bigodot ⨀ 1.从 { G 1 , G 2 , . . . , G n , ¬ H } \{G_1,G_2,...,G_n,\neg H\} {G1,G2,...,Gn,¬H} 出发
- ⨀ \color{red}\bigodot ⨀ 2.将 G 1 ∧ G 2 ∧ . . . ∧ G n ∧ ¬ H G_1\land G_2\land...\land G_n\land\neg H G1∧G2∧...∧Gn∧¬H 转化成合取范式 P ∧ ( P ∨ R ) ∧ ( ¬ P ∨ Q ) ∧ . . . ∧ ( ¬ P ∨ R ) P\land (P\lor R)\land(\neg P\lor Q)\land...\land(\neg P\lor R) P∧(P∨R)∧(¬P∨Q)∧...∧(¬P∨R) 的形式
- ⨀ \color{red}\bigodot ⨀ 3.将合取范式的所有子句(析取式)构成子句集合 S = { P , P ∨ R , ¬ P ∨ Q , . . . , ¬ P ∨ R } S=\{P,P\lor R,\neg P\lor Q,...,\neg P\lor R \} S={P,P∨R,¬P∨Q,...,¬P∨R}
- ⨀ \color{red}\bigodot ⨀ 4.使用消解规则消除互补式(互反对),如 ( P ∨ Q ) ∧ ( ¬ P ∨ R ) ⟹ ( Q ∨ R ) (P\lor Q)\land(\neg P\lor R)\Longrightarrow (Q\lor R) (P∨Q)∧(¬P∨R)⟹(Q∨R) 将 Q ∨ R Q\lor R Q∨R 放入 S S S。
- ⨀ \color{red}\bigodot ⨀ 5.重复上一步直到出现矛盾式(空子句)。
-
例题 \color{White}\colorbox{Fuchsia}{例题} 例题:如果公司的利润高,那么公司有个好经理或它是一个好企业及大体上是个好的经营年份。现在的情况是:公司的利润高,不是一个好的经营年份。证明公司有个好经理。
证明:
设 A : A: A: 公司的利润高; B : B: B: 公司有个好经理; C : C: C: 公司是个好企业; D : D: D: 是个好的经营年份。则原命题可符号化为: ( A → ( B ∨ ( C ∧ D ) ) ) ∧ A ∧ ¬ D ⟹ B (A\rightarrow (B\lor (C\land D)))\land A\land \neg D\Longrightarrow B (A→(B∨(C∧D)))∧A∧¬D⟹B
令 P 1 : A → ( B ∨ ( C ∧ D ) ) ⟺ ¬ A ∨ ( B ∨ ( C ∧ D ) ) ⟺ ¬ A ∨ ( ( B ∨ C ) ∧ ( B ∨ D ) ) ⟺ ( ¬ A ∨ B ∨ C ) ∧ ( ¬ A ∨ B ∨ D ) ) P 2 : A P 3 : ¬ D \begin{aligned}令&P_1:A\rightarrow (B\lor (C\land D))&&\iff\neg A\lor (B\lor (C\land D))\\&&&\iff\neg A\lor ((B\lor C)\land (B\lor D)) \\&&&\iff(\neg A\lor B\lor C)\land (\neg A\lor B\lor D)) \\ &P_2:A\\ &P_3:\neg D\\ \end{aligned} 令P1:A→(B∨(C∧D))P2:AP3:¬D⟺¬A∨(B∨(C∧D))⟺¬A∨((B∨C)∧(B∨D))⟺(¬A∨B∨C)∧(¬A∨B∨D))
则 S = { ¬ A ∨ B ∨ C , ¬ A ∨ B ∨ D , A , ¬ D , ¬ B } S=\{\neg A\lor B\lor C,\neg A\lor B\lor D,A,\neg D,\neg B\} S={¬A∨B∨C,¬A∨B∨D,A,¬D,¬B}
( 1 ) ¬ A ∨ B ∨ D P ( 2 ) A P ( 3 ) B ∨ D 由 ( 2 ) ( 3 ) 归 结 ( 4 ) ¬ B P ( 5 ) D 由 ( 3 ) ( 4 ) 归 结 ( 6 ) ¬ D P ( 7 ) Flase 由 ( 5 ) ( 6 ) 归 结 导 出 空 子 句 , 即 反 证 假 设 发 现 矛 盾 ∴ 公 司 有 个 好 经 理 \begin{aligned} &(1)&& \neg A\lor B\lor D &&P\\ &(2)&& A &&P\\ &(3)&& B\lor D && 由(2)(3)归结\\ &(4)&& \neg B && P\\ &(5)&& D && 由(3)(4)归结\\ &(6)&& \neg D &&P\\ &(7)&& \text{Flase} && 由(5)(6)归结\\ \end{aligned}\\ 导出空子句,即反证假设发现矛盾\therefore公司有个好经理 (1)(2)(3)(4)(5)(6)(7)¬A∨B∨DAB∨D¬BD¬DFlasePP由(2)(3)归结P由(3)(4)归结P由(5)(6)归结导出空子句,即反证假设发现矛盾∴公司有个好经理
-
-