## Amortized Resource Analysis with Polynomial Potential A Static Inference of Polynomial Bounds for Functional Programs (Extended Version)

### Cached

### Download Links

Citations: | 13 - 5 self |

### BibTeX

@MISC{Hoffmann_amortizedresource,

author = {Jan Hoffmann and Martin Hofmann and Ludwig-maximilians-universität München},

title = {Amortized Resource Analysis with Polynomial Potential A Static Inference of Polynomial Bounds for Functional Programs (Extended Version)},

year = {}

}

### OpenURL

### Abstract

Abstract. In 2003, Hofmann and Jost introduced a type system that uses a potential-based amortized analysis to infer bounds on the resource consumption of (first-order) functional programs. This analysis has been successfully applied to many standard algorithms but is limited to bounds that are linear in the size of the input. Here we extend this system to polynomial resource bounds. An automatic amortized analysis is used to infer these bounds for functional programs without further annotations if a maximal degree for the bounding polynomials is given. The analysis is generic in the resource and can obtain good bounds on heap-space, stack-space and time usage.

### Citations

662 | Light linear logic
- Girard
- 1998
(Show Context)
Citation Context ...ation of binomial coefficients. To wit, the coefficient of ( ) n i in the representation of p is (∆ip)(0). The hereditarily non-negative polynomials are scalar multiples of unary resource polynomials =-=[8]-=- and thus are closed under sum, product, and composition. Note that they include all non-negative linear combinations of the polynomials (xi)i∈N.s6 Type system Amortized Resource Analysis with Polynom... |

143 | Static prediction of heap space usage for first-order functional programs
- Hofmann, Jost
(Show Context)
Citation Context ... the problem of statically determining an upper bound on the resource usage of a given first-order functional program as a function of the size of its input. As in an earlier work by Hofmann and Jost =-=[15]-=- we rely on the potential method of amortized analysis to take into account the interaction between the steps of a computation and thus obtain tighter bounds than by a mere addition of the worst case ... |

143 |
Amortized computational complexity
- Tarjan
- 1985
(Show Context)
Citation Context ...s a compilation of the experimental results and more detailed versions of §7, §8 and §9. 2 Amortized Analysis: Examples and Intuition Amortized analysis was initially introduced by Sleator and Tarjan =-=[4]-=- to analyze the efficiency of data structures. For a given data structure one is often interested in the costs of a sequence of operations whose costs vary depending on the state of the data structure... |

128 | Proving the correctness of reactive systems using sized types
- Hughes, Pareto, et al.
- 1996
(Show Context)
Citation Context ...s. Another substantial contribution is the use of amortized analysis to infer sized types in functional programs. Sized types provide a general framework to represent the size of the data in its type =-=[17]-=-. There has been work on the inference 1 http://raml.tcs.ifi.lmu.deAmortized Resource Analysis with Polynomial Potential (Extended Version) 3 of linear bounds for sized types [16, 5] and on the infer... |

120 | Resource bound certification
- Crary, Weirich
- 2000
(Show Context)
Citation Context ... the code; by a straightforward intraprocedural analysis a set of recurrence equations or inequations for these functions is then derived. A typebased extraction of such recurrences has been given in =-=[7]-=-. Even for relatively simple programs the resulting recurrences are quite complicated and difficult to solve with standard methods. In the COSTA project [2] progress has been made with the solution of... |

82 | Recursion and Dynamic Data-Structures in Bounded Space; Towards Embedded ML Programming
- Hughes, Pareto
- 1999
(Show Context)
Citation Context ... a number that represents the size of data structures. This information can be used to prove termination [1], to find errors [17] or to state bounds on the resource consumption of functional programs =-=[16, 10]-=-. In this section we provide an inference method that computes polynomial relations between the sizes of the input and the size of the output of a function. This method is not limited to shapely funct... |

76 | Hume: a domain-specific language for real-time embedded systems
- Hammond, Michaelson
- 2003
(Show Context)
Citation Context ...ions that might be of interest in special embedded systems. Actual constants for stack-space, heap-space and clock-cycle consumption have been determined for the abstract machine of the language Hume =-=[14]-=- on the Renesas M32C/85U architecture. A list can be found in the literature [19]. 5 Resource Annotations for Polynomial Bounds Resource-annotated types are simple types where lists are annotated with... |

59 | Calculating sized types
- Chin, Khoo
- 2001
(Show Context)
Citation Context ...he data in its type [17]. There has been work on the inference 1 http://raml.tcs.ifi.lmu.deAmortized Resource Analysis with Polynomial Potential (Extended Version) 3 of linear bounds for sized types =-=[16, 5]-=- and on the inference of size information for so-called shapely functions, i.e., functions such that the size of the function value is determined exactly by a polynomial in the sizes of the arguments.... |

58 | Average-Case Analysis of Algorithms and
- FLAJOLET, VITTER
- 1987
(Show Context)
Citation Context ...olynomial bounds. Other resource analyses that can in principle obtain polynomial bounds are36 Jan Hoffmann and Martin Hofmann approaches based on recurrences pioneered by Grobauer [10] and Flajolet =-=[8]-=-. In those systems, an a priori unknown resource bounding function is introduced for each function in the code; by a straightforward intraprocedural analysis a set of recurrence equations or inequatio... |

46 | Speed: precise and efficient static estimation of program computational complexity
- Gulwani, Mehra, et al.
- 2009
(Show Context)
Citation Context ...ompositions of functions seem to be better dealt with by amortization. A successful method to estimate time bounds for C++ procedures with loops and recursion was recently developed by Gulwani et al. =-=[12, 11]-=- in the SPEED project. They annotate programs with counters and use automatic invariant discovery between their values using off-the-shelf program analysis tools which are based on abstract interpreta... |

36 | Automatic Inference of Upper Bounds for Recurrence Relations in Cost Analysis
- Albert, Arenas, et al.
- 2008
(Show Context)
Citation Context ...L(int))→L(int, int) that takes an integer and a list of integers and returns a list of pairs of integers such that the first argument is attached to every element of the list. The expression attach(1,=-=[1,2,3,4]-=-) thus evaluates to [(1,1),(1,2),(1,3),(1,4)]. The function attach can be implemented as follows. attach(x, l) = match l with | nil → nil | (y :: ys) → (x,y)::(attach (x,ys))4 Jan Hoffmann and Martin... |

27 | Automatic certification of heap consumption
- Beringer, Hofmann, et al.
- 2005
(Show Context)
Citation Context ...oth integration of components whose implementation is not available. Moreover, type derivations can be seen as certificates and can be automatically translated into formalized proofs in program logic =-=[15]-=-. However, we find the possibility of incorporating existing program analyses to be a particularly attractive feature of the SPEED approach. It would be interesting to investigate to what extent such ... |

20 | Eekelen. Polynomial Size Analysis for First-Order Functions
- Shkaravska, Kesteren, et al.
(Show Context)
Citation Context ... there is a fruitful interaction between sized types and amortization.Amortized Resource Analysis with Polynomial Potential (Extended Version) 37 Polynomial resource bounds have also been studied in =-=[20]-=-. Interestingly, the motivation of that paper is to extend amortized analysis to super-linear bounds; however loc. cit. only addresses the derivation of polynomial size bounds which is identified ther... |

18 | Cost recurrences for DML programs
- Grobauer
- 2001
(Show Context)
Citation Context ... a number that represents the size of data structures. This information can be used to prove termination [1], to find errors [17] or to state bounds on the resource consumption of functional programs =-=[16, 10]-=-. In this section we provide an inference method that computes polynomial relations between the sizes of the input and the size of the output of a function. This method is not limited to shapely funct... |

18 |
Dependent ML: an approach to practical programming with dependent types
- Xi
(Show Context)
Citation Context ...ble. Below we give the grammar of sized types for RAML and an informal explanation of what a sized type statement means. The size types that we will infer are existential sized types as defined by Xi =-=[22]-=-.24 Jan Hoffmann and Martin Hofmann Fig. 1. The computed heap-space bound (blue line) compared to the measured worstcase heap-space consumption (red crosses) of quicksort. Fig. 2. The computed evalua... |

15 |
Endre Tarjan. Amortized computational complexity
- Robert
- 1985
(Show Context)
Citation Context ...ted §9, §12, and §8. Furthermore, it contains only short versions of of §7, §10 and §11. 2 Amortized Analysis: Examples and Intuition Amortized analysis was initially introduced by Sleator and Tarjan =-=[21]-=- to analyze the efficiency of data structures. For a given data structure one is often interested in the costs of a sequence of operations whose costs vary depending on the state of the data structure... |

15 | A numerical abstract domain based on expression abstraction and max operator with application in timing analysis
- Gulavani, Gulwani
- 2008
(Show Context)
Citation Context ...ompositions of functions seem to be better dealt with by amortization. A successful method to estimate time bounds for C++ procedures with loops and recursion was recently developed by Gulwani et al. =-=[13, 14]-=- in the SPEED project. They annotate programs with counters and use automatic invariant discovery between their values using off-the-shelf program analysis tools which are based on abstract interpreta... |

11 | Semi-Continuous Sized Types and Termination
- Abel
- 2006
(Show Context)
Citation Context ...L(int))→L(int, int) that takes an integer and a list of integers and returns a list of pairs of integers such that the first argument is attached to every element of the list. The expression attach(1,=-=[1,2,3,4]-=-) thus evaluates to [(1,1),(1,2),(1,3),(1,4)]. The function attach can be implemented as follows. attach(x, l) = match l with | nil → nil | (y :: ys) → (x,y)::(attach (x,ys))4 Jan Hoffmann and Martin... |

11 | Static determination of quantitative resource usage for higher-order programs
- Jost, Hammond, et al.
- 2010
(Show Context)
Citation Context ..., it has been shown [19] that the same potential-based approach can be similarly applied to a wide range of resources such as time and stack space [4] as well as to polymorphic, higher-order programs =-=[18]-=-. Now consider the function pairs:L(int)→L(int, int) that computes the twoelement sets of a given set (if one views the input list as a set). The expression pairs([1,2,3,4]) thus evaluates to the list... |

10 | Amortised memory analysis using the depth of data structures
- Campbell
- 2009
(Show Context)
Citation Context ...L(int))→L(int, int) that takes an integer and a list of integers and returns a list of pairs of integers such that the first argument is attached to every element of the list. The expression attach(1,=-=[1,2,3,4]-=-) thus evaluates to [(1,1),(1,2),(1,3),(1,4)]. The function attach can be implemented as follows. attach(x, l) = match l with | nil → nil | (y :: ys) → (x,y)::(attach (x,ys))4 Jan Hoffmann and Martin... |

9 | Carbon Credits” for Resource-Bounded Computations using Amortised Analysis
- Jost, Loidl, et al.
- 2009
(Show Context)
Citation Context ...notations. It is furthermore generic in the resource and provides good bounds on heap space, stack space, clock cycles (time) or other resources that might be of interest to a user. The linear system =-=[15, 19]-=- has been successfully applied in the domain of embedded systems [13]. We envisage that the present extension will also have applications there, in particular in situations where only a few functions ... |

7 |
Olha Shkaravska. Automatic certification of heap consumption
- Beringer, Hofmann, et al.
- 2005
(Show Context)
Citation Context |

3 |
Corneliu Popeea, and Huu Hai Nguyen. Verifying Safety Policies with Size Properties and Alias Controls
- Chin, Khoo, et al.
- 2005
(Show Context)
Citation Context ...atic but interesting aspect is the use of slicing techniques to eliminate large code portions that do not contribute to the resource being analyzed. Another related approach is the use of sized types =-=[17, 16, 5, 6]-=- which provide a general framework to represent the size of the data in its type. Sized types are a very important concept and we also employ them indirectly. Our method adds a certain amount of data ... |

3 |
Gulavani and Sumit Gulwani. A Numerical Abstract Domain Based on Expression Abstraction and Max Operator with Application in Timing Analysis
- Bhargav
- 2008
(Show Context)
Citation Context ...ompositions of functions seem to be better dealt with by amortization. A successful method to estimate time bounds for C++ procedures with loops and recursion was recently developed by Gulwani et al. =-=[12, 11]-=- in the SPEED project. They annotate programs with counters and use automatic invariant discovery between their values using off-the-shelf program analysis tools which are based on abstract interpreta... |

2 |
Eekelen, M.C.: Polynomial Size Analysis of FirstOrder Functions. In: Typed Lambda Calc. Apps
- Shkaravska, Kesteren, et al.
- 2007
(Show Context)
Citation Context ...sions in favour of numerical potential annotations. As we have demonstrated, there is a fruitful interaction between sized types and amortization. Polynomial resource bounds have also been studied in =-=[20]-=-. Interestingly, the motivation of that paper is to extend amortized analysis to super-linear bounds; however loc. cit. only addresses the derivation of polynomial size bounds which is identified ther... |

1 |
A.: The EmBounded Project: Automatic Prediction of Resource Bounds for Embedded Systems
- Hammond, Dyckhoff, et al.
(Show Context)
Citation Context ...unds on heap space, stack space, clock cycles (time) or other resources that might be of interest to a user. The linear system [15, 19] has been successfully applied in the domain of embedded systems =-=[13]-=-. We envisage that the present extension will also have applications there, in particular in situations where only a few functions exhibit super-linear resource consumption. For this, it is important ... |

1 | H.H.: Verifying Safety Policies with Size - Chin, Khoo, et al. - 2005 |