布尔代数

逻辑门、与、或、非、异或、与非和布尔运算。

LaTeX 中的布尔代数符号:与、或、异或

LaTeX 中的布尔代数符号沿用了逻辑联结词:与(AND)是 \land(∧),或(OR)是 \lor(∨),非(NOT)是 \lnot(¬)。异或(XOR)写作 \oplus(⊕),也可以用 amssymb 中的 \veebar。蕴含和等价是 \Rightarrow 和 \iff,真、假两个常量是 \top 和 \bot,量词是 \forall 和 \exists。它们都只能用于数学模式。下表列出了最常用的命令及各自所需的宏包;完整的逻辑门符号列表见页面下方。

速查表:最常用的布尔运算符号

符号命令用途宏包复制
∧\land
\land与(别名 \wedge)内置
∨\lor
\lor或(别名 \vee)内置
¬\lnot
\lnot非(别名 \neg)内置
A‾\overline{A}
\overline{A}非,上划线记法内置
⊕\oplus
\oplus异或内置
⊻\veebar
\veebar异或,逻辑学写法amssymb
⊼\barwedge
\barwedge与非amssymb
⇒\Rightarrow
\Rightarrow蕴含内置
  ⟺  \iff
\iff当且仅当(等价)内置
⊤\top
\top真,1内置
⊥\bot
\bot假,0内置
∀x ∃y\forall x \, \exists y
\forall x \, \exists y对所有、存在内置

LaTeX 布尔代数符号常见问题

如何在 LaTeX 中输入与和或符号?
与(∧)是 \land 或其别名 \wedge,或(∨)是 \lor 或 \vee。二者都是内置命令,需放在数学模式中:$A \land B$、$A \lor B$。非是 \lnot 或 \neg。在电路记法中,也可以用 A \cdot B 表示与,A + B 表示或,\overline{A} 表示非。
如何在 LaTeX 中输入异或?
使用内置的 \oplus(⊕):$A \oplus B$。逻辑学教材有时用 \veebar(⊻),它需要 \usepackage{amssymb}。同或通常写作 \odot 或 \overline{A \oplus B}。
LaTeX 中的布尔代数符号需要哪个宏包?
常用符号都不需要:\land、\lor、\lnot、\oplus、\Rightarrow、\iff、\top、\bot、\forall 和 \exists 都是内置命令。\veebar 和 \barwedge 需要加载 amssymb,\implies 需要 amsmath。
∧\land

AND

\land
∨\lor

OR

\lor
¬\neg

NOT

\neg
⊕\oplus

XOR

\oplus
⊼\barwedge

NAND

\barwedge
∨ˉ\bar{\vee}

NOR

\bar{\vee}
⊙\odot

XNOR

\odot
⇒\Rightarrow

Implies

\Rightarrow
⇔\Leftrightarrow

If and Only If

\Leftrightarrow
⊤\top

True

\top
⊥\bot

False

\bot
A⋅BA \cdot B

Boolean AND

A \cdot B
A+BA + B
A‾\overline{A}

Boolean NOT

\overline{A}
A′A'
A⋅B‾=A‾+B‾\overline{A \cdot B} = \overline{A} + \overline{B}

De Morgan

\overline{A \cdot B} = \overline{A} + \overline{B}