A constraint-based approach to guarded algebraic data types
- 1 January 2007
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 29 (1)
- https://doi.org/10.1145/1180475.1180476
Abstract
We study HMG(X), an extension of the constraint-based type system HM(X) with deep pattern matching, polymorphic recursion, andguarded algebraic data types. Guarded algebraic data types subsume the concepts known in the literature asindexed types,guarded recursive datatype constructors,(first-class) phantom types, andequality qualified types, and are closely related toinductive types. Their characteristic property is to allow every branch of a case construct to be typechecked under different assumptions about the type variables in scope. We prove that HMG(X) is sound and that, provided recursive definitions carry a type annotation, type inference can be reduced to constraint solving. Constraint solving is decidable, at least for some instances ofX, but prohibitively expensive. Effective type inference for guarded algebraic data types is left as an issue for future research.Keywords
This publication has 26 references indexed in Scilit:
- Stratified type inference for generalized algebraic data typesPublished by Association for Computing Machinery (ACM) ,2006
- A theory of type polymorphism in programmingPublished by Elsevier ,2003
- Intensional polymorphism in type-erasure semanticsJournal of Functional Programming, 2002
- Local type inferenceACM Transactions on Programming Languages and Systems, 2000
- Indexed typesTheoretical Computer Science, 1997
- Principal type schemes for functional programs with overloading and subtypingScience of Computer Programming, 1994
- A Syntactic Approach to Type SoundnessInformation and Computation, 1994
- Polymorphic type inference and abstract data typesACM Transactions on Programming Languages and Systems, 1994
- Type inference with polymorphic recursionACM Transactions on Programming Languages and Systems, 1993
- Equational problems anddisunificationJournal of Symbolic Computation, 1989