A Space Consumption Analysis by Abstract Interpretation
- Cite this paper as:
- Montenegro M., Peña R., Segura C. (2010) A Space Consumption Analysis by Abstract Interpretation. In: van Eekelen M., Shkaravska O. (eds) Foundational and Practical Aspects of Resource Analysis. FOPARA 2009. Lecture Notes in Computer Science, vol 6324. Springer, Berlin, Heidelberg
Safe is a first-order functional language with an implicit region-based memory system and explicit destruction of heap cells. Its static analysis for inferring regions, and a type system guaranteeing the absence of dangling pointers have been presented elsewhere.
In this paper we present a new analysis aimed at inferring upper bounds for heap and stack consumption. It is based on abstract interpretation, being the abstract domain the set of all n-ary monotonic functions from real non-negative numbers to a real non-negative result. This domain turns out to be a complete lattice under the usual \(\sqsubseteq\) relation on functions. Our interpretation is monotonic in this domain and the solution we seek is the least fixpoint of the interpretation.
We first explain the abstract domain and some correctness properties of the interpretation rules with respect to the language semantics, then present the inference algorithms for recursive functions, and finally illustrate the approach with the upper bounds obtained by our implementation for some case studies.
Unable to display preview. Download preview PDF.