A Syntactic Approach to Type Soundness

  title={A Syntactic Approach to Type Soundness},
  author={Andrew K. Wright and Matthias Felleisen},
  journal={Inf. Comput.},
We present a new approach to proving type soundness for Hindley/Milner-style polymorphic type systems. The keys to our approach are (1) an adaptation of subject reduction theorems from combinatory logic to programming languages, and (2) the use of rewriting techniques for the specification of the language semantics. The approach easily extends from polymorphic functional languages to imperative languages that provide references, exceptions, continuations, and similar features. We illustrate the… 

Simple imperative polymorphism

A study of a number of ML programs shows that the inability to type all Hindley-Milner typable expressions seldom impacts realistic programs, so with a module system that separates specifications from implementations, imperative features can be freely used to implement polymorphic specifications.

Quantified types in an imperative language

A formal abstract machine and type-safety proof that capture the essence of type variables at the C level is developed that avoids a subtle unsoundness issue resulting from the address-of operator.

Extrinsically typed operational semantics for functional languages

We present a type system over language definitions that classifies parts of the operational semantics of a language in input, and models a common language design organization. The resulting typing

Proof of Imperative Programs in Type Theory

A functional translation of imperative programs, based on a combination of the type and effect discipline and monads, in the context of Type Theory is presented, which includes functional constructions in a straight-forward way.

A Type System for a Lambda Calculus with Assignments

A Hindley/Milner-style polymorphic type system for λvar, an extension of the call-by-name λ-calculus with mutable variables and assignments, which proves the soundness of the type system with respect toλvar's untyped reduction semantics so that any well-typed program will evaluate to an answer, provided the evaluation terminates.

Proving Type Soundness of a Simply Typed ML-Like Language with References

This paper formalizes in the Coq proof assistant an MLlike language with imperative features, a monomorphic type system, a reduction semantics, and the type soundness that is an extension of Mini-ML.

Liberal Typing for Functional Logic Programs

A new notion of well-typed program is proposed that adds support for type-indexed functions, existential types, opaque higher-order patterns and generic functions--as shown by an extensive collection of examples that illustrate the possibilities of this proposal.

Types in Compilation

  • R. Harper
  • Computer Science
    Lecture Notes in Computer Science
  • 2001
A translation from a language with singleton kinds to one without is presented, and it is proved to be sound and complete, and this translation is useful for type-preserving compilers generating typed target languages.

A Rewriting Logic Approach to Defining Type Systems

This work presents an extension of the syntactic approach to proving type system soundness presented by Wright and Felleisen [1994] that works in the above described semantics-based domain.

The Essence of Lightweight Family Polymorphism

This paper gives a formal translation from .FJ into a variant of Featherweight GJ with a little extension of F-bounded polymorphism, to achieve a clear correspondence between the two languages without losing type safety.



Type Inference for Polymorphic References

  • M. Tofte
  • Computer Science
    Inf. Comput.
  • 1990

A Theory of Type Polymorphism in Programming

  • R. Milner
  • Computer Science
    J. Comput. Syst. Sci.
  • 1978

Typing first-class continuations in ML

The soundness of the Damas–Milner polymorphic type assignment system with respect to this semantics is proved, and the full Damas-Milner type system is shown to be unsound in the presence of first-class continuations.

Polymorphic type inference and assignment

The type system given here leads to a better integration of imperative programming style with the purely applicative kernel of ML, and generic functions that allocate mutable data can safely be given fully polymorphic types.

A Syntactic Theory of Sequential State

Type assignment in programming languages

A family of polymorphic type disciplines for programming languages similar to the type discipline of ML, the metalanguage of the LCF system, which are based on the use of type inference systems to define the notion of well typed expressions and programs and on theUse of type assignment algorithms to compute the type or types that can be inferred for those same expressions or programs.

Dynamic typing in a statically-typed language

This paper is an exploration of the syntax, operational semantics, and denotational semantics of a simple language with the type Dynamic, and discusses an operational semantics for this language and obtains a soundness theorem.

Abstract types have existential types

This work uses a second-order typed lambda calculus SOL to show how data algebras may be given types, passed as parameters, and returned as results of function calls.

Abstract types have existential type

This work uses a second-order typed lambda calculus SOL to show how data algebras may be given types, passed as parameters, and returned as results of function calls.

On the Relation between Direct and Continuation Semantics

This work gives two theorems which specify the relationship between the direct and the continuation semantic functions for a purely applicative language and shows that direct semantics are included in continuation semantics.