## Static Prediction of Heap Space Usage for First-order Functional Programs (2003)

### Cached

### Download Links

- [www.cs.st-andrews.ac.uk]
- [www.tcs.informatik.uni-muenchen.de]
- DBLP

### Other Repositories/Bibliography

Venue: | in Symposium on Principles of Programming Languages (POPL’03 |

Citations: | 134 - 25 self |

### BibTeX

@INPROCEEDINGS{Hofmann03staticprediction,

author = {Martin Hofmann and Steffen Jost},

title = {Static Prediction of Heap Space Usage for First-order Functional Programs},

booktitle = {in Symposium on Principles of Programming Languages (POPL’03},

year = {2003},

pages = {185--197},

publisher = {ACM Press}

}

### Years of Citing Articles

### OpenURL

### Abstract

Categories and Subject Descriptors We show how to efficiently obtain linear a priori bounds on the heap space consumption of first-order functional programs. The analysis takes space reuse by explicit deallocation into account and also furnishes an upper bound on the heap usage in the presence of garbage collection. It covers a wide variety of examples including, for instance, the familiar sorting algorithms for lists, including quicksort. The analysis relies on a type system with resource annotations. Linear programming (LP) is used to automatically infer derivations in this enriched type system. We also show that integral solutions to the linear programs derived correspond to programs that can be evaluated without any operating system support for memory management. The particular integer linear programs arising in this way are shown to be feasibly solvable under mild assumptions.

### Citations

1128 | Proof-carrying code
- Necula
- 1997
(Show Context)
Citation Context ...in a form that allows one to say very little about its global behaviour. Bothsaws are unacceptable in a scenario where independently veriable certicates on resource usage of mobile code are desired [1=-=4, 1]-=-. What one would rather expect in this situation is a statement of the form: running f on an input of length n will require no more than b(n) heap cells where b(n) is an expressionslike 3n+7 or 2:5n 3... |

305 | De interpreters for higherorder programming languages - Reynolds - 1972 |

286 | Region-based memory management
- Tofte, Talpin
- 1997
(Show Context)
Citation Context ...type. The approaches are thus quite dierent technically. Nevertheless, sized types can also be used to infer space bounds. The transition from size to space is made via regionbased memory management [=-=19]-=- which however, imposes unnatural restrictions due to the fact that a given data structure, e.g. a list, must reside entirely in one region. This prevents the analysis of computations in which lifetim... |

118 | Resource Bound Certification
- Crary, Weirich
- 2000
(Show Context)
Citation Context ...and recommend to fit an algebraic expression into a value table obtained from small inputs. This is acceptable for profiling purposes but certainly not for resource certification. In other works like =-=[3]-=- the user must provide a conjectured resource bound. The formalism can be used to validate Extended version, for WWW only – July 2, 2009it but even for the validation user interaction is required. Mo... |

86 | A type system for bounded space and functional in-place update
- Hofmann
(Show Context)
Citation Context ...tions. As is well-known such solutions can be eciently computed. We also show that integral solutions to the L(P ) are in 1-1 correspondence to enriched versions of P in the programming language LFPL =-=[8]-=- which bypasses memory management by explicitly passing around memory cells as part of the data. Programs in LFPL largely behave like imperative programs that modify heap-allocated data in-place rathe... |

77 | Recursion and dynamic data-structures in bounded space: towards embedded ML programming
- Hughes, Pareto
- 1999
(Show Context)
Citation Context ...even for the validation user interaction is required. Moreover, this work only accounts for execution time not heap space. Another piece of well-known related work are Hughes and Pareto's sized types =-=[10]-=-. This system allows one to certify upper bounds on the number of constructor symbols in inductive data types. For example List k A is the type of Lists of type A of length at most k, and accordingly ... |

62 | Quasi-linear types, in
- Kobayashi
- 1999
(Show Context)
Citation Context ...atic type system. We already know that linear typing, i.e., the absence of contraction, provides such a guarantee; we conjecture that the more general read-only type systems and analyses described in =-=[2, 12, 15, 18]-=- all are able to provide such a guarantee as well, by suitably restricting but not altogether excluding the contraction rule. The important point here is that the semantic formalisation of benign shar... |

38 | Another type system for in-place update, in
- Aspinall, Hofmann
- 2005
(Show Context)
Citation Context ...atic type system. We already know that linear typing, i.e., the absence of contraction, provides such a guarantee; we conjecture that the more general read-only type systems and analyses described in =-=[2, 12, 15, 18]-=- all are able to provide such a guarantee as well, by suitably restricting but not altogether excluding the contraction rule. The important point here is that the semantic formalisation of benign shar... |

29 | Granularity in large-scale parallel functional programming
- Loidl
- 1998
(Show Context)
Citation Context ...ure should only be used for read-only purposes, as destroying any of the element lists leads to malignant sharing. 10. RELATED WORK Approaches based on abstract interpretation and symbolic evaluation =-=[7, 13, 4, 20, 5, 6]-=- go in the direction of the naive approach mentioned in the Introduction. The structure of the inferred resource bound matches the structure of the program. Where the program contains a while loop or ... |

24 | Observers for linear types
- Odersky
- 1992
(Show Context)
Citation Context ...atic type system. We already know that linear typing, i.e., the absence of contraction, provides such a guarantee; we conjecture that the more general read-only type systems and analyses described in =-=[2, 12, 15, 18]-=- all are able to provide such a guarantee as well, by suitably restricting but not altogether excluding the contraction rule. The important point here is that the semantic formalisation of benign shar... |

23 | Automatic TimeBound Analysis for a Higher-Order Language
- Gomez, Liu
- 2002
(Show Context)
Citation Context ...ure should only be used for read-only purposes, as destroying any of the element lists leads to malignant sharing. 10. RELATED WORK Approaches based on abstract interpretation and symbolic evaluation =-=[7, 13, 4, 20, 5, 6]-=- go in the direction of the naive approach mentioned in the Introduction. The structure of the inferred resource bound matches the structure of the program. Where the program contains a while loop or ... |

15 | Automatic Accurate Cost-Bound Analysis for High-Level Languages
- Liu, Gomez
(Show Context)
Citation Context ...ure should only be used for read-only purposes, as destroying any of the element lists leads to malignant sharing. 10. RELATED WORK Approaches based on abstract interpretation and symbolic evaluation =-=[7, 13, 4, 20, 5, 6]-=- go in the direction of the naive approach mentioned in the Introduction. The structure of the inferred resource bound matches the structure of the program. Where the program contains a while loop or ... |

15 |
Types for crash prevention
- Pareto
- 2000
(Show Context)
Citation Context ... insertion sort algorithm according to x5.7 of [10]. The authors speculate on a possible solution based on region resetting and liveness inference, but this is not worked out in [10] nor in the later =-=[16]-=-. We emphasize that proper dynamic memory allocation is not modelled in [10]. This is acceptable in view of the intended application of sized types to embedded programming, but not|in our opinion|in a... |

14 |
Resource Bound Certi
- Crary, Weirich
- 2000
(Show Context)
Citation Context ...uts and recommend tost an algebraic expression into a value table obtained from small inputs. This is acceptable for proling purposes but certainly not for resource certication. In other works like [3=-=]-=- the user must provide a conjectured resource bound. The formalism can be used to validate Extended version, for WWW only { December 31, 2002 it but even for the validation user interaction is require... |

14 | Lambda-Upsilon-Omega: An assistant algorithms analyzer
- Flajolet, Salvy, et al.
- 1989
(Show Context)
Citation Context |

12 | Efficiently executing PVS
- Shankar
- 1999
(Show Context)
Citation Context |

11 | Automatic accurate live memory analysis for garbage-collected languages
- Unnikrishnan, Stoller, et al.
- 2001
(Show Context)
Citation Context |

5 |
2002], Static prediction of dynamic space usage of linear functional programs
- Jost
(Show Context)
Citation Context ...id, though, that not all possible LFPL programs arise as reconstructions from solutions of the constraint system. The problem of reconstructing arbitrary LFPL programs is considered in more detail in =-=[11]-=-. While obtaining integral solutions to linear programs is in general NP hard, we prove that in several important and natural sub-cases of our setting they can be obtained eciently. We emphasize that ... |

1 |
The strength of non size-increasing computation. 2002
- Hofmann
(Show Context)
Citation Context ...ages the problem of heap space inference becomes much more complicated as we need to monitor the size of closures which are much more dependent on dynamic aspects. This is discussed in some detail in =-=[9]-=-. We do not see at this point how our work could be extended to cover general higher-order functions, not even linear ones. One referee suggested to investigate Reynolds' idea of defunctionalisation [... |