Skip to main content
QUICK REVIEW

[Paper Review] The Yoneda Reduction of Polymorphic Types

Paolo Pistone, Luca Tranchini|arXiv (Cornell University)|Jul 8, 2019
Logic, programming, and type systemsComputer Science32 references1 citations
TL;DR

This paper introduces Yoneda reduction, a type-rewriting system in System F that eliminates quantifiers from polymorphic types using Yoneda-type isomorphisms grounded in category theory. By leveraging parametricity and dinaturality, the method transforms quantified types into equivalent monomorphic constructions using polynomial trees and fixpoints, enabling decidability of program equivalence in certain fragments and providing a proof-theoretic method to count type inhabitants.

ABSTRACT

In this paper we explore a family of type isomorphisms in System F whose validity corresponds, semantically, to some form of the Yoneda isomorphism from category theory. These isomorphisms hold under theories of equivalence stronger than beta-eta-equivalence, like those induced by parametricity and dinaturality. We show that the Yoneda type isomorphisms yield a rewriting over types, that we call Yoneda reduction, which can be used to eliminate quantifiers from a polymorphic type, replacing them with a combination of monomorphic type constructors. We establish some sufficient conditions under which quantifiers can be fully eliminated from a polymorphic type, and we show some application of these conditions to count the inhabitants of a type and to compute program equivalence in some fragments of System F.

Motivation & Objective

  • To formalize a type-rewriting system based on Yoneda isomorphisms for eliminating quantifiers in polymorphic types.
  • To establish sufficient conditions under which quantifiers can be fully eliminated using Yoneda reduction.
  • To apply the reduction to count type inhabitants and decide program equivalence in restricted fragments of System F.
  • To connect Yoneda-type isomorphisms with proof-theoretic techniques such as fixpoint equations and balancedness conditions.

Proposed method

  • Proposes Yoneda type isomorphisms as a formal rewriting system that transforms quantified types into monomorphic type constructors.
  • Introduces the concept of a 'characteristic' of a polymorphic type, defined via a coherence condition on a polynomial tree representation.
  • Uses polynomial trees to represent types in a βη-invariant way, enabling systematic quantifier elimination.
  • Applies the Yoneda reduction to transform types like @X.(A → X) → (B → X) into B → A, leveraging dinaturality and parametricity.
  • Defines fragments Λ2κ≤0 and Λ2κ≤1 of System F where program equivalence becomes decidable via the reduction.
  • Establishes an embedding of the polymorphic fragment Λ2Poly into the predicative fragment Λ2at, preserving ε-equivalence.

Experimental results

Research questions

  • RQ1Under what conditions can quantifiers be fully eliminated from a polymorphic type using Yoneda-type isomorphisms?
  • RQ2How does Yoneda reduction enable the counting of type inhabitants in System F?
  • RQ3What is the relationship between Yoneda isomorphisms and proof-theoretic criteria like balancedness and non-duplication?
  • RQ4Can Yoneda reduction be used to decide program equivalence in restricted fragments of System F?
  • RQ5How do fixpoint constructions in the reduction relate to polynomial equation systems for counting inhabitants?

Key findings

  • Yoneda reduction transforms quantified types into equivalent monomorphic constructions using polynomial trees and fixpoints, enabling full quantifier elimination under the coherence condition.
  • When a type satisfies the balancedness or negative-non-duplication condition, its universal closure reduces to 1 via Yoneda isomorphisms.
  • For types satisfying a special case of positive-non-duplication, the universal closure reduces to a sum of 1s, indicating a finite number of inhabitants.
  • The fragment Λ2κ≤0 of System F has decidable program equivalence, while Λ2κ≤1 does not, due to the undecidability of the latter.
  • The reduction establishes ε-equivalence between the standard embedding of System F and a predicative variant, confirming that both yield equivalent program behavior under parametricity.
  • The method provides a canonical way to compute the number of inhabitants of a type by reducing it to a fixpoint equation, as shown in the example where |A| = 0 due to |AYi| = 0.

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.