Why are there so many notations for Boolean logic? [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
开发者_运维技巧 Improve this questionEnglish "and" "or" "not"
Sets
∩ ∪ '
First order logic
∧ ∨ ¬
Combinational logic
* + '
C-style programming
&& || !
Circuit diagrams
Set notation can be explained by the fact that set operations are different from bit operations.
C-style notation can be explained by the limitations of ASCII code (no caps or cups).
But still, there's a lot of unnecessary translation.
Why don't circuit diagrams just use boxes containing the mathematical symbols? Then you wouldn't have to look up every logic gate you're unfamiliar with. Not to mention that it's very hard to Google:
I believe circuits are different in shape so that they would stand out. It would (IMO) be harder to read electrical diagrams if it was all boxes (not to mention longer to write by hand). It might be tough for you since you're not using these notations daily, but to remember 4-5 symbols isn't that tough (and, or, xor, and identity, plus the little circle for "not"ing the exits and/or entrances).
Regarding sets and c - you already answered yourself.
Regarding English - well, you don't expect people to use signs, do you? Moreso when these signs are to be read as words (unlike apostrophes, full stops, etc.).
Combinational vs. FOL - I'm assuming that's just for convenience, to have a clear separation, and to make it clearer if you are dealing with a FOL (or higher-level logic) formula or otherwise. This is especially important if you also have math signs in your logic formula, e.g.: ((3*x+1<y) ∨ (y<4*x))
. Combinational logic use their symbols because many of the operations there are equivalent to their mathematical meaning, e.g.: +0, *0, *1.
Everyone just chooses the most comfortable thing for them. That's just the way it is.
As a final note, some programming languages do use "and", "or", "not", such as python, and even c has them as macros in ciso646...
精彩评论