## Type Inference with Recursive Types AT DIFFERENT RANKS (1999)

### BibTeX

@MISC{Pericas-Geertsen99typeinference,

author = {Santiago M. Pericas-Geertsen},

title = {Type Inference with Recursive Types AT DIFFERENT RANKS},

year = {1999}

}

### OpenURL

### Abstract

We consider a polymorphic type system (System F) with recursive types for the lambda calculus with constants. We use Leivant’s notion of rank to delimit the boundaries for decidable and undecidable type inference in our system. More precisely, we show that type inference in our system is undecidable at rank k ≥ 3. Similar results are known to hold for System F without recursive types. Our undecidability result is obtained by a reduction from a particular adaptation of the semi-unification problem (so-called “regular semi-unification”) whose undecidability is, interestingly, obtained by methods totally different from those used in the case of standard (or finite) semi-unification. Type inference for a rank-1 restriction of our system is known to be decidable. A simple modification to the way unification is performed (so-called “regular unification”) is all that is required. We also conjecture that type inference at rank-2 is decidable and equivalent to finding regular solutions for instances of a particular form of semi-unification known as “acyclic semi-unification”.

### Citations

1615 |
The Java Language Specification
- Team, Gosling, et al.
- 1996
(Show Context)
Citation Context ...y or may not be possible, depending on the language and the typing rules. When it is, type inference turns untyped programs into strongly typed ones. Modern languages such as Haskell [PJHH+ 93], Java =-=[GJS96]-=-, and ML [MTHM90] were all designed with strong typing in mind. Java requires programs to be explicitly type annotated while Haskell and ML (both based on the Hindley/Milner type system) provide type ... |

936 | A theory of type polymorphism in progra.mming
- Milner
- 1978
(Show Context)
Citation Context ...formation from untyped or partially typed programs, plays an increasingly important role in the static analysis of computer programs. Originally devised by Hindley [Hin69] and independently by Milner =-=[Mil78]-=-, it has found its way into the design of several recent programming languages. 1 Type inference may or may not be possible, depending on the language and the typing rules. When it is, type inference ... |

605 |
The Definition of Standard ML (Revised
- Milner, Tofte, et al.
- 1997
(Show Context)
Citation Context ...possible, depending on the language and the typing rules. When it is, type inference turns untyped programs into strongly typed ones. Modern languages such as Haskell [PJHH+ 93], Java [GJS96], and ML =-=[MTHM90]-=- were all designed with strong typing in mind. Java requires programs to be explicitly type annotated while Haskell and ML (both based on the Hindley/Milner type system) provide type inference mechani... |

305 | Subtyping recursive types
- Amadio, Cardelli
- 1993
(Show Context)
Citation Context ...oid naming the variables ♥, ♦ and △ to avoid cluttering the notation later. All that matters about ♥ is that if S is a solution of Γx then S(x) and S(F (x1, △,x2)) are equal. Other authors have shown =-=[AC93]-=- that every t ∈T Σ reg can be finitely (but not uniquely) represented using a recursive binder like µ. For the sake of the argument, let us define Treg as the least set satisfying the following equati... |

154 |
The Lambda Calculus: its Syntax and Semantics. NorthHolland, revised edition
- Barendregt
- 1984
(Show Context)
Citation Context ....24 Note that the undecidability of Λ µ 3 is not the result of having FIX as an operator. In fact, FIX can be easily encoded as a pure lambda term typable in Λ µ 1 ⊂ Λµ 3 . One such encoding is from =-=[Bar84]-=-, where FIX =(λx.λy.y(xxy))(λx.λy.y(xxy)). It is easy to verify that this encoding is indeed typable in Λ µ 1 and that the intended semantics are preserved, i.e., (FIX M) reduces to (M(FIX M)). 5 Type... |

142 | Fundamental properties of infinite trees - Courcelle - 1983 |

142 |
The principal type-scheme of an object in combinatory logic
- Hindley
- 1969
(Show Context)
Citation Context ...s of automatically inferring type information from untyped or partially typed programs, plays an increasingly important role in the static analysis of computer programs. Originally devised by Hindley =-=[Hin69]-=- and independently by Milner [Mil78], it has found its way into the design of several recent programming languages. 1 Type inference may or may not be possible, depending on the language and the typin... |

126 | An ideal model for recursive polymorphic types - MacQueen, Plotkin, et al. - 1986 |

120 | The Glasgow Haskell compiler: A technical overview - Jones, Hall, et al. - 1993 |

93 | What are principal typings and what are they good for
- Jim
- 1996
(Show Context)
Citation Context ...our systems: It is common to all type systems (most notably, System F) involving universal types at ranks ≥ 1. The importance of a substitution-based principality property in practice is discussed in =-=[Jim96]-=-. • Investigate the relationship between our systems, based on universal types and recursive types, to derive types for recursive definitions and the systems proposed by Jim, based on intersection typ... |

85 |
Polymorphic Type Inference
- Leivant
- 1983
(Show Context)
Citation Context ...work is to delimit the boundaries for decidable and undecidable type inference in a system combining recursive types and universal types. For this purpose, the notion of rank previously introduced by =-=[Lei83]-=- for System F is used. More specifically, we show that type inference is undecidable for any rank k ≥ 3. 2In general, the decision problem of whether a program variable is assigned a zero (or any othe... |

78 | A direct algorithm for type inference in the rank-2 fragment of the second-order λ-calculus - Kfoury, Wells - 1994 |

76 | Basic simple type theory - Hindley - 1997 |

75 | Recursive unsolvability of a problem of Thue - Post |

55 |
Type reconstruction in the presence of polymorphic recursion
- Kfoury, Tiuryn, et al.
- 1993
(Show Context)
Citation Context ...nstruct a term MΓ ∈L fix such that MΓ is typable in Λ µ,fix 1 if and only if Γ has a regular solution. Hence, it is undecidable whether an arbitrary term in L fix is typable in Λ µ,fix 1 . Proof. See =-=[KTU93a]-=- for a detailed proof of the equivalence between type inference in Λ µ,fix 1 and the semi-unification problem. 4 Type Inference in Λ µ 3 We show that type inference in the system Λ µ 3 =∆λ 3 ∪ ∆ C 3 ∪... |

54 |
The undecidability of the semi-unification problem
- Kfoury, Tiuryn, et al.
- 1990
(Show Context)
Citation Context ...the following: • The undecidability of the regular semi-unification problem that, interestingly, calls for methods entirely different from those used for the undecidability of finite semi-unification =-=[KTU93b]-=-. For the result in this paper, we use a reduction from the word problem for finitely generated monoids which we have adapted from a similar encoding of the same word problem into “feature algebras” i... |

42 | Type inference with recursive types: Syntax and semantics - Cardone, Coppo - 1991 |

41 |
P.Urcyczyn: An Analysis of ML-Typability
- Kfoury
- 1990
(Show Context)
Citation Context ...ursive types is polynomial-time equivalent to finding regular solutions for instances of acyclic semi-unification. Many of the ideas already used to handle the finite case of acyclic semi-unification =-=[KTU94]-=- are used again in the regular case of the same problem. As a result, whether an instance of acyclic semi-unification has a regular solution (and, therefore, whether a program is typable with rank-2 r... |

35 |
On subsumption and semi-unification in feature algebras
- Dörre, Rounds
- 1989
(Show Context)
Citation Context ...er, we use a reduction from the word problem for finitely generated monoids which we have adapted from a similar encoding of the same word problem into “feature algebras” in computational linguistics =-=[DR92]-=-. • For every k ≥ 3, type inference with rank-k recursive types is shown to be undecidable. This is based on a sequence of reductions from the (unrestricted) regular semi-unification problem to the pr... |

26 | Rank 2 type systems and recursive definitions
- Jim
- 1993
(Show Context)
Citation Context ... Investigate the relationship between our systems, based on universal types and recursive types, to derive types for recursive definitions and the systems proposed by Jim, based on intersection types =-=[Jim95]-=-. • Consider the addition of “objects” to our source language. Recursive types can be used to find expressive types for objects returning or updating self. A rank-1 inference algorithm including objec... |

9 |
The word problem for certain classes of semigroups, Algebra and Logic 5
- GUREVICH
- 1966
(Show Context)
Citation Context ...cture is a monoid instead of a semigroup. In fact, the word problem remains undecidable in this case too. Lemma 3.4 (Word problem for monoids). The word problem for monoids is undecidable. Proof. See =-=[Gur66]-=-. 3.2 Undecidability of Λ µ,fix 1 The terms we use in this section are defined over the signature Σ = {F }∪Q containing a single ternary function symbol F and a set of constants Q. WewriteTΣfor the se... |