Re:Finding bugs in Haskell code by proving it
by lcdoutlet on Sunday December 10, 2017 @06:32PM
(#15894116)
http://www.cl.cam.ac.uk/~jrh13/hol-light/
The author John Harrison who works at Intel has used his theorem proving application hol-light in doing verification on large code bases.
Re:Finding bugs in Haskell code by proving it
by neilparikh on Sunday December 10, 2017 @07:27PM
(#15894342)
You might already know about this, but if you're looking to learn Coq, I would recommend the Software Foundations series (https://softwarefoundations.cis.upenn.edu/).
Re:Finding bugs in Haskell code by proving it
by harveywi on Monday December 11, 2017 @09:18AM
(#15897119)
I started with Certified Programming with Dependent Types (http://adam.chlipala.net/cpdt/).
If you are more interested in programming, consider trying Idris (http://idris-lang.org/). Edwin Brady, the language designer, wrote a great book that I would recommend called Type-Driven Development with Idris (https://www.manning.com/books/type-driven-development-with-i...).
Re:Finding bugs in Haskell code by proving it
by agentultra on Monday December 11, 2017 @09:14AM
(#15897101)
If you're considering Coq but haven't started I'd also consider Lean[0].
The documentation isn't as great but the main tutorial is decent. It also doubles as a practical programming language. And the community is active and helpful.
I've always found Coq to be a little impenetrable. I don't know what makes Lean more accessible to me but I've found it much easier to get into.
Re:Finding bugs in Haskell code by proving it
by nickpsecurity on Sunday December 10, 2017 @11:44PM
(#15895204)
I have a stock recommendation for this if you want to learn formal methods to hopefully prove some useful programs. It might also apply if you want to do it for fun but don't want to get weighed down too much.
Re:Finding bugs in Haskell code by proving it
by tomsmeding on Monday December 11, 2017 @04:52AM
(#15896071)
Thanks for mentioning, will look at that as well. But I think I'd like to try Coq anyway :)
I've never worked with Coq myself, and really, the process described here still looks much too convoluted for practically proving nontrivial amounts of code correct. But it looks like lots of fun too! And it is sort-of the holy grail of computer science, writing code and being able to prove it correct instead of just testing it with maybe-or-maybe-not enough test cases.
In practice I find that Haskell itself already prevents a lot of bugs, but of course in functions like the one dissected here, logical errors are still easily made.
I'll definitely look into Coq one of these weeks.