377 points · by AriFordsham · 1w ago · 186 comments
That's not to say there isn't value in formal correctness, but the important part is identifying when it's useful and when its more trouble than its worth...
Think about the filesystem, the big issue with formalizing a program spec that operates on a file system is simply the fact it is essentially a shared object amongst all the programs running on the system. Add to that the fact that (though this changes with modern containerization systems, namespaces, pledge what ever) a program may at any point gain access to root permissions if it makes the system call to do so providing the correct credentials it becomes very difficult formally be able to remove any possible states from the system.
All this could be different but we would radically need to redesign are systems and the way we think about the problems.
This is one of the real limits of formal verification. Defects or subtle inconsistencies in hardware are not that uncommon. This is mitigated to a some extent by using assertions in release builds but this has significant limitations.
* 49% : specification error - wrong thing built in the right way
* 49% : bug involving something the software integrates with (e.g. 3rd party library, UI, database, API endpoint)
* 2% : code bugs
formal verification won't eliminate that 2%. it might get it down to 1%. there are still two enormous elephants in the room.
this is why everyone talks about it and nobody does it.
I don't dispute this, and is infact related directly to my point, it seems that people are reading my comment as formal verification is a Panacea, I was only trying to point out that are primitives and abstractions provided by operating systems as well as programming languages are one major area that stops one from writing a formal spec.
Real formal verification is very very hard.
You do seem to miss the point that I am saying many of these subtle inconsistencies can be still complex but encoded into a formal model and I was showing how the file system abstraction adds it's own complexities.
Operating systems probably would be one thing that could be a massive project to undertake but would be worth it. We already have a formally verified micro kernel sel4 that proves lots of useful features and as you point out hardware issues an important thing at this level of correctness and sel4 simply assumes certain models for this.
Please check the data centric OS proposed by Stonebreaker and his team from Stanford, MIT, Google and VMware, and the pre-cursors to it namely TabulaROSA by the MIT team and also Twizzer from UC Santa Cruz [2],[3],[4].
These are excellent books by Dave McComb on the subject of data-centric software paradigm and why we need this new paradigm shift [5].
[1] Why We Need A Data-Centric OS For AI:
https://www.nextplatform.com/control/2025/05/27/why-we-need-...
[2] DBOS: A DBMS-oriented Operating System [PDF]:
https://vldb.org/pvldb/vol15/p21-skiadopoulos.pdf
[3] TabulaROSA: Tabular Operating System Architecture for Massively Parallel Heterogeneous Compute Engines:
https://dspace.mit.edu/entities/publication/69c8906b-440f-49...
[4] Twizzler: A Data-centric OS for Non-volatile Memory:
https://dl.acm.org/doi/10.1145/3454129
[5] Software Wasteland and The Data-Centric Revolution:
Formal specification presumes a priori a great deal of control over the world in general, especially the more you move away "from nature" and more towards what a human might want to instantiate themselves. Formal methods often try not to deal with things they don't "understand", or try to abstract the parts that "don't matter" away. But inevitably it changes, and the repsonse to that change is to subsume more and more into your own ontology so you understand the nuances. Or you simply control all interoperable endpoints, and so the nuances vanish away, because you're in control.
This is great when the battle is against nature. "Nature", for all its ambiguities, we generally can assume to be stable. What about with human society?
In some sense, there might not be much to formal methods if you could solve the underlying capability of getting everybody to agree on the semantics in the first place, and have no desire for change at all. But that is an absurdly strong requirement. Formal methods is constantly a race to try and find good abstractions and then breaking them.
I don't think there really is a way out of this, but I'm not that creative :/
Linux never accepted the Capsicum patches, but they eventually added process descriptors and some important openat flags so that almost all the difficult pieces are effectively in place.
I don't know how far along they've gotten (presumably not as nearly far as OpenBSD has gotten with pledge+unveil refactorings), but FreeBSD reworked many of their utilities and services to utilize Capsicum.
> OpenBSD pledge+unveil This was one of those things that now seem obvious, and is elegant albeit in that unixy way. From what I can tell one could built something on linux with seccomp or openbsds pledge to implement a runtime that could allow for implementing such structures all in usersapce not just process isolation but creating IPC that allows for determinism and other things. (I think it's more seccomp with filtering syscalls though where this becomes feasible I don't know if anyone has done this before)
Where do you start for formalizing this?
An example of a spread sheet program might have been more productive example or a http API server or some kind of middle where program. I feel like you picked the most obtuse example possible even though my point was not to cover all possible programs that one might want to write.
The problem is even formalizing a file system at all. It is nearly impossible to even effectively prove something as simple as:
1. Program A creates a file, F, that only program A writes and writes some data.
2. Program B writes file G which correctly modifies untold amounts of arbitrary file system data structures.
3. Program A reads file F and sees the contents are unchanged.
If you could easily prove that for arbitrary programs that follow those very basic rules, then you would be able to formalize like 90% of file system usage.
The weaknesses and difficultys of formal methods are at a far, far lower level than people think.
The sort of model you suggested does not map every possible state of the file system to a model state structure so one could have various problems with results of the proof.
I guess the difficulty of formal methods depends on how much and what you want to prove, there is no real formal definition as to when something becomes formal methods is a spectrum and includes algo/c type type systems to CoC proofs and extracted programs.
What I was trying to show is the nightmare of modeling accurately and in a way that matters lots of operating system primitives and further reasoning about when the assumptions have been violated by the program set up.
Indeed this does not effect the stuff outside the interaction of the program with the operating system and my point when it came to modern programming primitives is that not all data structures or methods of programming lend themselves to being able to write formal proofs about them.
You might be able to have a type BigInterfaceTypeThatDoesLotsOfThings<a> but this might be impossible to formalize in any meaningful way and AI is not the panacea and this stuff is not easy and require hard thinking.
Additionally a lot of formally verified programs are done via constructive proofs where you build up the correct program from primitives and extract the program and prove it that way. This requires generally requires a type system that has a complete inference algorithm like ML type-systems and are much harder to work with and you have to set up knowing you want to do this sort of thing.
Capability systems indeed make a lot of sense for operating system level constraints and I agree this is a sensible direction and combined with type systems you can build some very powerful permission systems. But these do not solve formally verifying lots of behaviors and good capability system in my opinion (and something I worked on previous as a side project that is completely unfinished and abandoned.) need mathematical primitives and structures that lend themselves to proofs and being restricted by capabilities.
Note capabilities become a program themselves and types can become programs, so getting your types right has the same issues in the first place when talking about this level of formalization.
While these areas were main premise of an article when it was written, I think the article really aged well into current time of mass AI/LLM deployment. It shows fundamental limitations of token based systems / symbolic reasoning that LLM espouses internally, while writing correct software. These limitations also apply to humans, however humans mental modelling, being not fully based on symbolic processing, have been historically shown capable of writing correct software systems, while AI/LLM systems have not been proven to be able to do that, and as article shows that with current token based technology it's unlikely they will ever be.
I think those domains has more stringent requirement and a more focused usage, making the classes of inout narrower. A lot of software for B2B and B2C tries to be a kitchen sink and in the result get turned into a ball of mud. Some stuff should just be separate software.
Verifying a bunch of glue is more trouble than worth, though i think still a worthwhile exercise to explore. Even static code analysis engines are basically free bug hunting yet not used by most projects.
Sure, but people (perhaps including you) don't understand that it's foundational.
That is, it's not enough to be correct, but if your program isn't even correct there's basically no chance it does what you intended.
Now imagine being able to point to a monitoring system that report no errors from their ISO certified fridge fleet instead; they ate old leftovers on their own.
One could argue the fridge should just expose their temperature over a MQTT or Bluetooth mesh publisher protocol to a local data aggregator, rather than be connected directly to the local notwork with a out-of-date Linux computer.
But the contractor firm probably had a cheap development rate when they submitted their application for the work package and won the contract.
We ought to be able to build high-confidence software.
Unless you have bamboozled your customers completely, they should expect a product that you provide to be a) fit for purpose, b) fit for use, and c) secure.
We know of course that very little commercial software is (d) proven correct. Software Correctness (d) is hard, no question.
Just getting to ONE of { a, b, c } appears to be a bridge too far. But that's where professional rigour and diligence is required.
btw good article, u/turbobutton.
We are, it's just incredibly expensive.
Cheers!
Mathematical Modeling is foundational. That is how the Scientific Method operates, whether you understand it or not. Your entire hardware and software stack is built upon mathematical structures and logic. Hence any use of those to solve any problem can and should use the same mathematical tools.
The only thing you can argue about is how much of "Formal Methods" application is necessary and enough to get "good" results in the real world. The formal methods community has solid advice for this too viz. learn to reason in a formal manner while writing code whether using formal specification/verification tools or not. It is the learning to think in mathematically formal terms that is important.
See my comment here for some resources and background - https://news.ycombinator.com/item?id=50478624
Note that the problem of mapping "Real world Expectations" to "System Requirements" which can then be expressed as "Specifications for a Mathematical Model" is a different one. But this is more of a philosophical problem viz. how much of reality can be modeled in mathematical terms? The answer so far when we really get down to it is "almost" everything. The qualifier is due to problems in ontology/epistemology, fundamental logic i.e. Deductive vs. Constructive, what to accept as truth etc.
The whole progress of Science and Technology is a testament to the above truth.
This does not require proving systems complete correct, but it does involve proving many properties of these systems.
It's sort of like doing test-first and discovering, after writing a few tests, that your mental model of how data structures or processes might work was wrong. Seems better to discover these things earlier rather than later.
Software verification in practice works more like physics than like mathematics. When you are testing software, you aren't trying to prove correctness but verifying that all your known ways of proving the software would be incorrect in some way are incorrect. I.e. the theory that the software is broken in a particular way is false. That doesn't mean it's not broken in a different way. And you can never get to full correctness this way because of the combinatorial explosion of inputs, parameters, etc. means the number of tests you'd have to run quickly goes to infinity. But if you cover most of the stuff you care about, you can at least build up some confidence over time that it probably does what it's supposed to mostly. Of course when LLMs then find new theories about breaking the software that are correct, you still have some issues to clear up.
Formal proofs have their place in things that are small enough in scope and high enough in value to justify using them and have that be feasible. That has been shifting a bit in recent years thanks to better tools, AI, and more compute. But it's still not very practical for large categories of software. If people want to unleash Lean on their vibe coded React thingy, good luck!
Somebody really needs to draft some consensus specifications for users, so we can finally get them standardized.
I would say it is important when ... other systems
1. Depend on the "correctness" of our system.
2. Depend on the correctness of the assumptions the other system's spec makes about its environment
The software is always interpreted in the real world, and you can always convert the software plus the interpreter into a mathematical proof (via Curry-Howard isomorphism) that given input gives a given output. It is mathematically equivalent to running a program, up to the reliability of the interpreter and correctness of the mathematical model of the interpreter.
What might be a bit harder, to show, that a set of inputs causes a set of outputs. But that's just partial interpretation and depending on properties, in practical programs quite doable.
And frankly, existence of LLMs shows that you can quite easily prove most program properties. When LLM creates a program it translates a program description in natural language together with formal version of natural language (which it has from training) into a computer program. In other words, LLM doesn't work with the real world, but with a model of the real world. Although LLM's world model is not sound (in the sense that logical fragment of its reasoning has not been proven sound), many people are mostly happy with the results. This shows that LLM can preserve properties between the description of the program in natural language and the world model embedded in LLM (these often include implicit desirable properties), and the resulting source code to be executed. And if you're able to preserve the properties, the actual sound proofs transfer by construction, too (up to the few cases where LLM slips and reasons unsoundly, but AI labs are trying hard to reduce these cases to minimum).
Some API:s can be perfect. But then the real world adaptation needs to happen inside the module serving the API.
So I had to reconstruct a signal that fitted the data for the equations to work at all. But the reconstruction was no longer measured data. It was made up, and there was no single solution for fitting the data. That meant I could claim to "respect the data" while producing any result I wanted.
a fun one that immediately comes to mind is asserting something holds for reals, but not evaluating whether it holds for IEEE floats, though maybe that's not really a thing in finance due to rounding related rules anyways
The same argument goes for type safety in general: would you rather "know" how it all works all the time and make the changes without assistance (ample evidence this is generally not possible beyond toy scale) and discover later what you missed, or encode expectations into types so a significant chunk of it is "chase compiler errors"?
No location on that continuum is ideal in all cases, there's plenty of room for variety.
Software is effectively contract law, and if one were solvable the other would be too. The fact that we have so many lawyers, and loopholes are a constant issue is the same reason we have so many programmers and so many bugs.
We cannot nail down what is and isn’t acceptable input, acceptable output, and acceptable intermediate states all at the same time. And that’s what you need for correct software.
It tells me something like: “reality is always going to be dirty” and “someone has to deal with that current dirt”.
For a given program and a one off proof one can prove many things or if we over approximate by assuming loops terminate we can prove many things soundly with the risk of rejecting programs that are sometimes correct (eg type systems).
This may have been a quirk of language or my interpretation though.
Correct with regards to a formal specification?
How do we know the specification is "correct"? By definition?
If people from three different business units were looking at the same system would they all agree on what "correct" is?
I have experience with multiple companies with over $100 Million/year in revenue where different departments have different definitions of what counts as a sale. So to report sales numbers you have to figure out which department is providing the numbers and which department is the audience and recalculate the figures.
The sales team wants to count a sale as any signed commitment to purchase so they can get their bonus, the finance team might only want to count what has been paid for and the warehouse might only care about shipments. There's no amount of formal verification that can overcome these kinds of politics of a business.
I've encountered tickets where a team reports some internal tool as not functioning correctly, despite that tool having been in use for years (I've seen 20+ years) without complaint. You dig deeper and it's just that somebody thinking that <new thing> is the correct outcome, and that those people who decided on <current thing> had no idea what they were doing.
It works for me, and says:
Using lightweight formal and semi-formal methods gives likely-correct software at a very affordable cost.
A case study: https://www.osequi.com/studies/list/list.html
Now, after the LLMs made formalisation thus correctness 'cheap' I can affirm:
LLMs—with the right guardrails and tools—can safely automate the design, implementation, and verification of production-ready software. What’s left for humans is to understand the problem and steer the machine toward a solution. This is production-ready software development at the speed of thought.
1) On Formal Methods Thinking in Computer Science Education to understand the different levels of formal methods practice available. Here is a previous comment of mine which explains and links to the paper - https://news.ycombinator.com/item?id=46298961
2) Formal Methods, Informally: How to Write Programs That Work by Carroll Morgan teaches you how to reason in a formal methods manner before you start using the heavyweight tools. Much can be profitably achieved by just learning to think in this manner - https://www.cambridge.org/highereducation/books/formal-metho...
My observation was that in real life, you always start with an informal idea of what the program should do.
And you always have to figure out whether whatever formalization you choose matches that informal idea. And there's a rub:
“One can’t proceed from the informal to the formal by formal means.” — Alan Perlis
I invariably found that matching to be significantly harder with the Z specification than with an actual program.
And since that is (usually) the hard step, making that step harder is a losing proposition even if it makes other steps easier. Which it might or might not.
Of course, the parameters and weights in this chain can vary, and vary sufficiently that you get a different outcome.
However, I think this fundamental and at best difficult-, at worst impossible-to-solve problem is why specification and proof are not used much.
It's nice to see this older discussion of the topic outside of 'AI does lean' and the assumptions that formally verification is easy or will be easy for AI and you can just switch you brain off.
Build programs that can be verified in the first place is difficult design problem that requires real thought and deep insight of the problem.
Only a small subset of software is composed of even the tiniest piece that gain value from correctness. A database sure, there's lots of bits in a database that can be defined to be "correct" - but outside of the core, what does correctness mean for the ergonomics of using it? Is it worth your while to produce a Lean specification of the CLI? The maintenance scripts it ships with? Clearly not, but there're other things closer to the bit that must be "correct" that are fuzzy. Where to draw the line?
There is plenty of value in plain old software testing, for the squishier parts of a piece of software. Something less strict but still executable can prove "the software works well enough and is usable". Which suggests there exists an entire unexplored continuum of techniques for scaling verification, and that existence would imply we're only so far looking at a couple of points on it. Horses for courses, but we still need to discover the other horses.
Finally, correctness is a dynamic, ever-changing thing. You'll never get a good definition of correct if define it once and declare victory, because tomorrow someone will want something else and accommodating that will make your solution "wrong".
An example of this could be the subtype AuthenticatedUser of the type User or the subtype SearchTree of the type BinaryTree. Any time you want to change the element (By updating user data or by inserting a node in a tree), you have to reattach a proof for the modified element or the type-checker will straight up reject it.
It is, of course, a lot of work to (re)construct the proofs, but for me this strikes the perfect middleground between "formalize all your code and try to finish before retirement/bankruptcy" and "just ship and hope you didn't mess up". If you have a critical part of your software, you can formalize some characteristic on it and guarantee (!) that no one further down the pipeline will mess it up. And you can do that while leaving most of your other code untouched.
"Any consistent, effectively axiomatizable formal system sufficiently powerful to express elementary arithmetic contains statements that it can neither prove nor disprove."
Hilbert's optimistic idea was that every mathematical problem can ultimately be solved.
Gödel disproved that there exists a single effective formal framework sufficient to settle every mathematical problem expressible within it.
The key is within a single framework. It's logically possible that every individual mathematical problem could ultimately be solved by some mathematical reasoning, even though no single effective formal system can solve them all.
Sure, by Rice's theorem, no program can decide whether an arbitrary function always computes the sum of its two inputs. But that's only because we are allowing arbitrarily difficult-to-analyze implementations of the sum function. So this theorem co-exists with the fact that simple implementations of sum can be proven correct.
In this light I think the best conclusion is "to write correct software in reasonable time, we must use easy to analyze languages and program styles".
This is my major complaint with even less-rigid languages like rust, they kind of force you to write production-level code even if you are just brainstorming. That's why they are terrible for games and websites, domains where correctness doesn't matter as much as feeling and iteration speed. Sure, it would be nice if those programs had no bugs, but basically any means of increasing iteration speed and flexibility is worth it.
A startup or indie usually has a short runway. Saying we're going to half that so we can make sure we don't have any memory leaks is a laugh. It may cost 10s-100s of $K, or be the difference in launch / failure.
We basically would not have AI today if it weren't for loosey-goosey riddled-with-holes languages like python with all the symbolic madness they enable. The ability of researchers to write a few lines and run it without regard to memory, processor layouts, etc. was what enabled them to write these programs at all. Of course we've put lipstick on the pig with CUDA and torch "compiling" compute graphs, its actually such a beautiful disaster that most software runs on JS or python, two horrid languages that have so much work to make them just performant enough.
I have no idea how to go about it, but it would be very cool to have a system where you can take the soft clay approach, while having a compiler that can effectively tell what it can prove about the program, and what it can't, and as you figure out the right shape of the program, you tighten it up until you have the level of proof you're happy with.
> This is my major complaint with even less-rigid languages like rust, they kind of force you to write production-level code even if you are just brainstorming.
I will say, this was my experience when starting out with Rust, but after working with it for a while and "internalizing" it, I actually find it to be quite quick to experiment with.
1) Retrospective: An Axiomatic Basis For Computer Programming by C.A.R.Hoare. This was written 30 years after An Axiomatic Basis for Computer Programming to take stock on what was proven right and what was proven wrong - https://cacm.acm.org/opinion/retrospective-an-axiomatic-basi...
My basic mistake was to set up proof in opposition to testing, where in fact both of them are valuable and mutually supportive ways of accumulating evidence of the correctness and serviceability of programs. As in other branches of engineering, it is the responsibility of the individual software engineer to use all available and practicable methods, in a combination adapted to the needs of a particular project, product, client, or environment. The best contribution of the scientific researcher is to extend and improve the methods available to the engineer, and to provide convincing evidence of their range of applicability. Any more direct advocacy of personal research results actually excites resistance from the engineer.
2) How Did Software Get So Reliable Without Proof? by C.A.R.Hoare. More detailed paper on the above theme (pdf) - https://6826.csail.mit.edu/2020/papers/noproof.pdf
So basically you have 3 options depending on how much math vs engineering you want. I signed up for the middle and it turned out to be the hardest one. Should have gone to the EE side but back then I had no idea how different it was.
seL4 is an example of a proven correct kernel used on billions of devices. It was extremely expensive to prove it correct without AI but now the “cost per proof” has dropped dramatically.
Don't get me wrong, computer science and empiricism is awesome. But the "applied sciences" of software is often verrrry different than what software engineers and computer scientists think it is. The methods software engineers use to develop working software have not changed much over the past 20-30 years. Too much focus on language, not enough focus on system engineering.
I don't care about the examples given, I care about my word processor, web browser and such. Can we prove them - putting limits on the scripting language
Putting limits on a scripting language should not be too hard (even without talking about any correctness proof). And I would bet that for a scripting language where the limits are in a way that "in a correct implementation, it should be highly likely that these limits are actually enforced" (i.e. the specification of the scripting language has no parts that makes you suspicious whether there exists some loophole that a malicious actor could use to overstep the limits), it should actually be possible to write a verified implementation with some effort.
But this is not what people want: for example, basically every evolution of the web standards since HTML5 by the WHATWG was about extending what is possible to do in the scripting language (JavaScript).
Among other examples, it specifically mentions that you if lego together two Push-Down Automata chatting with each other you get a Turing Machine back out. It doesn't include my other favorite recent example that we found a 0-day sandbox escape in the Universal Turing Machine itself.
The problems generally keep coming back to the Church-Turing Hypothesis that if you've got one Turing Complete language you've got theoretical access to them all.
Turing Completeness in turn seems an "emergent property" rather than a hard bar to clear. Rule 110 [0] shows Turing Completeness in the mathematical equivalent of a petri dish. We've built Turing Machines out of Magic the Gathering card game decks [1].
To some extent if there was a way to build a truly, well enforced, secure scripting language you would think that we would have already found it given how important it would be to security and to safety.
I'm not sure where the limits we need to place are, but that's the reasonable place to start.
I might want my code to dabble in CORS, read env vars, or snoop around in my .ssh directory, but I don't want my imports to be able to do that.
OpenBSD has a (partial?) solution for that: pledge (2)
https://man.openbsd.org/OpenBSD-6.7/pledge.2
Often, a programming needs a lot of rights at the start to set things up (often even root permissions). After this has been done, it should better have irrevocable limited rights. The pledge() syscall is there to do this transition:
"Subsequent calls to pledge() can reduce the abilities further, but abilities can never be regained."
Basically, every program is written with some confidence that it should work correctly if written this way. This is generally true even for AI-generated code. And if there is such confidence, then the argument for its correctness should naturally follow from carefully spelling out the reasoning behind that confidence.
In practice, the correctness of almost every program we encounter in everyday life is actually very easy to argue for, compared to difficult mathematical problems. And when it isn’t, any decent programmer would leave a comment explaining why it works. Otherwise, I think most people would agree that the code should probably be rewritten.
Management and marketing can only cope with a vague, third party description of the sheet.
Reminds me of the XKCD with the mathematicians all the way over there... Oh, hi!
Ironic that multiple levels of abstraction understanding, from mathematics to physics to hardware to software to management and marketing are all required to make a single, successful product that can touch the world. All these eyes of needles to be lined up and threaded.
It's nice to stand back in awe occasionally. Then return to complaining about hardware prices and AI slop ;)
In particular, I think its deductive proofs section is unnecessarily pessimistic. People have some idea as to why their code is correct when they write it. They're occasionally wrong (at a typical rate of single-digit bugs per 1k SLOC), but you can't often write an approximately correct program without an approximately correct proof of correctness in your mind. Yes, it's true that some proofs are intractably long, but that doesn't apply to the code we actually write. A language requiring you to write out those things you're relying on and concluding isn't much more verbose than any other programming language, and that mental scaffolding makes automated theorem proving vastly easier. You'll still fail to validate correct programs from time to time, but you solve that the same way the Rust people do -- add escape hatches and/or change your code to match the solver's limitations.
Even quite complicated externalities are similarly solvable. People talk about time and filesystems and what have you as unprovable balls of mud, and ... they're right ... but that misses the point. Precious little software handles an FS correctly. That's all the level of proof your program needs; not that you never corrupt your save state, but that if no other process mucks around with your data then you never corrupt your save state. For better software (like TigerBeetle) with stronger guarantees, well, they've already written their own proofs of correctness. All that remains is tying them to the actual implementation.
One small nitpick:
A 4K challenge normally refers to code that fits in 4KB, but a straightforward encoding of a 1919 state TM takes 19192(2+11) = 49894 bits, or 6237 bytes, over 6KB.
Recent AI-fueled optimizations have lowered the count to at most 215 states though, which fits comfortably in 1KB...
It's clear that we have to accept an inability to fully verify our programs, but as a practical concern it may often be sufficient (or at least immensely helpful) to verify that a program matches its design.
How often we use full int16 for counting things? Even stuff like video frames we can easily limit size_t to fixed values like `{1920x1080, 1920x1080x3 , 1920x1080x1.5, 1080}` (representing common memory sizes for 420/RGB frames).
So instead of validating the whole infinite space of all possible states, we can carve tiny tunnels in this hypercube and significantly reduce that surface of proof.
Have we ever had that? The ssh-hole, the php issues, and a litany of CVEs that recently surfaced are almost all originate from bugs that predate vibe coding.
But if you have a basic understanding of computational complexity and Turing machines, plus a general knowledge of basic programming and CS, you should be able to follow the article well enough to get something out of it, I think.
But those types of programs do tend to have well-defined specifications to begin with.
Sorta depends on what type of software you're writing, and if you're interested in the topic.
I know that in the AI era, with code being generated in enormous quantities, formal verification is important. It is effective to some degree, but in my view, software that requires provable correctness is only a subset of all software, and I agree with the author that a kind of empiricism is the right approach. Because most of it is based on understanding a customer's "requirements." And if we consider that not all requirements can be formally proven mathematically, then in practice the line between where formal verification is used and where it isn't will become clearly drawn.
Formal specification is the work of deciding where the target is, and formal verification is the work of hitting that target with an arrow. But most of software development is the work of deciding where the target ought to be. Formal specification is like shooting an arrow at a moving target and hitting the bullseye, but figuring out where to pin that target down is software development, and honestly, most of software development spends more time pinning the target's position. Especially in the AI era, even more so.
You can't formally verify code when the code hasn't even met the spec yet! It takes a huge amount of time and effort to achieve this! Even when you think you've achieved this and your code meets the spec word-for-word, some stakeholders will still disagree based on technicalities and definitions!
How in the world are we supposed to prove that code is correct when people can't even agree on the same definition of 'correct'?! That's most of the work, really.
Also, if it takes people 1 year to complete a project in such a way that it barely just meets the spec to an acceptable standard, and only in a pure high level business sense; just barely covering all the basic exception handling scenarios; how long is it going to take to add formal verification on top of that? How many more gaps will have to be plugged, how many more assumptions will need to be enumerated, in order to make your formal proof air-tight? Then what happens if the client reads your formal proof and informs you that some of your assumptions are incorrect? What value is your proof then?
Even a simple spec like "Copy a file from A to B" may require a highly complex solution. I could easily turn this simple 7-word statement into a 10k-word requirement specification document depending on the systems involved because of how much complexity can exist. And that's just one small part of a much larger system. And the 10k word spec might require a 10k-line code solution; which itself might require a 500k-line formal proof.
The formal 500k-line proof itself, which might take years to produce, would likely contain many assumptions upon which the proof rests; just by going through the list of assumptions, the stakeholder could invalidate the entire proof, years of work, in just 1 second with the mere frowning of their brow. That's not even considering the fact that the requirements themselves may change over time (more than once per year). Hence, by the time you finish producing the proof, it is already invalid with respect to the requirements.
Therefore, formal proofs are only of limited use; when the project is simple, requirements are fixed and assumptions can be fully enumerated and verified by the primary stakeholder.
EDIT: Actually, I ran my comment through Claude and it was able to generate a formal proof of what I just said but phrased in this way:
"A monolithic, full functional-correctness proof against a complete specification is useful only when the project is simple, the requirements are fixed and the assumptions are accepted." Q.E.D.
You can ask Claude to write the proof out for you. It should mention 'No salvage' as an assumption among others and provide some superficial counter-points (alluding to seL4 project) but you can ask it to disprove this which it did successfully based on the assumption that most projects aren't sufficiently modular (with respect to proofs) to make proofs salvageable in the event of requirement changes.
Along with the proof, it provided a remarkable piece of information:
'Supporting evidence. The objection cited seL4, but seL4 supports the reply. The CACM paper on the verification has a section titled Kernel Design for Verification: the kernel was shaped to suit the proof. Even so, the verification team estimated that invariants took about 80% of the effort in the first refinement step, and those invariants were about system-wide conditions and relationships between data structures. On the cost of change, a member of the seL4 team told the project’s mailing list that altering something central to the system could wipe out a large share of the proof, and that estimating re-proof cost remains “a bit of a black art”.'
Humans enjoy inventing language, metaphor, to fill perceived gaps in irrational physical reality we can never resolve. To pretend we are more than meets the eye.
Entropy keeps creating need to replace, to refill through erosion of physical state.
Good luck engineering around gravity, electromagnetism, and nuclear forces across the fabric of space time chipping away at all human endeavors.
As a 15 year old when downloading porn was a thing on torrents. I made a folder on my parents computer called "Pron" thinking I was very clever. My dad found it and I had to act very sheepish for a few weeks.
A lot of modern programs never terminate and thus to me "halting" means no longer able to compute, i.e it's hung/deadlocked.
Computer Science historically being seen as a gateway to software development has done a large disservice to both fields.
And an astronomer should absolutely have understanding of those, their intricacies, the optical equations involved, and how to operate them (usually with automated software, but astronomers are the ones writing that software).
Now an astrophysicist has less to do with telescopes, especially if your field is theoretical cosmology, although they still require familiarity with telescopes, practicalities, how observations are made etc. because that is the basis of their theory. So, a cosmologist vs. an astronomer might be a better analog for a computer scientist vs. a software engineer.
And I know that despite doing my own thesis in cosmology, my studies involved a lot of knowledge and teaching about telescopes, including at least one night of observations (it's pretty boring, things are very automated).
A heck of a lot. Your professor clearly does not know much about astronomy.
La Palma - Gateway to the Universe (November 9, 2026)
The team journey to La Palma, where giant new telescopes and cutting-edge science are opening extraordinary new windows on our universe.
~ https://thetvdb.com/series/the-sky-at-night/episodes/1205884...Roque de los Muchachos Observatory - https://en.wikipedia.org/wiki/Roque_de_los_Muchachos_Observa...
If you choose an answer to this question at random what is the chance you will be correct?
A) 25% B) 50% C) 0% D) 25%
Maybe I'm wrong but I believe this problem and the halting problem are versions of Gödel's incompleteness theorem. In the realm of probability theory and computing science respectably. Basically, I see it as the inability of a set of rules to reason (or be applied) to themselves.
In fact, it's generally considered a harder problem to include the second boolean "does it halt successfully?" Does it stop at all is a hard enough question before asking if it stops with a success or a failure/crash. In practice this is often the easier problem to debug: once it stops we generally know if it was successful or failed. But that doesn't help to answer the questions like "will it always stop successfully?" or "will it 'forever' run successfully without ever stopping for a failure/crash/hang/deadlock?"
The terminology of the "halting problem" is a very specific term of computer science, and it didn't age badly. This is like saying a reactor "going critical" hasn't aged well because non-physicists don't understand what "critical" means: it's not meant for them. Or about "prime numbers" because non-mathematicians don't know what "prime" means. Or what a "continuous function" is, etc, etc. You get the idea.
Modern programs are still composed of functions, and those functions are subject to the halting problem, in the sense that they get inputs and provide outputs. If they don't, they did not "compute" in precisely the sense you meant it. So let's say your videogame or whatever is waiting for input (the joystick or mouse) and you don't provide it, and because it's a turn-based game, nothing else happens. Has it "halted" in the sense we're discussing? Nope. It would be subject to halting if, once you provide input, the program cannot produce the intended result for your input (move a sprite, display "game over", start another round, play an animation, modify internal game state, etc).
In other words, Computer Science talks of "programs" but it's really any computation that takes an input and produces an output, and modern programs are made of them, so the problem applies to them.
My favourites are "normal" and "almost all". Almost All real numbers are Normal.
Type systems can already prove significant aspects of programs correct, and the stronger the type system and the more thoroughly you make use of it, the more properties can be proven.
The issue with proving programs correct in general is essentially that programs can be quite large and complex, making full proofs of correctness a major undertaking that generally isn’t considered worth the effort, compared to testing and using the program to discover bugs.
It has nothing to do with the idea that “programming isn’t math.”
1. "State space of the towers of Hanoi program is a Sierpinski triangle!".
I don't quite understand why that is, or how to prove it, or even how to draw the state-space. But isn't that simply amazing?
2. Laws of software resemble laws of gravity, at least in one aspect:
It is easy to understand and use Newton's laws of gravity in the case of TWO objects. What is difficult to analyze and predict is the gravitaional interactions of > 2 objects. In software the difficulty (or impossibility) is to understand what happens when thousands of software components interact with each other.
Now draw a dot to represent this state, then consider the two consequent states that can come out of it (move the smallest disk to one of the two empty towers). Draw a line representing the transition between the initial and those two consequent states (and the reverse, you don't need arrows here as all movements are reversible). Now examine the two new states, you'll see you can draw a line between them and also introduce two more states (move second biggest disk to the still empty tower).
Repeat this process, and select the right arrangement of the nodes, and you'll get something approximating the sierpinski triangle. You may need to play with the layout a bit to get it right.
Start with just one disk, then two, then three to see how it gets more and more like the sierpinski triangle as the disks increase.
EDIT: https://www.cut-the-knot.org/triangle/Hanoi.shtml - found this which illustrates it and already has the right layout so you don't have to retry it. You'll notice that it's not quite the same as the Sierpinski triangle, the middle sections are hexagons instead of triangles.