2 ms·
> I don't think it's really even possible for a language to force the programmer to give a proper formal specification. The language, probably not. The standar
by zozbot234 7y ago
> I don't think it's really even possible for a language to force the programmer to give a proper formal specification.
The language, probably not. The standard library can certainly require detailed-enough formal preconditions to make its code defect-free, meaning that any remaining bugs can then be directly traced to the programmer's code.
- MaxBarraclough 7y agoYou mean that, for instance, a standard-library generic sort function, might require that your comparator function behave correctly when the arguments are reversed? That's an interesting idea. Like Java interfaces, but with formal contracts. I doubt that putting these contracts into the standard-library would give you good proof-coverage though.