Results 1 - 10
of
49
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.
Type Inclusion Constraints and Type Inference
- In Proceedings of the 1993 Conference on Functional Programming Languages and Computer Architecture
, 1993
"... We present a general algorithm for solving systems of inclusion constraints over type expressions. The constraint language includes function types, constructor types, and liberal intersection and union types. We illustrate the application of our constraint solving algorithm with a type inference sys ..."
Abstract
-
Cited by 203 (19 self)
- Add to MetaCart
We present a general algorithm for solving systems of inclusion constraints over type expressions. The constraint language includes function types, constructor types, and liberal intersection and union types. We illustrate the application of our constraint solving algorithm with a type inference system for the lambda calculus with constants. In this system, every pure lambda term has a (computable) type and every term typable in the Hindley/Milner system has all of its Hindley/Milner types. Thus, the inference system is an extension of the Hindley/Milner system that can type a very large set of lambda terms. 1 Introduction Type inference systems for functional languages are based on solving systems of type constraints. The best known and most widely used type inference algorithm was first discovered by Hindley and later independently by Milner [Hin69, Mil78]. In its simplest form, the algorithm generates type equations from the program text and then solves the equations. If the equati...
Soft typing with conditional types
- In Twenty-First Annual ACM Symposium on Principles of Programming Languages
, 1994
"... We present a simple and powerful type inference method for dynamically typed languages where no type information is supplied by the user. Type inference is reduced to the problem of solvability of a system of type inclusion constraints over a type language that includes function types, constructor t ..."
Abstract
-
Cited by 182 (15 self)
- Add to MetaCart
We present a simple and powerful type inference method for dynamically typed languages where no type information is supplied by the user. Type inference is reduced to the problem of solvability of a system of type inclusion constraints over a type language that includes function types, constructor types, union, intersection, and recursive types, and conditional types. Conditional types enable us to analyze control flow using type inference, thus facilitating computation of accurate types. We demonstrate the power and practicrdity of the method with examples and performance results from an implementation. 1
A Finite Presentation Theorem for Approximating Logic Programs
- In Seventeenth Annual ACM Symposium on Principles of Programming Languages
, 1990
"... In program analysis, a key notion used to approximate the meaning of a program is that of ignoring inter-variable dependencies. We formalize this notion in logic programming in order to define an approximation to the meaning of a program. The main result proves that this approximation is not only re ..."
Abstract
-
Cited by 90 (15 self)
- Add to MetaCart
In program analysis, a key notion used to approximate the meaning of a program is that of ignoring inter-variable dependencies. We formalize this notion in logic programming in order to define an approximation to the meaning of a program. The main result proves that this approximation is not only recursive, but that it can be finitely represented in the form of a cyclic term graph. This explicit representation can be used as a starting point for logic program analyzers. A preliminary version appears in the Proceedings, 17 th ACM Symposium on POPL. y School of Computer Science, Carnegie Mellon University, Pittsburgh, PA 15213-3890 z IBM Thomas J. Watson Research Center, PO Box 218, Yorktown Heights, NY 10598 Section 1: Introduction 1 1 Introduction The problem at hand is: given a logic program, obtain an approximation of its meaning, that is, obtain an approximation of its least model. The definition of the approximation should be declarative (so that results can be proved ab...
Set Constraints: Results, Applications and Future Directions
- In Second Workshop on the Principles and Practice of Constraint Programming
"... . Set constraints are a natural formalism for many problems that arise in program analysis. This paper provides a brief introduction to set constraints: what set constraints are, why they are interesting, the current state of the art, open problems, applications and implementations. 1 Introduction ..."
Abstract
-
Cited by 69 (3 self)
- Add to MetaCart
. Set constraints are a natural formalism for many problems that arise in program analysis. This paper provides a brief introduction to set constraints: what set constraints are, why they are interesting, the current state of the art, open problems, applications and implementations. 1 Introduction Set constraints are a natural formalism for describing relationships between sets of terms of a free algebra. A set constraint has the form X ` Y , where X and Y are set expressions. Examples of set expressions are 0 (the empty set), ff (a set-valued variable), c(X; Y ) (a constructor application), and the union, intersection, or complement of set expressions. Recently, there has been a great deal of interest in program analysis algorithms based on solving systems of set constraints, including analyses for functional languages [AWL94, Hei94, AW93, AM91, JM79, MR85, Rey69], logic programming languages [AL94, HJ92, HJ90b, Mis84], and imperative languages [HJ91]. In these algorithms, sets of...
Set Constraints are the Monadic Class
, 1992
"... We investigate the relationship between set constraints and the monadic class of first-order formulas and show that set constraints are essentially equivalent to the monadic class. From this equivalence we can infer that the satisfiability problem for set constraints is complete for NEXPTIME. Mor ..."
Abstract
-
Cited by 68 (0 self)
- Add to MetaCart
We investigate the relationship between set constraints and the monadic class of first-order formulas and show that set constraints are essentially equivalent to the monadic class. From this equivalence we can infer that the satisfiability problem for set constraints is complete for NEXPTIME. More precisely, we prove that this problem has a lower bound of NTIME(c n= log n ). The relationship between set constraints and the monadic class also gives us decidability and complexity results for certain practically useful extensions of set constraints, in particular "negative projections" and subterm equality tests.
Formal Language, Grammar and Set-Constraint-Based Program Analysis by Abstract Interpretation
, 1995
"... Grammar-based program analysis à la Jones and Muchnick and set-constraint-based program analysis à la Aiken and Heintze are static analysis techniques that have traditionally been seen as quite different from abstract-interpretation-based analyses, in particular because of their apparent non-iterati ..."
Abstract
-
Cited by 66 (9 self)
- Add to MetaCart
Grammar-based program analysis à la Jones and Muchnick and set-constraint-based program analysis à la Aiken and Heintze are static analysis techniques that have traditionally been seen as quite different from abstract-interpretation-based analyses, in particular because of their apparent non-iterative nature. For example, on page 18 of N. Heintze thesis, it is alleged that ``The finitary nature of abstract interpretation implies that there is a fundamental limitation on the accuracy of this approach to program analysis. There are decidable kinds of analysis that cannot be computed using abstract interpretation (even with widening and narrowing). The set-based analysis considered in this thesis is one example''. On the contrary, we show that grammar and set-constraint-based program analyses are similar abstract interpretations with iterative fixpoint computation using either a widening or a finitary grammar/set-constraints transformer or even a finite domain for each particular program. The understanding of grammar-based and set-constraint-based program analysis as a particular instance of abstract interpretation of a semantics has several advantages. First, the approximation process is formalized and not only explained using examples. Second, a domain of abstract properties is exhibited which is of general scope. Third, these analyses can be easily combined with other abstract-interpretation-based analyses, in particular for the analysis of numerical values. Fourth, they can be generalized to very powerful attribute-dependent and context-dependent analyses. Finally, a few misunderstandings may be removed.
Subtyping Constrained Types
, 1996
"... A constrained type is a type that comes with a set of subtyping constraints on variables occurring in the type. Constrained type inference systems are a natural generalization of Hindley/Milner type inference to languages with subtyping. This paper develops several subtyping relations on polymorphic ..."
Abstract
-
Cited by 60 (2 self)
- Add to MetaCart
A constrained type is a type that comes with a set of subtyping constraints on variables occurring in the type. Constrained type inference systems are a natural generalization of Hindley/Milner type inference to languages with subtyping. This paper develops several subtyping relations on polymorphic constrained types of a general form that allows recursive constraints and multiple bounds on type variables. We establish a full type abstraction property that equates a novel operational notion of subtyping with a semantic notion based on regular trees. The decidability of this notion of subtyping is open; we present a decidable approximation. Subtyping constrained types has applications to signature matching and to constrained type simplification. The relation will thus be a critical component of any programming language incorporating a constrained typing system. 1 Introduction A constrained type is a type that is additionally constrained by a set of subtyping constraints on the free ty...
The Complexity of Set Constraints
, 1993
"... . Set constraints are relations between sets of terms. They have been used extensively in various applications in program analysis and type inference. We present several results on the computational complexity of solving systems of set constraints. The systems we study form a natural complexity hier ..."
Abstract
-
Cited by 60 (9 self)
- Add to MetaCart
. Set constraints are relations between sets of terms. They have been used extensively in various applications in program analysis and type inference. We present several results on the computational complexity of solving systems of set constraints. The systems we study form a natural complexity hierarchy depending on the form of the constraint language. 1 Introduction Systems of set constraints have received considerable attention as a formalism for expressing algorithms in program analysis and type inference. Many algorithms based on set constraints have been proposed and implemented, but very little is known about the computational complexity of solving systems of set constraints. In this paper we present complexity results for a natural hierarchy of decision problems involving set constraints. Set constraints are formal inclusions between expressions representing subsets of T \Sigma , the set of ground terms over a finite ranked alphabet \Sigma . A positive set constraint is an in...
Static Type Inference in a Dynamically Typed Language
- In Eighteenth Annual ACM Symposium on Principles of Programming Languages
, 1991
"... We present a type inference system for FL based on an operational, rather than a denotational, formulation of types. The essential elements of the system are a type language based on regular trees and a type inference logic that implements an abstract interpretation of the operational semantics of F ..."
Abstract
-
Cited by 59 (7 self)
- Add to MetaCart
We present a type inference system for FL based on an operational, rather than a denotational, formulation of types. The essential elements of the system are a type language based on regular trees and a type inference logic that implements an abstract interpretation of the operational semantics of FL. We use a non-standard approach to type inference because our requirements---using type information in the optimization of functional programs---differ substantially from those of other type systems. 1 Introduction Compilers derive at least two benefits from static type inference: the ability to detect and report potential run-time errors at compile-time, and the use of type information in program optimization. Traditionally, type systems have emphasized the detection of type errors. Statically typed functional languages such as Haskell [HWA*88] and ML [HMT89] include type constraints as part of the language definition, making some type inference necessary to ensure that type constraints ...

