paperbot · PL 论文追踪

全部论文 待读 收藏

P2 AUTOMAP: Inferring Rank-Polymorphic Function Applications with Integer Linear Programming

AUTOMAP:使用整数线性规划推断秩多态函数应用
OOPSLA 8(OOPSLA2)2024匹配度 2/10 · 论文研究静态类型数组语言中的 map/replicate 类型推断与整数线性规划实现,属于传统 PL/类型系统方向;与用户核心关注的 PL↔AI、LLM/Agent 改进静态分析、浮点程序分析及贝叶斯程序分析均无直接交集。仅在“兼具理论形式化与工程实现”的偏好上有间接关联。引用 2 inbox
Robert Schenck, Nikolaj Hey Hinnerskov, Troels Henriksen, Magnus Madsen, Martin Elsman
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出用整数线性规划自动推断静态类型数组语言中的 map 与 replicate,兼顾动态数组语言体验与静态类型保证。

动态类型数组语言(如 Python、APL、Matlab)会把标量运算提升到数组并复制标量以适配应用,但这种便利在静态类型语言中通常缺失。本文提出一种自动推断 map 与 replicate 操作的机制,其类型系统支持参数多态、高阶函数和顶层 let-泛化,并利用整数线性规划寻找使程序能展开为良类型程序所需的最少操作。作者论证该推断系统为程序员提供有用且符合直觉的保证,展示若干理论性质,并在静态类型数组语言 Futhark 中实现了该机制。

问题
如何在静态类型数组语言中自动引入动态数组语言常见的标量提升与复制行为,同时保持静态类型保证。
方法
设计支持参数多态、高阶函数与顶层 let-泛化的类型系统,并用整数线性规划最小化所需的 map/replicate 操作以完成类型展开。
评估
通过论证理论性质并在 Futhark 中实现来评估机制;摘要未报告用户实验或性能基准。
原文摘要(Abstract)

Dynamically typed array languages such as Python, APL, and Matlab lift scalar operations to arrays and replicate scalars to fit applications. We present a mechanism for automatically inferring map and replicate operations in a statically-typed language in a way that resembles the programming experience of a dynamically-typed language while preserving the static typing guarantees. Our type system—which supports parametric polymorphism, higher-order functions, and top-level let-generalization—makes use of integer linear programming in order to find the minimum number of operations needed to elaborate to a well-typed program. We argue that the inference system provides useful and unsurprising guarantees to the programmer. We demonstrate important theoretical properties of the mechanism and report on the implementation of the mechanism in the statically-typed array programming language Futhark.

链接与引用

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

BibTeX
@article{0001HHME24,
  title = {AUTOMAP: Inferring Rank-Polymorphic Function Applications with Integer Linear Programming},
  author = {Robert Schenck and Nikolaj Hey Hinnerskov and Troels Henriksen and Magnus Madsen and Martin Elsman},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA2},
  year = {2024},
  doi = {10.1145/3689774}
}