logoalt Hacker News

latentsea • today at 8:46 AM • 1 reply • view on HN

Interesting. I work in bog standard LOB SaaS type businesses my whole career, so zero practical experience with formal methods, but a growing interest in them due to how I see the industry trending towards them. Can I ask... in your case, what is $dayjob related to that you find yourself operating this way already? Finance? Aerospace? Just curious...

> You must not write implementation before having all conjectures stated -- otherwise the implementation will bias your thinking, and you will try to prove properties of your implementation instead of what you needed.

Most software engineers don't really have a background in it, and tbh I kinda don't know where to start, and have heard that right now if you're already experienced with formal methods then you can get great results out of approaches like this with LLMs, but if you just vibecode up the Lean or TLA+ etc then you're not going to get out of it what you were expecting. I suspect your statement here is exactly the kind of thing that makes all the difference, but I don't know how to know what the other things that make the difference are. Any other pointers?


Replies

rramadass • today at 9:25 AM

You might find some of my previous comments useful.

On Formal Methods Thinking/Levels and (In)Formal Methods - https://news.ycombinator.com/item?id=50478624

On Design By Contract (DbC) - https://news.ycombinator.com/item?id=50108540

On Combining Tests and Proofs with Contracts - https://news.ycombinator.com/item?id=50108206

On Correctness-by-Construction - https://news.ycombinator.com/item?id=49613696

Note that the above is based on using classical logic predicates to "steer" the program through its "state space". This is the more fundamental and "simpler" approach since it uses only First-Order Logic.

Another way is to use the Type System (constructive logic, dependent types in Lean4 etc.) to embed the above directly into the program types. This is harder since you need Typed Lambda Calculus, Higher-Order Logic and need to think quite differently. For this you can read Types and Programming Languages by Benjamin Pierce and/or any number of lambda calculus books. The Curry-Howard Correspondence helps you understand this if you have some idea of the above state space approach.

Finally, if you want to know/study the whole of above you need to read Understanding Formal Methods by Jean-Francois Monin - https://news.ycombinator.com/item?id=50506655

It is all overwhelming at first if you are completely new to it so use it as a roadmap. Survey all of the above to get a grip on the jargon, notation and application and then choose your approach/logic/tool based on your interests/needs.