A Coq library for internal verification of running-times

作者:McCarthy Jay*; Fetscher Burke; New Max S; Feltey Daniel; Findler Robert Bruce
来源:Science of Computer Programming, 2018, 164: 49-65.
DOI:10.1016/j.scico.2017.05.001

摘要

This paper presents a Coq library that lifts an abstract yet precise notion of running-time into the type of a function. Our library is based on a monad that counts abstract steps. The monad's computational content, however, is simply that of the identity monad so programs written in our monad (that recur on the natural structure of their arguments) extract into idiomatic OCaml code.
We evaluated the expressiveness of the library by proving that red-black tree insertion and search, merge sort, insertion sort, various Fibonacci number implementations, iterated list insertion, various BigNum operations, and Okasaki's Braun Tree algorithms all have their expected running times.