离散语文预习笔记
放到洛谷上以后
命题逻辑的基本概念
波兰式(前置)/逆波兰式(后置):按运算顺序打上括号,从外到内一层一层做
命题逻辑的等值和推理演算
等值公式、等值演算
-
双重否定律:
\lnot\lnot P=P -
\to 不满足结合律、交换律 -
\leftrightarrow 不满足分配率 -
等幂律(连接词两边相同):
P\and P=P ,P\or P=P ,P\to P=T ,P\leftrightarrow P=T -
吸收律:
P\or(P\and Q)=P ,P\and(P\or Q)=P -
摩根律:
\lnot (P\and Q)=\lnot P\or \lnot Q$,$\lnot (P\or Q)=\lnot P\and \lnot Q \lnot (P\to Q)=P \and\lnot Q \lnot (P\leftrightarrow Q)=\lnot P\leftrightarrow Q=P\leftrightarrow \lnot Q=(\lnot P\and Q)\or (P\and \lnot Q) -
同一律(连接词一边为
T/F ,结果与P 有关):P\and T=P,P\or F=P,T\to P=P,T\leftrightarrow P=P,P\to F=\lnot P -
零律(连接词一边为
T/F ,结果为T/F ):P\or T=T,P\and F=F,P\to T=T,F\to P=T -
补余律(连接词两边异或和为1)
-
蕴含等值:
P\to Q=\lnot P\or Q -
前提合取合并:
P\to (Q\to R)=(P\and Q)\to R -
等价等值式:
P\leftrightarrow Q=(P\to Q)\and (Q\to P) -
假言易位:
P\to Q=\lnot Q\to \lnot P -
等价否定等值式:
P\leftrightarrow Q=\lnot P\leftrightarrow \lnot Q -
归谬论:
(P\to Q)\and(P\to\lnot Q)=\lnot P -
从取真来描述双条件
P\leftrightarrow Q=(P\and Q)\or(\lnot P\and \lnot Q) -
从取假来描述双条件
P\leftrightarrow Q=(\lnot P\or Q)\and( P\or \lnot Q) -
前提交换:
P\to(Q\to R)=Q\to (P\to R) -
前提析取合并:
(P\to R)\and (Q\to R)=(P\or Q)\to R -
置换规则
联结词的完备集
真值函项/
完备:
推理演算
- 基本推理公式:
P\and Q \Rightarrow P,P \Rightarrow P\or Q,P\and(P\to Q) \Rightarrow Q,(P\to Q)\and (Q\to R) \Rightarrow P\to R - 推理规则:前提引入、结论引入、代入、置换、分离、条件证明(
A_1\and A_2 \Rightarrow B 与A_1 \Rightarrow A_2\to B 等价) - 归结法:
A \Rightarrow B 成立当且仅当A\and\lnot B 为矛盾式。求出合取范式,消互补对。
命题逻辑的等值和推理演算
等值式
- 否定型等值式
- 量词分配等值式
范式
前束范式
- 消去蕴含和双蕴含
- 否定词右移
- 量词左移
- 变元易名
注意哪些个体变项是约束出现,哪些是自由出现
Skolem 标准形
- 先求出前束范式
- 消去存在量词,并将相应变元以函数代入
仅当
推理公式
谓词逻辑推理规则
- UI:
\dfrac{(\forall x)P(x)}{ \therefore P(y)} (y 是任意个体变项)或\dfrac{(\forall x)P(x)}{ \therefore P(c)} (c 是任意个体常项),y,c 易名规则允许下 - UG:
\dfrac{P(y)}{ \therefore (\forall x)P(x)} ,任意自由变项y 都有P(y) 为真,x 不在P(y) 中约束出现 - EI:
\dfrac{(\exist x)P(x)}{ \therefore P(c)} ,c 是使P(x) 为真的特定个体常项,c 不在P(x) 中出现,P(x) 中没有其他自由个体变项 - EG:
\dfrac{P(c)}{ \therefore (\exist x)P(x)} ,c 是特定个体常项,x 不在P(c) 中出现
注意区分个体变项和个体常项!注意个体之间的依赖关系!没有东西依赖于
一般从较短的存在入手较容易
自由变元看作全局变量,
归结推理
对于
集合
集合的运算
广义并:设
广义交:设
幂集:
集合运算的性质
-
交、并的集合恒等式类似等值公式
-
A-B=A-(A\cap B),A-B=A\cap -B,A\cup B=A\cup (B-A),A\cap(B-C)=(A\cap B)-C -
对称差:交换律、结合律、
\cap 对\oplus 的分配律、同一律、零律、吸收律 -
$$ A\subseteq B\Rightarrow (A\cup C)\sube(B\cup C)\qquad A\subseteq B\Rightarrow (A\cap C)\sube(B\cap C)\\ (A\sube B)\and(C\sube D)\Rightarrow(A\cup C) \sube(B\cup D)\qquad(A\sube B)\and(C\sube D)\Rightarrow(A\cap C)\sube(B\cap D)\\ (A\sube B)\and(C\sube D)\Rightarrow(A-D) \sube(B-C)\qquad(C\sube D)\Rightarrow(A-D )\sube(A\cap C)\\ $$ -
幂集的性质
A\sube B\Leftrightarrow P(A)\sube P(B)\qquad A= B\Leftrightarrow P(A)= P(B)\\ P(A)\in P(B)\Rightarrow A\in B\\ P(A)\cap P(B)= P(A\cap B)\qquad P(A)\cup P(B)\sube P(A\cup B)\\ P(A-B)\sube(P(A)-P(B))\cup \varnothing 传递集合:
A 的任意元素的元素都是A 的元素,即A 的元素一定是A 的子集对集合的集合
A ,A 是传递集合\Leftrightarrow P(A) 是传递集合\Leftrightarrow A\sube P(A) 若
A 是集合,x\in A,y\in A ,则<x,y>\in P(P(A)) -
广义交和广义并
广义并是幂集的逆运算,但运算顺序不可逆。
若集合
若非空集合
- 笛卡尔积的性质
A\times(B\cup C)=(A\times B)\cup(A\times C)\qquad A\times(B\cap C)=(A\times B)\cap(A\times C)\\(B\cup C)\times A=(B\times A)\cup (C\times A)\qquad (B\cap C)\times A=(B\times A)\cap (C\times A)\\(A\times B)\sube (C\times D)\Leftrightarrow (A\sube C)\and(B\sube D)\\(A\sube B)\Leftrightarrow(A\times C)\sube(B\times C)\Leftrightarrow(C\times A)\sube(C\times B)\quad(C\neq\varnothing)
TBC.