A Sound Polymorphic Type System for a Dialect of C
MetadataShow full item record
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.
The article of record as published may be found at http://dx.doi.org/
RightsThis 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.
Showing items related by title, author, creator and subject.
Özgen, Mustafa (Monterey, California. Naval Postgraduate School, 1996-09);In an attempt to bring the ML-style type inference to the C programming language, Smith and Volpano developed a type system for a dialect of C, called PolyC SmV96a SmV95b. PolyC extends C with ML-style polymorphism and a ...
Bonem, Peter Bryant (Monterey, California. Naval Postgraduate School, 1995-09);Functional programming languages incorporate a number of powerful features, including advanced polymorphic type systems and first-class, higher- order functions. However, these important features have had little effect ...
Smith, Geoffrey; Volpano, Dennis (1996-04);Advanced polymorphic type systems have come to play an important role in the world of functional programming. But, curiously, these type systems have so far had little impact upon widely-used imperative programming languages ...