This has been done so many times.<p>The Stanford Pascal Verifier was probably the first[1] The Pascal-F Verifier, a project I headed around 1980,[2][3] used preconditions and postconditions very similar to what this guy is doing in Rust. "Specifically, full functional correctness with properties like arithmetic correctness, in-bounds array accesses, state machines correctness, functional correctness with respect to an abstract specification or security properties." - we had all that in 1983. Look at the example starting at page 56 in [2].<p>DEC did a lot of work on this for Modula, and later Java, in the late 1980s.[4] Modula went down with DEC. The work was mostly lost. Dafny is probably the most modern system in this line.<p>Memory safety by proof was coming along well in the early 1980s. Working systems existed. Automatic prover technology was working. Then came C.<p>The "array is a pointer" mindset of C set programming back by <i>decades</i>. In Pascal, <i>there were no buffer overflows</i>. Pascal, Modula, Ada, and on to Rust - no buffer overflows. Everything carried along size information. Subscript checking optimizations had been figured out by the 1980s, so the performance penalty was coming down.<p>The author mentions Sapiens, an attempt to apply machine learning to the problem of null pointers in C. (Anyone have a reference? It's hard to find.) Massive amounts of effort are being applied to try to infer information that C just can't express. This would be a lot more worthwhile if it resulted in translation of C to something better.<p>Forty years, and this <i>still</i> isn't fixed.<p>[1] <a href="http://i.stanford.edu/pub/cstr/reports/cs/tr/79/731/CS-TR-79-731.pdf" rel="nofollow">http://i.stanford.edu/pub/cstr/reports/cs/tr/79/731/CS-TR-79...</a>
[2] <a href="http://www.animats.com/papers/verifier/verifiermanual.pdf" rel="nofollow">http://www.animats.com/papers/verifier/verifiermanual.pdf</a>
[3] <a href="https://github.com/John-Nagle/pasv" rel="nofollow">https://github.com/John-Nagle/pasv</a>
[4] <a href="https://link.springer.com/content/pdf/10.1007/BFb0026441.pdf" rel="nofollow">https://link.springer.com/content/pdf/10.1007/BFb0026441.pdf</a>