PulseExploreJournal ClubDebatesTrendingResearchersJournals
Instagram
HomeExploreJournal ClubTrending
Synapse
⌘+K
Synapse
January 1, 199243 citations

Algorithmic aspects of type inference with subtypes

View Full Paper
PLPatrick LincolnJMJohn C. Mitchell

Key Points

Key points are not available for this paper at this time.

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 infering a most general polymorphic type, undervariable 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 structure or the subtype hierarchy varies arbitrarily. We also give a polynomial time algorithm for the limited case where there are of no function constants and the type hierarchy is either variable or any fixed lattice.

Ask AI
Helpful
Bookmark
Share
View Full Paper

Cite This Study

Lincoln et al. (1992) studied this question.

synapsesocial.com/papers/6a1c70f61e0790f17da1536fhttps://doi.org/10.1145/143165.143227
Ask AI
Helpful
Bookmark
Share
View Full Paper