Results 1 - 10
of
24
Efficient Inference of Object Types
, 1995
"... Abadi and Cardelli have recently investigated a calculus of objects [2]. The calculus supports a key feature of object-oriented languages: an object can be emulated by another object that has more refined methods. Abadi and Cardelli presented four first-order type systems for the calculus. The simpl ..."
Abstract
-
Cited by 52 (6 self)
- Add to MetaCart
Abadi and Cardelli have recently investigated a calculus of objects [2]. The calculus supports a key feature of object-oriented languages: an object can be emulated by another object that has more refined methods. Abadi and Cardelli presented four first-order 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 Higher-Order Polymorphic Multi-Methods
, 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 class-based objectoriented programming and higher-order multi-methods in the tradition of CLOS [12]. Inste ..."
Abstract
-
Cited by 49 (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 class-based objectoriented programming and higher-order multi-methods in the tradition of CLOS [12]. Instead of using extensible records as a foundation for object-oriented extensions of functional languages, we propose to reinterpret ML datatype declarations as abstract and concrete class declarations, and to replace pattern matching on run-time values by dynamic dispatch on run-time 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 multi-methods, 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 40 (1 self)
- Add to MetaCart
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 3-address, 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 30 (6 self)
- Add to MetaCart
In this paper, we present an efficient and practical algorithm for inferring static types for local variables in a 3-address, 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 NP-hard. 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
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 coNP-complete. ffl deciding C j= ff fi for consistent, atomic C and ff; fi atomic can be done in linear time. The structural lower (coNP-hardness) and upper (membership in coNP) bounds as well as the optimal algorithm for atomic entailment are new. The coNP-hardness result indicates that entailment is strictly harder than satisfiability, which is known to be in PTIME for lattices of base types. The proof of coNP-completeness 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...
On the theory of structural subtyping
, 2003
"... We show that the first-order theory of structural subtyping of non-recursive 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
We show that the first-order theory of structural subtyping of non-recursive 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 Σ-term-power of C, which generalizes the structure arising in structural subtyping. The domain of the Σ-term-power of C is the set of Σ-terms over the set of elements of C. We show that the decidability of the first-order theory of C implies the decidability of the first-order theory of the Σterm-power of C. This result implies the decidability of the first-order theory of structural subtyping of non-recursive types.
Satisfying Subtype Inequalities in Polynomial Space
, 1997
"... This paper studies the complexity of type inference in lambda-calculus 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 18 (0 self)
- Add to MetaCart
This paper studies the complexity of type inference in lambda-calculus 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 PSPACE-complete. 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.
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 16 (0 self)
- Add to MetaCart
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.
Constraint Automata and the Complexity of Recursive Subtype Entailment
- In Proceedings of the 25th International Colloquium on Automata, Languages, and Programming (ICALP
, 1998
"... . We study entailment of structural and nonstructural recursive subtyping constraints. Constraints are formal inequalities between type expressions, interpreted over an ordered set of possibly infinite labeled trees. The nonstructural ordering on trees is the one introduced by Amadio and Cardelli fo ..."
Abstract
-
Cited by 15 (0 self)
- Add to MetaCart
. We study entailment of structural and nonstructural recursive subtyping constraints. Constraints are formal inequalities between type expressions, interpreted over an ordered set of possibly infinite labeled trees. The nonstructural ordering on trees is the one introduced by Amadio and Cardelli for subtyping with recursive types. The structural ordering compares only trees with common shape. A constraint set entails an inequality if every assignment of meanings (trees) to type expressions that satisfies all the constraints also satisfies the inequality. In this paper we prove that nonstructural subtype entailment is PSPACEhard, both for finite trees (simple types) and infinite trees (recursive types). For the structural ordering we prove that subtype entailment over infinite trees is PSPACE-complete, when the order on trees is generated from a lattice of type constants. Since structural subtype entailment over finite trees has been shown to be coNP-complete these are the first comple...

