3 ms·
To be fair, I've often found that outside of programming contexts, people generally use/interpret "or" to mean xor, and otherwise will use more specific languag
by saghm 4y ago
To be fair, I've often found that outside of programming contexts, people generally use/interpret "or" to mean xor, and otherwise will use more specific language (e.g. "and/or", "X, Y, or both"). It depends on context of course, but I think a big part of it is that it's somewhat common for the options presented to be literally impossible to both hold true (e.g. "I think either team A or B will win the Superbowl this year") or at least can reasonably assumed to be ("Have you decided what to order?" "I think I'm going to get either the steak or the salmon"). I don't think it's crazy to be willing to experiment with thinking outside the box when it comes to naming things given how hard we always talk about coming up with good names is.
- ngcc_hk 4y agoIn fact this “or” thinking underlying a lot of problem in our ability to handle issues. You always being asked to choose a or b … catholic or Protestant etc? the question is always should be 4 options - on top of “or” can we have both or none? For the winning team … if weather or riots etc suddenly prevent further we can declare no win or in some cases both win (each got 1 point instead of re-match).
- thayne 4y ago> outside of programming contexts, And formal logic, and reletadly generally mathematical proofs.
- adrian_b 4y agoWhile I agree that in common language "or" frequently means "exclusive or", I believe that using "xor" to mean "exclusive or" is a bad choice, because "xor" is ambiguous. In computer programming, "xor" is always used with the meaning "sum modulo 2", never with the meaning "exclusive or", despite its etymology. The 2 logical functions "exclusive or" and "sum modulo 2" are distinct. They coincide only when applied to two arguments, but they are very different when applied to 3 or more arguments. "Exclusive or" of N Boolean values is true when one and only one of them is true. "Sum modulo 2" of N Boolean values is true whenever an odd number of them are true. Both logical functions are very important and I find annoying that the name of "exclusive or" has been misapplied to "sum modulo 2".
- tempodox 4y agoI'd rather argue the opposite since XOR gates in hardware with more than 2 inputs also implement sum-modulo-2. Therefore I'd prefer the exactly-1-of-N-inputs-is-true (N > 1) function to be named differently.
- adrian_b 4y agoThese 2 logical functions have been named correctly and used so for centuries, so there is no need to change any name. The confusion between their names has appeared only some time around 1950, when someone of the designers of the first computers, while implementing in hardware the parity function, a.k.a. modulo-2 sum function, has decided nonetheless to give it the XOR mnemonic from the different "exclusive or" function. and then many others have followed this usage. It is OK now to use XOR, but one should always be well aware that XOR means parity a.k.a. modulo-2 sum, and not "exclusive or". I have replied to the parent comment, where the computer mnemonic "xor" was used to mean "exclusive or" in natural language, which is not recommended, as it may be not clear which is the intended meaning, because "xor", in its normal usage, does not mean "exclusive or". It should be noted that in mathematical notation, the 3 logical quantifiers "for all X ...", "there exists a X ..." and "there exists a unique X ..." correspond to the 3 logical functions "and", "or" and "exclusive or", and not to "and", "or" and "xor" (in the normal meaning of "xor").
- tempodox 4y agoThanks for that clarification :)
- saalweachter 4y agoNow that I think about it, we could have named it (bitwise) "ODD" and "EVEN" instead of "XOR" and "XNOR".
- yccs27 4y agoThe usage of "xor" as "sum modulo 2" is correct if you interpret it as composition of two-argument operators like a^b^c == a^(b^c). It's much easier to use infix notation with associative operators, so that is likely why the "sum mod 2" interpretation won. The "real xor of >2 arguments" is more useful with a notation like exactly_one(a,b,c).
- LudwigNagasena 4y ago> people generally use/interpret "or" to mean xor, and otherwise will use more specific language (e.g. "and/or", "X, Y, or both"). “To mean xor” isn’t really the best way to put it because “xor” in programming is often generalized to “odd parity”, ie xor(x,y,z) usually means x^y^z instead of x+y+z === 1. Does the second interpretation even have a common name to distinguish it from the odd parity interpretation of xor for multivalued cases?