Live data from Hacker News

A case against Boolean logic

abuseofnotation.github.io

21–30 of 97 posts

Re: A case against Boolean logic

#21
post #17
post #13

In one respect, boolean logic is popular because of bits. If we had ternary processors, ternary logic would be more popular. In another respect, boolean logic is popular because it's easy to reason about. The truth tables are relatively small in size and quantity. Not the case with ternary. Ternary is probably way better at modeling the real world, but the complexity could make code hard to understand. Maybe that can…

> 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.

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.

Re: A case against Boolean logic

#22
post #13

In one respect, boolean logic is popular because of bits. If we had ternary processors, ternary logic would be more popular. In another respect, boolean logic is popular because it's easy to reason about. The truth tables are relatively small in size and quantity. Not the case with ternary. Ternary is probably way better at modeling the real world, but the complexity could make code hard to understand. Maybe that can…

> Like, it gets used a lot in SQL

Except it explicitly is not strictly Boolean in SQL because of nulls.

X = Y can take the value true, false or null if either or both X and Y are null.

Re: A case against Boolean logic

#23
post #16

Earlier quoted context omitted.

Intuitionist logic seemed to me like a superset of regular logic. Like a generalization that gives you more choice. Like having an 8x8 board for anything instead of always playing chess. Seems like a good idea.

I'd argue the opposite. You can prove more stuff with classical logic while intuitionistic logic restricts you. For example given a real number x constructed in intuitionistic logic. You can't determine if x > 0 or x = 0 or x Also, more generally you can't prove existence statements in general without construction in intuitionistic logic. So, there exists an x such that P(x) can be proven without actually finding x c…

Five stages of accepting constructive mathematics by Andrej Bauer

"On the odd day, a mathematician might wonder what constructive mathematics is all about. They may have heard arguments in favor of constructivism but are not at all convinced by them, and in any case they may care little about philosophy. A typical introductory text about constructivism spends a great deal of time explaining the principles and contains only trivial mathematics, while advanced constructive texts are impenetrable, like all unfamiliar mathematics. How then can a mathematician find out what constructive mathematics feels like? What new and relevant ideas does constructive mathematics have to offer, if any? I shall attempt to answer these questions"

https://ww2.ams.org/journals/bull/2017-54-03/S0273-0979-2016...

https://math.andrej.com/2016/10/10/five-stages-of-accepting-...

Re: A case against Boolean logic

#24
Boolean algebra is like a NAND gate. It’s simple, but it can construct any other system you want.

You can reduce any statement to a series of true/false statements. Now, it may take a lot of statements, but that’s not the point. The point is to have the base be as simple as possible

Re: A case against Boolean logic

#25
post #17
post #13

In one respect, boolean logic is popular because of bits. If we had ternary processors, ternary logic would be more popular. In another respect, boolean logic is popular because it's easy to reason about. The truth tables are relatively small in size and quantity. Not the case with ternary. Ternary is probably way better at modeling the real world, but the complexity could make code hard to understand. Maybe that can…

> 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.

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

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

Re: A case against Boolean logic

#27
post #13

In one respect, boolean logic is popular because of bits. If we had ternary processors, ternary logic would be more popular. In another respect, boolean logic is popular because it's easy to reason about. The truth tables are relatively small in size and quantity. Not the case with ternary. Ternary is probably way better at modeling the real world, but the complexity could make code hard to understand. Maybe that can…

Actually "fun fact" we use something "kinda like" boolean logic, but distinct of the original "Prototypical BL" https://en.wikipedia.org/wiki/Two-element_Boolean_algebra

It has 2 operators: + and x (or more commonly: dot (.) - but this is more confusing on HN)

Also both + and x operations distribute, so A+(BxC) = (A+B)x(A+C)

Re: A case against Boolean logic

#28
post #18
post #13

In one respect, boolean logic is popular because of bits. If we had ternary processors, ternary logic would be more popular. In another respect, boolean logic is popular because it's easy to reason about. The truth tables are relatively small in size and quantity. Not the case with ternary. Ternary is probably way better at modeling the real world, but the complexity could make code hard to understand. Maybe that can…

> Ternary is probably way better at modeling the real world, but the complexity could make code hard to understand. Maybe that can be solved. Is it not true that the brain process in ternary? From the point of view of perception, I believe that we process the world in terms of pairwise comparisons. For example, the atomic indivisible of visual processing is figure/ground separation.

Yes. In opposites and in lack of data (null). Ternary thus fits better.

Back in ancient CS classes my prof said that was a Russian attempt of building ternary processors with +1, 0, -1 represented as voltages.

Another strike in for-ternary column is that it's the most efficient in the number of digits for representing numbers. Pi is optimally efficient but non-integer bases would break anyone's brain, I think.

Re: A case against Boolean logic

#29
post #18
post #13

In one respect, boolean logic is popular because of bits. If we had ternary processors, ternary logic would be more popular. In another respect, boolean logic is popular because it's easy to reason about. The truth tables are relatively small in size and quantity. Not the case with ternary. Ternary is probably way better at modeling the real world, but the complexity could make code hard to understand. Maybe that can…

> Ternary is probably way better at modeling the real world, but the complexity could make code hard to understand. Maybe that can be solved. Is it not true that the brain process in ternary? From the point of view of perception, I believe that we process the world in terms of pairwise comparisons. For example, the atomic indivisible of visual processing is figure/ground separation.

No. Neurons are 'aggregate and fire', and they either fire or they do not.

Re: A case against Boolean logic

#30
post #13

In one respect, boolean logic is popular because of bits. If we had ternary processors, ternary logic would be more popular. In another respect, boolean logic is popular because it's easy to reason about. The truth tables are relatively small in size and quantity. Not the case with ternary. Ternary is probably way better at modeling the real world, but the complexity could make code hard to understand. Maybe that can…

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.

Post reply on HN