Algebra booleana

Porte logiche, AND, OR, NOT, XOR, NAND e operazioni booleane.

Simboli di algebra booleana in LaTeX: AND, OR e XOR

I simboli di algebra booleana in LaTeX riutilizzano i connettivi logici: il simbolo AND è \land (∧), il simbolo OR è \lor (∨) e NOT è \lnot (¬). Lo XOR in LaTeX è \oplus (⊕), oppure \veebar di amssymb. Implicazione ed equivalenza sono \Rightarrow e \iff, le costanti vero e falso sono \top e \bot, e i quantificatori sono \forall ed \exists. Vanno tutti in modalità matematica. La tabella raccoglie i comandi più usati, con il pacchetto richiesto da ciascuno; l’elenco completo dei simboli delle porte logiche si trova più in basso.

Riferimento rapido: operazioni booleane

SimboloComandoUsoPacchettoCopia
∧\land
\landAND, congiunzione (alias \wedge)integrato
∨\lor
\lorOR, disgiunzione (alias \vee)integrato
¬\lnot
\lnotNOT, negazione (alias \neg)integrato
A‾\overline{A}
\overline{A}NOT, notazione con barraintegrato
⊕\oplus
\oplusXOR (o esclusivo)integrato
⊻\veebar
\veebarXOR, stile della logicaamssymb
⊼\barwedge
\barwedgeNANDamssymb
⇒\Rightarrow
\RightarrowImplicaintegrato
  ⟺  \iff
\iffSe e solo se (equivalenza)integrato
⊤\top
\topVero, 1integrato
⊥\bot
\botFalso, 0integrato
∀x ∃y\forall x \, \exists y
\forall x \, \exists yPer ogni, esisteintegrato

Domande frequenti sui simboli booleani in LaTeX

Come si scrivono i simboli AND e OR in LaTeX?
AND (∧) è \land o il suo alias \wedge, e OR (∨) è \lor o \vee. Sono entrambi integrati e vanno in modalità matematica: $A \land B$, $A \lor B$. NOT è \lnot o \neg. Nella notazione dei circuiti puoi anche scrivere A \cdot B per AND, A + B per OR e \overline{A} per NOT.
Come si scrive XOR in LaTeX?
Usa \oplus (⊕), che è integrato: $A \oplus B$. I testi di logica usano talvolta \veebar (⊻), che richiede \usepackage{amssymb}. XNOR si scrive di solito \odot o \overline{A \oplus B}.
Quale pacchetto serve per i simboli di algebra booleana in LaTeX?
Nessuno per quelli comuni: \land, \lor, \lnot, \oplus, \Rightarrow, \iff, \top, \bot, \forall ed \exists sono integrati. Carica amssymb per \veebar e \barwedge, e amsmath per \implies.
∧\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}