Scala step-by-step: soundness for DOT with step-indexed logical relations in Iris

The metatheory of Scala’s core type system—the Dependent Object Types (DOT) calculus—is hard to extend, like the metatheory of other type systems combining subtyping and dependent types. Soundness of important Scala features therefore remains an open problem in theory and in practice. To address some of these problems, we use a semantics-first approach to develop a logical relations model for a new version of DOT, called guarded DOT (gDOT). Our logical relations model makes use of an abstract form of step-indexing, as supported by the Iris framework, to model various forms of recursion in gDOT. To demonstrate the expressiveness of gDOT, we show that it handles Scala examples that could not be handled by previous versions of DOT, and prove using our logical relations model that gDOT provides the desired data abstraction. The gDOT type system, its semantic model, its soundness proofs, and all examples in the paper have been mechanized in Coq.

[1]  Compositional Non-Interference for Fine-Grained Concurrent Programs , 2019, 2021 IEEE Symposium on Security and Privacy (SP).

[2]  Ondrej Lhoták,et al.  Undecidability of d<: and its decidable fragments , 2020, Proc. ACM Program. Lang..

[3]  Derek Dreyer,et al.  Safe systems programming in Rust , 2021, Commun. ACM.

[4]  Ondrej Lhoták,et al.  A path to DOT: formalizing fully path-dependent types , 2019, Proc. ACM Program. Lang..

[5]  Jonas Kaiser,et al.  Autosubst 2: reasoning with multi-sorted de Bruijn terms and vector substitutions , 2019, CPP.

[6]  Ondrej Lhoták,et al.  κDOT: scaling DOT with mutation and constructors , 2018, SCALA@ICFP.

[7]  Joseph Tassarotti,et al.  MoSeL: a general, extensible modal framework for interactive proofs in separation logic , 2018, Proc. ACM Program. Lang..

[8]  Lars Birkedal,et al.  ReLoC: A Mechanised Relational Logic for Fine-Grained Concurrency , 2018, LICS.

[9]  Lars Birkedal,et al.  A logical relation for monadic encapsulation of state: proving contextual equivalences in the presence of runST , 2017, Proc. ACM Program. Lang..

[10]  Derek Dreyer,et al.  RustBelt: securing the foundations of the rust programming language , 2017, Proc. ACM Program. Lang..

[11]  Lars Birkedal,et al.  Iris from the ground up: A modular foundation for higher-order concurrent separation logic , 2018, Journal of Functional Programming.

[12]  Abel Nieto Towards algorithmic typing for DOT (short paper) , 2017, SCALA@SPLASH.

[13]  Bruno C. d. S. Oliveira,et al.  Unifying typing and subtyping , 2017, Proc. ACM Program. Lang..

[14]  Derek Dreyer,et al.  Robust and compositional verification of object capability patterns , 2017, Proc. ACM Program. Lang..

[15]  Ondrej Lhoták,et al.  A simple soundness proof for dependent object types , 2017, Proc. ACM Program. Lang..

[16]  Lars Birkedal,et al.  The Essence of Higher-Order Concurrent Separation Logic , 2017, ESOP.

[17]  Paula Severi,et al.  A Light Modality for Recursion , 2017, FoSSaCS.

[18]  Joseph Tassarotti,et al.  A Higher-Order Logic for Concurrent Termination-Preserving Refinement , 2017, ESOP.

[19]  Lars Birkedal,et al.  A relational model of types-and-effects in higher-order concurrent separation logic , 2017, POPL.

[20]  Karl Crary,et al.  Modules, abstraction, and parametric polymorphism , 2017, POPL.

[21]  Nada Amin,et al.  Type soundness proofs with definitional interpreters , 2017, POPL.

[22]  Lars Birkedal,et al.  Interactive proofs in higher-order concurrent separation logic , 2017, POPL.

[23]  Ondrej Lhoták,et al.  Mutable WadlerFest DOT , 2017, FTfJP@ECOOP.

[24]  Sandro Stucki Higher-Order Subtyping with Type Intervals , 2017 .

[25]  Fei Wang,et al.  Towards Strong Normalization for Dependent Object Types (DOT) , 2017, ECOOP.

[26]  Martin Odersky,et al.  Implementing higher-kinded types in Dotty , 2016, SCALA@SPLASH.

[27]  Nada Amin,et al.  Type soundness for dependent object types (DOT) , 2016, OOPSLA.

[28]  Lars Birkedal,et al.  Higher-order ghost state , 2016, ICFP.

[29]  Nada Amin,et al.  Dependent Object Types , 2016 .

[30]  Martin Odersky,et al.  The Essence of Dependent Object Types , 2016, A List of Successes That Can Change the World.

[31]  Gert Smolka,et al.  Autosubst: Reasoning with de Bruijn Terms and Parallel Substitutions , 2015, ITP.

[32]  Lars Birkedal,et al.  Iris: Monoids and Invariants as an Orthogonal Basis for Concurrent Reasoning , 2015, POPL.

[33]  Peng Fu,et al.  Self Types for Dependently Typed Lambda Encodings , 2014, RTA-TLCA.

[34]  Hongseok Yang,et al.  Step-indexed kripke models over recursive worlds , 2011, POPL '11.

[35]  Lars Birkedal,et al.  The category-theoretic solution of recursive metric-space equations , 2010, Theor. Comput. Sci..

[36]  DeLesley S. Hutchins,et al.  Pure subtype systems , 2010, POPL '10.

[37]  Sophia Drossopoulou,et al.  Tribe: a simple virtual class calculus , 2007, AOSD.

[38]  Andrew W. Appel,et al.  A very modal model of a modern, major, general type system , 2007, POPL '07.

[39]  Martin Odersky,et al.  A Core Calculus for Scala Type Checking , 2006, MFCS.

[40]  William R. Cook,et al.  A virtual class calculus , 2006, POPL '06.

[41]  Amal Ahmed,et al.  Semantics of types for mutable state , 2004 .

[42]  Alexei Kopylov,et al.  Dependent intersection: a new way of defining records in type theory , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[43]  Andrew W. Appel,et al.  An indexed model of recursive types for foundational proof-carrying code , 2001, TOPL.

[44]  Hiroshi Nakano,et al.  A modality for recursion , 2000, Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.99CB36332).

[45]  Karl Crary,et al.  What is a recursive module? , 1999, PLDI '99.

[46]  Fritz Henglein,et al.  Coinductive Axiomatization of Recursive Type Equality and Subtyping , 1998, Fundam. Informaticae.

[47]  Mark Lillibridge,et al.  A type-theoretic approach to higher-order modules with sharing , 1994, POPL '94.

[48]  John C. Mitchell,et al.  On the type structure of standard ML , 1993, TOPL.

[49]  Pierre America,et al.  Solving Reflexive Domain Equations in a Category of Complete Metric Spaces , 1987, J. Comput. Syst. Sci..

[50]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..