skip to main content
article
Free Access

A theory of type qualifiers

Authors Info & Claims
Published:01 May 1999Publication History
Skip Abstract Section

Abstract

We describe a framework for adding type qualifiers to a language. Type qualifiers encode a simple but highly useful form of subtyping. Our framework extends standard type rules to model the flow of qualifiers through a program, where each qualifier or set of qualifiers comes with additional rules that capture its semantics. Our framework allows types to be polymorphic in the type qualifiers. We present a const-inference system for C as an example application of the framework. We show that for a set of real C programs, many more consts can be used than are actually present in the original code.

References

  1. ABHR99 Martin Abadi, Anindya Banerjee, Nevin Heintze, and Jon G. Riecke. A Core Calculus of Dependency. In Proceedings of the ~6th Annual A CM SIGPLAN. SIGACT Symposium on Principles of Programming Languages, pages 147-160, San Antonio, Texas, January 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. AC96 Martin Abadi and Luca Cardelli. A Theory of Objects. Springer, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. AFFS98 Alexander Aiken, Manuel Fahndrich, Jeffrey S. Foster, and Zhendong Su. A Toolkit for Constructing Type- and Constraint-Based Program Analyses. In Proceedings of the second International Workshop on Types in Compilation, Kyoto, Japan, March 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. ASU88 Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. Compilers: Principles, Techniques, and Tools. Addison Wesley, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. CLR90 Thomas H. Cormen, Charles E. Leiserson, and Ronald L. Rivest. Introduction to Algorithms. Mc- Graw Hill, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Det96 David L. Detlefs. An overview of the Extended Static Checking system. In Proceedings of the First Workshop on Formal Methods in Software Practice, pages 1-9, January 1996.Google ScholarGoogle Scholar
  7. DHM95 Dirk Dussart, Fritz Henglein, and Christian Mossin. Polymorphic Recursion and Subtype Qualifications: Polymorphic Binding-Time Analysis in Polynomial Time. In Static Analysis, Second International Symposium, number 983 in Lecture Notes in Computer Science, pages 118-135, Glasgow, Scotland, September 1995. Springer-Verlag. Google ScholarGoogle Scholar
  8. EST95 Jonathan Eifrig, Scott Smith, and Valery Trifonov. Type Inference for Recursively Constrained Types and its Application to OOP. In Mathematical Foundations of Programming Semantics, Eleventh Annual Conference, volume 1 of Electronic Notes in Theoretical Computer Science. Elsevier, 1995.Google ScholarGoogle Scholar
  9. Eva96 David Evans. Static Detection of Dynamic Memory Errors. in Proceedings of the 1996 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 44-53, Philadelphia, Pennsylvania, May 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Hen91 Fritz Henglein. Efficient Type Inference for Higher- Order Binding-Time Analysis. In J. Hughes, editor, FPCA '91 Conference on Functional Programming Languages and Computer Architecture, volume 523 of Lecture Notes in Computer Science, pages 448-472, Cambridge, MA, August 1991. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. HR97 Fritz Henglein and jakob Rehof. The Complexity of Subtype Entailment for Simple Types. In Proceedings, Twelfth Annual IEEE Symposium on Logic in Computer Science, pages 352-361, Warsaw, Poland, July 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. ICF98 Proceedings of the third A CM SIGPLAN International Conference on Functional Programming, Baltimore, Maryland, September 1998.Google ScholarGoogle Scholar
  13. Jon92 Mark P. Jones. A theory of qualified types. In Bernd Krieg-Brficker, editor, 4th European Symposium on Programming, number 582 in Lecture Notes in Computer Science, pages 287-306, Rennes, France, February 1992. Springer-Verlag. Google ScholarGoogle Scholar
  14. Kie98 Richard Kieburtz. Taming Effects with Monadic Typing. In ICFP'98 {ICF98}, pages 51-62. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. KR88 Brian W. Kernighan and Dennis M. Ritchie. The C Programming Language. Prentice Hall, 2nd edition, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. KS93 Ntis Klarlund and Michael I. Schwartzback. Graph Types. In Proceedings of the 20th Annual A CM SiGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 196-205, Charleston, South Carolina, January 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. LG88 John M. Lucassen and David K. Gifford. Polymorphic Effect Systems. In Proceedings of the 15th Annual A CM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 47-57, San Diego, California, January 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. LN98 K. Rustan M. Leino and Greg Nelson. An Extended Static Checker for Modula-3. In Compiler Construction: 7th International Conference, volume 1383 of Lecture Notes in Computer Science, pages 302-305, April 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Mag93 Steve Maguire. Writing Solid Code. Microsoft Press, 1993.Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Mil78 Robin Milner. A Theory of Type Polymorphism in Programming. Journal of Computer and System Sciences, 17:348-375, 1978.Google ScholarGoogle ScholarCross RefCross Ref
  21. Mit91 John C. Mitchell. Type inference with simple subtypes. Journal of Functional Programming, 1(3):245- 285, July 1991.Google ScholarGoogle ScholarCross RefCross Ref
  22. MSS96 David R. Musser, Atul Saint, and Alexander Stepanov. STL Tutorial and Reference Guide. Addison-Wesley Publishing Company, 1996.Google ScholarGoogle Scholar
  23. ØP97 Peter Orba~k and Jens Palsberg. Trust in the )~-calculus. Journal of Functional Programming, 3(2):75-85, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. OSW97 Martin Odersky, Martin Sulzmann, and Martin Wehr. Type Inference with Constrained Types. In Benjamin Pierce, editor, Proceedings of the 4th International Workshop on Foundations of Object-Oriented Languages, January 1997.Google ScholarGoogle Scholar
  25. Pur Pure Atria. Purify: Fast detection of memory leaks and access errors.Google ScholarGoogle Scholar
  26. Reh99 Jakob Rehof. Personal communication, January 1999.Google ScholarGoogle Scholar
  27. Sol95 Kirsten Lackner Solberg. Annotated Type Systems for Program Analysis. PhD thesis, Aarhus University, Denmark, Computer Science Department, November 1995.Google ScholarGoogle Scholar
  28. TT94 Mads Tofte and Jean-Pierre Talpin. Implementstion of the Typed Call-by-Value ,Calculus using a Stack of Regions. In Proceedings of the 21st Annual A CM SIGPLAN-SIGA CT Symposium on Principles of Programming Languages, pages 188-201, Portland, Oregon, January 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. VS97 Dennis Volpano and Geoffrey Smith. A Type-Based Approach to Program Security. In Michel Bidoit and Max Danchet, editors, Theory and Practice of Software Development, 7th International Joint Conference, volume 1214 of Lecture Notes in Computer Science, pages 607-621, Lille, France, April 1997. Springer-Verlag. Google ScholarGoogle Scholar
  30. Wad98 Philip Wadler. The Marriage of Effects and Monads. In ICFP'98 {ICF98}, pages 63-74. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. WF94 Andrew K. Wright and Matthias Felleisen. A Syntactic Approach to Type Soundness. Information and Computation, 115(1):38-94, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Wri95 Andrew K. Wright. Simple Imperative Polymorphism. In Lisp and Symbolic Computation 8, volume 4, pages 343-356, 1995. Google ScholarGoogle Scholar
  33. YSP+98 K. Yelick, L. Semenzato, G. Pike, C. Miyamoto, B. Liblit, A. Krishnamurthy, P. Hilfinger, S. Graham, D. Gay, P. Colella, and A. Aiken. Titanium: A High- Performance Java Dialect. In ACM 1998 Workshop on Java for High-Performance Network Computing, February 1998.Google ScholarGoogle Scholar

Index Terms

  1. A theory of type qualifiers

          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

          Full Access

          • Published in

            cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 34, Issue 5
            May 1999
            304 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/301631
            Issue’s Table of Contents
            • cover image ACM Conferences
              PLDI '99: Proceedings of the ACM SIGPLAN 1999 conference on Programming language design and implementation
              May 1999
              304 pages
              ISBN:1581130945
              DOI:10.1145/301618

            Copyright © 1999 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 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: 1 May 1999

            Check for updates

            Qualifiers

            • article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader