Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted


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.

share|improve this answer
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. – jonaprieto Feb 3 '14 at 7:04
It works. BTW, is there a way to get Mathematica to output the result in symbols $\land$ instead of &&, and $\lor$ instead of ||? – T. Webster Feb 3 '14 at 7:52
@Identity: Just add //TraditionalForm to end, or enclose whatever you do in TraditionalForm[...] - I'll edit answer. – ciao Feb 3 '14 at 8:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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