Abstract. Hierarchical decomposition is a fundamental principle that encourages the organization of program elements into nested scopes of access, instead of treating all as "global." This paper offers a foundational study of heap decomposition inference, the problem of statically extracting the decomposition hierarchy latent in the runtimes of object-oriented programs, henceforth revealing the compositional nature of the heap. The centerpiece of the paper is Cypress, a sound, precise, and scalable constraint-based ownership type inference coupled with a novel application of linear programming over integers. All constraints in Cypress are linear, and the precision of decomposition -placing objects to scopes as non-global as possible -can be reduced to a linear programming problem. Cypress has been implemented as an open-source tool that can decompose realworld Java applications of more than 100K LOC and up to 6000 statically distinct instantiations.