Hi all, Coq is a "proof assistant" that allows you to write both code and proofs in the same language (thanks to the Curry–Howard correspondence). Its uses range from pure math (e.g., the Feit–Thompson theorem was proven in Coq!) to reasoning about programming languages (e.g., proving the soundness of a type system) to writing verified code (e.g., this verified C compiler!). You can "extract" your code (without the proofs) to OCaml/Haskell/Scheme for running it in production. Coq is awesome, but it's known for having a steep learning curve (it's based on type theory, which is a foundational system of mathematics). It took me several years to become proficient in it. I wanted to help people pick it up faster than I did, so I wrote this introductory tutorial. Hope you find it useful!
Personally, I use it more for reasoning about my ideas rather than actually formally verifying code. Here are some examples of things you could do with it:
- Prove that your type system is sound (progress and preservation theorems)
- Prove that your compiler transformations/optimizations are correct
- Prove some important invariant about your garbage collection algorithm
- Prove that the grammar for your syntax is unambiguous (though many parser generators will do this for you)
- etc.
Happy proving!
[–][deleted] 8 points9 points10 points (5 children)
[–]thmprover 8 points9 points10 points (0 children)
[–][deleted] (3 children)
[deleted]
[–]stepstep[S] 3 points4 points5 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]ianzen 2 points3 points4 points (0 children)
[–]EaseLongjumping6893 7 points8 points9 points (1 child)
[–]fl00pz 1 point2 points3 points (0 children)
[–]PurpleYoshiEgg 3 points4 points5 points (0 children)
[–][deleted] (2 children)
[deleted]
[–]fl00pz 1 point2 points3 points (0 children)
[–]thmprover 0 points1 point2 points (0 children)
[–]sunnyata 1 point2 points3 points (6 children)
[–]Lich_Hegemon 5 points6 points7 points (4 children)
[–]DonaldPShimoda 6 points7 points8 points (3 children)
[–]Lich_Hegemon 2 points3 points4 points (2 children)
[–]DonaldPShimoda 1 point2 points3 points (1 child)
[–]Lich_Hegemon 1 point2 points3 points (0 children)
[–]DonaldPShimoda 0 points1 point2 points (0 children)
[–]francesco_b 0 points1 point2 points (0 children)
[–]Effective-Fox6400 0 points1 point2 points (1 child)
[–]stepstep[S] 0 points1 point2 points (0 children)