4 ms·
Ternary is indeed an enticing, yet ultimately flawed dream. Quaternary allows for: True, “Yes” False, “No” Undetermined, “Maybe”, “Either”, True or Fa
by Nevermark 1y ago
Ternary is indeed an enticing, yet ultimately flawed dream.
Quaternary allows for:
True, “Yes”
False, “No”
Undetermined, “Maybe”, “Either”, True or False
And:
Contradiction, “Invalid”, “Both”, True and False
For logical arithmetic, I.e. reducing tree expressions, True and False are enough.
But in algebraic logic, where more general constraint topologies are possible, the other two values are required.
What is the logical value of the isolated expression “(x)”? I.e. “x” unconstrained?
Or the value of the expression “(x = not x)”?
None of 4-valued logic’s values are optional or spurious for logical algebra.
—-
Many people don’t know this, but all modern computers are quaternary, with 4 quaternit bytes. We don’t just let anyone in on that. Too much power, too much footgun jeopardy, for the unwashed masses and Python “programmers”.
The tricky thicket of web standards can’t be upgraded without introducing mayhem. But Apple’s internal-only docs reveal macOS and Swift have been fully quaternary compliant on their ARM since the M1.
On other systems you can replicate this functionality, at your own risk and effort, by accessing each quaternit with their two bit legacy isomorphic abstraction. Until Rust ships safe direct support.
—-
It will revolutionize computing, from the foundations up, when widely supported.
Russell’s paradox in math is resolved. Given a set S = “The set of all sets that don’t contain themselves”, the truth value of “Is S in S” in quaternary logic, reduces to Contradiction, which indeed it is. I.e. True and False. Making S a well formed, consistent entity, and achieving full set and logical completeness with total closure. So consistency is returned to Set theory and Russell’s quest for a unification of mathematics with just sets and logic becomes possible again. He would have been ecstatic. Gödel be damned! [0]
Turing’s Incompleteness Theorem demonstrates that 2-valued bit machines are inherently inconsistent or incomplete.
Given a machine M, applied to the statement S = “M will say this statement is False”, or “M(S) = False”, it has to fail.
If M(S) returns True, we can see that S is actually False. If M(S) returns False, we can see that actually S is True.
But for a quaternary Machine M4 evaluating S4 = “M4(S4) = False”, M4(S4) returns Contradiction. True and False. Which indeed we can see S4 is. If it is either True or False, we know it is the other as well.
Due to the equivalence of Undecidability and the Turing Halting Problem, resolving one resolves the other. And so quaternary machines are profoundly more powerful and well characterized than binary machines. Far better suited for the hardest and deepest problems in computing.
It’s easy to see why the developers of Rust and Haskell are so adamant about getting this right.
[0] https://tinyurl.com/godelbedamned https://tinyurl.com/godelbedamned
- readthenotes1 1y agoI've liked true, false, unknown, unknowable--though think there should be a something somewhere for fnord.
- nzeid 1y agoNot wrong, but I think the hope was more to have "8-trinit" bytes i.e. something with more states than a classic bit.
- Nevermark 1y agoThank you for taking my points with exactly the seriousness they deserve. I respond in that spirit. Taking the convention that “byte” always means 8 n-valued bits: One advantage of a convention of 8 quaternit bytes is they can be readily used as 8 ternary valued bytes too, albeit with reduced use of their value range. 8 quaternit bytes also have the advantage of higher resolution addressing, I.e. at the nibble = 4 quaternary bit boundaries. (The last bit of modern memory addresses indicates the upper or lower quaternary nibble.
- nzeid 1y agoI have the distinct feeling something went over my head here, hehe. Regardless, thanks for the insight.
- IndrekR 1y agoMost common quaternary storage system is probably DNA.
- Nevermark 1y agoEdit/addition: there are some serious points in the Socratic satire there, for those who want to consider. Despite our natural aesthetic hesitancy to equate a 4-valued bit with two 2-valued bits, we all understand they are the same. Many “binary” storage devices do the reverse, and store multiple “binary” values with higher range cells. A bit of information (whatever it’s arity) is the same bit regardless of how it is stored or named. We get stuck in our familiar frames and names. Also, the points about Russell’s paradox and Turing Incompleteness are conveyed in an absurdist’s deadpan, but they are in fact actual critiques I am making. In both cases, two-valued logic, suitable only for arithmetic, is used in algebraic contexts where self-referencing and open constraints are both possible, despite the basic inability of two-valued logic to represent the values of either. It is startling to me, the obvious limitations this out-of-the-gate bad assumption of an excluded middle in algebraic contexts, places on the generality of conclusions in both treatments, where the failings of the excluded middle are basically the "proof". Proof of what was assumed, essentially. Anyone who cares about those topics can work through those points. Neither are as meaningless or trivial as might be expected. Finally, four valued logic would be very useful to support at CPU instruction levels, for algebraic contexts, beyond arithmetic. Especially since no changes to memory are needed. Interestingly, with 4-valued logic, there are two different sets of AND, OR and NOT, for two ways they can be treated. And the current bit-wise operators, acting on [tf] 2-bit 4-valued logic (True as [+-], False as [-+], [--] as unknown, and [++] as contradiction) already implement the new versions of those operations. So new instructions are only needed to implement regular AND, OR, NOT operations for 2-bit 4-valued logical values.