EN FR
EN FR


Section: New Software and Platforms

HoCA

Higher-Order Complexity Analysis

Scientific Description

Over the last decade, various tools for the static analysis of resource properties of programs have emerged. In particular, the rewriting community has recently developed several tools for the time complexity analysis of term rewrite systems. These tools have matured and are nowadays able to treat non-trivial programs, in a fully automatic setting. However, none of these automatic complexity analysers can deal with higher-order functions, a pervasive feature of functional programs.

Our tool HoCA (Higher-Order Complexity Analyser) overcomes this limitation by translating higher-order programs – in the form of side-effect free OCaml programs – into equivalent first-order rewrite systems. At the heart of our tool lies Reynold's defunctionalization technique. Defunctionalization however is not enough. Resulting programs have a recursive structure too complicated to be analysed automatically in all but trivial cases. To overcome this issue, HoCA integrates a handful of well established program transformation techniques, noteworthy dead-code elimination, inlining, instantiation and uncurrying. All these techniques have been specifically suited to the methods integrated in modern first-order complexity analysers. Of course, the complete transformation pipeline underlying our tool is not only proven semantically correct, but also to reflect the runtime behavior. This way, a complexity bound on the resulting first-order program can be relayed back reliably to the higher-order program of interest.

A detailed description of HoCA is available on http://arxiv.org/abs/1506.05043