Hacker News new | ask | show | jobs
by viraptor 2 days ago
There's another alternative - let most of the spec be derived from the code. Verus for example allows you to wrap your code in a verus!() macro and get a lot of the work for free and guaranteed to be in sync with the code. Even without any custom proofs, just that part provides a no-crash guarantee. (You still need to do some work though - it's not free)
1 comments

The normal pattern is that the spec is shorter than the code, and therefore easier to get correct. That's why it's useful. Deriving the spec from the code therefore seems like going the less-useful direction.