到目前为止,我们只讨论了单个公式及其语义属性。在本节中,我们将开始研究公式是否可以转换为另一种形式,而不会改变其语义。为此,我们引入了逻辑等价的概念,它可以用来研究将给定公式转换为其范式。
公式
和
被称为 (语义) 等价,当且仅当对于所有赋值
对于
和
,
。我们写
。
包含不同子公式的公式可以是等价的,例如,所有重言式都是等价的。更有趣的是以下定理
令
且
为至少包含一个子公式
的公式。那么成立
,其中
是通过将
中的任何一个
替换为
获得的。
证明: 证明通过对子公式
的结构进行归纳。
假设归纳起点,
为原子公式,因此
成立,将
唯一出现的地方替换为
的结果是
,因为
,所以我们有
。假设该定理对
的所有真子公式成立:如果
,我们有与归纳起点相同的论证。如果
,我们有三种情况。
:因为
是
的一个子公式,我们可以得出结论
,其中
是通过将
替换为
构造的。从
语义的定义我们得出结论
,因此
。其中 H_1 是通过在 H 中将 F 替换为 G 构造的等价公式,得到 H_1
: 假设不失一般性,
出现在
中。那么,根据归纳假设,我们可以得出结论,
,并且根据
语义的定义,我们可以得出结论,
.
类似。
以下等价关系成立

(幂等性)

(交换律)

(结合律)

(吸收律)

(分配律)
(双重否定律)

(deMorgan's rule)
, if
is a tautology
, if
is a tautology (Rule of Tautology)
, if
is unsatisfiable
, if
is unsatisfiable (Rule of Unsatisfiability)
证明: 所有等价关系都可以通过真值表来证明。这里以第二条吸收定律为例进行证明
|
|
( ) |
( )) |
false |
false |
false
|
false
|
false |
true |
false
|
false
|
true |
false |
false
|
true
|
true |
true |
true
|
true
|
现在让我们使用这些等价关系以及代入定理 (TS) 来证明以下等价关系

结合律和 TS
交换律和 TS
分配律
交换律和 TS
分配律和 TS
不可满足性和 TS
交换律和 TS
交换律和 TS
二元连接词
用于异或,定义为
。证明以下命题逻辑公式成立
,
和 
(交换律)。
(结合律)
使用等价变换证明以下结论。请为所有重构步骤提供所用规则!






用等价关系证明
是一个永真式。
是不可满足的。
二元连接词
,其含义为“非此即彼”,由
定义。设
为一个命题逻辑公式,它只包含运算符
和
。证明对每个公式
都存在一个公式
,使得
并且
仅使用连接词
建立。
设
是一个命题逻辑公式,它只包含运算符
,
和
。证明对于每个公式
,都存在一个公式
,使得
并且
是通过仅使用连接词
和
建立的。
给出以下公式:



- 使用
简化
。
- 使用等价关系但不用
简化
。
文字是原子公式或原子公式的否定(分别为正或负)。公式
处于合取范式 (CNF) 当且仅当
其中
是一个文字。
公式
处于析取范式 (DNF) 当且仅当

其中
是一个文字
对于每个公式
存在一个等价公式处于 DNF,也存在一个等价公式处于 CNF。
让我们设计一个算法来将给定的公式 F 转化为等价的范式
给定: 公式 
1. 在
中用以下形式替换每个子公式



直到不再存在这种形式的子公式。
2. 在上述步骤的结果中,用以下形式替换每个子公式


直到不再存在这种形式的子公式。
结果: 一个等价的 CNF 公式
到目前为止,我们研究了如何将命题公式转化为等价的范式。范式中的另一个问题是,从给定的真值表构造范式公式;也就是说,公式本身是未知的,但它的行为由真值表给出。让我们从真值表中读取范式公式:假设一个公式
,它由以下真值表给出。
A |
B |
C |
F |
false |
false |
false |
true |
false |
false |
true |
false |
false |
true |
false |
false |
false |
true |
true |
false |
true |
false |
false |
true |
true |
false |
true |
true |
true |
true |
false |
false |
true |
true |
true |
false |
为了构建一个与
等价的 DNF 公式,我们必须考虑到,真值表中每一行导致真值
的结果,都会得到一个合取式:如果文字
的赋值为
,它被包含为
,如果赋值为
,我们就包含
。对于上面的例子,我们得到一个 DNF



如果我们在上面的过程中交换
和
以及
和
的角色,我们得到一个 CNF




我们介绍一种用于表示规范形式公式的特殊表示法。在引言中,我们已经使用了一种非常特殊的规范形式,即 CNF 公式的蕴涵形式:连接词
的每个子公式
都写成
不难看出,该蕴涵等价于析取式
。有时,蕴涵写成
在某些情况下,甚至使用以下含糊的表示法,其中前提中的逗号代表连接词,结论中的逗号代表析取词
对于逻辑推理的一些重要步骤,必须不仅以上述规范形式之一表示公式,而且必须使用以下定义中的所谓子句形式。
如果
是一个 CNF 公式,即
那么它在子句形式中的对应表示为
集合
称为子句。
这种文字集合表示法具有以下优点:文字的出现顺序无关紧要,并且文字在析取式中的多次出现将在其子句形式中“合并”。请注意,作为结果,我们在表示法中引入了结合律、交换律和幂等律。

创建等价于以下公式的(a)合取范式或(b)析取范式公式:

其中
表示异或。
定理证明器 OTTER 对子句集使用以下优化规则:
子句包含:如果子句
的文字是另一个子句
的子集,则从子句集中删除
。
通过单元子句删除:如果子句集包含一个单元子句
-这里
是单个文字的单元子句- 子句中每个互补文字
都被删除。
哪些逻辑定律证明了这些过程?
为以下公式生成真值表。给出公式的合取范式和析取范式。哪一个关系
,
,
和
成立?
而
适用。

从以下公式
的真值表生成 CNF 和 DNF。
A |
B |
C |
F |
0
|
0
|
0
|
0
|
1
|
0
|
0
|
1
|
0
|
1
|
0
|
0
|
1
|
0
|
0
|
1
|
1
|
1
|
0
|
1
|
1
|
0
|
1
|
0
|
0
|
1
|
1
|
1
|
1
|
1
|
1
|
0
|
从公式
生成 CNF。