Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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
add comment

1 Answer 1

up vote 4 down vote accepted

Yes.

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. –  d555 Feb 3 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 ||? –  Identity Feb 3 at 7:52
1  
@Identity: Just add //TraditionalForm to end, or enclose whatever you do in TraditionalForm[...] - I'll edit answer. –  rasher Feb 3 at 8:13
add comment

Your Answer

 
discard

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.