Skip to main content
QUICK REVIEW

[Paper Review] Subtyping on Nested Polymorphic Session Types

Ankush Das, Henry DeYoung|arXiv (Cornell University)|Mar 28, 2021
Logic, programming, and type systemsComputer Science37 references5 citations
TL;DR

This paper investigates subtyping in a system of nested, recursive, and polymorphic session types with coinductive type interpretation, proving that subtyping is undecidable even in a minimal fragment with only internal choices and unary recursive type constructors. Despite this undecidability, the authors present a sound, incomplete subtyping algorithm that supports programmer-provided subtyping declarations to enhance completeness, and implement it in the Rast language with strong empirical performance.

ABSTRACT

The importance of subtyping to enable a wider range of well-typed programs is undeniable. However, the interaction between subtyping, recursion, and polymorphism is not completely understood yet. In this work, we explore subtyping in a system of nested, recursive, and polymorphic types with a coinductive interpretation, and we prove that this problem is undecidable. Our results will be broadly applicable, but to keep our study grounded in a concrete setting, we work with an extension of session types with explicit polymorphism, parametric type constructors, and nested types. We prove that subtyping is undecidable even for the fragment with only internal choices and nested unary recursive type constructors. Despite this negative result, we present a subtyping algorithm for our system and prove its soundness. We minimize the impact of the inescapable incompleteness by enabling the programmer to seed the algorithm with subtyping declarations (that are validated by the algorithm). We have implemented the proposed algorithm in Rast and it showed to be efficient in various example programs.

Motivation & Objective

  • To investigate the interaction between subtyping, recursion, and polymorphism in a coinductively interpreted type system with nested types.
  • To determine whether subtyping remains decidable in the presence of nested recursive type constructors and explicit polymorphism.
  • To design a practical, sound, and extensible subtyping algorithm despite undecidability.
  • To enable efficient and correct type checking in a concurrent, linear, session-typed language like Rast through subtyping.
  • To explore the feasibility of integrating programmer-provided subtyping declarations to improve algorithmic completeness.

Proposed method

  • The authors formalize a type system with equirecursive, structural, and coinductively interpreted nested recursive types, explicit polymorphism, and parametric type constructors.
  • They prove undecidability of subtyping via a reduction from the language inclusion problem for BPA automata, even in a minimal fragment with only internal choice and unary recursion.
  • The proposed subtyping algorithm is based on Gay and Hole's simulation technique for session types, extended with constructor variance analysis and circular proof construction.
  • The algorithm supports incremental extension through programmer-provided subtyping declarations (validated by the algorithm), which seed the subtyping simulation and improve completeness.
  • The algorithm is implemented in Rast, a language with bidirectional type checking and explicit polymorphism, enabling direct reduction of type checking to subtyping.
  • The system uses coinductive hypotheses and equates types based on observable communication behavior, aligning with session type semantics.

Experimental results

Research questions

  • RQ1Is subtyping decidable in a system combining nested recursive types, explicit polymorphism, and coinductive type interpretation?
  • RQ2What is the impact of nesting and unary recursion on the decidability of subtyping in the presence of polymorphism?
  • RQ3Can a sound and practical subtyping algorithm be designed despite undecidability in the general case?
  • RQ4How can programmer-provided declarations be effectively integrated to improve algorithmic completeness?
  • RQ5To what extent can the algorithm be adapted to mixed inductive/coinductive subtyping or implicit polymorphism?

Key findings

  • Subtyping is undecidable in the fragment with only internal choices and nested unary recursive type constructors, even without function types or product types.
  • The undecidability result holds under coinductive interpretation, and the proof relies on a reduction from the language inclusion problem for BPA automata.
  • The proposed subtyping algorithm is sound and efficiently handles a wide range of example programs in the Rast language.
  • The algorithm's completeness can be incrementally improved by programmer-provided declarations, which are validated and integrated into the subtyping simulation.
  • The algorithm remains sound even when types are interpreted inductively, though it may miss some empty type identifications.
  • The system demonstrates that subtyping can be practically applied in session-typed concurrent programs, with strong empirical performance in the Rast implementation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.