I have some familiarity with Mathematica, but have no experience with any Boolean computation. Suppose we have the Boolean formula $(x_1 \lor x_2) \land (x_2 \lor x_3)$. This can be simplified by applying rules of Boolean logic, as follows.

$$\begin{align} &(x_1 \lor x_2) \land (x_2 \lor x_3) \\ &= (x_1 \land x_2) \lor (x_1 \land x_3) \lor (x_2 \land x_2) \lor (x_2 \land x_3) \\ &=x_2 \lor (x_1 \land x_2) \lor (x_2 \land x_3) \lor (x_1 \land x_3) \\ &=x_2 \lor (x_1 \land x_3) \end{align}$$

Can formulas of Boolean variables be computed in Mathematica 9? Can Mathematica apply rules of Boolean logic to make simplifications like as shown above?


1 Answer 1



For your example, e.g., BooleanMinimize[(x1 || x2) && (x2 || x3)] outputs (x1 && x3) || x2

FullSimplify will also do basic simplifications on boolean constructs, but the boolean specific functions available in MM give you more options & flexibility.

You can enter the traditional characters is desired using MM character names, and get the output using traditional characters also, e.g. BooleanMinimize[(x1 || x2) && (x2 || x3)]//TraditionalForm

There's a nice article in the Mathematica Journal.

  • $\begingroup$ You should review too LogicalExpand because it's very useful if you handled with logical expression. e.g In the particular example above, the outcome is the same by BooleanMinimize. $\endgroup$ Feb 3, 2014 at 7:04
  • $\begingroup$ It works. BTW, is there a way to get Mathematica to output the result in symbols $\land$ instead of &&, and $\lor$ instead of ||? $\endgroup$
    – T. Webster
    Feb 3, 2014 at 7:52
  • 1
    $\begingroup$ @Identity: Just add //TraditionalForm to end, or enclose whatever you do in TraditionalForm[...] - I'll edit answer. $\endgroup$
    – ciao
    Feb 3, 2014 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.