Yep, thats the kind of thing I had in mind. Except that I find it useful to have a chart that has all of the posibile permutations of binary boolean operations. For one it makes it easier to see how you can construct operators from each other. But mostly because I personally find it interesting how the chart of possible operators can be interpreted in different ways, and how complete it is. For instance XOR is commonly used computing and engineering, but rarely in symbolic logic, whereas -> (the conditional) is the opposite.
Actually I've always found this chart to be fascinating and for lack of a better term, very "deep". The fact that the binary enumeration of 0-15 happens to encode all the binary operators (at least in a boolean sense), along with the unary NOT, identity and empty set, and that you can construct all from some, but not all from every is somewhat amazing to me. I guess its just psychobable but to me theres something special there. The first time I put one together I sort of felt like I had just discovered the boolean table of elements or something. Anyway, I digress. :-)
|Dec||Bin||A||B||0||!(A || B)||!A && B||!A||A && !B||!B||A ^ B||!(A && B)||A && B||A == B||B||!A || B||A||A || !B||A || B||1|
These are included for completeness. They also have special properties, like A==A or 0,
B==B and 1.
These are interesting in that its fairly easy to construct any other operator from either alone.
- (**)Im not sure what to call these. Perhaps 'falsifies' as in 'B falsifies A' or 'A falsifies B'.
They are the reverse of the conditional or implication (see 7).
- This is logical equality and logical inequality not the traditional perl value equivelence.
However using negation you can ensure perl value equivelence as well, ie !$a == !$b or
!$a != !$b (the later is better written $a ^ $b)
- (**)Conditional or implication. A implies B. This is only false when A is True and B is not True. Symbolic logic makes
heavy use of this operator, where it can be used to test the truth of assertions
like "if A then B".
- Commutative and associative. A op B == B op A and
( A op B ) op C == A op ( B op C )
- Transitive and Non Associative. A op B != B op A.
If A op B and B op C then A op C.
(*) It may be a bit strange to think of these as binary operators, but its not that big of a
stretch to do so. And in visualizing the relationships between the other more important operators I find
its useful to include them.
(**) 3 and 7 are interesting in that in effect they are the boolean equivelents of the relational operators.
Like you I order my chart as a mathematician, engineer or programmer would, and not as a philosopher (who usually use T and F and who "count" from True to False), nor as Cine did. In fact I find his ordering quite unusual, and might even venture to argue that it is plain "wrong" to do so. I certainly think that both of the latter approaches make visualizing the enumeration of the possible input/output states to be much less intuitive. (Actually the whole T/F and ordering thing really got my goat in certain classes in school.)
<Elian> And I do take a kind of perverse pleasure in having an OO assembly language...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||