Towards Automatic Resource Bound Analysis for OCaml
Jan Hoffmann, Ankush Das, Shu-Chun Weng

TL;DR
This paper introduces an automatic resource analysis system for OCaml that derives polynomial bounds on various resources for higher-order, polymorphic, and user-defined inductive type programs, including those with side effects.
Contribution
It presents a novel multivariate automatic amortized resource analysis (AARA) that automatically infers polynomial resource bounds for complex OCaml programs, including higher-order functions and user-defined types.
Findings
Successfully derived resource bounds for 411 functions across multiple libraries.
Outperformed previous linear bound inference systems in handling programs with side effects.
Demonstrated practical applicability with integration into OCaml compiler and case studies.
Abstract
This article presents a resource analysis system for OCaml programs. This system automatically derives worst-case resource bounds for higher-order polymorphic programs with user-defined inductive types. The technique is parametric in the resource and can derive bounds for time, memory allocations and energy usage. The derived bounds are multivariate resource polynomials which are functions of different size parameters that depend on the standard OCaml types. Bound inference is fully automatic and reduced to a linear optimization problem that is passed to an off-the-shelf LP solver. Technically, the analysis system is based on a novel multivariate automatic amortized resource analysis (AARA). It builds on existing work on linear AARA for higher-order programs with user-defined inductive types and on multivariate AARA for first-order programs with built-in lists and binary trees. For the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsFormal Methods in Verification · Software Testing and Debugging Techniques · Logic, programming, and type systems
