gobdovan 6 hours ago

This blog is one of the most confused and inaccurate collection of writing that I recurrently find on HN. The account spams a deeply flawed blog post about 'Category theory illustrated' (also referenced from this article) where it misstates central theorems in CT and this 'Case against boolean logic' article, which promises an alternative to Boolean logic, but never formulates one.

The article instead gestures toward a heavily conflated 4 epistemic 'categories' (True, False, Unknown / unknowable, Meaningless / senseless) that conflate semantic truth values, epistemic states, and linguistic well-formedness.

You can represent all of these distinctions inside ordinary first-order logic. You can have:

Meaningless(fact)= True/False

Unknown(fact) = True/False ...and so on and so forth.

Where's the escape from boolean logic now? If anything, it points you to the fact that boolean logic is much more flexible than the given categories, which box you, from infinite possibilities into a few. Ironically, this could be abused even better by authority. An institution could simply say 'Human rights is a meaningless question, in the context of progress and prosperity. Asking us if we're for or against it is binary thinking.'

The biggest blind spot however is the idea that a proof is a universal tool for getting to truth. This completely dismisses the central thesis in philosophy and science of analytic-synthetic distinction. Intuitionistic proof theory works for analytic claims (like math) because their truth is self-contained. But synthetic claims (clamis about how the real world actually is) cannot be proven with mathematical certainty, but only supported, challenged or revised via empirical observation.

By trying to map formal proof theory directly onto politics and psychology, the author ignores how empirical truth actually works, e.g. gravity isn't proven like a theorem. as Popper noted, scientific theories are falsifiable and subject to revision, shifting from Newtonian to relativistic contexts while reality stays the same.

  • ufocia 5 hours ago

    When "shifting from Newtonian to relativistic contexts [while] reality" does not stay the same. While the op has many shortcomings, this post itself falls into the binary trap. You conclude without proof and contrary to currently accepted models, e.g. Schrodinger's uncertainty principle, that objective/Platonic reality exists.

    I agree with you that you can approximate continuous/analog systems with discrete/binary ones, but those approximations (almost) always have some loss of accuracy, assuming, arguendo, that accuracy even exists. For most purposes these "tolerances", if you will, are acceptable and even desirable. Thus the op also falls into the binary trap suggesting that the only right way to do things is the op's way.

    The quasi-political rant at the end does feel misplaced. While I see the op's general point, e.g. political polarization, the introduction/switch into the topic feels at least jarring.

    • ultrablack 3 hours ago

      I you don’t believe on objective reality, who are you posting to??

  • rhdunn 1 hour ago

    A better formulation would be something like Fuzzy Logic [1]. That represents floating point values from 0 (false) to 1 (true), so 0.5 could be "unsure", 0.9 could be "very likely", etc. However, that doesn't make boolean logic invalid.

    Boolean logic is also the foundation of computing: logic gates, circuits like BCD, etc.

    [1] https://en.wikipedia.org/wiki/Fuzzy_logic

    • gobdovan 1 hour ago

      Fuzzy logic is indeed a better formulation. One nit tho: the intermediary values don't mean 'very likely' or 'unsure' in general. They usually represent degrees of truth or degrees of membership. So it's more like '0.9 tall' means 'quite tall', while '0.5 tall' would be interpreted as 'this guy is tall to a degree of 0.5 out of 1'.

      They could technically refer to 'very likely' or 'unsure' only if the predicate you're modeling is itself about certainty or belief. For example, you could say "I'm certain about X to degree 0.8 out of 1" meaning you're quite certain about X. But notice that the 0.8 is about your belief, not about X itself.

  • athrowaway3z 1 hour ago

    I'm glad somebody called it out. This post reads like "the case against measuring hours" and then trying to vibe-splain how time works in general relativity.

    abuseofnotation seems a bit of an understatement. More like abuse of formalisms to dance around old & well understood insights with miss-used jargon.

    This goes beyond "not helpful" straight to "actively harmful" for anybody interested but not yet familiar with these concepts.

adrian_b 3 hours ago

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

This allowed him to view certain forms of logical reasoning as solvable by a kind of mechanical computation. Because of this, his work had an important influence on the development of automatic computers.

The modern fashion in computing science of calling a data type with the values "true" and "false" as "Boolean" is a misnomer that has nothing to do with George Boole, and which has its origin in the ALGOL 60 report and in its preliminary variants, which misused the term "Boolean". The IBM FORTRAN IV language did better than ALGOL 60, by calling the data type with "true" and "false" values as "logical", not "Boolean", but unfortunately most later languages used the ALGOL 60 term, not the FORTRAN IV term.

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.

I agree with TFA that for dealing with most practical situations binary logic is insufficient and ternary logic is the minimal tool, if not using even more complex kinds of logic, like modal logic or probabilistic logic.

  • mjh2539 34 minutes ago

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

carodgers 1 hour ago

"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 up what may be known.

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.

I cannot wait for the day that Lean and other proof systems become accessible enough, conversant enough, and interdisciplinary enough to put these eternal confusion peddlers out of business.

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

    • Avshalom 6 hours ago

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

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

      • tgv 6 hours ago

        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.

    • mcdonje 6 hours ago

      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.

  • Daub 7 hours 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 7 hours 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 7 hours ago

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

    • jfengel 6 hours 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.

    • ufocia 5 hours ago

      Let's just skip to quantum which models the "real" world in "real" terms.

  • JackFr 7 hours 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.

    • mcdonje 6 hours ago

      I thought about mentioning nulls, but it's a complicated subject. Not all columns are nullable. Null handling rules differ. It's not always ISO/ANSI.

  • raverbashing 7 hours 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 7 hours 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>.

    • kqp 6 hours ago

      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.

      • danbruc 5 hours ago

        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.

  • LargoLasskhyfv 6 hours 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.

  • Tangurena2 6 hours ago

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

    • mcdonje 6 hours ago

      True. Radix economy.

    • NooneAtAll3 2 hours ago

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

  • matt_kantor 6 hours ago

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

    The Curry-Howard correspondence[1] tells us that every function is a proof (in the intuitionistic sense) of the proposition represented by its return type, given the axioms ("context" in the article) represented by its arguments.

    This fact is leveraged heavily by proof assistants (as mentioned in the article), but is generally useful in any statically-typed programming language.

    [1]: https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspon...

    • ufocia 5 hours ago

      Fuzzy logic may be one approximation. Analog processors may be another.

      • matt_kantor 5 hours ago

        Did you reply to the wrong comment? I don't see how this relates to what I wrote.

    • nyrikki 3 hours ago

      The Curry-Howard correspondence formal relationship between intuitionistic logic and typed lambda calculus.

      Intuitionistic logic doesn’t hold PEM as a priori.

      Due to many issues like [0] you actually lose the univalent in HoTT.

      That is what allows you to say two programs are equivalent by behavior.

      No comment on the OP, but be careful as it is a rabbit hole.

      [0] https://ncatlab.org/nlab/show/Diaconescu-Goodman-Myhill+theo...

piekvorst 6 hours ago

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 cliche, it’s irrelevant. Gödel is about artificial formal deductive systems. They are not a claim to exclusive philosophy.

acrobionic 6 hours ago

"Each statement can be true in one context and false in another."

Is this statement itself true in all contexts, or only in some contexts? If it's true in all contexts, then we need an explanation for why this specific statement gets an exception from the rule. If it's false in some contexts, then there exist some contexts where absolute truth/falsity exists, so we can go ahead and use boolean logic just fine in those contexts.

  • thiagoharry 6 hours ago

    Yes, in some contexts absolute truth/falsity exists. For example, in a list of exercises about Boolean logic. Or circuits modelled after Boolean logic.

bashmelek 3 hours ago

This is the second time I’ve heard of “Platonism” referring to false dichotomies, and as someone who has casually read a bit of Plato I am very confused. Am I misunderstanding or is this a common technical term?

orthopodvt 2 hours ago

"All models are wrong. Some are useful." (Feynman) The blog sets up a straw man that oversimplifies how logic is used.

clickety_clack 3 hours ago

Interestingly, George Boole did much of his work on Boolean logic in Cork, Ireland. He moved there as a math professor in the university in the depths of the great famine around 1850.

ecoherb 5 hours ago

In biological Boolean Networks, this is a long standing form of debate, particularly the last line: "And without the correct context, the statement might not make sense at all."

Should we build Boolean networks that represent biological systems that have specific configurational requirements or should the model itself encode the limited context?

Often we choose something in-between, where the Boolean model of our biological system has some configurational choices (the context), but we can modify the context to see how the system operates in non-standard conditions.

All of this is with the hope that the ways that the model produces contradictions and unexpected behaviors can inform how our reality produces contradictions and unexpected behaviors (most commonly cancers). The states of the representative system, the Boolean network, may make no sense, and we can diagnose why with a Boolean network, when it would be neigh impossible to understand that odd state in the real system.

isodude 6 hours 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?

theow838484jj 7 hours 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 7 hours ago

    Indeed. "Breaking news! Function changes value when parameter changes. News at 11."

  • evan_piermont 7 hours 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.

gottheUIblues 6 hours ago

The normal term for the logic that has two truth values, the law of non-contradiction, and the law of the excluded middle is 'Classical Logic' which dates back centuries before George Boole. Non-classical logics which deny one or more of three properties that I've mentioned also exist

andychiare 6 hours ago

Boolean logic/black-and-white thinking is convenient for simple processing. But the world isn't simple.

If you just consider time, there are statements whose truth you can't determine: "It will rain tomorrow" (BTW, tomorrow "tomorrow" will be the day after tomorrow)

unprovable 8 hours 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.

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

0xfedcafe 8 hours ago

fp folks trying to reinvent probability theory is hilarious

  • epolanski 8 hours 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 7 hours 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 7 hours ago

      For 3 values, don’t you just need a pair of booleans ? Known or unknown… If known: 0 or 1 …

      • epolanski 5 hours ago

        unknown | yes | no has the same cardinality (3) of unknown | boolean as you can replace boolean with yes | no.

        If you write code that has to handle it, you still need to consider 3 cases, you can never reduce it to two cases only.

  • dnnddidiej 7 hours 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 7 hours 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.

  • kikimora 6 hours ago

    I don’t think this is anyhow about fp. Constructive logic appears naturally in proofs and type systems where it is very useful. Also it is quite fascinating to me to learn that law of excluded middle can be omitted and still such logic yields useful results.

    I also admit that the blogpost is lacking in many respects.

kpentad 2 hours ago

This is so dumb.

Dichotomous thinking is, often, a cognitive disorder or maybe a disorder of mood or affect. It has nothing whatever to do with formal boolean logic, without which very little (i.e., none) of science or modern engineering (or, hell, pre-modern rationality!) would even exist.

Its remedies have even less (if that were possible!) to do with intuitionist logic.

kittikitti 1 hour ago

Thank you for writing this post, I found it insightful and agreed with the fundamentals described. I also appreciated taking a look at the authors book, Category Theory: Illustrated, referenced in the article.

I must note that there is a trivial typo with a missing close-parenthesis, ")", where the article has "(see “When Universality Breaks”."

Xcelerate 6 hours ago

I think this question of what sentences can have truth value attached to them is significant. The liar paradox (a sentence in a formal language stating itself to be false) clearly doesn’t have a truth value. A statement that a specific program halts, however, does seem to be either true or false, regardless of whether or not a general algorithm exists that can answer such questions. In a sense, all sentences that fall on the arithmetical hierarchy seem to me to intuitively have a Boolean truth value (in the standard model, which we assume corresponds to what a program would actually “do” if we ran it forever).

Set theoretic questions like AC or CH are much more difficult for me to intuitively grok in the same way, because they don’t seem to “obviously” be either true or false. You can take either and still end up with a (presumably) consistent theory.

mcphage 6 hours ago

In addition to the points other commenters here have made, there's a large number of different logics building up from boolean logic—predicate calculus, various modal logics, and more. So rather than argue it's wrong or useless, it seems better to see it as the lowest rung on a ladder, and if boolean logic ain't cutting it, then take a step up the ladder.

leephillips 6 hours ago

Ternary logic seems to be widely regarded as useful in computation, because it’s implemented in several programming languages. For example, in Julia the “missing” value supplements true and false to form a ternary system.

thin_carapace 7 hours ago

stating a binary choice of options to escape binary thinking ... ironic , intentionally ?

  • entrope 6 hours ago

    Well, "should you use binary logic?" has an easy answer: yes*. (* - sometimes). There are a lot of cases where it's obviously not the right framework, others where it's useful up to a point, and some where it's absolutely the right approach. The relative frequencies of encountering those categories depends on what one is doing.

bena 7 hours 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

zombot 3 hours ago

> We might not be able to construct neither

So we might be able to construct either, but they meant to say the opposite. Am I to take criticism of Boolean logic from someone who doesn't understand negation?

ufocia 5 hours ago

This may be the one of the differences between engineers and lawyers

futter9 5 hours ago

Someone needs a new hobby. Goodness me. Possibly bait?