Hacker News new | ask | show | jobs
by tgv 29 days ago
> If we had ternary processors, ternary logic would be more popular.

Why? Boolean logic is older than its namesake, George Boole (1815-1864). Syllogisms are ancient. And we've had ternary systems, as well as others.

And what does the third value represent? True and false are pretty universal when it comes to predicates, but anything in between is rather subjective.

5 comments

    enum Bool
    { 
        True, 
        False, 
        FileNotFound 
    };
https://thedailywtf.com/articles/What_Is_Truth_0x3f_
According to one of my clients that I have doing database development over the last 15 years, that 3rd value would be 'maybe'. Frustrated me to no end during development in the early years.
A bool can be represented by a single bit. A tern(?) takes 2 bits or 1 trit to represent. Alternatively, a bool takes a trit to represent.

So, in terms of radix economy, ternary computing is the most efficient, but you're leaving information density unused if you use it for binary, and representing ternary with binary is inherently inefficient.

The third value could map to "mu" [1], or "unask the question".

[1] https://en.wikipedia.org/wiki/Mu_(negative)

generally a sort of Unknown though it depends on the formulation.

https://en.wikipedia.org/wiki/Three-valued_logic

It can also map unto "maybe", which opens another can of worms.

Not that there's anything wrong with having an extra value "unknown", but it doesn't fundamentally alter the logic. As unknown in most cases means "it will be true or false at some point", its usage in computing is that of a singleton (who needs a word with 64 potentially unknown bits?), so dealing with unknown values as an exception is easier than permeating hardware with it. Using ternary to represent unknown is just not efficient.