Back to Search Start Over

Dynaplex: analyzing program complexity using dynamically inferred recurrence relations

Authors :
KimHao Nguyen
Didier Ishimwe
ThanhVu Nguyen
Source :
Proceedings of the ACM on Programming Languages. 5:1-23
Publication Year :
2021
Publisher :
Association for Computing Machinery (ACM), 2021.

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).

Details

ISSN :
24751421
Volume :
5
Database :
OpenAIRE
Journal :
Proceedings of the ACM on Programming Languages
Accession number :
edsair.doi...........fb34ec0f91e6e152b6ec6ac19baede8b