# Efficient Type Checking for Path Polymorphism

**Authors:** Juan Edi, Andr\'es Viso, Eduardo Bonelli

arXiv: 1704.09026 · 2020-06-30

## TL;DR

This paper introduces a type-checking algorithm for a complex type system supporting path polymorphism, combining recursive, union, and application types, with a focus on efficiency and correctness.

## Contribution

It presents two algorithms for type equivalence and subtyping, including a polynomial-time automata-based method, improving the practicality of type checking for path polymorphism.

## Key findings

- Automata-based algorithm achieves polynomial-time complexity.
- Coinductive characterizations underpin the type equivalence and subtyping algorithms.
- Syntax-directed presentation proven equivalent to original system.

## Abstract

A type system combining type application, constants as types, union types (associative, commutative and idempotent) and recursive types has recently been proposed for statically typing path polymorphism, the ability to define functions that can operate uniformly over recursively specified applicative data structures. A typical pattern such functions resort to is $x\,y$ which decomposes a compound, in other words any applicative tree structure, into its parts. We study type-checking for this type system in two stages. First we propose algorithms for checking type equivalence and subtyping based on coinductive characterizations of those relations. We then formulate a syntax-directed presentation and prove its equivalence with the original one. This yields a type-checking algorithm which unfortunately has exponential time complexity in the worst case. A second algorithm is then proposed, based on automata techniques, which yields a polynomial-time type-checking algorithm.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1704.09026/full.md

## Figures

18 figures with captions in the complete paper: https://tomesphere.com/paper/1704.09026/full.md

## References

21 references — full list in the complete paper: https://tomesphere.com/paper/1704.09026/full.md

---
Source: https://tomesphere.com/paper/1704.09026