Results 1 - 10
of
35
Object-Oriented Type Inference
- OOPSLA'91
, 1991
"... We present a new approach to inferring types in untyped object-oriented programs with inheritance, assignments, and late binding. It guarantees that all messages are understood, annotates the program with type information, allows polymorphic methods, and can be used as the basis of an op-timizing co ..."
Abstract
-
Cited by 209 (18 self)
- Add to MetaCart
We present a new approach to inferring types in untyped object-oriented programs with inheritance, assignments, and late binding. It guarantees that all messages are understood, annotates the program with type information, allows polymorphic methods, and can be used as the basis of an op-timizing compiler. Types are finite sets of classes and subtyping is set inclusion. Using a trace graph, our algorithm constructs a set of conditional type constraints and computes the least solution by least fixed-point derivation.
Putting Type Annotations to Work
, 1996
"... We study an extension of the Hindley-Milner system with explicit type scheme annotations and type declarations. The system can express polymorphic function arguments, user-defined data types with abstract components, and structure types with polymorphic fields. More generally, all programs of the po ..."
Abstract
-
Cited by 91 (1 self)
- Add to MetaCart
We study an extension of the Hindley-Milner system with explicit type scheme annotations and type declarations. The system can express polymorphic function arguments, user-defined data types with abstract components, and structure types with polymorphic fields. More generally, all programs of the polymorphic lambda calculus can be encoded by a translation between typing derivations. We show that type reconstruction in this system can be reduced to the decidable problem of first-order unification under a mixed prefix.
What Are Principal Typings and What Are They Good For?
, 1995
"... We demonstrate the pragmatic value of the principal typing property, a property more general than ML's principal type property, by studying a type system with principal typings. The type system is based on rank 2 intersection types and is closely related to ML. Its principal typing property prov ..."
Abstract
-
Cited by 88 (0 self)
- Add to MetaCart
We demonstrate the pragmatic value of the principal typing property, a property more general than ML's principal type property, by studying a type system with principal typings. The type system is based on rank 2 intersection types and is closely related to ML. Its principal typing property provides elegant support for separate compilation, including "smartest recompilation" and incremental type inference, and for accurate type error messages. Moreover, it motivates a novel rule for typing recursive definitions that can type many examples of polymorphic recursion.
Type-Based Analysis of Uncaught Exceptions
, 1998
"... This paper presents a program analysis to estimate uncaught exceptions in ML programs. This analysis relies on unification-based type inference in a non-standard type system, using rows to approximate both the flow of escaping exceptions (a la effect systems) and the flow of result values (a la cont ..."
Abstract
-
Cited by 57 (1 self)
- Add to MetaCart
This paper presents a program analysis to estimate uncaught exceptions in ML programs. This analysis relies on unification-based type inference in a non-standard type system, using rows to approximate both the flow of escaping exceptions (a la effect systems) and the flow of result values (a la control-flow analyses). The resulting analysis is efficient and precise; in particular, arguments carried by exceptions are accurately handled.
The implementation of the Gofer functional programming system
, 1994
"... The Gofer system is a functional programming environment for a small, Haskell-like language. Supporting a wide range of different machines, including home computers, the system is widely used, both for teaching and research. This report describes the main ideas and techniques used in the implementat ..."
Abstract
-
Cited by 54 (4 self)
- Add to MetaCart
The Gofer system is a functional programming environment for a small, Haskell-like language. Supporting a wide range of different machines, including home computers, the system is widely used, both for teaching and research. This report describes the main ideas and techniques used in the implementation of Gofer. This information will be particularly useful for work using Gofer as a platform to explore the use of new language features or primitives. It should also be of interest to those curious to see how the general techniques of functional programming language compilation are adapted to a simple, but practical, implementation.
Implementation of the typed call-by-value λ-calculus using a stack of regions
- In ACM Symposium on Principles of Programming Languages
, 1994
"... We present a translation scheme for the polymorphically typed call-by-value λ-calculus. All runtime values, including function closures, are put into regions. The store consists of a stack of regions. Region inference and effect inference are used to infer where regions can be allocated and de-alloc ..."
Abstract
-
Cited by 53 (0 self)
- Add to MetaCart
We present a translation scheme for the polymorphically typed call-by-value λ-calculus. All runtime values, including function closures, are put into regions. The store consists of a stack of regions. Region inference and effect inference are used to infer where regions can be allocated and de-allocated. Recursive functions are handled using a limited form of polymorphic recursion. The translation is proved correct with respect to a store semantics, which models a regionbased run-time system. Experimental results suggest that regions tend to be small, that region allocation is frequent and that overall memory demands are usually modest, even without garbage collection. 1
Dimension Types
- In 5th European Symp. on Programming, LNCS 788
, 1994
"... . Scientists and engineers must ensure that physical equations are dimensionally consistent, but existing programming languages treat all numeric values as dimensionless. This paper extends a strongly-typed programming language with a notion of dimension type. Our approach improves on previous propo ..."
Abstract
-
Cited by 24 (3 self)
- Add to MetaCart
. Scientists and engineers must ensure that physical equations are dimensionally consistent, but existing programming languages treat all numeric values as dimensionless. This paper extends a strongly-typed programming language with a notion of dimension type. Our approach improves on previous proposals in that dimension types may be polymorphic. Furthermore, any expression which is typable in the system has a most general type, and we describe an algorithm which infers this type automatically. The algorithm exploits equational unification over Abelian groups in addition to ordinary term unification. An implementation of the type system is described, extending the ML Kit compiler. Finally, we discuss the problem of obtaining a canonical form for principal types and sketch some more powerful systems which use dependent and higher-order polymorphic types. 1 Introduction One aim behind strongly-typed languages is the detection of common programming errors before run-time. Types act as a ...
Rank 2 Type Systems and Recursive Definitions
, 1995
"... We demonstrate an equivalence between the rank 2 fragments of the polymorphic lambda calculus (System F) and the intersection type discipline: exactly the same terms are typable in each system. An immediate consequence is that typability in the rank 2 intersection system is DEXPTIME-complete. We int ..."
Abstract
-
Cited by 24 (1 self)
- Add to MetaCart
We demonstrate an equivalence between the rank 2 fragments of the polymorphic lambda calculus (System F) and the intersection type discipline: exactly the same terms are typable in each system. An immediate consequence is that typability in the rank 2 intersection system is DEXPTIME-complete. We introduce a rank 2 system combining intersections and polymorphism, and prove that it types exactly the same terms as the other rank 2 systems. The combined system suggests a new rule for typing recursive definitions. The result is a rank 2 type system with decidable type inference that can type some interesting examples of polymorphic recursion. Finally,we discuss some applications of the type system in data representation optimizations such as unboxing and overloading.
A Theory of Stack Allocation in Polymorphically Typed Languages
, 1993
"... We present a stack-allocation scheme for the call-by-value lambda calculus typed according to Milner's polymorphic type discipline. All the values a program produces, including function closures, are put into regions at runtime. Regions are allocated and deallocated in a stack-like manner. Region in ..."
Abstract
-
Cited by 23 (5 self)
- Add to MetaCart
We present a stack-allocation scheme for the call-by-value lambda calculus typed according to Milner's polymorphic type discipline. All the values a program produces, including function closures, are put into regions at runtime. Regions are allocated and deallocated in a stack-like manner. Region inference and effect inference is used to infer where regions can be allocated and deallocated. By allowing a limited form of polymorphic recursion in region types, the region inference is able to distinguish between the life-times of different invocations of a function, even when the function is recursive. The region analysis is eager in its attempt to reclaim memory as quickly as possible. The main result of this report is that region inference is safe, a result which entails that regions really can be deallocated, when region inference says they can. We give detailed proofs of this claim, which (in various forms) has been advanced several times in the literature. An algorithm for implementi...

