Polymorphic type, region and effect inference

We present a new static system which reconstructs the types, regions and effects of expressions in an implicitly typed functional language that supports imperative operations on reference values. Just as types structurally abstract collections of concrete values, regions represent sets of possibly aliased reference values and effects represent approximations of the imperative behaviour on regions. We introduce a static semantics for inferring types, regions and effects, and prove that it is consistent with respect to the dynamic semantics of the language. We present a reconstruction algorithm that computes the types and effects of expressions, and assigns regions to reference values. We prove the correctness of the reconstruction algorithm with respect to the static semantics. Finally, we discuss potential applications of our system to automatic stack allocation and parallel code generation.

[1]  J. A. Robinson,et al.  A Machine-Oriented Logic Based on the Resolution Principle , 1965, JACM.

[2]  James H. Morris,et al.  Lambda-calculus models of programming languages. , 1969 .

[3]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[4]  Barry K. Rosen Data Flow Analysis for Procedural Languages , 1979, JACM.

[5]  W. Daniel Hillis,et al.  The connection machine , 1985 .

[6]  Paul Hudak A semantic model of reference counting and its abstraction (detailed summary) , 1986, LFP '86.

[7]  Joannes M. Lucassen Types and Effects Towards the Integration of Functional and Imperative Programming. , 1987 .

[8]  M. Tofte Operational Semantics and Polymorphic Type Inference , 1988 .

[9]  D. K. Gifford,et al.  FX-87 PERFORMANCE MEASUREMENTS: DATAFLOW IMPLEMENTATION , 1988 .

[10]  James R. Larus,et al.  Detecting conflicts between structure accesses , 1988, PLDI '88.

[11]  John C. Mitchell,et al.  The essence of ML , 1988, POPL '88.

[12]  Robin Milner,et al.  The definition of standard ML Version 2: LFCS report ECS-LFCS-88-62 , 1988 .

[13]  Williams Ludwell Harrison,et al.  The interprocedural analysis and automatic parallelization of Scheme programs , 1990, LISP Symb. Comput..

[14]  Alain Deutsch,et al.  On determining lifetime and aliasing of dynamically allocated data in higher-order functional specifications , 1989, POPL '90.

[15]  Mark A. Sheldon,et al.  Static dependent types for first class modules , 1990, LISP and Functional Programming.

[16]  Xavier Leroy,et al.  Polymorphic type inference and assignment , 1991, POPL '91.

[17]  Pierre Jouvelot,et al.  Algebraic reconstruction of types and effects , 1991, POPL '91.