# A Path To DOT: Formalizing Fully Path-Dependent Types

**Authors:** Marianna Rapoport, Ond\v{r}ej Lhot\'ak

arXiv: 1904.07298 · 2019-08-15

## TL;DR

This paper introduces pDOT, an extension of the DOT calculus, to support fully path-dependent types, enabling formalization of complex language features like Scala's module system and nested dependencies.

## Contribution

The paper formalizes pDOT, a generalized DOT calculus supporting arbitrary path lengths and singleton types, with a mechanized proof of type safety.

## Key findings

- pDOT supports types depending on paths of arbitrary length.
- Naive path extensions to DOT are unsound, requiring specific conditions.
- A Coq proof confirms pDOT's type safety.

## Abstract

The Dependent Object Types (DOT) calculus aims to formalize the Scala programming language with a focus on path-dependent types $-$ types such as $x.a_1\dots a_n.T$ that depend on the runtime value of a path $x.a_1\dots a_n$ to an object. Unfortunately, existing formulations of DOT can model only types of the form $x.A$ which depend on variables rather than general paths. This restriction makes it impossible to model nested module dependencies. Nesting small components inside larger ones is a necessary ingredient of a modular, scalable language. DOT's variable restriction thus undermines its ability to fully formalize a variety of programming-language features including Scala's module system, family polymorphism, and covariant specialization.   This paper presents the pDOT calculus, which generalizes DOT to support types that depend on paths of arbitrary length, as well as singleton types to track path equality. We show that naive approaches to add paths to DOT make it inherently unsound, and present necessary conditions for such a calculus to be sound. We discuss the key changes necessary to adapt the techniques of the DOT soundness proofs so that they can be applied to pDOT. Our paper comes with a Coq-mechanized type-safety proof of pDOT. With support for paths of arbitrary length, pDOT can realize DOT's full potential for formalizing Scala-like calculi.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1904.07298/full.md

## Figures

218 figures with captions in the complete paper: https://tomesphere.com/paper/1904.07298/full.md

## References

32 references — full list in the complete paper: https://tomesphere.com/paper/1904.07298/full.md

---
Source: https://tomesphere.com/paper/1904.07298