Skip to main content
QUICK REVIEW

[Paper Review] Dinaturality Meets Genericity: A Game Semantics of Bounded Polymorphism

Scalas, Alceste, Yoshida, Nobuko|arXiv (Cornell University)|Oct 18, 2015
Logic, programming, and type systemsComputer Science41 references12 citations
TL;DR

This paper presents a mechanized type soundness proof for a rich DOT calculus that supports type refinement and full subtyping with intersection and union types—features previously thought to break key metatheoretic properties. By using a high-level, definitional interpreter in Coq, the authors show that soundness can be proven via straightforward induction, even with mutable references and polymorphism, overcoming limitations of traditional syntactic approaches based on term rewriting.

ABSTRACT

Designing, developing and maintaining concurrent applications is an error-prone and time-consuming task; most difficulties arise because compilers are usually unable to check whether the inputs/outputs performed by a program at runtime will adhere to a given protocol specification. To address this problem, we propose lightweight session programming in Scala: we leverage the native features of the Scala type system and standard library, to introduce (1) a representation of session types as Scala types, and (2) a library, called lchannels, with a convenient API for session-based programming, supporting local and distributed communication. We generalise the idea of Continuation-Passing Style Protocols (CPSPs), studying their formal relationship with session types. We illustrate how session programming can be carried over in Scala: how to formalise a communication protocol, and represent it using Scala classes and lchannels, letting the compiler help spotting protocol violations. We attest the practicality of our approach with a complex use case, and evaluate the performance of lchannels with a series of benchmarks.

Motivation & Objective

  • To establish type soundness for a rich DOT calculus that includes type refinement and a full subtyping lattice with intersection and union types.
  • To overcome the failure of key metatheoretic properties like environment narrowing and subtyping transitivity in full DOT by distinguishing runtime objects from non-executed code.
  • To demonstrate that definitional interpreters in Coq enable scalable, inductive soundness proofs for advanced polymorphic type systems, including System F<: with mutable references.
  • To show how DOT-like calculi naturally emerge as generalizations of F<: by extending its operational semantics to support path-dependent types.
  • To derive equivalent small-step semantics and Wright–Felleisen-style proofs from the definitional interpreter foundation, establishing a systematic path from F<: to DOT.

Proposed method

  • Uses a definitional interpreter implemented in Coq to model big-step operational semantics, enabling clear separation between static terms and runtime values.
  • Employs numeric step counters (depth bounds) to ensure termination and support inductive proofs, even in the presence of mutable references.
  • Extends System F<: with type members, path-dependent types, and subtyping to build a foundation for DOT-like systems.
  • Gradually generalizes the semantics from F<: to richer systems, including type refinement and intersection types, to derive System D as an intermediate design space.
  • Derives small-step semantics and soundness proofs from the definitional interpreter via mechanical transformation, preserving correctness.
  • Leverages Siek’s Three Easy Lemmas and Coq’s total functional programming to achieve purely inductive proofs without coinduction.

Experimental results

Research questions

  • RQ1Can a DOT calculus with type refinement and full subtyping (including intersection and union types) be proven sound despite breaking traditional metatheoretic properties like environment narrowing and subtyping transitivity?
  • RQ2Can definitional interpreters in Coq support mechanized soundness proofs for polymorphic, higher-order type systems with mutable state and subtyping?
  • RQ3How can the operational behavior of System F<: be systematically extended to yield a principled foundation for DOT and intermediate systems with path-dependent types?
  • RQ4Is it possible to derive small-step semantics and Wright–Felleisen-style soundness proofs from a definitional interpreter model without losing correctness or requiring complex proof techniques?
  • RQ5What insights does a runtime-first semantics provide for the design and formalization of advanced type systems like DOT?

Key findings

  • The paper presents the first mechanized soundness proof for a full DOT calculus that includes type refinement and a complete subtyping lattice with intersection and union types.
  • The proof establishes soundness via a definitional interpreter in Coq, using only inductive reasoning, even for systems with mutable references and polymorphism—challenging the belief that coinductive techniques are necessary.
  • The authors show that environment narrowing and subtyping transitivity need only hold for runtime objects, not for all terms, enabling soundness despite their failure in general.
  • The framework reveals a rich design space of intermediate calculi between System F<: and DOT, collectively termed System D, which generalize F<: with path-dependent types.
  • Small-step semantics and traditional syntactic soundness proofs are systematically derived from the definitional interpreter model, showing that the approach is both foundational and practical.
  • The work demonstrates that definitional interpreters can scale to realistic, polymorphic type systems, offering a viable alternative to term rewriting for type soundness proofs.

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.