A Sound Polymorphic Type System for a Dialect of C

Loading...
Thumbnail Image
Authors
Smith, Geoffrey
Volpano, Dennis
Subjects
Advisors
Date of Issue
1996
Date
1998
Publisher
Language
Abstract
Advanced polymorphic type systems have come to play an important role in the world of functional programming. But, so far, these type systems have has little impact upon widely used imperative programming languages like c and C++. We show that ML-style polymorphism can be integrated smoothly into a dialect of C, which wwe call Polymorphic C. It has the same ppointer operatins as C, including the address-of operator &, the dereferencing operator * and pointer srithmetic. We give a natural semantics for Polymorphic C, and prove a type soundness theorem that gives a rigorous and useful characterization of what can go wrong when a well-typed Polymorphic C program in executed. For example, a well-typed Polymorphic c program may fail to terminate, or it may abortdue to a dangling pointer error. Proving such a type soundness theorem requuires a notion of an attempted program execution; we show that a natural semantics theorem gives rise quite naturally to a transition semantics, which we calla natural transtition semantics, that models program execution in terms of transformatins of partial derivation trees. This techique should be generally useful in proving type soundness for languages defined using natural semantics.
Type
Description
The article of record as published may be found at http://dx.doi.org/
Series/Report No
Department
Computer Science (CS)
Organization
Identifiers
NPS Report Number
Sponsors
Funder
Format
Citation
Science of Computer Programming, Vol. 32, No. 2-3, pp. 49-72, 1998.
Distribution Statement
Rights
This publication is a work of the U.S. Government as defined in Title 17, United States Code, Section 101. Copyright protection is not available for this work in the United States.
Collections