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

后端 未结 7 1753
难免孤独
难免孤独 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:44

    This is a problem with any specification language (even English), not just dependent types. Your own post is a good example: it contains an informal specification of "sort function" that only requires the result to be sorted, which is not what you want (\xs -> [] would qualify). See e.g. this post from Twan van Laarhoven's blog.

提交回复
热议问题