Mathematica 9 is now available
 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]=



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.