skip to main content
10.1145/2509136.2509530acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Class hierarchy complementation: soundly completing a partial type graph

Published:29 October 2013Publication History

ABSTRACT

We present the problem of class hierarchy complementation: given a partially known hierarchy of classes together with subtyping constraints ("A has to be a transitive subtype of B") complete the hierarchy so that it satisfies all constraints. The problem has immediate practical application to the analysis of partial programs--e.g., it arises in the process of providing a sound handling of "phantom classes" in the Soot program analysis framework. We provide algorithms to solve the hierarchy complementation problem in the single inheritance and multiple inheritance settings. We also show that the problem in a language such as Java, with single inheritance but multiple subtyping and distinguished class vs. interface types, can be decomposed into separate single- and multiple-subtyping instances. We implement our algorithms in a tool, JPhantom, which complements partial Java bytecode programs so that the result is guaranteed to satisfy the Java verifier requirements. JPhantom is highly scalable and runs in mere seconds even for large input applications and complex constraints (with a maximum of 14s for a 19MB binary).

References

  1. K. Ali and O. Lhoták. Application-only call graph construction. In Proc. of the 26th European Conf. on Object-Oriented Programming, ECOOP '12, pages 688--712. Springer, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. K. Ali and O. Lhoták. Averroes: Whole-program analysis without the whole program. In Proc. of the 27th European Conf. on Object-Oriented Programming, ECOOP '13, pages 378--400. Springer, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. D. Ancona, F. Damiani, S. Drossopoulou, and E. Zucca. Polymorphic bytecode: compositional compilation for Java-like languages. In Proc. of the 32nd ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL '05, pages 26--37, New York, NY, USA, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Ancona, F. Damiani, S. Drossopoulou, E. Zucca, and D. U. D. Genova. Even more principal typings for Java-like languages. In ECOOP Workshop on Formal Techniques for Java Programs (FTfJP), 2004.Google ScholarGoogle Scholar
  5. D. Ancona and E. Zucca. Principal typings for Java-like languages. In Proc. of the 31st ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL '04, pages 306--317, New York, NY, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Bravenboer and Y. Smaragdakis. Strictly declarative specification of sophisticated points-to analyses. In Proc. of the 24th Annual ACM SIGPLAN Conf. on Object Oriented Programming, Systems, Languages, and Applications, OOPSLA '09, New York, NY, USA, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. E. Bruneton, R. Lenglet, and T. Coupaye. ASM: A code manipulation tool to implement adaptable systems. In Adaptable and extensible component systems, 2002.Google ScholarGoogle Scholar
  8. C. Daskalakis, R. M. Karp, E. Mossel, S. Riesenfeld, and E. Verbin. Sorting and selection in posets. In Proc. of the 20th Annual ACM-SIAM Symp. on Discrete Algorithms, SODA '09, pages 392--401, Philadelphia, PA, USA, 2009. Society for Industrial and Applied Mathematics. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. D. Dig. A refactoring approach to parallelism. IEEE Software, 28(1):17--22, Jan. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. Gosling, B. Joy, G. Steele, and G. Bracha. The Java#8482; Language Specification, Third Edition. Addison-Wesley Professional, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S. Guarnieri and B. Livshits. GateKeeper: mostly static enforcement of security and reliability policies for Javascript code. In Proc. of the 18th USENIX Security Symposium, SSYM '09, pages 151--168, Berkeley, CA, USA, 2009. USENIX Association. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. A. Hejlsberg, S. Wiltamuth, and P. Golde. C\# Language Specification. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. G. Kastrinis and Y. Smaragdakis. Hybrid context-sensitivity for points-to analysis. In Proc. of the 2013 ACM SIGPLAN Conf. on Programming Language Design and Implementation, PLDI '13. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. T. Lindholm and F. Yellin. Java Virtual Machine Specification. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2nd edition, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Madsen, B. Livshits, and M. Fanning. Practical static analysis of Javascript applications in the presence of frameworks and libraries. Technical Report MSR-TR-2012--66, Microsoft Research, July 2012.Google ScholarGoogle Scholar
  16. M. Naik, A. Aiken, and J. Whaley. Effective static race detection for Java. In Proc. of the 2006 ACM SIGPLAN Conf. on Programming Language Design and Implementation, PLDI '06, pages 308--319. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. Odersky, P. Altherr, V. Cremet, B. Emir, S. Maneth, S. Micheloud, N. Mihaylov, M. Schinz, E. Stenman, and M. Zenger. An overview of the Scala programming language. Technical Report IC/2004/64, EPFL Lausanne, Switzerland, 2004.Google ScholarGoogle Scholar
  18. R. F. St\"ark and J. Schmid. The problem of bytecode verification in current implementations of the JVM. Technical report, ETH Zürich, 2000.Google ScholarGoogle Scholar
  19. R. Vallée-Rai, P. Co, E. Gagnon, L. Hendren, P. Lam, and V. Sundaresan. Soot - a Java bytecode optimization framework. In Proc. of the 1999 Conf. of the Centre for Advanced Studies on Collaborative research, CASCON '99. IBM Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. R. Vallée-Rai, E. Gagnon, L. J. Hendren, P. Lam, P. Pominville, and V. Sundaresan. Optimizing Java bytecode using the Soot framework: Is it feasible? In Proc. of the 9th Int. Conf. on Compiler Construction, CC '00, pages 18--34, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Class hierarchy complementation: soundly completing a partial type graph

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          OOPSLA '13: Proceedings of the 2013 ACM SIGPLAN international conference on Object oriented programming systems languages & applications
          October 2013
          904 pages
          ISBN:9781450323741
          DOI:10.1145/2509136

          Copyright © 2013 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 29 October 2013

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          OOPSLA '13 Paper Acceptance Rate50of189submissions,26%Overall Acceptance Rate268of1,244submissions,22%

          Upcoming Conference

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader