paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Relational cost analysis in a functional-imperative setting

函数式-命令式环境下的关系成本分析
JFP vol.312021匹配度 3/10 · 论文属于类型系统与程序验证中的关系成本分析,与静态分析/形式化验证有邻接关系,但不涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析,也未讨论 AI 在 PL 中的应用或面向 ML/Agentic 程序的静态分析。引用 4 inbox
WEIHAO QU, MARCO GABOARDI, DEEPAK GARG
crossref: 2026-09-10

AI 速览

一句话:提出类型-效应系统 ARel,借助跟踪可变数组关系的类型精化,形式化推导函数式-命令式程序间的相对求值成本界。

关系成本分析旨在形式化地界定两个程序求值成本之差,也可用于推理同一程序在不同输入下的成本差异。本文面向操作可变数组的高阶函数式-命令式程序,提出类型-效应系统 ARel。其核心是一种轻量级类型精化机制,用于追踪两个可变数组之间的差(关系);该机制与内建于类型中的 Hoare 式三元组相结合,使系统能够表达并证明若干在命令式更新数据的程序的精确相对成本。作者基于双向类型检查实现了 ARel,展示了该方法进行精细成本推理的可行性。

问题
如何形式化地建立两个程序(或同一程序在不同输入上)求值成本之差的界,尤其是在涉及可变数组更新与高阶函数式-命令式特性时。
方法
提出类型-效应系统 ARel:设计轻量级类型精化以追踪两个可变数组之间的关系(差异),并将 Hoare 式三元组内建到类型中,从而在类型检查时推导相对成本界。
评估
作者用双向类型检查实现了 ARel,并用若干命令式更新数据的程序验证其能表达并建立精确的相对成本界。
原文摘要(Abstract)

Abstract Relational cost analysis aims at formally establishing bounds on the difference in the evaluation costs of two programs. As a particular case, one can also use relational cost analysis to establish bounds on the difference in the evaluation cost of the same program on two different inputs. One way to perform relational cost analysis is to use a relational type-and-effect system that supports reasoning about relations between two executions of two programs. Building on this basic idea, we present a type-and-effect system, called ARel, for reasoning about the relative cost (the difference in the evaluation cost) of array-manipulating, higher order functional-imperative programs. The key ingredient of our approach is a new lightweight type refinement discipline that we use to track relations (differences) between two mutable arrays. This discipline combined with Hoare-style triples built into the types allows us to express and establish precise relative costs of several interesting programs that imperatively update their data. We have implemented ARel using ideas from bidirectional type checking.

链接与引用

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

BibTeX
@article{paperbot1243,
  title = {Relational cost analysis in a functional-imperative setting},
  author = {WEIHAO QU and MARCO GABOARDI and DEEPAK GARG},
  journal = {Journal of Functional Programming},
  volume = {31},
  year = {2021},
  doi = {10.1017/s0956796821000071}
}