LogicalExpand[expr]
expands out logical combinations of equations, inequalities, and other functions.
LogicalExpand
LogicalExpand[expr]
expands out logical combinations of equations, inequalities, and other functions.
Details and Options
- LogicalExpand applies distributive laws for logical operations.
- LogicalExpand generates ORs of ANDs corresponding to disjunctive normal form, with some contractions.
Examples
open all close allBasic Examples (1)
Scope (7)
Represent logic expressions as a disjunction of conjunctions (disjunctive normal form):
LogicalExpand[(a || b) && !(c || d || e)]LogicalExpand[a || !a]LogicalExpand[a && !a]Expand logic expressions out to forms involving only And, Or, and Not:
LogicalExpand[Xor[p, q, r]]Expand out combinations of equations:
LogicalExpand[x == a && y == b || x == a || y == b]Get separate equations for different terms in a series:
Series[f[x] ^ 2, {x, 0, 2}] == 2 + xLogicalExpand[%]Convert multi-argument equations and inequalities to two-argument form:
x ≤ y + 1 < z && x ^ 2 - 1 == y ^ 2 - 2 == z ^ 2 - 3LogicalExpand[%]Expand negations of Element statements:
LogicalExpand[!Element[x | y | z, Reals]]Applications (1)
Properties & Relations (2)
The output of LogicalExpand is equivalent to the input:
e1 = Implies[Xor[a, b, c], (a || b) && c]e2 = LogicalExpand[e1]Table[e1 == e2, {a, {True, False}}, {b, {True, False}}, {c, {True, False}}]LogicalExpand[!(a || b)]LogicalExpand[!(a && b)]Neat Examples (1)
An expanded Xor of
variables will always contain
terms:
LogicalExpand[Xor@@Array[Subscript[x, #]&, 6]]//TraditionalFormLength[%]See Also
Expand PiecewiseExpand Reduce BooleanConvert Implies Resolve And Not Or
Related Guides
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), LogicalExpand, Wolfram Language function, https://reference.wolfram.com/language/ref/LogicalExpand.html.
CMS
Wolfram Language. 1988. "LogicalExpand." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LogicalExpand.html.
APA
Wolfram Language. (1988). LogicalExpand. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LogicalExpand.html
BibTeX
@misc{reference.wolfram_2026_logicalexpand, author="Wolfram Research", title="{LogicalExpand}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/LogicalExpand.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_logicalexpand, organization={Wolfram Research}, title={LogicalExpand}, year={1988}, url={https://reference.wolfram.com/language/ref/LogicalExpand.html}, note=[Accessed: 12-June-2026]}