TY - JOUR
T1 - Typed path polymorphism
AU - Ayala-Rincón, Mauricio
AU - Bonelli, Eduardo
AU - Edi, Juan
AU - Viso, Andrés
N1 - Publisher Copyright:
© 2019
PY - 2019/8/16
Y1 - 2019/8/16
N2 - Path polymorphism enables the definition of functions uniformly applicable to arbitrary recursively specified data structures. Path polymorphic function declarations rely on patterns of the form x y (i.e. the application of two variables), which decompose a data structure into its parts. We propose a static type system for a calculus that captures this feature, combining constants as types, union types and recursive types. The fundamental properties of Subject Reduction and Progress are addressed to guarantee well-behaved dynamics; they rely crucially on a novel notion of pattern compatibility. We also introduce an efficient type-checking algorithm by formulating a syntax-directed variant of the type system. This involves algorithms for checking type equivalence and subtyping, both based on coinductive characterizations of those relations.
AB - Path polymorphism enables the definition of functions uniformly applicable to arbitrary recursively specified data structures. Path polymorphic function declarations rely on patterns of the form x y (i.e. the application of two variables), which decompose a data structure into its parts. We propose a static type system for a calculus that captures this feature, combining constants as types, union types and recursive types. The fundamental properties of Subject Reduction and Progress are addressed to guarantee well-behaved dynamics; they rely crucially on a novel notion of pattern compatibility. We also introduce an efficient type-checking algorithm by formulating a syntax-directed variant of the type system. This involves algorithms for checking type equivalence and subtyping, both based on coinductive characterizations of those relations.
KW - Path polymorphism
KW - Pattern matching
KW - Static typing
KW - Type checking
KW - λ-calculus
UR - http://www.scopus.com/inward/record.url?scp=85062917105&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85062917105&partnerID=8YFLogxK
U2 - 10.1016/j.tcs.2019.02.018
DO - 10.1016/j.tcs.2019.02.018
M3 - Article
AN - SCOPUS:85062917105
SN - 0304-3975
VL - 781
SP - 111
EP - 130
JO - Theoretical Computer Science
JF - Theoretical Computer Science
ER -