paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Chaperone contracts for higher-order sessions

高阶会话的监护契约
ICFP 1(ICFP)2017匹配度 1/10 · 该论文研究高阶会话中的 chaperone 契约、动态监控与 blame 定理,属于传统程序语言理论/形式语义方向,未涉及 LLM、Agent、机器学习系统、浮点程序分析或贝叶斯程序分析等用户核心交叉方向。虽然包含形式化与 OCaml 实现,但与用户研究画像基本无关。引用 16 inbox
Hernán Melgratti, Luca Padovani
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:将 chaperone 契约扩展到会话,在高阶语言中建立动态监控语义与 blame 定理,并给出 OCaml 实现。

论文研究并发程序中的会话契约监控问题。会话端点上的消息种类、方向与属性会随会话推进而变化,传统函数/对象契约无法描述这种动态行为,因此需要能随会话演化的契约。作者将用于可变对象的 chaperone 契约推广到高阶会话,在一个带会话的高阶语言中形式化契约监控,给出“正确模块”的刻画,即模块始终遵守其使用会话的契约,并证明 blame 定理以定位违约方。基于该演算,作者实现了一个轻量级 OCaml 模块,利用现成 OCaml 支持静态会话类型检查与动态契约监控。

问题
如何为并发程序的高阶会话设计可随会话进展演化的契约监控,并准确判定和归责违约模块?
方法
将 chaperone 契约扩展到会话,在带会话的高阶演算中形式化监控语义,刻画正确模块并证明 blame 定理。
评估
通过形式化定义与 blame 定理进行理论验证,并实现轻量级 OCaml 模块展示静态会话类型检查与动态监控结合的可行性。
原文摘要(Abstract)

Contracts have proved to be an effective mechanism that helps developers in identifying those modules of a program that violate the contracts of the functions and objects they use. In recent years, sessions have established as a key mechanism for realizing inter-module communications in concurrent programs. Just like values flow into or out of a function or object, messages are sent on, and received from, a session endpoint. Unlike conventional functions and objects, however, the kind, direction, and properties of messages exchanged in a session may vary over time, as the session progresses. This feature of sessions calls for contracts that evolve along with the session they describe. In this work, we extend to sessions the notion of chaperone contract (roughly, a contract that applies to a mutable object) and investigate the ramifications of contract monitoring in a higher-order language that features sessions. We give a characterization of correct module, one that honors the contracts of the sessions it uses, and prove a blame theorem. Guided by the calculus, we describe a lightweight implementation of monitored sessions as an OCaml module with which programmers can benefit from static session type checking and dynamic contract monitoring using an off-the-shelf version of OCaml.

链接与引用

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

BibTeX
@article{MelgrattiP17,
  title = {Chaperone contracts for higher-order sessions},
  author = {Hernán Melgratti and Luca Padovani},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {1},
  number = {ICFP},
  year = {2017},
  doi = {10.1145/3110279}
}