Lune

POPL2025Top-tier venue

QuickSub: Efficient Iso-Recursive Subtyping

Litao Zhou, Bruno C. d. S. Oliveira

Abstract

Many programming languages need to check whether two recursive types are in a subtyping relation. Traditionally recursive types are modelled in two different ways: equi-or iso-recursive types. While efficient algorithms for subtyping equi-recursive types are well studied for simple type systems, efficient algorithms for iso-recursive subtyping remain understudied.

In this paper we present QuickSub: an efficient and simple to implement algorithm for iso-recursive subtyping. QuickSub has the same expressive power as the well-known iso-recursive Amber rules. The worst case complexity of QuickSub is 𝑂 (𝑛𝑚), where 𝑚 is the size of the type and 𝑛 is the number of recursive binders. However, in practice, the algorithm is nearly linear with the worst case being hard to reach. Consequently, in many common cases, QuickSub can be several times faster than alternative algorithms. We validate the efficiency of QuickSub with an empirical evaluation comparing it to existing equi-recursive and iso-recursive subtyping algorithms. We prove the correctness of the algorithm and formalize a simple calculus with recursive subtyping and records. For this calculus we also show how type soundness can be proved using QuickSub. All the results have been formalized and proved in the Coq proof assistant.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Recursive Subtyping for All cites Revisiting iso-recursive subtyping
  • Mutually Iso-Recursive Subtyping cites Revisiting iso-recursive subtyping
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on7

  1. Statically verified refinements for multiparty protocolsFangyi Zhou, Francisco Ferreira, Raymond Hu, Rumyana Neykova et al.OOPSLA 2020 · 38 citations
  2. On the semantic expressiveness of recursive typesMarco Patrignani, Eric Mark Martin, Dominique DevriesePOPL 2021 · 16 citations
  3. Recursive Subtyping for AllLitao Zhou, Yaoda Zhou, Bruno C. d. S. OliveiraPOPL 2023 · 8 citations
  4. Mutually Iso-Recursive SubtypingAndreas RossbergOOPSLA 2023 · 8 citations
  5. Revisiting iso-recursive subtypingYaoda Zhou, Bruno C. d. S. Oliveira, Jinxu ZhaoOOPSLA 2020 · 6 citations

Related papers

  1. Full Iso-Recursive TypesLitao Zhou, Qianyong Wan, Bruno C. d. S. OliveiraOOPSLA 2024 · 4 citations
  2. The Simple Essence of Boolean-Algebraic Subtyping: Semantic Soundness for Algebraic Union, Intersection, Negation, and Equi-recursive TypesChun Yin Chau, Lionel ParreauxPOPL 2026 · 4 citations
  3. Parametric Subtyping for Structural Parametric PolymorphismHenry DeYoung, Andreia Mordido, Frank Pfenning, Ankush DasPOPL 2024 · 3 citations
  4. Type-level programming with match typesOlivier Blanvillain, Jonathan Immanuel Brachthäuser, Maxime Kjaer, Martin OderskyPOPL 2022 · 10 citations
  5. Undecidability of d<: and its decidable fragmentsJason Z. S. Hu, Ondrej LhotákPOPL 2020 · 9 citations
Dusk over the sea between two cliffs drawn in fine vertical lines