🤖 AI Summary
Modular complexity analysis of integer programs remains challenging for non-tail-recursive and general function-call structures, as existing frameworks lack systematic support for recursion.
Method: We introduce Recursive Ranking Functions (RRFs), a novel formalism enabling modular automatic resource analysis for arbitrary recursive integer programs. Our approach integrates RRFs with instruction-level complexity analysis and implements an end-to-end automated analyzer within the KoAT tool.
Contribution/Results: Our method precisely infers polynomial and exponential time complexities—outperforming prior modular techniques in both precision and scalability. It overcomes a fundamental limitation of existing modular analysis frameworks, which were restricted to non-recursive programs. Experimental evaluation demonstrates significant improvements in analytical accuracy and applicability to realistic recursive code patterns, establishing the first fully modular, automated complexity analyzer supporting general recursion in integer programs.
📝 Abstract
In earlier work, we developed a modular approach for automatic complexity analysis of integer programs. However, these integer programs do not allow non-tail recursive calls or subprocedures. In this paper, we consider integer programs with function calls and present a natural extension of our modular complexity analysis approach to the recursive setting based on a new form of ranking functions. Hence, our approach combines already existing powerful techniques on the "imperative" parts of the program and our novel ranking functions on the recursive parts. The strength of this combination is demonstrated by our implementation in the complexity analysis tool KoAT.