A Space Consumption Analysis by Abstract Interpretation [chapter]

Manuel Montenegro, Ricardo Peña, Clara Segura
2010 Lecture Notes in Computer Science  
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
more » ... mbers to a real non-negative result. This domain turns out to be a complete lattice under the usual 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.
doi:10.1007/978-3-642-15331-0_3 fatcat:njzn5tbofbdmpg3u72hxhvivgm