This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / Logical Operations  /
LogicalExpand

  • LogicalExpand[ expr ] expands out expressions containing logical connectives such as &&||.
  • LogicalExpand applies distributive laws for logical operations.
  • Example: LogicalExpand[p && !(q || r)].
  • LogicalExpand generates ORs of ANDs corresponding to disjunctive normal form, with some contractions.
  • See the Mathematica book: Section 1.5.6Section 3.6.6.
  • See also: Expand.

    Further Examples

    The results of LogicalExpand contain no nested Ands, Ors, or Nots. The head of the expression will be an explicit Or unless there is only one term. Similarly, any compound term will have an explicit head of And. LogicalExpand attempts to shorten output with heuristic simplification.

    In[1]:=

    Out[1]=

    In[2]:=

    Out[2]=

    In[3]:=

    Out[3]=

    In[4]:=

    Out[4]=