logoalt Hacker News

rramadass • today at 9:25 AM • 0 replies • view on HN

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.