Results 1  10
of
24
How Good is Local Type Inference?
, 1999
"... A partial type inference technique should come with a simple and precise specification, so that users predict its behavior and understand the error messages it produces. Local type inference techniques attain this simplicity by inferring missing type information only from the types of adjacent synta ..."
Abstract

Cited by 180 (4 self)
 Add to MetaCart
A partial type inference technique should come with a simple and precise specification, so that users predict its behavior and understand the error messages it produces. Local type inference techniques attain this simplicity by inferring missing type information only from the types of adjacent syntax nodes, without using global mechanisms such as unification variables. The paper reports on our experience with programming in a fullfeatured programming language including higherorder polymorphism, subtyping, parametric datatypes, and local type inference. On the positive side, our experiments on several nontrivial examples confirm previous hopes for the practicality of the type inference method. On the negative side, some proposed extensions mitigating known expressiveness problems turn out to be unsatisfactory on close examination. 1 Introduction It is widely believed that a polymorphic programming language should provide some form of type inference, to avoid discouraging programming ...
TypeBased Analysis of Uncaught Exceptions
, 1998
"... This paper presents a program analysis to estimate uncaught exceptions in ML programs. This analysis relies on unificationbased type inference in a nonstandard 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 78 (2 self)
 Add to MetaCart
This paper presents a program analysis to estimate uncaught exceptions in ML programs. This analysis relies on unificationbased type inference in a nonstandard type system, using rows to approximate both the flow of escaping exceptions (a la effect systems) and the flow of result values (a la controlflow analyses). The resulting analysis is efficient and precise; in particular, arguments carried by exceptions are accurately handled.
Precise constraintbased type inference for Java
 Lecture Notes in Computer Science
, 2001
"... Abstract. Precise type information is invaluable for analysis and optimization of objectoriented programs. Some forms of polymorphism found in objectoriented languages pose significant difficulty for type inference, in particular data polymorphism. Agesen’s Cartesian Product Algorithm (CPA) can an ..."
Abstract

Cited by 59 (7 self)
 Add to MetaCart
Abstract. Precise type information is invaluable for analysis and optimization of objectoriented programs. Some forms of polymorphism found in objectoriented languages pose significant difficulty for type inference, in particular data polymorphism. Agesen’s Cartesian Product Algorithm (CPA) can analyze programs with parametric polymorphism in a reasonably precise and efficient manner, but CPA loses precision for programs with data polymorphism. This paper presents a precise constraintbased type inference system for Java. It uses DataPolymorphic CPA (DCPA), a novel constraintbased type inference algorithm which extends CPA with the ability to accurately and efficiently analyze data polymorphic programs. The system is implemented for the full Java language, and is used to statically verify the correctness of Java downcasts. Benchmark results are given which show that DCPA is significantly more accurate than CPA and the efficiency of DCPA is close to CPA. 1
A General Framework for Hindley/Milner Type Systems with Constraints
, 2000
"... with constraints. The basic idea is to factor out the common core of previous extensions of the Hindley/Milner system. I present a Hindley/Milner system where the constraint part is a parameter. Speci c applications can be obtained by providing speci c constraint systems which capture the applicat ..."
Abstract

Cited by 30 (8 self)
 Add to MetaCart
with constraints. The basic idea is to factor out the common core of previous extensions of the Hindley/Milner system. I present a Hindley/Milner system where the constraint part is a parameter. Speci c applications can be obtained by providing speci c constraint systems which capture the application in mind. For instance, the Hindley/Milner system can be recovered by instantiating the constraint part to the standard Herbrand constraint system. Type system instances of the general framework are sound if the underlying constraint system is sound. Furthermore, I give a generic type inference algorithm for the general framework, under sucient conditions on the speci c constraint system type inference yields principal types.
DemandDriven Type Inference with Subgoal Pruning: Trading Precision for Scalability
, 2004
"... After two decades of effort, type inference for dynamically typed languages scales to programs of a few tens of thousands of lines of code, but no further. For larger programs, this paper proposes using a kind of demanddriven analysis where the number of active goals is carefully restricted. To ach ..."
Abstract

Cited by 17 (2 self)
 Add to MetaCart
After two decades of effort, type inference for dynamically typed languages scales to programs of a few tens of thousands of lines of code, but no further. For larger programs, this paper proposes using a kind of demanddriven analysis where the number of active goals is carefully restricted. To achieve this restriction, the algorithm occasionally prunes goals by giving them solutions that are trivially true and thus require no further subgoals to be solved; the previous subgoals of a newly pruned goal may often be discarded from consideration, reducing the total number of active goals. A specific algorithm DDP is described which uses this approach. An experiment on DDP shows that it infers precise types for roughly 30 % to 45 % of the variables in a program with hundreds of thousands of lines; the percentage varies with the choice of pruning threshold, a parameter of the algorithm. The time required varies from an average of onetenth of one second per variable to an unknown maximum, again depending on the pruning threshold. These data suggest that 50 and 2000 are both good choices of pruning threshold, depending on whether speed or precision is more important.
Hindley/Milner style type systems in constraint form
, 1999
"... This papers describes Hindley/Milner style type systems in constraint form. Previously, many type descriptions have still been partially represented in the type language. We argue that this can lead to shortcomings in the type and inference system. Examples are given to support this statement. As a ..."
Abstract

Cited by 15 (1 self)
 Add to MetaCart
This papers describes Hindley/Milner style type systems in constraint form. Previously, many type descriptions have still been partially represented in the type language. We argue that this can lead to shortcomings in the type and inference system. Examples are given to support this statement. As a solution we present a purely constraintbased formulation of Hindley/Milner style type systems which enjoys much nicer logical properties than previous approaches. More specifically, we present a solution to the open problem of type inference in nonregular theories.
Polyvariant Flow Analysis with Constrained Types
 In Proc. European Symp. on Programming
, 2000
"... . The basic idea behind improving the quality of a monovariant control flow analysis such as 0CFA is the concept of polyvariant analyses such as Agesen's Cartesian Product Algorithm (CPA) and Shivers' nCFA. In this paper we develop a novel framework for polyvariant flow analysis based on ..."
Abstract

Cited by 11 (6 self)
 Add to MetaCart
(Show Context)
. The basic idea behind improving the quality of a monovariant control flow analysis such as 0CFA is the concept of polyvariant analyses such as Agesen's Cartesian Product Algorithm (CPA) and Shivers' nCFA. In this paper we develop a novel framework for polyvariant flow analysis based on AikenWimmers constrained type theory. We develop instantiations of our framework to formalize various polyvariant algorithms, including nCFA and CPA. With our CPA formalization, we show the callgraph based termination condition for CPA will not always guarantee termination. We then develop a novel termination condition and prove it indeed leads to a terminating algorithm. Additionally, we show how data polymorphism can be modeled in the framework, by defining a simple extension to CPA that incorporates data polymorphism. 1 Introduction In this paper we develop a general framework for polyvariant flow analysis, expressing it in terms of AikenWimmers constrained types [4]. It is already known ...
NonStructural Subtype Entailment in Automata Theory
, 2003
"... Decidability of nonstructural subtype entailment is a longstanding open problem in programming language theory. In this paper, we apply automata theoretic methods to characterize the problem equivalently by using regular expressions and word equations. This characterization induces new results on ..."
Abstract

Cited by 8 (3 self)
 Add to MetaCart
(Show Context)
Decidability of nonstructural subtype entailment is a longstanding open problem in programming language theory. In this paper, we apply automata theoretic methods to characterize the problem equivalently by using regular expressions and word equations. This characterization induces new results on nonstructural subtype entailment, constitutes a promising starting point for further investigations on decidability, and explains for the first time why the problem is so difficult. The difficulty is caused by implicit word equations that we make explicit.
Gradual Typing with Unificationbased Inference
 DLS'08
, 2008
"... Static and dynamic type systems have wellknown strengths and weaknesses. Gradual typing provides the benefits of both in a single language by giving the programmer control over which portions of the program are statically checked based on the presence or absence of type annotations. This paper stud ..."
Abstract

Cited by 8 (0 self)
 Add to MetaCart
(Show Context)
Static and dynamic type systems have wellknown strengths and weaknesses. Gradual typing provides the benefits of both in a single language by giving the programmer control over which portions of the program are statically checked based on the presence or absence of type annotations. This paper studies the combination of gradual typing and unificationbased type inference with the goal of developing a system that helps programmers increase the amount of static checking in their program. The key question in combining gradual typing and type inference is how should the dynamic type of a gradual system interact with the type variables of a type inference system. This paper explores the design space and shows why three straightforward approaches fail to meet our design goals. This paper presents a new type system based on the idea that a solution for a type variable should be as informative as any type that constrains the variable. The paper also develops an efficient inference algorithm and proves it sound and complete with respect to the type system.
Type Inference for FirstClass Messages with Feature Constraints
 International Journal of Foundations of Computer Science
, 1998
"... We present a constraint system OF of feature trees that is appropriate to specify and implement type inference for firstclass messages. OF extends traditional systems of feature constraints by a selection constraint xhyiz "by firstclass feature tree" y, in contrast to the standard sel ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
We present a constraint system OF of feature trees that is appropriate to specify and implement type inference for firstclass messages. OF extends traditional systems of feature constraints by a selection constraint xhyiz "by firstclass feature tree" y, in contrast to the standard selection constraint x[ f ]y "by fixed feature" f . We investigate the satisfiability problem of OF and show that it can be solved in polynomial time, and even in quadratic time in an important special case. We compare OF with Treinen's constraint system EF of feature constraints with firstclass features, which has an NPcomplete satisfiability problem. This comparison yields that the satisfiability problem for OF with negation is NPhard. Based on OF we give a simple account of type inference for firstclass messages in the spirit of Nishimura's recent proposal, and we show that it has polynomial time complexity: We also highlight an immediate extension that is desirable but makes type inference NPhard.