Cleanest way to express the exclusive or

257 Views Asked by At

One way to express the XOR using only AND, OR, NOT is:

¬(∧)∧¬(¬∧¬)

Is this the "cleanest" or most straightforward way to do it, or is there a simpler way to express the XOR relationship?

2

There are 2 best solutions below

0
On BEST ANSWER

Sometimes, the description "either but not both" in the form $(A \vee B) \wedge \neg (A \wedge B)$ can be easier to parse (and is slightly shorter).

0
On

Another way is $$(A \land \lnot B) \lor (\lnot A \land B)$$