## Inferring Recursive Data Types (0)

Citations: | 5 - 0 self |

### BibTeX

@TECHREPORT{Mcallester_inferringrecursive,

author = {David Mcallester},

title = {Inferring Recursive Data Types},

institution = {},

year = {}

}

### Years of Citing Articles

### OpenURL

### Abstract

. This paper contains five results on the problem of inferring types. The first is that type inference over recursive types with unions and data constructors can be done in cubic time using a flow analysis. The second is a general theorem characterizing the time complexity of bottom-up logic programs. The O(n 3 ) running time of the flow analysis is a corollary of this bottom-up run time theorem. The third is that for shallow case statements typability by the semantic types of Aiken, Wimmers and Lakshman is equivalent to typability by recursive types and hence can be determined by flow analysis. The fourth is that, even for first order programs of arity one, typability by recursive types is PSPACE hard for polymorphic programs. The final result is that for any fixed bound on order and arity Hindley-Milner typability can be determined in pseudo-linear time, i.e., O(nff(n)) where ff is the inverse Ackerman function. The last two results suggest that let-polymorphism over s...

### Citations

985 | A Theory of Type Polymorphism in Programming
- Milner
- 1978
(Show Context)
Citation Context ...essed by recursive types involving unions and data constructors. The problem of inferring recursive types can be understood in the context of the more traditional Hindley-Milner type inference system =-=[21, 11]-=-. In the Hindley-Milner system data constructors must have user-specified types such as the following. NIL : 8oe (oe)list; CONS : 8oe oe \Theta (oe)list ! (oe)list Here we are interested in the proble... |

314 | Subtyping Recursive Types
- Amadio, Cardelli
- 1993
(Show Context)
Citation Context ...includes data constructors and union types. It can also be viewed as an extension of the recently established equivalence between flow analysis and recursive types in the absence of data constructors =-=[5, 25, 13, 26]. Here we -=-formulate flow analysis as a process of computing a directed graph on the subexpressions of the input where u ! w means that w is a "possible value" of u. A program is typable by flow analys... |

224 | Type inclusion constraints and type inference
- Aiken, Wimmers
- 1993
(Show Context)
Citation Context ... Declarationfree type inference, and the synthesis of recursive types, has been explored both in the context of logic programming, e.g., [22, 14, 10, 16], and in the context of functional programming =-=[23, 1, 2, 12]-=-. Declaration-free type inference has two advantages over Hindley-Milner types. First, it can be used for languages, such as Scheme, where type declarations are not provided. Second it allows the same... |

207 |
HOL: A proof generating system for higher-order logic
- Gordon
- 1987
(Show Context)
Citation Context ...essed by recursive types involving unions and data constructors. The problem of inferring recursive types can be understood in the context of the more traditional Hindley-Milner type inference system =-=[21, 11]-=-. In the Hindley-Milner system data constructors must have user-specified types such as the following. NIL : 8oe (oe)list; CONS : 8oe oe \Theta (oe)list ! (oe)list Here we are interested in the proble... |

192 | Soft typing with conditional types
- Aiken, Wimmers, et al.
- 1994
(Show Context)
Citation Context ... Declarationfree type inference, and the synthesis of recursive types, has been explored both in the context of logic programming, e.g., [22, 14, 10, 16], and in the context of functional programming =-=[23, 1, 2, 12]-=-. Declaration-free type inference has two advantages over Hindley-Milner types. First, it can be used for languages, such as Scheme, where type declarations are not provided. Second it allows the same... |

141 | Type inference with polymorphic recursion
- Henglein
- 1993
(Show Context)
Citation Context ...olymorphism for simple types. Henglein has shown that, for any given bound b on the size of types, the problem of determining Hindley-Milner typability by types of size b is polynomial time decidable =-=[15]-=-. This immediately implies that for any bound on order and arity Hindley-Milner typability is polynomial time decidable. Here we give a more refined result --- typability by types of size b can be det... |

128 |
An Ideal Model for Recursive Polymorphic Types
- MacQueen, Plotkin, et al.
- 1986
(Show Context)
Citation Context ...he more general theorem. The third result relates the flow analysis type inference algorithm to the semantic type system given by Aiken, Wimmers and Lakshman [1, 2]. They take an ideal model of types =-=[19]-=- in which semantic types are defined to be certain subsets of a semantic domain. A program is typable by semantic types if every subexpression can be assigned a semantic type satisfying certain constr... |

97 | A finite presentation theorem for approximating logic programs
- Heintze, Jaffar
- 1990
(Show Context)
Citation Context ...rogram without declarations for data constructors such as CONS. Declarationfree type inference, and the synthesis of recursive types, has been explored both in the context of logic programming, e.g., =-=[22, 14, 10, 16]-=-, and in the context of functional programming [23, 1, 2, 12]. Declaration-free type inference has two advantages over Hindley-Milner types. First, it can be used for languages, such as Scheme, where ... |

90 | A type system equivalent to flow analysis
- Palsberg, O’Keefe
- 1995
(Show Context)
Citation Context ...includes data constructors and union types. It can also be viewed as an extension of the recently established equivalence between flow analysis and recursive types in the absence of data constructors =-=[5, 25, 13, 26]. Here we -=-formulate flow analysis as a process of computing a directed graph on the subexpressions of the input where u ! w means that w is a "possible value" of u. A program is typable by flow analys... |

77 |
Towards a theory of types in Prolog
- Mishra
- 1984
(Show Context)
Citation Context ...rogram without declarations for data constructors such as CONS. Declarationfree type inference, and the synthesis of recursive types, has been explored both in the context of logic programming, e.g., =-=[22, 14, 10, 16]-=-, and in the context of functional programming [23, 1, 2, 12]. Declaration-free type inference has two advantages over Hindley-Milner types. First, it can be used for languages, such as Scheme, where ... |

72 | Set constraints are the monadic class
- Bachmair, Ganzinger, et al.
- 1993
(Show Context)
Citation Context ...ion type ff ! fi where ff contains (but need not equal) the type of e. The semantic view of type inference has, to a large extent, motivated recent work on solving systems of semantic set constraints =-=[3, 7, 4, 8, 9]-=-. Here we show that for monomorphic programs with shallow case statements typability in the Aiken-Wimmers-Lakshmansystem is equivalent to typability by the flow analysis discussed above. For monomorph... |

67 | The complexity of set constraints - Aiken, Kozen, et al. - 1993 |

59 |
Declaration-free type checking
- Mishra, Reddy
- 1985
(Show Context)
Citation Context ... Declarationfree type inference, and the synthesis of recursive types, has been explored both in the context of logic programming, e.g., [22, 14, 10, 16], and in the context of functional programming =-=[23, 1, 2, 12]-=-. Declaration-free type inference has two advantages over Hindley-Milner types. First, it can be used for languages, such as Scheme, where type declarations are not provided. Second it allows the same... |

52 | Decidability of systems of set constraints with negative constraints
- Aiken, Kozen, et al.
- 1995
(Show Context)
Citation Context ...ion type ff ! fi where ff contains (but need not equal) the type of e. The semantic view of type inference has, to a large extent, motivated recent work on solving systems of semantic set constraints =-=[3, 7, 4, 8, 9]-=-. Here we show that for monomorphic programs with shallow case statements typability in the Aiken-Wimmers-Lakshmansystem is equivalent to typability by the flow analysis discussed above. For monomorph... |

50 |
Deciding ML typability is complete for deterministic exponential time
- Mairson
- 1990
(Show Context)
Citation Context ...nential time flow typability is exponential time decidable. Even for simple types, the problem of determining polymorphic typability (typability of the let-expansion) is complete for exponential time =-=[20, 18]-=-. So one could argue that monomorphic analysis of the letexpansion is the best that can be done. However, we show in section 9 that for any fixed bound on order and arity, the Hindley-Milner type infe... |

49 | Control-flow analysis and type systems - Heintze - 1995 |

45 |
Set Based Analysis of ML Programs
- Heintze
- 1993
(Show Context)
Citation Context |

34 |
Data flow analysis and type recovery in Scheme
- Shivers
- 1991
(Show Context)
Citation Context ...c type inference for recursive types. The type inference procedure based on flow analysis is related to the set based analysis methods of Heintze [12]. The analysis is also similar to that of Shivers =-=[27]-=- or Jagannathan and Write [17] but includes data constructors and union types. It can also be viewed as an extension of the recently established equivalence between flow analysis and recursive types i... |

33 | Negative set constraints with equality
- Charatonik, Pacholski
- 1994
(Show Context)
Citation Context ...ion type ff ! fi where ff contains (but need not equal) the type of e. The semantic view of type inference has, to a large extent, motivated recent work on solving systems of semantic set constraints =-=[3, 7, 4, 8, 9]-=-. Here we show that for monomorphic programs with shallow case statements typability in the Aiken-Wimmers-Lakshmansystem is equivalent to typability by the flow analysis discussed above. For monomorph... |

32 | Set constraints with projections are in NEXPTIME
- Charatonik, Pacholski
- 1994
(Show Context)
Citation Context |

24 | Type analysis of prolog using type graphs
- Hentenryck, Cortesi, et al.
- 1995
(Show Context)
Citation Context ...rogram without declarations for data constructors such as CONS. Declarationfree type inference, and the synthesis of recursive types, has been explored both in the context of logic programming, e.g., =-=[22, 14, 10, 16]-=-, and in the context of functional programming [23, 1, 2, 12]. Declaration-free type inference has two advantages over Hindley-Milner types. First, it can be used for languages, such as Scheme, where ... |

7 |
Eyal Yardeni. Logic programs as types for logic programs
- Fruhwirth, Shapiro, et al.
- 1991
(Show Context)
Citation Context |

3 |
ML typability is DEXPTIME complete
- Kfoury, Tiuryn, et al.
- 1990
(Show Context)
Citation Context ...nential time flow typability is exponential time decidable. Even for simple types, the problem of determining polymorphic typability (typability of the let-expansion) is complete for exponential time =-=[20, 18]-=-. So one could argue that monomorphic analysis of the letexpansion is the best that can be done. However, we show in section 9 that for any fixed bound on order and arity, the Hindley-Milner type infe... |

2 |
Effective flow analysis for avoiding run time checks
- Jagannathan, Write
- 1995
(Show Context)
Citation Context ... types. The type inference procedure based on flow analysis is related to the set based analysis methods of Heintze [12]. The analysis is also similar to that of Shivers [27] or Jagannathan and Write =-=[17]-=- but includes data constructors and union types. It can also be viewed as an extension of the recently established equivalence between flow analysis and recursive types in the absence of data construc... |

2 |
Constraned types and their expressivelness. Transactions on Programming Languages and Systems
- Palsberg, Smith
(Show Context)
Citation Context ...includes data constructors and union types. It can also be viewed as an extension of the recently established equivalence between flow analysis and recursive types in the absence of data constructors =-=[5, 25, 13, 26]. Here we -=-formulate flow analysis as a process of computing a directed graph on the subexpressions of the input where u ! w means that w is a "possible value" of u. A program is typable by flow analys... |