# Is there an inconsistency with BooleanConvert[]?

Posted 9 months ago
964 Views
|
2 Replies
|
3 Total Likes
|
 I do junior highschool 'algebra with sets' (not 'Boolean algebra' per se!). If A and B have an empty Intersection, then it follows that the Union of (B) with the (complement of A) is simply the (complement of A). Likewise, the Union of (A) with the (complement of B) is the (complement of B). One can verify/visualize this situation easily with a Venn diagram.One can translate set algebra to Boolean algebra. "Empty Intersection" translates to "a&&b is False at all times" (or "Not[a&&b] is True at all times"). Using the BooleanConvert function, Wolfram L gets it mathematically right and does the simplification. But when i switch the places of the variables (commutative law), Wolfram L refuses to simplify: In[1]:= BooleanConvert[!a||b,"DNF",!(a&&b)] BooleanConvert[b||!a,"DNF",!(a&&b)] Out[1]= !a Out[2]= !a In[3]:= BooleanConvert[a||!b,"DNF",!(a&&b)] BooleanConvert[!b||a,"DNF",!(a&&b)] Out[3]= a||!b Out[4]= a||!b I would call this unexpected behavior an inconsistency if not a bug, and it should be fixed asap. Or maybe i am doing something wrong? What can i do to get the expected result, !b ? Thanks for your kind thoughts.
2 Replies
Sort By:
Posted 9 months ago
 The similar function BooleanMinimize does better: In[11]:= BooleanMinimize[a || ! b, "DNF", LogicalExpand[! (a && b)]] BooleanMinimize[! b || a, "DNF", LogicalExpand[! (a && b)]] Out[11]= ! b Out[12]= ! b In[13]:= BooleanMinimize[b || ! a, "DNF", LogicalExpand[! (a && b)]] BooleanMinimize[! a || b, "DNF", LogicalExpand[! (a && b)]] Out[13]= ! a Out[14]= ! a 
 Raspi:Interesting find. I also find this strange. So, I tried: BooleanConvert[b || ! a, "DNF", ! (a && b)] and got, as expected: ! a So then I tried: BooleanConvert[a || ! b, "DNF", ! (a && b)] and got, as not expected: a || ! b Being perplexed, I then tried: BooleanConvert[! b || a, "DNF", ! (b && a)] and got, again as not expected: a || ! b It looks like the symbol a is getting special treatment, but I have a hard time believing that that is the case.Unless I'm missing something (which is likely), I think there might be a bug, or at least an inconstency.Thanks for posting.