一句话:提出从执行轨迹动态推断递推关系并求解,为非确定性递归程序计算渐近复杂度界。
本文关注如何自动确定非确定性递归程序的渐近复杂度界。作者提出从程序执行轨迹中动态推断递推关系,再使用 annihilator method 和 Master Theorem 求解递推,得到表示复杂度界的闭式解。初步评估在若干经典递归程序上进行:方法能学到正确界,如 quicksort 的 O(n²);对指数程序给出比已有结果更精确的界,如 Fibonacci;并可捕获非线性多项式、非多项式、对数及指数等多种复杂度关系。
Determining program complexity bounds is a fundamental problem with a variety of applications in software development. In this paper we present a novel approach for computing the asymptotic complexity bounds of non-deterministic recursive programs by solving dynamically inferred recurrence relations. Recurrences are inferred from program execution traces and solved using the annihilator method and Master Theorem to obtain closed-form solutions representing the complexity bounds. Our preliminary evaluation shows that this approach can learn correct bounds for popular classical recursive programs (e.g. O(n2) for quicksort), achieving more precise bounds for exponential programs than previously reported (e.g. O((1+√5/2)n) for fibonacci), and capturing a wide range of bounds including non-linear polynomial and non-polynomial, logarithmic, and exponential relations.