The core calculus of Typed Racket is revised, revising the core calculus of Typed Racket and giving asemantic type soundness proof using step-indexed logical relations, formalized in Lean, arguing that this approach is simpler than it may seem, and easily scales to handle the complexity of the occurrence typing in Typed Racket.
Abstract
Over the past two decades, numerous systems have brought some of the benefits of dependent typing to a wide variety of new programming languages, often by restricting which terms can appear inside types. Such techniques are known as refinement types, occurrence typing, liquid types, and path dependent types, among others. However, the restrictions adopted by these systems often break the substitution property, because they explicitly disallow the ability to substitute arbitrary terms for variables inside types. This leads to significant complexity in the design and metatheory of these systems, increasing the possibility of significant errors. We consider a specific line of work on occurrence typing, namely, the calculus underlying Typed Racket due to Tobin-Hochstadt and Felleisen 2010. We show that the fundamental challenge of substitution into types resulted in multiple flaws in the formalism and the syntactic type soundness theorem of this work. These flaws are replicated in several other papers building on this work, and also surface as a soundness bug in Typed Racket itself. We identify and repair these problems, revising the core calculus of Typed Racket and giving a \emph{semantic type soundness} proof using step-indexed logical relations, formalized in Lean. We argue that this approach is simpler than it may seem, and easily scales to handle the complexity of the occurrence typing in Typed Racket.
Set-theoretic types support expressive record types through unions, intersections, and negations, but they lack the row polymorphism needed to type operations that propagate unknown fields across records. Prior work addresses this by allowing Boolean combinations of rows in type substitutions, which complicates the for...
Mickaël Laurent, Pierre Donat-Bouillud, Filip Křikava et al.· Proceedings of the ACM on Pr...· 2 citations
Refinement type systems allow programmers to use logical conditions to constrain variable values. However, most practical refinement type systems limit their expressiveness to remain automatically decidable. Deductive verification, on the other hand, can prove more complex properties but requires more time and expertis...
Florian Lanzinger, Joshua Bachmeier, Mattias Ulbrich et al.· Formal Aspects of Computing· 0 citations
Type systems for metaprogramming take one of two approaches to safeguarding the scopes of variables in generated code. They either use Environment Classifiers (EC) to identify scopes by name (Taha and Nielsen, 2003), or they use Contextual Modal Type Theory (CMTT) to match scopes by structure (Nanevski, Pfenning, and P...
Tian-Yu Chen, Darshal Shetty, J. Siek et al.· 0 citations
Python is well-known as a dynamically typed language, meaning that type checks are moved into runtime and type annotations in the code are not required. However, it can still be statically typed with the help of type hints and external type checking tools. This research explores this practice in-depth, looking at the b...