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.
- 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 ScholarDigital Library
- AC96 Martin Abadi and Luca Cardelli. A Theory of Objects. Springer, 1996. Google ScholarDigital Library
- 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 ScholarDigital Library
- ASU88 Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. Compilers: Principles, Techniques, and Tools. Addison Wesley, 1988. Google ScholarDigital Library
- CLR90 Thomas H. Cormen, Charles E. Leiserson, and Ronald L. Rivest. Introduction to Algorithms. Mc- Graw Hill, 1990. Google ScholarDigital Library
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- ICF98 Proceedings of the third A CM SIGPLAN International Conference on Functional Programming, Baltimore, Maryland, September 1998.Google Scholar
- 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 Scholar
- Kie98 Richard Kieburtz. Taming Effects with Monadic Typing. In ICFP'98 {ICF98}, pages 51-62. Google ScholarDigital Library
- KR88 Brian W. Kernighan and Dennis M. Ritchie. The C Programming Language. Prentice Hall, 2nd edition, 1988. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Mag93 Steve Maguire. Writing Solid Code. Microsoft Press, 1993.Google ScholarDigital Library
- Mil78 Robin Milner. A Theory of Type Polymorphism in Programming. Journal of Computer and System Sciences, 17:348-375, 1978.Google ScholarCross Ref
- Mit91 John C. Mitchell. Type inference with simple subtypes. Journal of Functional Programming, 1(3):245- 285, July 1991.Google ScholarCross Ref
- MSS96 David R. Musser, Atul Saint, and Alexander Stepanov. STL Tutorial and Reference Guide. Addison-Wesley Publishing Company, 1996.Google Scholar
- ØP97 Peter Orba~k and Jens Palsberg. Trust in the )~-calculus. Journal of Functional Programming, 3(2):75-85, 1997. Google ScholarDigital Library
- 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 Scholar
- Pur Pure Atria. Purify: Fast detection of memory leaks and access errors.Google Scholar
- Reh99 Jakob Rehof. Personal communication, January 1999.Google Scholar
- Sol95 Kirsten Lackner Solberg. Annotated Type Systems for Program Analysis. PhD thesis, Aarhus University, Denmark, Computer Science Department, November 1995.Google Scholar
- 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 ScholarDigital Library
- 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 Scholar
- Wad98 Philip Wadler. The Marriage of Effects and Monads. In ICFP'98 {ICF98}, pages 63-74. Google ScholarDigital Library
- WF94 Andrew K. Wright and Matthias Felleisen. A Syntactic Approach to Type Soundness. Information and Computation, 115(1):38-94, 1994. Google ScholarDigital Library
- Wri95 Andrew K. Wright. Simple Imperative Polymorphism. In Lisp and Symbolic Computation 8, volume 4, pages 343-356, 1995. Google Scholar
- 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 Scholar
Index Terms
- A theory of type qualifiers
Recommendations
Flow-sensitive type qualifiers
PLDI '02: Proceedings of the ACM SIGPLAN 2002 conference on Programming language design and implementationWe present a system for extending standard type systems with flow-sensitive type qualifiers. Users annotate their programs with type qualifiers, and inference checks that the annotations are correct. In our system only the type qualifiers are modeled ...
A theory of type qualifiers
PLDI '99: Proceedings of the ACM SIGPLAN 1999 conference on Programming language design and implementationWe 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 ...
Flow-insensitive type qualifiers
We describe flow-insensitive type qualifiers, a lightweight, practical mechanism for specifying and checking properties not captured by traditional type systems. We present a framework for adding new, user-specified type qualifiers to programming ...
Comments