Type Soundness for Path Polymorphism
Preprint
Abstract
Path polymorphism is the ability to define functions that can operate uniformly over arbitrary recursively specified data structures. Its essence is captured by patterns of the form $x\,y$ which decompose a compound data structure into its parts. Typing these kinds of patterns is challenging since the type of a compound should determine the type of its components. We propose a static type system (i.e. no run-time analysis) for a pattern calculus that captures this feature. Our solution combines type application, constants as types, union types and recursive types. We address the fundamental properties of Subject Reduction and Progress that guarantee a well-behaved dynamics. Both these results rely crucially on a notion of pattern compatibility and also on a coinductive characterisation of subtyping.
Keywords
All Related Versions
This publication has 20 references indexed in Scilit:
- The Polymorphic Rewriting-calculusElectronic Notes in Theoretical Computer Science, 2005
- Subtyping Union Types2004
- Rewriting Calculus with Fixpoints: Untyped and First-Order SystemsLecture Notes in Computer Science, 2004
- Efficient Type MatchingLecture Notes in Computer Science, 2002
- Efficient and Flexible Matching of Recursive TypesInformation and Computation, 2001
- Matching Power2001
- The Rho Cube2001
- An algebraic approach to the interpretation of recursive typesLecture Notes in Computer Science, 1992
- An extension of system F with subtyping1991
- Fundamental properties of infinite treesTheoretical Computer Science, 1983