4 ms·
That's quite possible, and most proof of correctness systems can do it, but there's no syntax in Rust for talking about the necessary object invariants. Object
by Animats 11y ago
That's quite possible, and most proof of correctness systems can do it, but there's no syntax in Rust for talking about the necessary object invariants.
Object invariants are assertions which must be true whenever control is not within the object. The object invariants must be true when control leaves the object by exiting any public function. Nothing outside the object must be able to alter the variables involved in the object invariant. Only one execution thread can be in the object at a time.
If you can demonstrate all of those conditions, assuming the invariant is true at entry to the object, you have proved the object invariant.
This is a useful and well-understood concept in the proof world, but isn't seen much in programming languages.
- ralfj 11y agoSince Rust supports concurrency, it is worth mentioning that these techniques have been scaled to handle objects that can be accessed from multiple threads at once - while maintaining the modularity of the approach. See, for example, <http://plv.mpi-sws.org/iris/> http://plv.mpi-sws.org/iris/> and <http://software.imdea.org/fcsl/> http://software.imdea.org/fcsl/>.