Live data from Hacker News

A case against Boolean logic

abuseofnotation.github.io

81–90 of 97 posts

Re: A case against Boolean logic

#81

Nitpick: TFA discusses binary logic, i.e. logic with only 2 truth values, not Boolean logic, which is a particular form of binary logic, and which does not match the description from TFA. The innovation brought by George Boole to logic was that he replaced the traditional logical values "true" and "false" with the numbers "1" and "0" and he identified the traditional logical operations with special cases of arithmeti…

> An example of a programming language with true Boolean logic is APL, where the logical truth values are the numbers "1" and "0" (which is very handy in expressing conditional operations on arrays), while all the programming languages that use "true" and "false" do not use Boolean logic, despite claiming to do so.

So Bash could be considered the red-headed, left-handed sibling to APL?

Re: A case against Boolean logic

#82
Mixing data and state in conversation is not a fixable bug. Humans are naturally deeply biased against discussion culture or democractic debate culture as there is a instinctive fear of intribal warfare, leading to loss of life and tribal weakness. The in /out group thing and consensus search is literally hardcoded.

Re: A case against Boolean logic

#83
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…

From an information theory perspective, the most efficient base for computations would be e (2.718). And trinary is closer than binary.

I have an axe to grind. Radix economy makes a shallow argument when calculating the wrong per-digit information cost.

I need some functions to show what I mean. Calculate logarithms, calculate the number of digits, and convert a base-n unit of information into base-2 units of information. Finally, calculate the information cost: the number of digits, times the information needed per digit.

  import ln, floor
  define log := (num,base) -> ln(num) / ln(base)
  define digits := (num,base) -> floor(log(num,base) + 1)
  define tobits := (base) -> log(base,2)
  define infocost := (num,base) -> digits(num,base) * tobits(base)
  define infocost_wikipedia := (num,base) -> digits(num,base) * base
  define infocost_tbwtc := (num, base) -> (digits(num,base) - 1) * tobits(base) + tobits(base- 1)
https://www.desmos.com/calculator/1wfdtsuaav

I define a logarithmic per-digit information cost, following information theory. For example, 1 trit = log(3,2) bits. This results in no advantage for any base (in which case, choose base 2).

Wikipedia uses a linear per-digit information cost equal to the base. This holds when communicating options takes linear time (Wikipedia's example of a phone menu). This results in advantage for base e (in which case, choose base 3).

The video "The Best Way To Count" uses the logarithmic digit cost, and also notes that the leading digit carries less information (it excludes 0, like a IEEE floating point mantissa). This results in advantage for base 2.

Therefore, know the context to apply the right cost analysis!

https://en.wikipedia.org/wiki/Optimal_radix_choice

https://en.wikipedia.org/wiki/Talk:Optimal_radix_choice#Why_...?

https://en.wikipedia.org/wiki/Talk:Optimal_radix_choice#Bina...

https://youtu.be/rDDaEVcwIJM?t=701 timestamp 11:41

Re: A case against Boolean logic

#84
post #81

Nitpick: TFA discusses binary logic, i.e. logic with only 2 truth values, not Boolean logic, which is a particular form of binary logic, and which does not match the description from TFA. The innovation brought by George Boole to logic was that he replaced the traditional logical values "true" and "false" with the numbers "1" and "0" and he identified the traditional logical operations with special cases of arithmeti…

> An example of a programming language with true Boolean logic is APL, where the logical truth values are the numbers "1" and "0" (which is very handy in expressing conditional operations on arrays), while all the programming languages that use "true" and "false" do not use Boolean logic, despite claiming to do so. So Bash could be considered the red-headed, left-handed sibling to APL?

In APL, the fact that the truth values are also numbers is exploited by eliminating the need to create a new notation for various kinds of masked array operations, like those implemented in GPUs and in Intel/AMD AVX-512 for providing parallel conditional operations.

In APL and similar languages, applying a relational operator to a combination of vectors, matrices or other kinds of arrays will produce an array of "0" or "1" values, which can then be used in various kinds of array multiplications to select a part of the elements of an array for some kind of operation, e.g. a reduction operation.

This is just a reuse of the notation for arithmetic operations, useful to minimize the number of distinct operator symbols, because a good compiler will not do multiplications by "1" or "0", but it will use SIMD masked operations or blend instructions or conditional move instructions in order to get the same result.

Re: A case against Boolean logic

#85

Earlier quoted context omitted.

From an information theory perspective, the most efficient base for computations would be e (2.718). And trinary is closer than binary.

I still don't get what is being optimized for to get e as the answer

Optimizing for "radix economy", an argument that attempts to balance the digit cost against the choice of base. When the cost per digit equals the base, e turns out optimal. But when the cost per digit equals the digit's information content (bit, trit, etc; 1 trit = log(3,2) bits), all bases turn out about equal.

https://en.wikipedia.org/wiki/Optimal_radix_choice

Re: A case against Boolean logic

#86
post #64

Logic is identification of that which exists . Thus, a proposition either does correspond to reality or doesn’t at all. There is no partial semi-truths: the moment a concept or proposition ceases to describe reality, it becomes false. Contexts don’t change much. They are merely implicit knowledge, subject to the same binary standard. They don’t change the truth, only applicability. Mentioning Gödel here is not just c…

“The law of non contradiction exists”. Even Aristotle couldn’t “prove it” exists yet logic uses it all the time. I hardly think logic is about what exists but rather a tool, born out of interlocution. https://plato.stanford.edu/entries/aristotle-noncontradictio...

Aristotle indeed couldn’t prove it, that is, to derive it as a conclusion step by step from the evidence of the senses. His reasons for this are sound: 1) an attempt to do so has to rely on PNC already, and 2) we can’t assume infinite regress.

Asking a proof of PNC would imply proving non-contradiction by some means that assumes that contradictions do exist.

PNC doesn’t need a proof; it needs validation: a process of establishing an idea’s relationship to reality, whether through deductive reasoning, inductive reasoning, or sense perception.

> logic is [not] about what exists but rather a tool

If logic describes something that is not real, then our ideas and even institutions are detached from reality, and so some people claim a right to secede from “established truths” and place anyone who disagrees outside the circle of rational dialogue. That would be a harmless academic issue if the last two centuries weren’t a living record of that detachment playing out in politics, ideology, and culture.

Re: A case against Boolean logic

#87
post #56
post #50

Earlier quoted context omitted.

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 a…

Have you stopped beating your wife?

Re: A case against Boolean logic

#88

"We’ve established that the truth or falsity of a statement depends on its context — that is, on the assumptions we take as true or false in order to justify it." I am inexplicably and disproportionately irritated by people like this. They've an a priori commitment to epistemic relativism. Unnaturally allergic to any claim that certainty is possible, and dedicated to undoing the careful work of those who are building…

> No, not every statement requires assumptions in order to hold. "The assumptions A implies B and B implies C, taken together, yield A implies C." This statement contains assumptions and makes observations about them, but it is true regardless of whether the assumptions it describes are true. The statement as a whole is "true" in the exact sense that the no counterexample to it can ever be given in any universe, under any set of assumptions.

"The assumptions A implies B and B implies C, taken together, yield A implies C" is a statement using propositional logic. Like any formal system, propositional logic has axioms (for example, as defined by Frege[0]). Those axioms plus rules like modus ponens are things you need to "assume" to decide the truth value of that statement.

[0]: https://en.wikipedia.org/wiki/Hilbert_system#Frege's_Begriff...

Re: A case against Boolean logic

#89
post #50
post #30

Earlier quoted context omitted.

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…

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.

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.

Re: A case against Boolean logic

#90

"We’ve established that the truth or falsity of a statement depends on its context — that is, on the assumptions we take as true or false in order to justify it." I am inexplicably and disproportionately irritated by people like this. They've an a priori commitment to epistemic relativism. Unnaturally allergic to any claim that certainty is possible, and dedicated to undoing the careful work of those who are building…

> No, not every statement requires assumptions in order to hold. "The assumptions A implies B and B implies C, taken together, yield A implies C." This statement contains assumptions and makes observations about them, but it is true regardless of whether the assumptions it describes are true. The statement as a whole is "true" in the exact sense that the no counterexample to it can ever be given in any universe, unde…

Modus ponens holds regardless of whether it is assumed correct or not. By that, I mean that excepting contradictions, not only are no counterexamples known, but it is known that none will ever be found.

So I decline to adopt your convention of classifying it as an assumption. It might be more accurate to call it an observation.

Post reply on HN