A Path to DOT: Formalizing Fully Path-Dependent Types

被引:8
|
作者
Rapoport, Marianna [1 ]
Lhotak, Ondrej [1 ]
机构
[1] Univ Waterloo, Waterloo, ON, Canada
来源
基金
加拿大自然科学与工程研究理事会;
关键词
DOT; Scala; dependent types; paths;
D O I
10.1145/3360571
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页数:29
相关论文
共 50 条
  • [1] Foundations of Path-Dependent Types
    Amin, Nada
    Rompf, Tiark
    Odersky, Martin
    [J]. ACM SIGPLAN NOTICES, 2014, 49 (10) : 233 - 249
  • [2] The path-dependent city
    Woodlief, A
    [J]. URBAN AFFAIRS REVIEW, 1998, 33 (03) : 405 - 437
  • [3] PATH-DEPENDENT FUNCTIONS
    KHRAPKO, RI
    [J]. THEORETICAL AND MATHEMATICAL PHYSICS, 1985, 65 (03) : 1196 - 1204
  • [4] Survey on Path-Dependent PDEs
    Peng, Shige
    Song, Yongsheng
    Wang, Falei
    [J]. CHINESE ANNALS OF MATHEMATICS SERIES B, 2023, 44 (06) : 837 - 856
  • [5] ON THE PATH-DEPENDENT POLARIZATION TENSOR
    ZUKOWSKI, M
    [J]. JOURNAL OF PHYSICS A-MATHEMATICAL AND GENERAL, 1985, 18 (03): : 437 - 443
  • [6] Viscosity solutions of obstacle problems for fully nonlinear path-dependent PDEs
    Ekren, Ibrahim
    [J]. STOCHASTIC PROCESSES AND THEIR APPLICATIONS, 2017, 127 (12) : 3966 - 3996
  • [7] Path-Dependent UK Bioenergy
    Levidow, Les
    Papaioannou, Theo
    Borda-Rodriguez, Alexander
    [J]. SCIENCE AS CULTURE, 2013, 22 (02) : 213 - 221
  • [8] MULTIASSET PATH-DEPENDENT OPTIONS
    BOYLE, PP
    [J]. JOURNAL OF FINANCE, 1993, 48 (03): : 1071 - 1071
  • [9] Path-dependent American options
    Chevalier, Etienne
    Vath, Vathana Ly
    Mnif, Mohamed
    [J]. JOURNAL OF COMPUTATIONAL FINANCE, 2019, 23 (01) : 61 - 95
  • [10] An Analysis of Path-Dependent Options
    Wusterhausen, Frank
    [J]. JOURNAL OF OPTIMIZATION THEORY AND APPLICATIONS, 2015, 167 (03) : 874 - 887