Advertisement

Safe Programming with Pointers Through Stateful Views

  • Dengping Zhu
  • Hongwei Xi
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3350)

Abstract

The need for direct memory manipulation through pointers is essential in many applications. However, it is also commonly understood that the use (or probably misuse) of pointers is often a rich source of program errors. Therefore, approaches that can effectively enforce safe use of pointers in programming are highly sought after. ATS is a programming language with a type system rooted in a recently developed framework Applied Type System, and a novel and desirable feature in ATS lies in its support for safe programming with pointers through a novel notion of stateful views. In particular, even pointer arithmetic is allowed in ATS and guaranteed to be safe by the type system of ATS. In this paper, we give an overview of this feature in ATS, presenting some interesting examples based on a prototype implementation of ATS to demonstrate the practicality of safe programming with pointer through stateful views.

Keywords

Model Check Type System Stateful View Dependent Type Safe Programming 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [AO91]
    Apt, K.R., Olderog, E.-R.: Verification of Sequential and Concurrent Programs, xvi+441 pp. Springer, New York (1991); ISBN 0-387-97532-2 (New York) 3-540- 97532-2 (Berlin)Google Scholar
  2. [C+86]
    Constable, R.L., et al.: Implementing Mathematics with the NuPrl Proof Development System, x+299 pp. Prentice-Hall, Englewood Cliffs (1986) ISBN 0-13- 451832-2Google Scholar
  3. [Det96]
    Detlefs, D.: An overview of the extended static checking system. In: Workshop on Formal Methods in Software Practice (1996)Google Scholar
  4. [EGP99]
    Clarke, E.M., Grumberg, O., Peled, D.: Model Checking. MIT Press, Cambridge (1999)Google Scholar
  5. [FD02]
    Fahndrich, M., Deline, R.: Adoption and Focus: Practical Linear Types for Imperative Programming. In: Proceedings of the ACM Conference on Programming Language Design and Implementation, Berlin, June 2002, pp. 13–24 (2002)Google Scholar
  6. [FTA02]
    Foster, J., Terauchi, T., Aiken, A.: Flow-sensitive Type Qualifiers. In: ACM Conference on Programming Language Design and Implementation, Berlin, June 2002, pp. 1–12 (2002)Google Scholar
  7. [Gir87]
    Girard, J.-Y.: Linear logic. Theoretical Computer Science 50(1), 1–101 (1987)zbMATHCrossRefMathSciNetGoogle Scholar
  8. [Hoa69]
    Hoare, C.A.R.: An axiomatic basis for computer programming. Communications of the ACM 12(10), 576–580, 583 (1969)zbMATHCrossRefGoogle Scholar
  9. [JMG+01]
    Jim, T., Morrisett, G., Grossman, D., Hicks, M., Baudet, M., Harris, M., Wang, Y.: Cyclone, a Safe Dialect of C (2001), http://www.cs.cornell.edu/Projects/cyclone/, Available at http://www.cs.cornell.edu/Projects/cyclone/
  10. [MWH03]
    Mandelbaum, Y., Walker, D., Harper, R.: An effective theory of type refinements. In: Proceedings of the Eighth ACM SIGPLAN International Conference on Functional Programming, Uppsala, Sweden, September 2003, pp. 213–226 (2003)Google Scholar
  11. [NMW02]
    Necula, G.C., McPeak, S., Weimer, W.: CCured: Type-Safe Retrofitting of Legacy Code. In: Proceedings of the 29th ACM Symposium on Principles of Programming Languages, London, January 2002, pp. 128–139 (2002)Google Scholar
  12. [OSSY02]
    Oiwa, Y., Sekiguchi, T., Sumii, E., Yonezawa, A.: Fail-safe ansi-c compiler: An approach to making c programs secure (progress report). In: Okada, M., Pierce, B.C., Scedrov, A., Tokuda, H., Yonezawa, A. (eds.) ISSS 2002. LNCS, vol. 2609, pp. 133–153. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  13. [Rey02]
    Reynolds, J.: Separation Logic: a logic for shared mutable data structures. In: Proceedings of 17th IEEE Symposium on Logic in Computer Science, LICS 2002 (2002), citeseer.nj.nec.com/reynolds02separation.html
  14. [XCC03]
    Xi, H., Chen, C., Chen, G.: Guarded Recursive Datatype Constructors. In: Proceedings of the 30th ACM SIGPLAN Symposium on Principles of Programming Languages, New Orleans, LA, January 2003, pp. 224–235 (2003)Google Scholar
  15. [XH01]
    Xi, H., Harper, R.: A Dependently Typed Assembly Language. In: Proceedings of International Conference on Functional Programming, September 2001, pp. 169–180 (2001)Google Scholar
  16. [Xi98]
    Xi, H.: Dependent Types in Practical Programming. PhD thesis, pp. viii+181–viii+189. Carnegie Mellon University (1998), Available at http://www.cs.cmu.edu/~hwxi/DML/thesis.ps
  17. [Xi00]
    Xi, H.: Imperative Programming with Dependent Types. In: Proceedings of 15th IEEE Symposium on Logic in Computer Science, Santo Barbara, CA, June 2000, pp. 375–387 (2000)Google Scholar
  18. [Xi03]
    Xi, H.: Applied Type System (July 2003), Available at http://www.cs.bu.edu/~hwxi/ATS
  19. [Xi04]
    Xi, H.: Applied Type System (extended abstract). In: Berardi, S., Coppo, M., Damiani, F. (eds.) TYPES 2003. LNCS, vol. 3085, pp. 394–408. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  20. [XP99]
    Xi, H., Pfenning, F.: Dependent Types in Practical Programming. In: Proceedings of 26th ACM SIGPLAN Symposium on Principles of Programming Languages, San Antonio, Texas, January 1999, pp. 214–227 (1999)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Dengping Zhu
    • 1
  • Hongwei Xi
    • 1
  1. 1.Computer Science DepartmentBoston University 

Personalised recommendations