Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

Declaring and checking non-null types in an object-oriented language

Published: 26 October 2003 Publication History
  • Get Citation Alerts
  • Abstract

    Distinguishing non-null references from possibly-null references at the type level can detect null-related errors in object-oriented programs at compile-time. This paper gives a proposal for retrofitting a language such as C# or Java with non-null types. It addresses the central complications that arise in constructors, where declared non-null fields may not yet have been initialized, but the partially constructed object is already accessible. The paper reports experience with an implementation for annotating and checking null-related properties in C# programs.

    References

    [1]
    Robert DeLine and Manuel Fähndrich. Enforcing high-level protocols in low-level software. In Proceedings of the 2001 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), volume 36, number 5 in SIGPLAN Notices, pages 59--69. ACM, May 2001.]]
    [2]
    ECMA. Standard ECMA-334: C# Language Specification, December 2002. Available on the web as http://www.ecma-international.org/publications/files/ecma-st/Ecma-334.pdf.]]
    [3]
    David Evans, John Guttag, James Horning, and Yang~Meng Tan. LCLint: A tool for using specifications to check code. In Proceedings of the ACM SIGSOFT '94 Symposium on the Foundations of Software Engineering, pages 87--96, 1994.]]
    [4]
    Manuel Fähndrich and K. Rustan M. Leino. Heap monotonic typestates. In Proceedings of the 1st International Workshop on Aliasing, Confinement and Ownership, July 2003.]]
    [5]
    Kathleen Fisher and John H. Reppy. The design of a class mechanism for Moby. In Proceedings of the 1999 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), volume~34, number~5 in SIGPLAN Notices, pages 37--49. ACM, May 1999.]]
    [6]
    Robert Fitzgerald, Todd B. Knoblock, Erik Ruf, Bjarne Steensgaard, and David Tarditi. Marmot: An optimizing compiler for Java. Software-Practice and Experience, 30(3), 2000.]]
    [7]
    Cormac Flanagan, Matthew Flatt, Shriram Krishnamurthi, Stephanie Weirich, and Matthias Felleisen. Catching bugs in the web of program invariants. In Proceedings of the ACM SIGPLAN '96 Conference on Programming Language Design and Implementation (PLDI), volume 31, number 5 in SIGPLAN Notices, pages 23--32. ACM, May 1996.]]
    [8]
    Cormac Flanagan, K. Rustan M. Leino, Mark Lillibridge, Greg Nelson, James B. Saxe, and Raymie Stata. Extended static checking for Java. In Proceedings of the 2002 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), volume 37, number 5 in SIGPLAN Notices, pages 234--245. ACM, May 2002.]]
    [9]
    James Gosling, Bill Joy, and Guy Steele. The Java\raisebox.6ex tm Language Specification. Addison-Wesley, 1996.]]
    [10]
    Trevor Jim, Greg Morrisett, Dan Grossman, Michael Hicks, James Cheney, and Yanling Wang. Cyclone: A safe dialect of C. In USENIX Annual Technical Conference, General Track, pages 275--288, June 2002.]]
    [11]
    Barbara Liskov, Dorothy Curtis, Mark Day, Sanjay Ghemawat, Robert Gruber, Paul Johnson, and Andrew C. Myers. Theta reference manual, preliminary version. Memo~88, Programming Methodology Group, MIT Laboratory for Computer Science, February 1995. Available on the web at http://www.pmg.lcs.mit.edu/Theta.html.]]
    [12]
    Barbara Liskov and John Guttag. Abstraction and Specification in Program Development. MIT Electrical Engineering and Computer Science Series. MIT Press, 1986.]]
    [13]
    Robin Milner, Mads Tofte, and Robert Harper. The Definition of Standard ML. MIT Press, 1990.]]
    [14]
    Greg Morrisett, David Walker, Karl Crary, and Neal Glew. From system F to typed assembly language. ACM Transactions on Programming Languages and Systems, 21(3):527--568, 1999.]]
    [15]
    George C. Necula, Scott McPeak, and Westley Weimer. CCured: Type-safe retrofitting of legacy code. In Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 128--139, 2002.]]
    [16]
    Simon Peyton Jones, John Hughes, Lennart Augustsson, Dave Barton, Brian Boutel, Warren Burton, Joseph Fasel, Kevin Hammond, Ralf Hinze, Paul Hudak, Thomas Johnsson, Mark Jones, John Launchbury, Erik Meijer, John Peterson, Alastair Reid, Colin Runciman, and Philip Wadler. Haskell 98 report, February 1999. Available on the web as http://haskell.org/onlinereport.]]
    [17]
    Chris Smith. Java pointifications: Nullability constraints, June 2001. Available on the web as http://cdsmith.twu.net/professional/java/pontifications/nonnull.html.]]
    [18]
    Frederick Smith, David Walker, and Greg Morrisett. Alias types. In Proceedings of the 14th European Symposium on Programming, volume 1782 of Lecture Notes in Computer Science, pages 366--381. Springer, March 2000.]]
    [19]
    Raymie Stata. Improving the safety of Java, December 1995. Available on the web as http://larch-www.lcs.mit.edu:8001/\homedirraymie/Java/javachangessafety.html.]]

    Cited By

    View all
    • (2022)Verifying Whiley Programs with BoogieJournal of Automated Reasoning10.1007/s10817-022-09619-166:4(747-803)Online publication date: 20-Mar-2022
    • (2021)Safe object initialization, abstractlyProceedings of the 12th ACM SIGPLAN International Symposium on Scala10.1145/3486610.3486895(33-43)Online publication date: 17-Oct-2021
    • (2021)Relational nullable types with Boolean unificationProceedings of the ACM on Programming Languages10.1145/34854875:OOPSLA(1-28)Online publication date: 15-Oct-2021
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 38, Issue 11
    Special Issue: Proceedings of the OOPSLA '03 conference
    November 2003
    417 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/949343
    Issue’s Table of Contents
    • cover image ACM Conferences
      OOPSLA '03: Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications
      October 2003
      430 pages
      ISBN:1581137125
      DOI:10.1145/949305
    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 ACM 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: 26 October 2003
    Published in SIGPLAN Volume 38, Issue 11

    Check for updates

    Author Tags

    1. Java
    2. c#
    3. non-null types
    4. null references
    5. type system

    Qualifiers

    • Article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)10
    • Downloads (Last 6 weeks)0

    Other Metrics

    Citations

    Cited By

    View all
    • (2022)Verifying Whiley Programs with BoogieJournal of Automated Reasoning10.1007/s10817-022-09619-166:4(747-803)Online publication date: 20-Mar-2022
    • (2021)Safe object initialization, abstractlyProceedings of the 12th ACM SIGPLAN International Symposium on Scala10.1145/3486610.3486895(33-43)Online publication date: 17-Oct-2021
    • (2021)Relational nullable types with Boolean unificationProceedings of the ACM on Programming Languages10.1145/34854875:OOPSLA(1-28)Online publication date: 15-Oct-2021
    • (2020)Behavioural Types for Memory and Method Safety in a Core Object-Oriented LanguageProgramming Languages and Systems10.1007/978-3-030-64437-6_6(105-124)Online publication date: 24-Nov-2020
    • (2019)An Introduction to Software Verification with WhileyEngineering Trustworthy Software Systems10.1007/978-3-030-17601-3_1(1-37)Online publication date: 14-Apr-2019
    • (2016)Semantic subtyping for imperative object-oriented languagesACM SIGPLAN Notices10.1145/3022671.298399251:10(568-587)Online publication date: 19-Oct-2016
    • (2016)Semantic subtyping for imperative object-oriented languagesProceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications10.1145/2983990.2983992(568-587)Online publication date: 19-Oct-2016
    • (2016)Inference and Checking of Object ImmutabilityProceedings of the 13th International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools10.1145/2972206.2972208(1-12)Online publication date: 29-Aug-2016
    • (2016)CasperJournal of Systems and Software10.1016/j.jss.2016.08.062122:C(52-62)Online publication date: 1-Dec-2016
    • (2015)Exploiting array manipulation habits to optimize garbage collection and type flow analysisSoftware—Practice & Experience10.1002/spe.230045:12(1639-1657)Online publication date: 1-Dec-2015
    • Show More Cited By

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media