Dynaplex: Analyzing Program Complexity using Dynamically Inferred Recurrence Relations

Published in Proceedings of the ACM on Programming Languages, 2021

Recommended citation: Didier Ishimwe, KimHao Nguyen, and ThanhVu Nguyen. 2021. Dynaplex: analyzing program complexity using dynamically inferred recurrence relations. Proc. ACM Program. Lang. 5, OOPSLA, Article 138 (October 2021), 23 pages.

In this work, we introduce a new dynamic approach for inferring the asymptotic complexity bounds of recursive programs. From program execution traces, we learn recurrence relations and solve them using pattern matching to obtain closed-form solutions representing the complexity bounds of the program. This approach allows us to efficiently infer simple linear recurrence relations that represent nontrivial, potentially nonlinear polynomial and non-polynomial, complexity bounds such as O(n^{1.58}) for Karatsuba multiplication algorithm. Download paper here