Results 1  10
of
35
Efficient Inference of Object Types
, 1995
"... Abadi and Cardelli have recently investigated a calculus of objects [2]. The calculus supports a key feature of objectoriented languages: an object can be emulated by another object that has more refined methods. Abadi and Cardelli presented four firstorder type systems for the calculus. The simpl ..."
Abstract

Cited by 59 (6 self)
 Add to MetaCart
(Show Context)
Abadi and Cardelli have recently investigated a calculus of objects [2]. The calculus supports a key feature of objectoriented languages: an object can be emulated by another object that has more refined methods. Abadi and Cardelli presented four firstorder type systems for the calculus. The simplest one is based on finite types and no subtyping, and the most powerful one has both recursive types and subtyping. Open until now is the question of type inference, and in the presence of subtyping "the absence of minimum typings poses practical problems for type inference" [2]. In this paper...
Type Checking HigherOrder Polymorphic MultiMethods
, 1997
"... We present a new predicative and decidable type system, called ML , suitable for languages that integrate functional programming and parametric polymorphism in the tradition of ML [21, 28], and classbased objectoriented programming and higherorder multimethods in the tradition of CLOS [12]. Inste ..."
Abstract

Cited by 55 (0 self)
 Add to MetaCart
We present a new predicative and decidable type system, called ML , suitable for languages that integrate functional programming and parametric polymorphism in the tradition of ML [21, 28], and classbased objectoriented programming and higherorder multimethods in the tradition of CLOS [12]. Instead of using extensible records as a foundation for objectoriented extensions of functional languages, we propose to reinterpret ML datatype declarations as abstract and concrete class declarations, and to replace pattern matching on runtime values by dynamic dispatch on runtime types. ML is based on universally quantified polymorphic constrained types. Constraints are conjunctions of inequalities between monotypes built from type constructors organized into extensible and partially ordered classes. We give type checking rules for a small, explicitly typed functional language `a la XML [20] with multimethods, show that the resulting system has decidable minimal types, and discuss subject ...
Principal Type Schemes for Functional Programs with Overloading and Subtyping
 Science of Computer Programming
, 1994
"... We show how the Hindley/Milner polymorphic type system can be extended to incorporate overloading and subtyping. Our approach is to attach constraints to quantified types in order to restrict the allowed instantiations of type variables. We present an algorithm for inferring principal types and ..."
Abstract

Cited by 51 (1 self)
 Add to MetaCart
(Show Context)
We show how the Hindley/Milner polymorphic type system can be extended to incorporate overloading and subtyping. Our approach is to attach constraints to quantified types in order to restrict the allowed instantiations of type variables. We present an algorithm for inferring principal types and prove its soundness and completeness. We find that it is necessary in practice to simplify the inferred types, and we describe techniques for type simplification that involve shape unification, strongly connected components, transitive reduction, and the monotonicities of type formulas.
Efficient Inference of Static Types for Java Bytecode
, 2000
"... In this paper, we present an efficient and practical algorithm for inferring static types for local variables in a 3address, stackless, representation of Java bytecode. By decoupling the type inference problem from the low level bytecode representation, and abstracting it into a constraint system, ..."
Abstract

Cited by 38 (6 self)
 Add to MetaCart
In this paper, we present an efficient and practical algorithm for inferring static types for local variables in a 3address, stackless, representation of Java bytecode. By decoupling the type inference problem from the low level bytecode representation, and abstracting it into a constraint system, we show that there exists verifiable bytecode that cannot be statically typed. Further, we show that, without transforming the program, the static typing problem is NPhard. In order to get a practical approach we have developed an algorithm that works eciently for the usual cases and then applies efficient program transformations to simplify the hard cases. We have implemented this algorithm in the Soot framework. Our experimental results show that all of the 17,000 methods used in our tests were successfully typed, 99.8% of those required only the first stage, 0.2% required the second stage, and no methods required the third stage.
The Complexity of Subtype Entailment for Simple Types
 In Proceedings of the 12th Annual IEEE Symposium on Logic in Computer Science (LICS
, 1997
"... A subtyping 0 is entailed by a set of subtyping constraints C, written C j= 0 , if every valuation (mapping of type variables to ground types) that satisfies C also satisfies 0 . We study the complexity of subtype entailment for simple types over lattices of base types. We show that: ..."
Abstract

Cited by 28 (1 self)
 Add to MetaCart
(Show Context)
A subtyping 0 is entailed by a set of subtyping constraints C, written C j= 0 , if every valuation (mapping of type variables to ground types) that satisfies C also satisfies 0 . We study the complexity of subtype entailment for simple types over lattices of base types. We show that: ffl deciding C j= 0 is coNPcomplete. ffl deciding C j= ff fi for consistent, atomic C and ff; fi atomic can be done in linear time. The structural lower (coNPhardness) and upper (membership in coNP) bounds as well as the optimal algorithm for atomic entailment are new. The coNPhardness result indicates that entailment is strictly harder than satisfiability, which is known to be in PTIME for lattices of base types. The proof of coNPcompleteness gives an improved algorithm for deciding entailment and puts a precise complexitytheoretic marker on the intuitive "exponential explosion" in the algorithm. Central to our results is a novel characterization of C j= ff fi for atomic, co...
Satisfiability of Inequalities in a Poset
 Fundamenta Informaticae
"... We consider tractable and intractable cases of the satisfiability problem for conjunctions of inequalities between variables and constants in a fixed finite poset. We show that crowns are intractable. ..."
Abstract

Cited by 20 (0 self)
 Add to MetaCart
(Show Context)
We consider tractable and intractable cases of the satisfiability problem for conjunctions of inequalities between variables and constants in a fixed finite poset. We show that crowns are intractable.
Type Inference with Structural Subtyping: A faithful formalization of an efficient constraint solver
, 2003
"... We are interested in type inference in the presence of structural subtyping from a pragmatic perspective. This work combines theoretical and practical contributions: first, it provides a faithful description of an efficient algorithm for solving and simplifying constraints; whose correctness is f ..."
Abstract

Cited by 19 (4 self)
 Add to MetaCart
We are interested in type inference in the presence of structural subtyping from a pragmatic perspective. This work combines theoretical and practical contributions: first, it provides a faithful description of an efficient algorithm for solving and simplifying constraints; whose correctness is formally proved. Besides, the framework has been implemented in Objective Caml, yielding a generic type inference engine. Its efficiency is assessed by a complexity result and a series of experiments in realistic cases.
On the theory of structural subtyping
, 2003
"... We show that the firstorder theory of structural subtyping of nonrecursive types is decidable. Let Σ be a language consisting of function symbols (representing type constructors) and C a decidable structure in the relational language L containing a binary relation ≤. C represents primitive types; ..."
Abstract

Cited by 18 (8 self)
 Add to MetaCart
(Show Context)
We show that the firstorder theory of structural subtyping of nonrecursive types is decidable. Let Σ be a language consisting of function symbols (representing type constructors) and C a decidable structure in the relational language L containing a binary relation ≤. C represents primitive types; ≤ represents a subtype ordering. We introduce the notion of Σtermpower of C, which generalizes the structure arising in structural subtyping. The domain of the Σtermpower of C is the set of Σterms over the set of elements of C. We show that the decidability of the firstorder theory of C implies the decidability of the firstorder theory of the Σtermpower of C. This result implies the decidability of the firstorder theory of structural subtyping of nonrecursive types.
Satisfying Subtype Inequalities in Polynomial Space
, 1997
"... This paper studies the complexity of type inference in lambdacalculus with subtyping. Type inference is equivalent to solving systems of subtype inequalities. We consider simple types ordered structurally from an arbitrary set of base subtype assumptions. In this case, we give a PSPACE upper bound. ..."
Abstract

Cited by 17 (0 self)
 Add to MetaCart
This paper studies the complexity of type inference in lambdacalculus with subtyping. Type inference is equivalent to solving systems of subtype inequalities. We consider simple types ordered structurally from an arbitrary set of base subtype assumptions. In this case, we give a PSPACE upper bound. Together with the known lower bound, this result settles completely the complexity of type inference over simple types, which is PSPACEcomplete. We use a technique of independent theoretical interest that simplifies existing methods developed in the literature. Finally the algorithm, although mainly theoretical, can lead to a slight practical improvement of existing implementations.
Type Elaboration and Subtype Completion for Java Bytecode
 IN PROCEEDINGS 27TH ACM SIGPLANSIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES
, 1999
"... Java source code is strongly typed, but the translation from Java source to bytecode omits much of the type information originally contained within methods. Type elaboration is a technique for reconstructing strongly typed programs from incompletely typed bytecode by inferring types for local variab ..."
Abstract

Cited by 16 (0 self)
 Add to MetaCart
Java source code is strongly typed, but the translation from Java source to bytecode omits much of the type information originally contained within methods. Type elaboration is a technique for reconstructing strongly typed programs from incompletely typed bytecode by inferring types for local variables. There are situations where, technically, there are not enough types in the original type hierarchy to type a bytecode program. Subtype completion is a technique for adding necessary types to an arbitrary type hierarchy to make type elaboration possible for all verifiable Java bytecode. Type elaboration with subtype completion has been implemented as part of the Marmot Java compiler.