尚未生成 AI 速览(可能缺少 API key 或等待下次运行补跑)。
Abstract Gradual typing provides a model for when a legacy language with less precise types interacts with a newer language with more precise types. Casts mediate between types of different precision, allocating blame when a value fails to conform to a type. The blame theorem asserts that blame always falls on the less-precisely typed side of a cast. One instance of interest is when a legacy language (such as Java) permits null values at every type, while a newer language (such as Scala or Kotlin) explicitly indicates which types permit null values. Nieto et al. in 2020 introduced a gradually typed calculus for just this purpose. The calculus requires three distinct constructors for function types and a non-standard proof of the blame theorem; it can embed terms from the legacy language into the newer language (or vice versa) only when they are closed. Here, we define a simpler calculus that is more orthogonal, with one constructor for function types and one for possibly nullable types, and with an entirely standard proof of the blame theorem; it can embed terms from the legacy language into the newer language (and vice versa) even if they are open. All results in the paper have been mechanized in Coq.
DOI 原文 ·
@article{paperbot2681,
title = {A simple blame calculus for explicit nulls},
author = {ONDŘEJ LHOTÁK and PHILIP WADLER},
journal = {Journal of Functional Programming},
volume = {34},
year = {2024},
doi = {10.1017/s0956796824000121}
}