Reference. Focusing on Refinement Typing

We present a logically principled foundation for systematizing, in a way that works with any computational effect and evaluation order, SMT constraint generation seen in refinement type systems for functional programming languages. By carefully combining a focalized variant of call-by-push-value, bidirectional typing, and our novel technique of value-determined indexes, our system generates solvable SMT constraints without existential (unification) variables. We design a polarized subtyping relation allowing us to prove our logically focused typing algorithm is sound, complete, and decidable. We prove type soundness of our declarative system with respect to an elementary domain-theoretic denotational semantics. Type soundness implies, relatively simply, the total correctness and logical consistency of our system. The relative ease with which we obtain both algorithmic and semantic results ultimately stems from the proof-theoretic technique of focalization.

Cite

Cite as @economou-2023-focusing (helia, typst) · \cite{economou-2023-focusing} (LaTeX)
BibTeX
bibtex · 1 line
@article{economou-2023-focusing, title={Focusing on Refinement Typing}, volume={45}, ISSN={1558-4593}, url={http://dx.doi.org/10.1145/3610408}, DOI={10.1145/3610408}, number={4}, journal={ACM Transactions on Programming Languages and Systems}, publisher={Association for Computing Machinery (ACM)}, author={Economou, Dimitrios J. and Krishnaswami, Neel and Dunfield, Jana}, year={2023}, month=Dec, pages={1–62} }
hayagriva YAML (typst)
yaml · 19 lines
economou-2023-focusing:
  type: article
  title: Focusing on Refinement Typing
  author:
  - Economou, Dimitrios J.
  - Krishnaswami, Neel
  - Dunfield, Jana
  date: 2023-12
  page-range: 1-62
  url: http://dx.doi.org/10.1145/3610408
  serial-number:
    doi: 10.1145/3610408
    issn: 1558-4593
  parent:
    type: periodical
    title: ACM Transactions on Programming Languages and Systems
    publisher: Association for Computing Machinery (ACM)
    issue: 4
    volume: 45
Cites 90 works (5 here)
With notes (5)

Bidirectional Typing dunfield-2021-bidirectional

Bidirectional typing combines two modes of typing: type checking, which checks that a program satisfies a known type, and type synthesis, which determines a type from the program. Using checking enables bidirectional typing to support features for which inference is undecidable; using synthesis enables bidirectional typing to avoid the large annotation burden of explicitly typed languages. In addition, bidirectional typing improves error locality. We highlight the design principles that underlie bidirectional type systems, survey the development of bidirectional typing from the prehistoric period before Pierce and Turner’s local type inference to the present day, and provide guidance for future investigations.
DOI · arXiv

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

Complete and easy bidirectional typechecking for higher-rank polymorphism dunfield-2013-complete

PDF · DOI · arXiv · pldb

The view from the left mcbride-2004-the

Pattern matching has proved an extremely powerful and durable notion in functional programming. This paper contributes a new programming notation for type theory which elaborates the notion in various ways. First, as is by now quite well-known in the type theory community, definition by pattern matching becomes a more discriminating tool in the presence of dependent types, since it refines the explanation of types as well as values. This becomes all the more true in the presence of the rich class of datatypes known as inductive families (Dybjer, 1991). Secondly, as proposed by Peyton Jones (1997) for Haskell, and independently rediscovered by us, subsidiary case analyses on the results of intermediate computations, which commonly take place on the right-hand side of definitions by pattern matching, should rather be handled on the left. In simply-typed languages, this subsumes the trivial case of Boolean guards; in our setting it becomes yet more powerful. Thirdly, elementary pattern matching decompositions have a well-defined interface given by a dependent type; they correspond to the statement of an induction principle for the datatype. More general, user-definable decompositions may be defined which also have types of the same general form. Elementary pattern matching may therefore be recast in abstract form, with a semantics given by translation. Such abstract decompositions of data generalize Wadler’s (1987) notion of ‘view’. The programmer wishing to introduce a new view of a type 𝑇 , and exploit it directly in pattern matching, may do so via a standard programming idiom. The type theorist, looking through the Curry–Howard lens, may see this as proving a theorem , one which establishes the validity of a new induction principle for 𝑇 . We develop enough syntax and semantics to account for this high-level style of programming in dependent type theory. We close with the development of a typechecker for the simply-typed lambda calculus, which furnishes a view of raw terms as either being well-typed, or containing an error. The implementation of this view is ipso facto a proof that typechecking is decidable.
PDF · DOI · pldb

Dependent types in practical programming xi-1999-dependent

PDF · DOI · pldb
External (85)
economou-2023-focusing reference entries/refs/economou-2023-focusing/economou-2023-focusing.hel