Affiliation:
1. University of Nebraska-Lincoln, USA
2. George Mason University, USA
Abstract
Being able to detect program runtime complexity is useful in many tasks (e.g., checking expected performance and identifying potential security vulnerabilities). 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 recurrence relations that represent nontrivial, potentially nonlinear polynomial and non-polynomial, complexity bounds.
We present Dynaplex, a tool that implements these ideas to automatically generate recurrence relations from execution traces. Our preliminary results on popular and challenging recursive programs show that Dynaplex can learn precise relations capturing worst-case complexity bounds (e.g.,
O
(
n
log
n
) for mergesort,
O
(2
n
) for Tower of Hanoi and
O
(
n
1.58
) for Karatsuba’s multiplication algorithm).
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
6 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Robust Resource Bounds with Static Analysis and Bayesian Inference;Proceedings of the ACM on Programming Languages;2024-06-20
2. An Intelligent Scheduling System for Large-Scale Online Judging;Communications in Computer and Information Science;2024
3. Inferring Complexity Bounds from Recurrence Relations;Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering;2023-11-30
4. Invalidator: Automated Patch Correctness Assessment via Semantic and Syntactic Reasoning;IEEE Transactions on Software Engineering;2023
5. Dynaplex;Proceedings of the ACM/IEEE 44th International Conference on Software Engineering: Companion Proceedings;2022-05-21