paperbot · PL 论文追踪

全部论文 待读 收藏

P2 CPS transformation with affine types for call-by-value implicit polymorphism

面向按值调用隐式多态、带仿射类型的 CPS 变换
ICFP 5(ICFP)2021匹配度 1/10 · 该论文是纯类型论与形式语义研究,关注 CBV 隐式多态的 CPS 变换、仿射类型与参数性,并未涉及 LLM/Agent、静态分析、浮点程序分析或贝叶斯程序分析等用户核心方向。其理论形式化贡献与用户画像中 PL 与 AI 交叉的问题域几乎无关。引用 1 inbox
Taro Sekiyama, Takeshi Tsukada
crossref: 2026-09-10

AI 速览

一句话:提出带仿射类型的新 CPS 目标语言 Λ_open,解决 CBV 隐式多态 CPS 变换的类型保持难题并证明参数性。

把程序变换为 CPS 可显式化续元,但按值调用(CBV)隐式多态下保持类型很困难。作者将障碍称为作用域入侵(scope intrusion),并为此提出新的 CPS 目标语言 Λ_open,其中加入两个多态构造:一个只绑定类型变量,另一个只泛化类型变量。由于无限制使用会导致不希望的泛化而不安全,Λ_open 引入仿射类型,只允许类型安全的泛化。作者从 Curry 风格 CBV System F 定义到类型安全 Λ_open 的 CPS 变换,并证明该变换保持意义与类型。论文还研究 Λ_open 的参数性,构造带步指标的 Kripke 逻辑关系,证明其满足 Fundamental Property,并相对于上下文等价是可靠的。

问题
研究如何在按值调用隐式多态(Curry 风格 System F)下实现类型保持的 CPS 变换;核心困难是作者所称的作用域入侵。
方法
提出 CPS 目标语言 Λ_open,用分别只绑定和只泛化类型变量的多态构造,并借助仿射类型限制不安全泛化;同时构造带步指标的 Kripke 逻辑关系研究参数性。
评估
以理论证明为主:证明从 Curry 风格 CBV System F 到类型安全 Λ_open 的 CPS 变换保持意义与类型,并证明该逻辑关系满足 Fundamental Property 及相对于上下文等价的可靠性。
原文摘要(Abstract)

Transformation of programs into continuation-passing style (CPS) reveals the notion of continuations, enabling many applications such as control operators and intermediate representations in compilers. Although type preservation makes CPS transformation more beneficial, achieving type-preserving CPS transformation for implicit polymorphism with call-by-value (CBV) semantics is known to be challenging. We identify the difficulty in the problem that we call scope intrusion. To address this problem, we propose a new CPS target language Λ open that supports two additional constructs for polymorphism: one only binds and the other only generalizes type variables. Unfortunately, their unrestricted use makes Λ open unsafe due to undesired generalization of type variables. We thus equip Λ open with affine types to allow only the type-safe generalization. We then define a CPS transformation from Curry-style CBV System F to type-safe Λ open and prove that the transformation is meaning and type preserving. We also study parametricity of Λ open as it is a fundamental property of polymorphic languages and plays a key role in applications of CPS transformation. To establish parametricity, we construct a parametric, step-indexed Kripke logical relation for Λ open and prove that it satisfies the Fundamental Property as well as soundness with respect to contextual equivalence.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1118,
  title = {CPS transformation with affine types for call-by-value implicit polymorphism},
  author = {Taro Sekiyama and Takeshi Tsukada},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {5},
  number = {ICFP},
  year = {2021},
  doi = {10.1145/3473600}
}