The case against boolean logic
34 points by boris_m 2 hours ago | 32 comments
  • cheschire an hour ago |
    The emphasis on applying false dichotomies to every situation, in my opinion, is what leads to the truthiness[0] inherent in modern partisan politics.

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

  • unprovable an hour ago |
    An important context here is the one in which George Boole was noticing the patterns that he created an algebra out of; he was actually analysing the Chinese book I Ching... The fact that context is so lost by the amplification of what is, itself, a distillation is, as you rightly argue, the real issue. Not sure what the answer is, but it probably isn't C^* algebras.
  • 0xfedcafe an hour ago |
    fp folks trying to reinvent probability theory is hilarious
    • epolanski an hour ago |
      Non-boolean logic is more than a century old.

      We could bring quantum physics as a simple example of binary logic collapsing, but in programming there are countless ones.

      A simple one is a table of users in SQL, where age can be `null` and not just a positive number.

      For filters like "age < 18" and "age > 18" a binary answer cannot model business logic decisions on this set of data properly.

      Thus SQL implements a third logic value, UNKNOWN.

      Another simple example "is the room hot?".

      This is by intuition a bad fit for binary logic. Even if you define "hot" as 30C it's quite clear that the problem is way too nuanced and context dependent to model with binary logic, you need more than two possible answers than yes/no.

      • Pet_Ant an hour ago |
        I took a course in advanced logic and there is actually a really broad and diverse world of them that is fascinating. Contextual logic for one.
      • naveen99 40 minutes ago |
        For 3 values, don’t you just need a pair of booleans ? Known or unknown… If known: 0 or 1 …
    • dnnddidiej an hour ago |
      probability isn't the own non-boolean. analog circuits and fuzzy logic. quantum (ok yeah probabilities!), neural nets. also taking the questions angle - open ended questions.
    • paganel 43 minutes ago |
      > probability theory

      Probability theory presupposes that there's a 0 to 1 or 0 to 100 scale of "truthiness" (depending on which scale one might prefer), while the true non-boolean logic has the guts to fully embrace Parmenides's view on One and the Multiple.

      We could also try and approach "knowledge" the way that the 5th-6th century Christian mystics were trying to do during their quest to approach the nature of the Divine (or of the Truth, taken in a more restricted manner) via negatives, more exactly via "turning away their faces from said Truth". Interesting that those Christian mystics were an intellectual continuation of the 3rd-4th century Neoplatonists.

  • amiga386 an hour ago |
    TIL there's a whole rabbithole of "why vs why not intuitionist logic":

    https://en.wikipedia.org/wiki/Brouwer%E2%80%93Hilbert_contro...

    • dnnddidiej an hour ago |
      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.
      • mooreat 32 minutes ago |
        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 < 0. While you can in classical logic.

        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 classically, but in intuitionistic logic I must provide a procedure for constructing x.

        All this said, even though you can prove less statements in intuitionistic logic I find it's restrictions satisfying because it forces us to prove things by showing they exist via construction. Which to me is more satisfying than just showing that a construction exists.

        • leonidasrup 22 minutes ago |
          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-...

  • theow838484jj an hour ago |
    How about you demand context is always attached to "boolean logic"? Because what author is describing is just plain bait and switch, nothing related to boolean algebra.
    • tgv 28 minutes ago |
      Indeed. "Breaking news! Function changes value when parameter changes. News at 11."
    • evan_piermont 27 minutes ago |
      Yes, I think this path quickly leads to Boolean valued models or Boolean Algebras with Operators or Krike Frames or .... In other words, there are many well studied, well understood ways of relating epistemology, context, uncertainty to an otherwise Boolean model.
  • mcdonje an hour ago |
    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 be solved.

    That said, boolean logic is more expressive than I think the blog post gives it credit for because it's usually only a part of the code. Like, it gets used a lot in SQL, where you're reasoning about with several columns. So, yeah, it's binary thinking on each dimension, but there are N dimensions.

    The alternative presented is intuitionist logic, which is practically what in the computing world? Where is it used? Or where could or should it be used? I guess it can be represented in lamba calculus...

    • tgv 31 minutes 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.

      • mgeorge001 24 minutes ago |
        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.
      • antipurist 21 minutes ago |
        The third value could map to "mu" [1], or "unask the question".

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

    • Daub 29 minutes ago |
      > 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.

      • peterlada 12 minutes ago |
        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.

      • burnished 12 minutes ago |
        No. Neurons are 'aggregate and fire', and they either fire or they do not.
      • jfengel 10 minutes ago |
        The brain doesn't do any of that. The brain is neural goo.

        It can arduously crank through simple logic problems with its ludicrously tiny memory (around 8 bytes). Everything else is intuition and guesswork.

        You can try to model those heuristics with various logics. Some logics work better in certain situations. Classical first order logic is actually really bad at modeling brain work, but it's simple to automate, so we use it even where it's wildly inappropriate.

    • JackFr 23 minutes ago |
      > 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.

    • raverbashing 13 minutes ago |
      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)

    • danbruc 12 minutes 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>.

    • LargoLasskhyfv 3 minutes ago |
      Some of us have (balanced) ternary processors. Not even emulated on FPGAs anymore, somewhat more coarse ASIC, without all the IO, just PCIe. They aren't publically available, though.

      OTOH there is stuff like this planned to launch, which may compensate that lack of commercial availability somewhat:

      https://news.ycombinator.com/item?id=48177736

      Though it's not ternary per se, it could be seen as several steps further above that.

  • bena 21 minutes ago |
    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

  • thin_carapace 15 minutes ago |
    stating a binary choice of options to escape binary thinking ... ironic , intentionally ?
  • isodude 2 minutes ago |
    My wife does not care whatever excuse I have to why the kitchen is not in order when she comes home.

    I failed her anyhow.

    Should I tell her that boolean logic is not applicable on my intentions?