Shape Analysis in the Absence of Pointers and Structure [chapter]

Matthew Might
2010 Lecture Notes in Computer Science  
Shape analyses (Chase et al. 1990 , Sagiv et al. 2002 ) discover properties of dynamic and/or mutable structures. We ask, "Is there an equivalent to shape analysis for purely functional programs, and if so, what 'shapes' does it discover?" By treating binding environments as dynamically allocated structures, by treating bindings as addresses, and by treating value environments as heaps, we argue that we can analyze the "shape" of higher-order functions. To demonstrate this, we enrich an
more » ... -interpretive control-flow analysis with principles from shape analysis. In particular, we promote "anodization" as a way to generalize both singleton abstraction and the notion of focusing, and we promote "binding invariants" as the analog of shape predicates. Our analysis enables two optimizations known to be beyond the reach of control-flow analysis (globalization and super-β inlining) and one previously unknown optimization (higher-order rematerialization).
doi:10.1007/978-3-642-11319-2_20 fatcat:6iudb7wlbvfwxd7u2vhfrcbv2e