Results 1 - 10
of
10
Type Inference with Polymorphic Recursion
- ACM Transactions on Programming Languages and Systems
, 1991
"... The Damas-Milner Calculus is the typed -calculus underlying the type system for ML and several other strongly typed polymorphic functional languages such as Miranda 1 and Haskell. Mycroft has extended its problematic monomorphic typing rule for recursive definitions with a polymorphic typing ru ..."
Abstract
-
Cited by 129 (0 self)
- Add to MetaCart
The Damas-Milner Calculus is the typed -calculus underlying the type system for ML and several other strongly typed polymorphic functional languages such as Miranda 1 and Haskell. Mycroft has extended its problematic monomorphic typing rule for recursive definitions with a polymorphic typing rule. He proved the resulting type system, which we call the Milner-Mycroft Calculus, sound with respect to Milner's semantics, and showed that it preserves the principal typing property of the Damas-Milner Calculus. The extension is of practical significance in typed logic programming languages and, more generally, in any language with (mutually) recursive definitions. In this paper we show that the type inference problem for the Milner-Mycroft Calculus is log-space equivalent to semi-unification, the problem of solving subsumption inequations between first-order terms. This result has been proved independently by Kfoury, Tiuryn, and Urzyczyn. In connection with the recently establish...
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.
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.
Rank 2 Intersection Type Assignment in Term Rewriting Systems
, 1996
"... A notion of type assignment on Curryfied Term Rewriting Systems is introduced that uses Intersection Types of Rank 2, and in which all function symbols are assumed to have a type. Type assignment will consist of specifying derivation rules that describe how types can be assigned to terms, using the ..."
Abstract
-
Cited by 21 (13 self)
- Add to MetaCart
A notion of type assignment on Curryfied Term Rewriting Systems is introduced that uses Intersection Types of Rank 2, and in which all function symbols are assumed to have a type. Type assignment will consist of specifying derivation rules that describe how types can be assigned to terms, using the types of function symbols. Using a modified unification procedure, for each term the principal pair (of basis and type) will be defined in the following sense: from these all admissible pairs can be generated by chains of operations on pairs, consisting of the operations substitution, copying, and weakening. In general, given an arbitrary typeable CuTRS, the subject reduction property does not hold. Using the principal type for the left-hand side of a rewrite rule, a sufficient and decidable condition will be formulated that typeable rewrite rules should satisfy in order to obtain this property. Introduction In the recent years, several paradigms have been investigated for the implementatio...
Polymorphic Type Inference and Semi-Unification
, 1989
"... In the last ten years declaration-free programming languages with a polymorphic typing discipline (ML, B) have been developed to approximate the flexibility and conciseness of dynamically typed languages (LISP, SETL) while retaining the safety and execution efficiency of conventional statically type ..."
Abstract
-
Cited by 21 (2 self)
- Add to MetaCart
In the last ten years declaration-free programming languages with a polymorphic typing discipline (ML, B) have been developed to approximate the flexibility and conciseness of dynamically typed languages (LISP, SETL) while retaining the safety and execution efficiency of conventional statically typed languages (Algol68, Pascal). These polymorphic languages can be type checked at compile time, yet allow functions whose arguments range over a variety of types. We investigate several polymorphic type systems, the most powerful of which, termed Milner-Mycroft Calculus, extends the so-called let-polymorphism found in, e.g., ML with a polymorphic typing rule for recursive definitions. We show that semi-unification, the problem of solving inequalities over firstorder terms, characterizes type checking in the Milner-Mycroft Calculus to polynomial time, even in the restricted case where nested definitions are disallowed. This permits us to extend some infeasibility results for related combinato...
Type Reconstruction with First-Class Polymorphic Values
, 1989
"... We present the first type reconstruction system which combines the implicit typing of ML with the full power of the explicitly typed second-order polymorphic lambda calculus. The system will accept ML-style programs, explicitly typed programs, and programs that use explicit types for all first-class ..."
Abstract
-
Cited by 11 (0 self)
- Add to MetaCart
We present the first type reconstruction system which combines the implicit typing of ML with the full power of the explicitly typed second-order polymorphic lambda calculus. The system will accept ML-style programs, explicitly typed programs, and programs that use explicit types for all first-class polymorphic values. We accomplish this flexibility by providing both generic and explicitly-quantified polymorphic types, as well as operators which convert between these two forms of polymorphism. This type reconstruction system is an integral part of the FX-89 programming language. We present a type reconstruction algorithm for the system. The type reconstruction algorithm is proven sound and complete with respect to the formal typing rules.
Partial Type Assignment in Left Linear Applicative Term Rewriting Systems -- Theory, Applications and Implementation
, 1992
"... This paper introduces a notion of partial type assignment on left linear applicative term rewriting systems that is based on the extension defined by Mycroft of Curry’s type assignment system. The left linear applicative TRS we consider are extensions to those suggested by most functional programmin ..."
Abstract
-
Cited by 10 (9 self)
- Add to MetaCart
This paper introduces a notion of partial type assignment on left linear applicative term rewriting systems that is based on the extension defined by Mycroft of Curry’s type assignment system. The left linear applicative TRS we consider are extensions to those suggested by most functional programming languages in that they do not discriminate against the varieties of function symbols that can be used in patterns. As such there is no distinction between function symbols (such as append and plus) and constructor symbols (such as cons and succ). Terms and rewrite rules will be written as trees, and type assignment will consist of assigning types to function symbols, nodes and edges between nodes. The only constraints on this system are imposed by the relation between the type assigned to a node and those assigned to its incoming and out-going edges. We will show that every typeable term has a principal type, and formulate a needed and sufficient condition typeable rewrite rules should satisfy in order to gain preservance of types under rewriting. As an example we will show that the optimisation function performed after bracket abstraction is typeable. Finally we will present a type check algorithm that checks if rewrite rules are correctly typed, and finds the principal pair for typeable terms.
Structural Polymorphism
- Informal Proceedings Workshop on Generic Programming, WGP'98, Marstrand
, 1998
"... This paper describes structural polymorphism, a new form of type polymorphism appropriate to functional languages featuring user-defined algebraic data types (e.g., Standard ML, Haskell and Miranda 1 ). The approach extends the familiar notion of parametric polymorphism by allowing the definition of ..."
Abstract
-
Cited by 6 (0 self)
- Add to MetaCart
This paper describes structural polymorphism, a new form of type polymorphism appropriate to functional languages featuring user-defined algebraic data types (e.g., Standard ML, Haskell and Miranda 1 ). The approach extends the familiar notion of parametric polymorphism by allowing the definition of functions which are generic with respect to data structures as well as to individual types. For example, structural polymorphism accommodates generalizations of the usual length and map functions which may be applied not only to lists, but also to trees, binary trees or similar algebraic structures. Under traditional polymorphic type systems, these functions may be defined for arbitrary component types, but must be (laboriously) re-defined for every distinct data structure. In this sense, our approach also extends the spirit of parametric polymorphism, in that it provides the programmer relief from the burden of unnecessary repetitive effort. The mechanism we will use to realize this form of polymorphism is inspired by a feature familiar to functional programmers, namely the pattern abstraction. Pattern abstractions generalize the usual lambda abstraction (x.e) in that they are comprised of multiple pattern/expression clauses, rather than just a single bound-variable/expression pair. By analogy with pattern abstractions, we generalize polymorphic type abstractions (Òå.e) to type-pattern abstractions, which are comprised of multiple type-pattern/expression pairs. The types given to type-pattern abstractions are universally quantified, just as for traditional type abstractions, but the universal quantifiers are now justified by a recursive analysis of the forms of all possible type instantiations, rather than by parametric independence with respect to a type variable. (x:+.e) ...
Predicative polymorphism in π-calculus
- 6TH PARALLEL ARCHITECTURES AND LANGUAGES EUROPE, VOLUME 817 OF LNCS
, 1994
"... We present a formulation of the polyadic π-calculus featuring a syntactic category for agents, together with a typing system assigning polymorphic types to agents. The new presentation introduces an operator to express recursion, and an ML-style let-constructor allowing to associate an agent to an a ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
We present a formulation of the polyadic π-calculus featuring a syntactic category for agents, together with a typing system assigning polymorphic types to agents. The new presentation introduces an operator to express recursion, and an ML-style let-constructor allowing to associate an agent to an agentvariable, and use the latter several times in a program. The essence of the monomorphic type system is the assignment of types to names, and multiple name-type pairs to programs [14]. The polymorphic type system incorporates a form of abstraction over types, and inference rules allowing to introduce and eliminate the abstraction operator. The extended system preserves most of the syntactic properties of the monomorphic system, including subject-reduction and computability of principal typings. We present an algorithm to extract the principal typing of a process, and prove it correct with respect to the typing system. We also study, in the context of π-calculus, some well-known properties of the let-constructor.
Type Systems for Programming Languages
, 2001
"... These notes belong to the course Type Systems for Programming Languages, given to fourth year students in Computing and Joint Mathematics and Computing with some experience in reasoning and logic, and students in the Advanced Masters programme at the Department of Computing, Imperial College, London ..."
Abstract
- Add to MetaCart
These notes belong to the course Type Systems for Programming Languages, given to fourth year students in Computing and Joint Mathematics and Computing with some experience in reasoning and logic, and students in the Advanced Masters programme at the Department of Computing, Imperial College, London. The course is intended for students interested in theoretical computer science, who possess some knowledge of logic. No prior knowledge on type systems or proof techniques is assumed, other than being familiar with the principle of induction. Aims • To lay out in detail the design of type assignment systems for programming languages. • To focus on the importance of a sound theoretical framework, in order to be able to reason about properties of a typed program. • To understand the concepts of: type checking, type reconstruction, polymorphism, type derivation, typeability, typing of recursive functions, termination in the context of typeability, and undecidable systems. • To study various systems and various languages, and to compare those and to select.

