Sound and Complete Bidirectional Typechecking for Higher-Rank Polymorphism with Existentials and Indexed Types
Jana Dunfield, Neelakantan R. Krishnaswami

TL;DR
This paper presents a sound and complete bidirectional typechecking system for a complex type language including higher-rank polymorphism, existentials, and indexed types, with formal proofs of correctness.
Contribution
It introduces a novel declarative and algorithmic type system for advanced types, extending bidirectional typing principles to indexed types with proof-theoretic foundations.
Findings
Provides a declarative specification based on focalization
Develops an algorithmic typing system that is sound and complete
Supports first-class existential types and pattern matching coverage
Abstract
Bidirectional typechecking, in which terms either synthesize a type or are checked against a known type, has become popular for its applicability to a variety of type systems, its error reporting, and its ease of implementation. Following principles from proof theory, bidirectional typing can be applied to many type constructs. The principles underlying a bidirectional approach to indexed types (generalized algebraic datatypes) are less clear. Building on proof-theoretic treatments of equality, we give a declarative specification of typing based on focalization. This approach permits declarative rules for coverage of pattern matching, as well as support for first-class existential types using a focalized subtyping judgment. We use refinement types to avoid explicitly passing equality proofs in our term syntax, making our calculus similar to languages such as Haskell and OCaml. We also…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
