Dependent types can prove your code is correct up to a specification. But how do you prove the specification is correct?

后端 未结 7 1737
难免孤独
难免孤独 2021-02-01 01:21

Dependent types are often advertised as a way to enable you to assert that a program is correct up to a specification. So, for example, you are asked to write a code that

7条回答
  •  轮回少年
    2021-02-01 01:47

    Suppose your function is not top level one, but used by somebody else as part of some module, which also has correctness proof. The latter must use correctness proof of your function, and if it is bad, module will not compile. The module itself still can have mistakes, but it is not problem of yours anymore.

提交回复
热议问题