Efficient Cost Bounds with Linear Maps

📅 2025-09-26
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing Automatic Amortized Resource Analysis (AARA) infers cost-free types via recursive constructions, incurring high computational overhead and supporting only polynomial cost bounds. Method: We propose a novel cost-free type representation based on linear mappings, algebraically reformulating type inference as solving matrix inequality constraints. This integrates linear programming with a type system for efficient, automated constraint resolution. Contribution/Results: Our approach is the first to incorporate linear mappings and matrix inequalities into resource analysis, enabling unified modeling of non-polynomial cost bounds—including exponential ones—beyond prior polynomial limitations. It achieves exponential speedup in inference time over the state-of-the-art algorithms while ensuring strong generality and formal verifiability. Experimental evaluation confirms substantial efficiency gains and broad applicability across diverse resource-aware programs.

Technology Category

Application Category

📝 Abstract
The Automatic Amortized Resource Analysis (AARA) derives program-execution cost bounds using types. To do so, AARA often makes use of cost-free types, which are critical for the composition of types and cost bounds. However, inferring cost-free types using the current state-of-the-art algorithm is expensive due to recursive dependence on additional cost-free types. Furthermore, that algorithm uses a heuristic only applicable to polynomial cost bounds, and not, e.g., exponential bounds. This paper presents a new approach to these problems by representing the cost-free types of a function in a new way: with a linear map, which can stand for infinitely many cost-free types. Such maps enable an algebraic flavor of reasoning about cost bounds (including non-polynomial bounds) via matrix inequalities. These inequalities can be solved with off-the-shelf linear-programming tools for many programs, so that types can always be efficiently checked and often be efficiently inferred. An experimental evaluation with a prototype implementation shows that-when it is applicable-the inference of linear maps is exponentially more efficient than the state-of-the-art algorithm.
Problem

Research questions and friction points this paper is trying to address.

AARA infers program cost bounds using types but faces efficiency issues
Current heuristic only works for polynomial bounds, not exponential ones
New approach uses linear maps to represent cost-free types efficiently
Innovation

Methods, ideas, or system contributions that make the work stand out.

Uses linear maps to represent cost-free types
Solves matrix inequalities via linear programming
Enables efficient inference of non-polynomial bounds
🔎 Similar Papers
No similar papers found.