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

04/15/2019
by   Marianna Rapoport, et al.
0

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... a_n.T that depend on the runtime value of a path x.a_1... 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/12/2017

A Simple Soundness Proof for Dependent Object Types

Dependent Object Types (DOT) is intended to be a core calculus for model...
research
06/22/2023

Special Delivery: Programming with Mailbox Types (Extended Version)

The asynchronous and unidirectional communication model supported by mai...
research
05/24/2018

A sequent calculus with dependent types for classical arithmetic

In a recent paper, Herbelin developed dPA^ω, a calculus in which constru...
research
05/17/2020

A tutorial introduction to quantum circuit programming in dependently typed Proto-Quipper

We introduce dependently typed Proto-Quipper, or Proto-Quipper-D for sho...
research
11/02/2021

A strong call-by-need calculus

We present a call-by-need λ-calculus that enables strong reduction (that...
research
07/07/2022

Scoped Capabilities for Polymorphic Effects

Type systems usually characterize the shape of values but not their free...
research
07/09/2023

Type-Preserving Compilation of Class-Based Languages

The Dependent Object Type (DOT) calculus was designed to put Scala on a ...

Please sign up or login with your details

Forgot password? Click here to reset