Hacker News new | ask | show | jobs
by danbruc 20 days ago
In one respect, boolean logic is popular because of bits. If we had ternary processors, ternary logic would be more popular.

Ternary truth values combines two dependent binary questions - do we know the truth value of X and what is the truth value of X. The second one is meaningless if the first one is false. You can merge the two binary values into one ternary unknown, true, and false but this does not really change much. Depending on the context one or the other might be easier to work with. Option types generalize this, there is always a binary choice between the value is known or unknown, and if it is known, then there will also be the actual value. A ternary logic value is just Maybe<Boolean>.

1 comments

The known/unknown question is not separate in the real world, computing avoids it by asking binary questions only when they’re answerable. Considered generally, though, if I ask a true/false question then read your answer from a single bit, it may be the case that there is no possible way for you to not lie to me.
Which is exactly what I wrote. [...] two dependent binary questions [...] The second one is meaningless if the first one is false.

Considered generally, though, if I ask a true/false question then read your answer from a single bit, it may be the case that there is no possible way for you to not lie to me.

Then you are not asking a binary question. If there is, for example, the possibility that I might not know the answer, then you are actually asking two dependent questions - do you know the answer and if so, what is the answer.

Have you stopped beating your wife?
Two question, have you ever beaten your wife, if so, did you stop? You can not stop something that never started. Alternatively, if you know from context that the wife has been beaten in the past, then yes or no are perfectly fine as the only options.

That question is obviously made as a trap because you can defend both answers. Yes, I am not beating her and actually never have, focusing on the current state. No, I did not stop because I never started, focusing on the state change. And the other party can do the same. No, so you did not stop beating your wife, so you are beating her. Yes, so you stopped beating your wife, then must have beaten here in the past.

The correct response is of course that the question is not applicable because it assumes a state - the wife has been beaten in the past - that does not match reality. And not applicable is not a third answer to the question, it is a statement about the question itself. So in contexts where non-applicable binary question might occur, you have to first determine whether the question is applicable before proceeding to answer the question.

As a specific example. If I ask the true/false question "Have you stopped murdering people?" an entirely valid response is "that question is wrong"

It is reasonable to map the world in binary logic. but the map logic must be correct and raising an error when it is not is important.

The crucial point here is the difference between response and answer. Saying that the question is not applicable because you never started murdering people is a response but not an answer to the question. And that response answers an omitted binary question, is the actual question applicable in the current context, is the implied assumption - you started murdering people at some point in the past - satisfied?