## Algorithmic Aspects of Type Inference With Subtypes (1992)

Venue: | In Conference Record of the Nineteenth Annual ACM Symposium on Principles of Programming Languages |

Citations: | 27 - 0 self |

### BibTeX

@INPROCEEDINGS{Lincoln92algorithmicaspects,

author = {Patrick Lincoln and John C. Mitchell},

title = {Algorithmic Aspects of Type Inference With Subtypes},

booktitle = {In Conference Record of the Nineteenth Annual ACM Symposium on Principles of Programming Languages},

year = {1992},

pages = {293--304},

publisher = {ACM}

}

### Years of Citing Articles

### OpenURL

### Abstract

We study the complexity of type inference for programming languages with subtypes. There are three language variations that effect the problem: (i) basic functions may have polymorphic or more limited types, (ii) the subtype hierarchy may be fixed or vary as a result of subtype declarations within a program, and (iii) the subtype hierarchy may be an arbitrary partial order or may have a more restricted form, such as a tree or lattice. The naive algorithm for inferring a most general polymorphic type, under variable subtype hypotheses, requires deterministic exponential time. If we fix the subtype ordering, this upper bound grows to nondeterministic exponential time. We show that it is np-hard to decide whether a lambda term has a type with respect to a fixed subtype hierarchy (involving only atomic type names). This lower bound applies to monomorphic or polymorphic languages. We give pspace upper bounds for deciding polymorphic typability if the subtype hierarchy has a lattice structur...

### Citations

1535 | Object-oriented software construction - Meyer - 1997 |

98 |
Type inference with simple subtypes
- Mitchell
- 1991
(Show Context)
Citation Context ...ation that we will not discuss in any detail is that there is some coercion function f oe! which transforms values of type oe into values of types. Some discussion of this alternative may be found in =-=[Mit91]-=-. An atomic subtype assertion is a statement asb , where a and b are either type variables or type constants. All of our subtyping hypotheses will be atomic. Without this assumption, subtyping hypothe... |

83 |
A simple algorithm and proof for type inference
- Wand
- 1987
(Show Context)
Citation Context ...e left incomplete. Next the DAG representation of the Curry-type of the term is computed, as if the type of each constant and variable were renamed with new type variables at each leaf occurrence. In =-=[Wan87]-=- an algorithm similar to ours up to this point is presented. However, in our algorithm, the Sub rule presents a new kind of relation, and we actually solve the equations generated by the algorithm in ... |

78 |
Type inference with subtypes
- Fuh, Mishra
- 1988
(Show Context)
Citation Context ...cribes the set of possible typings with respect to any subtype hierarchy. Various aspects of the algorithm have been studied by other authors, with Fuh and Mishra elaborating algorithmic alternatives =-=[FM90]-=- and Wand and O'Keefe studying the computational complexity of typability [WO89]. An extension with polymorphic record operations [JM88] has been implemented by Jategaonkar [Jat89]. Unfortunately, the... |

49 | ML with extended pattern matching and subtypes
- Jategaonkar, Mitchell
- 1988
(Show Context)
Citation Context ...rithmic alternatives [FM90] and Wand and O'Keefe studying the computational complexity of typability [WO89]. An extension with polymorphic record operations [JM88] has been implemented by Jategaonkar =-=[Jat89]-=-. Unfortunately, the straightforward implementation of the type inference algorithm with subtypes requires exponential time, even in the absence of polymorphic let declarations (see [KMM91]). This may... |

43 | Unification and ML Type Reconstruction
- Kanellakis, Mairson, et al.
- 1991
(Show Context)
Citation Context ...ategaonkar [Jat89]. Unfortunately, the straightforward implementation of the type inference algorithm with subtypes requires exponential time, even in the absence of polymorphic let declarations (see =-=[KMM91]-=-). This may be an obstacle to practical type inference for object-oriented languages. It is therefore important to investigate the inherent complexity of type inference and type checking in the presen... |

38 |
Coercion and type inference (summary
- Mitchell
- 1984
(Show Context)
Citation Context ...o signature \Sigma = hB; S; T i if all of the term constants in M appear in T and all uses of Const and Sub in the derivation of the typing statment are in accordance with the signature. As stated in =-=[Mit84]-=- and proved in [Mit91], one may normalize proofs of typing statements so that the only uses of the Sub rule are immediately following uses Var and Const. That is, the steps in any proof of a typing st... |

24 | The C++ programming language - Stroustrop - 1986 |

17 | Satisfiability of Inequalities in a Poset
- Pratt, Tiuryn
- 1996
(Show Context)
Citation Context ...her. Theorem 4.3 F3, F2, and F1 are np-hard. Proof. F3 is np-hard from the above two lemmas, and F2 and F1 are conservative over F3, so the result follows immediately. Recent work by Pratt and Tiuryn =-=[PT91]-=- has shown that po-sat remains np-complete for certain fixed posets. Our construction builds a different poset and set of inequations for each 3-sat problem. Pratt's construction builds a different se... |

14 |
On the complexity of type inference with coercion
- Wand, O’Keefe
- 1989
(Show Context)
Citation Context ...s aspects of the algorithm have been studied by other authors, with Fuh and Mishra elaborating algorithmic alternatives [FM90] and Wand and O'Keefe studying the computational complexity of typability =-=[WO89]-=-. An extension with polymorphic record operations [JM88] has been implemented by Jategaonkar [Jat89]. Unfortunately, the straightforward implementation of the type inference algorithm with subtypes re... |

6 |
BCK-combinators and linear -terms have types
- Hindley
- 1989
(Show Context)
Citation Context ...lgorithm in [Wan87] with unification, producing a DAG which represents the types of all subterms. Note that the unifications performed at this step never fail, due to type renaming, as is the case in =-=[Hin89]. At each -=-leaf a constraint oesis generated by the Sub rule, which we encode as a "dashed" arc on the DAG. Note that these inequalities (represented by dashed arcs) may involve terms such as ff ! fi c... |

1 |
Solving term inequalities is pspacehard
- Tiuryn
- 1991
(Show Context)
Citation Context ... [WO89], which requires a constant with a polymorphic type. We also observe that if type parameters and subtype assumptions are given explicitly in the syntax of terms, it follows from the results in =-=[Tiu91]-=- that deciding whether an explicitly-typed term has a type is pspace hard. We give two algorithms for the decision problem. The more general algorithm applies to terms with arbitrary constants, but as... |