Lune

OOPSLA2021Top-tier venue

Dynaplex: analyzing program complexity using dynamically inferred recurrence relations

Didier Ishimwe, KimHao Nguyen, ThanhVu Nguyen

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

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Integrating Resource Analyses via Resource Decomposition cites Robust Resource Bounds with Static Analysis and Bayesian Inference
  • Integrating Resource Analyses via Resource Decomposition cites Templates and recurrences: better together
  • DynamiTe: dynamic termination and non-termination proofs cites Learning nonlinear loop invariants with gated continuous logic networks
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. Robust Resource Bounds with Static Analysis and Bayesian InferenceLong Pham, Feras A. Saad, Jan HoffmannPLDI 2024 · 6 citations
  2. Integrating Resource Analyses via Resource DecompositionLong Pham, Yue Niu, Nathaniel Glover, Feras Saad et al.OOPSLA 2025

Builds on4

  1. SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity VulnerabilitiesTheofilos Petsios, Jason Zhao, Angelos D. Keromytis, Suman JanaCCS 2017 · 214 citations
  2. Templates and recurrences: better togetherJason Breck, John Cyphert, Zachary Kincaid, Thomas W. RepsPLDI 2020 · 30 citations
  3. DynamiTe: dynamic termination and non-termination proofsTon Chanh Le, Timos Antonopoulos, Parisa Fathololumi, Eric Koskinen et al.OOPSLA 2020 · 26 citations
  4. Learning nonlinear loop invariants with gated continuous logic networksJianan Yao, Gabriel Ryan, Justin Wong, Suman Jana et al.PLDI 2020 · 1 citation

Related papers

  1. Synthesis with Asymptotic Resource BoundsQinheping Hu, John Cyphert, Loris D'Antoni, Thomas W. RepsCAV 2021 · 5 citations
  2. Recurrence extraction for functional programs through call-by-push-valueG. A. Kavvos, Edward Morehouse, Daniel R. Licata, Norman DannerPOPL 2020 · 20 citations
  3. Adaptive Recursive Query OptimizationAnna Herlihy, Guillaume Martres, Anastasia Ailamaki, Martin OderskyICDE 2024 · 5 citations
  4. Automated Tail Bound Analysis for Probabilistic Recurrence RelationsYican Sun, Hongfei Fu, Krishnendu Chatterjee, Amir Kafshdar GoharshadyCAV 2023 · 9 citations
  5. Scaling implicit parallelism via dynamic control replicationMichael Bauer, Wonchan Lee, Elliott Slaughter, Zhihao Jia et al.PPoPP 2021 · 12 citations
Dusk over the sea between two cliffs drawn in fine vertical lines