# Non-polynomial Worst-Case Analysis of Recursive Programs

**Authors:** Krishnendu Chatterjee, Hongfei Fu, Amir Kafshdar Goharshady

arXiv: 1705.00317 · 2017-05-02

## TL;DR

This paper introduces a novel approach for proving non-polynomial worst-case bounds of recursive programs using measure functions synthesized through linear programming, enabling bounds like n log n and non-integer polynomial exponents.

## Contribution

The paper extends ranking functions to recursion, enabling synthesis of non-polynomial measure functions with logarithmic and exponential forms using linear programming techniques.

## Key findings

- Successfully synthesized bounds for classical recursive algorithms
- Achieved bounds such as O(n log n) for Merge-Sort
- Obtained non-integer polynomial bounds close to best-known results

## Abstract

We study the problem of developing efficient approaches for proving worst-case bounds of non-deterministic recursive programs. Ranking functions are sound and complete for proving termination and worst-case bounds of nonrecursive programs. First, we apply ranking functions to recursion, resulting in measure functions. We show that measure functions provide a sound and complete approach to prove worst-case bounds of non-deterministic recursive programs. Our second contribution is the synthesis of measure functions in nonpolynomial forms. We show that non-polynomial measure functions with logarithm and exponentiation can be synthesized through abstraction of logarithmic or exponentiation terms, Farkas' Lemma, and Handelman's Theorem using linear programming. While previous methods obtain worst-case polynomial bounds, our approach can synthesize bounds of the form $\mathcal{O}(n\log n)$ as well as $\mathcal{O}(n^r)$ where $r$ is not an integer. We present experimental results to demonstrate that our approach can obtain efficiently worst-case bounds of classical recursive algorithms such as (i) Merge-Sort, the divide-and-conquer algorithm for the Closest-Pair problem, where we obtain $\mathcal{O}(n \log n)$ worst-case bound, and (ii) Karatsuba's algorithm for polynomial multiplication and Strassen's algorithm for matrix multiplication, where we obtain $\mathcal{O}(n^r)$ bound such that $r$ is not an integer and close to the best-known bounds for the respective algorithms.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1705.00317/full.md

## Figures

22 figures with captions in the complete paper: https://tomesphere.com/paper/1705.00317/full.md

## References

67 references — full list in the complete paper: https://tomesphere.com/paper/1705.00317/full.md

---
Source: https://tomesphere.com/paper/1705.00317