Safe Programming with Pointers Through Stateful Views

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.

[1]  Hongwei Xi,et al.  Imperative programming with dependent types , 2000, Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.99CB36332).

[2]  George C. Necula,et al.  CCured: type-safe retrofitting of legacy code , 2002, POPL '02.

[3]  Akinori Yonezawa,et al.  Software Security — Theories and Systems , 2003, Lecture Notes in Computer Science.

[4]  Hongwei Xi,et al.  Applied Type System: Extended Abstract , 2003, TYPES.

[5]  Robert Harper,et al.  A dependently typed assembly language , 2001, ICFP '01.

[6]  J. van Leeuwen,et al.  Theoretical Computer Science , 2003, Lecture Notes in Computer Science.

[7]  Maribel Fernández,et al.  Curry-Style Types for Nominal Terms , 2006, TYPES.

[8]  Patrick Lincoln,et al.  Linear logic , 1992, SIGA.

[9]  David L. Detlefs,et al.  An Overview of the Extended Static Checking System , 2007 .

[10]  Frank Pfenning,et al.  Dependent types in practical programming , 1999, POPL '99.

[11]  James Cheney,et al.  Cyclone: A Safe Dialect of C , 2002, USENIX Annual Technical Conference, General Track.

[12]  David Walker,et al.  An effective theory of type refinements , 2003, ICFP '03.

[13]  M. Nivat Fiftieth volume of theoretical computer science , 1988 .

[14]  Akinori Yonezawa,et al.  Fail-Safe ANSI-C Compiler: An Approach to Making C Programs Secure: Progress Report , 2002, ISSS.

[15]  Anish Arora,et al.  Book Review: Verification of Sequential and Concurrent Programs by Krzysztof R. Apt and Ernst-Riidiger Olderog (Springer-Verlag New York, 1997) , 1998, SIGA.

[16]  Gang Chen,et al.  Guarded recursive datatype constructors , 2003, POPL '03.

[17]  Robert DeLine,et al.  Adoption and focus: practical linear types for imperative programming , 2002, PLDI '02.

[18]  John C. Reynolds,et al.  Separation logic: a logic for shared mutable data structures , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[19]  Alexander Aiken,et al.  Flow-sensitive type qualifiers , 2002, PLDI '02.

[20]  Stephan Merz,et al.  Model Checking , 2000 .

[21]  Rance Cleaveland,et al.  Implementing mathematics with the Nuprl proof development system , 1986 .