Reference. Explicit Refinement Types

We present 𝜆ert, a type theory supporting refinement types with explicit proofs. Instead of solving refinement constraints with an SMT solver like DML and Liquid Haskell, our system requires and permits programmers to embed proofs of properties within the program text, letting us support a rich logic of properties including quantifiers and induction. We show that the type system is sound by showing that every refined program erases to a simply-typed program, and by means of a denotational semantics, we show that every erased program has all of the properties demanded by its refined type. All of our proofs are formalised in Lean 4.

Cite

Cite as @ghalayini-2023-explicit (helia, typst) · \cite{ghalayini-2023-explicit} (LaTeX)
BibTeX
bibtex · 1 line
@article{ghalayini-2023-explicit, title={Explicit Refinement Types}, volume={7}, ISSN={2475-1421}, url={http://dx.doi.org/10.1145/3607837}, DOI={10.1145/3607837}, number={ICFP}, journal={Proceedings of the ACM on Programming Languages}, publisher={Association for Computing Machinery (ACM)}, author={Ghalayini, Jad Elkhaleq and Krishnaswami, Neel}, year={2023}, month=Aug, pages={187–214} }
hayagriva YAML (typst)
yaml · 18 lines
ghalayini-2023-explicit:
  type: article
  title: Explicit Refinement Types
  author:
  - Ghalayini, Jad Elkhaleq
  - Krishnaswami, Neel
  date: 2023-08
  page-range: 187-214
  url: http://dx.doi.org/10.1145/3607837
  serial-number:
    doi: 10.1145/3607837
    issn: 2475-1421
  parent:
    type: periodical
    title: Proceedings of the ACM on Programming Languages
    publisher: Association for Computing Machinery (ACM)
    issue: ICFP
    volume: 7
Cites 30 works (3 here)
With notes (3)

Logical Relations as Types: Proof-Relevant Parametricity for Program Modules sterling_harper_2021

The theory of program modules is of interest to language designers not only for its practical importance to programming, but also because it lies at the nexus of three fundamental concerns in language design: the phase distinction, computational effects, and type abstraction. We contribute a fresh “synthetic” take on program modules that treats modules as the fundamental constructs, in which the usual suspects of prior module calculi (kinds, constructors, dynamic programs) are rendered as derived notions in terms of a modal type-theoretic account of the phase distinction. We simplify the account of type abstraction (embodied in the generativity of module functors) through a lax modality that encapsulates computational effects, placing projectibility of module expressions on a type-theoretic basis.

Our main result is a (significant) proof-relevant and phase-sensitive generalization of the Reynolds abstraction theorem for a calculus of program modules, based on a new kind of logical relation called a parametricity structure. Parametricity structures generalize the proof-irrelevant relations of classical parametricity to proof-relevant families, where there may be non-trivial evidence witnessing the relatedness of two programs—simplifying the metatheory of strong sums over the collection of types, for although there can be no “relation classifying relations,” one easily accommodates a “family classifying small families.”

Using the insight that logical relations/parametricity is itself a form of phase distinction between the syntactic and the semantic, we contribute a new synthetic approach to phase separated parametricity based on the slogan logical relations as types, by iterating our modal account of the phase distinction. We axiomatize a dependent type theory of parametricity structures using two pairs of complementary modalities (syntactic, semantic) and (static, dynamic), substantiated using the topos theoretic Artin gluing construction. Then, to construct a simulation between two implementations of an abstract type, one simply programs a third implementation whose type component carries the representation invariant.

DOI · arXiv

Syntax and Semantics of Quantitative Type Theory atkey-2018-syntax

DOI

Functors are type refinement systems mellies_zeilberger_2015

The standard reading of type theory through the lens of category theory is based on the idea of viewing a type system as a category of well-typed terms. We propose a basic revision of this reading: rather than interpreting type systems as categories, we describe them as functors from a category of typing derivations to a category of underlying terms. Then, turning this around, we explain how in fact any functor gives rise to a generalized type system, with an abstract notion of typing judgment, typing derivations and typing rules. This leads to a purely categorical reformulation of various natural classes of type systems as natural classes of functors.

The main purpose of this paper is to describe the general framework (which can also be seen as providing a categorical analysis of refinement types), and to present a few applications. As a larger case study, we revisit Reynolds’ paper on “The Meaning of Types” (2000), showing how the paper’s main results may be reconstructed along these lines.

PDF · DOI · pldb
External (27)
ghalayini-2023-explicit reference entries/refs/ghalayini-2023-explicit/ghalayini-2023-explicit.hel