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

Semantic type qualifiers

Published: 12 June 2005 Publication History

Abstract

We present a new approach for supporting user-defined type refinements, which augment existing types to specify and check additional invariants of interest to programmers. We provide an expressive language in which users define new refinements and associated type rules. These rules are automatically incorporated by an extensible typechecker during static typechecking of programs. Separately, a soundness checkerautomatically proves that each refinement's type rules ensure the intended invariant, for all possible programs. We have formalized our approach and have instantiated it as a framework for adding new type qualifiers to C programs. We have used this framework to define and automatically prove sound a host of type qualifiers of different sorts, including pos and neg for integers, tainted and untainted for strings, and nonnull and unique for pointers, and we have applied our qualifiers to ensure important invariants on open-source C programs.

References

[1]
J. Aldrich, V. Kostadinov, and C. Chambers. Alias annotations for program understanding. In Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 311--330. ACM Press, 2002.
[2]
K. Arnold, J. Gosling, and D. Holmes. The Java Programming Language Third Edition. Addison-Wesley, Reading, MA, third edition, 2000.
[3]
C. Bailleux. More security problems in bftpd-1.0.12. bugtraq mailing list post of December 8, 2000. http://www.securityfocus.com/archive/1/149977.
[4]
C. Boyapati, R. Lee, and M. Rinard. Ownership types for safe programming: Preventing data races and deadlocks. In Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 211--230. ACM Press, 2002.
[5]
J. Boyland. Alias burying: Unique variables without destructive reads. Softw. Pract. Exper., 31(6):533--553, 2001.
[6]
C# Language Specification, Second Edition. ECMA International, Standard ECMA-334, Dec. 2002.
[7]
B. Chin, S. Markstrum, and T. Millstein. Semantic type qualifiers. Technical Report CSD-TR-40045, UCLA Computer Science Department, November 2004.
[8]
D. G. Clarke, J. M. Potter, and J. Noble. Ownership types for flexible alias protection. In Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 48--64. ACM Press, 1998.
[9]
R. L. Constable, S. F. Allen, H. M. Bromley, W. R. Cleaveland, J. F. Cremer, R. W. Harper, D. J. Howe, T. B. Knoblock, N. P. Mendler, P. Panangaden, J. T. Sasaki, and S. F. Smith. Implementing Mathematics with the Nuprl Proof Development System. Prentice-Hall, Englewood Cliffs, NJ, 1986.
[10]
T. Coquand and G. Huet. The calculus of constructions. Inf. Comput., 76(2-3):95--120, 1988.
[11]
K. Crary and J. C. Vanderwaart. An expressive, scalable type theory for certified code. In Proceedings of the seventh ACM SIGPLAN international conference on Functional programming, pages 191--205. ACM Press, 2002.
[12]
R. DeLine and M. Fahndrich. Enforcing high-level protocols in low-level software. In Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation, pages 59--69. ACM Press, 2001.
[13]
R. DeLine and M. Fahndrich. Typestates for objects. In Proceedings of the 2004 European Conference on Object-Oriented Programming, LNCS 3086, Oslo, Norway, June 2004. Springer-Verlag.
[14]
D. Detlefs, G. Nelson, and J. B. Saxe. Simplify: A theorem prover for program checking. Technical Report HPL-2003-148, HP Labs, 2003.
[15]
M. Fahndrich and K. R. M. Leino. Declaring and checking non-null types in an object-oriented language. In Proceedings of the 18th ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications, pages 302--312. ACM Press, 2003.
[16]
C. Flanagan and S. N. Freund. Type-based race detection for Java. In Proceedings of the ACM SIGPLAN 2000 conference on Programming language design and implementation, pages 219--232. ACM Press, 2000.
[17]
C. Flanagan, K. R. M. Leino, M. Lillibridge, G. Nelson, J. B. Saxe, and R. Stata. Extended static checking for Java. In Proceedings of the ACM SIGPLAN '02 Conference on Programming Language Design and Implementation, June 2002.
[18]
C. Flanagan and S. Qadeer. A type and effect system for atomicity. In Proceedings of the ACM SIGPLAN 2003 conference on Programming language design and implementation, pages 338--349. ACM Press, 2003.
[19]
J. S. Foster, M. Fähndrich, and A. Aiken. A Theory of Type Qualifiers. In Proceedings of the 1999 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 192--203, Atlanta, Georgia, May 1999.
[20]
J. S. Foster, T. Terauchi, and A. Aiken. Flow-sensitive type qualifiers. In Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation, pages 1--12. ACM Press, 2002.
[21]
E. Gamma, R. Helm, R. E. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Massachusetts, 1995.
[22]
J. Gosling, B. Joy, G. Steele, and G. Bracha. The Java Language Specification Second Edition. The Java Series. Addison-Wesley, Boston, Mass., 2000.
[23]
D. Grossman, G. Morrisett, T. Jim, M. Hicks, Y. Wang, and J. Cheney. Region-based memory management in Cyclone. In Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation, pages 282--293. ACM Press, 2002.
[24]
R. Johnson and D. Wagner. Finding user/kernel pointer bugs with type inference. In Proceedings of the 13th USENIX Security Symposium, pages 119--134, 2004.
[25]
S. Lerner, T. Millstein, and C. Chambers. Automatically proving the correctness of compiler optimizations. In Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation, pages 220--231. ACM Press, 2003.
[26]
S. Lerner, T. Millstein, E. Rice, and C. Chambers. Automated soundness proofs for dataflow analyses and transformations via local rules. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM Press, 2005.
[27]
Y. Mandelbaum, D. Walker, and R. Harper. An effective theory of type refinements. In Proceedings of the eighth ACM SIGPLAN international conference on Functional programming, pages 213--225. ACM Press, 2003.
[28]
P. Martin-Löf. Constructive mathematics and computer programming. In Sixth International Congress for Logic, Methodology, and Philosophy of Science, pages 153--175, Amsterdam, 1982. North-Holland.
[29]
R. Milner, M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML (Revised). The MIT Press, 1997.
[30]
G. Morrisett, D. Walker, K. Crary, and N. Glew. From System F to typed assembly language. ACM Trans. Program. Lang. Syst., 21(3):527--568, 1999.
[31]
G. C. Necula. Proof-carrying code. In Proceedings of the 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 106--119. ACM Press, 1997.
[32]
G. C. Necula, S. McPeak, S. P. Rahul, and W. Weimer. CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs. In Proceedings of CC 2002: 11'th International Conference on Compiler Construction. Springer-Verlag, Apr. 2002.
[33]
G. C. Necula, S. McPeak, and W. Weimer. C Cured: Type-safe retrofitting of legacy code. In Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 128--139. ACM Press, 2002.
[34]
G. Nelson and D. C. Oppen. Simplification by cooperating decision procedures. ACM Trans. Program. Lang. Syst., 1(2):245--257, 1979.
[35]
D. Rémy and J. Vouillon. Objective ML: An effective object-oriented extension of ML. Theory and Practice of Object Systems, 4(1):27--52, 1998.
[36]
U. Shankar, K. Talwar, J. S. Foster, and D. Wagner. Detecting Format String Vulnerabilities with Type Qualifiers. In Proceedings of the 10th Usenix Security Symposium, Washington, D.C., Aug. 2001.
[37]
Z. Shao, B. Saha, V. Trifonov, and N. Papaspyrou. A type system for certified binaries. In Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 217--232. ACM Press, 2002.
[38]
M. Tofte and J.-P. Talpin. Implementation of the typed call-by-value λ-calculus using a stack of regions. In Proceedings of the 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 188--201. ACM Press, 1994.
[39]
A. K. Wright and M. Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38--94, 15~Nov. 1994.
[40]
H. Xi and F. Pfenning. Eliminating array bound checking through dependent types. In Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 249--257, Montreal, June 1998.
[41]
H. Xi and F. Pfenning. Dependent types in practical programming. In Proceedings of the 26th ACM SIGPLAN Symposium on Principles of Programming Languages, pages 214--227, San Antonio, January 1999.

Cited By

View all
  • (2018)FlowNotationProceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security10.1145/3243734.3278508(2207-2209)Online publication date: 15-Oct-2018
  • (2008)Abstract Interpretation Plugins for Type SystemsProceedings of the 12th international conference on Algebraic Methodology and Software Technology10.1007/978-3-540-79980-1_15(184-198)Online publication date: 28-Jul-2008
  • (2024)Verifying the Option Type with Rely-Guarantee ReasoningProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695036(367-380)Online publication date: 27-Oct-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 40, Issue 6
Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation
June 2005
325 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/1064978
Issue’s Table of Contents
  • cover image ACM Conferences
    PLDI '05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation
    June 2005
    338 pages
    ISBN:1595930566
    DOI:10.1145/1065010
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: 12 June 2005
Published in SIGPLAN Volume 40, Issue 6

Check for updates

Author Tags

  1. extensible typechecking
  2. type qualifiers
  3. type soundness

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)18
  • Downloads (Last 6 weeks)2
Reflects downloads up to 09 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2018)FlowNotationProceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security10.1145/3243734.3278508(2207-2209)Online publication date: 15-Oct-2018
  • (2008)Abstract Interpretation Plugins for Type SystemsProceedings of the 12th international conference on Algebraic Methodology and Software Technology10.1007/978-3-540-79980-1_15(184-198)Online publication date: 28-Jul-2008
  • (2024)Verifying the Option Type with Rely-Guarantee ReasoningProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695036(367-380)Online publication date: 27-Oct-2024
  • (2023)Chipmunk: Investigating Crash-Consistency in Persistent-Memory File SystemsProceedings of the Eighteenth European Conference on Computer Systems10.1145/3552326.3567498(718-733)Online publication date: 8-May-2023
  • (2021)Scalability and precision by combining expressive type systems and deductive verificationProceedings of the ACM on Programming Languages10.1145/34855205:OOPSLA(1-29)Online publication date: 15-Oct-2021
  • (2019)Uncovering Information Flow Policy Violations in C Programs (Extended Abstract)Computer Security – ESORICS 201910.1007/978-3-030-29962-0_2(26-46)Online publication date: 15-Sep-2019
  • (2016)Dynamically diagnosing type errors in unsafe codeACM SIGPLAN Notices10.1145/3022671.298399851:10(800-819)Online publication date: 19-Oct-2016
  • (2016)Dynamically diagnosing type errors in unsafe codeProceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications10.1145/2983990.2983998(800-819)Online publication date: 19-Oct-2016
  • (2015)CascadeProceedings of the 37th International Conference on Software Engineering - Volume 110.5555/2818754.2818785(234-245)Online publication date: 16-May-2015
  • (2015)Cascade: A Universal Programmer-Assisted Type Qualifier Inference Tool2015 IEEE/ACM 37th IEEE International Conference on Software Engineering10.1109/ICSE.2015.44(234-245)Online publication date: May-2015
  • Show More Cited By

View Options

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