逻辑非
外观
| 逻辑非 | |
|---|---|
| 术语名称 | 逻辑非 |
| 英语名称 | bitwise NOT |
| 别名 | 按位非, 位非, 位反, 按位取补, bitwise complement |
逻辑非(logical NOT)指二值变量的一种一元运算,相当于命题的否定联结词。与模 2 剩余类环上的一元运算 [math]\displaystyle{ 1-x }[/math] 同构。
定义
| 逻辑非 | |
|---|---|
| 运算名称 | 逻辑非 |
| 运算符号 | [math]\displaystyle{ \bar{\bullet} }[/math],[math]\displaystyle{ 1-\bullet }[/math],[math]\displaystyle{ 1\oplus\bullet }[/math],[math]\displaystyle{ {\sim}\bullet }[/math],[math]\displaystyle{ \lnot\bullet }[/math] |
| Latex | \bar{}, 1-, 1\oplus, {\sim}, \lnot
|
| 运算对象 | 二值变量 |
| 运算元数 | 2 |
| 运算结果 | 二值变量 |
| 结构 | 布尔代数 |
| 定义域 | [math]\displaystyle{ \mathbb{B} }[/math] |
| 陪域 | [math]\displaystyle{ \mathbb{B} }[/math] |
对二值变量 [math]\displaystyle{ x \in \mathbb{B} = \{0,1\} }[/math] ,将一元运算 [math]\displaystyle{ 1\mapsto 0; 0\mapsto 1 }[/math] 称为逻辑非(logical NOT)运算,记作 [math]\displaystyle{ \bar{x} }[/math] 。也有人记作 [math]\displaystyle{ 1-x }[/math] 、 [math]\displaystyle{ 1\oplus x }[/math] 、 [math]\displaystyle{ {\sim}x }[/math] 或 [math]\displaystyle{ \lnot x }[/math] 。使用 [math]\displaystyle{ x\in \{-1,1\} }[/math] 时,除了上述记号,也有人记作 [math]\displaystyle{ -x }[/math] 。
性质
运算性质:
- 双重否定律
- 与逻辑与、逻辑或满足 De Morgan 律
变体
三值逻辑非
对三值逻辑变量,也存在对应逻辑非的同名运算。
| [math]\displaystyle{ \bar{x} }[/math] | T | U | F |
|---|---|---|---|
| F | U | T |
| 逻辑运算 | |||
|---|---|---|---|
| 逻辑非 | 逻辑与 | 逻辑或 | 逻辑异或 |