paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Relating Functional and Imperative Session Types

函数式与命令式会话类型的关联
LMCS vol.Volume 18, Issue 32022匹配度 1/10 · 该论文属于纯 PL 类型理论中的会话类型研究,讨论函数式与命令式会话类型演算的表达力差异,与用户关注的 LLM/Agent 静态分析、浮点程序分析、贝叶斯程序分析等方向没有直接关联。引用 3 inbox
Hannes Saffrich, Peter Thiemann
crossref: 2026-09-10

AI 速览

一句话:通过双向翻译刻画函数式与命令式会话类型演算的表达力差异。

命令式会话类型为会话通信提供命令式接口:通道引用是一等对象,操作会改变其类型状态。相较使用线性类型管理通道的函数式接口,命令式程序表面更简单,却需显式跟踪通信状态。本文重新审视早期命令式会话类型工作,给出从命令式演算到线性函数式会话类型系统的保类型、保语义翻译,说明函数式方法蕴含命令式方法;同时给出反向的无类型翻译并证明其保语义。进一步限制函数式演算的类型系统,使反向翻译也保类型,从而精确刻画两个演算在表达力上的差异,并表明命令式演算表达力不足主要源于其类型系统限制。

问题
命令式会话类型与函数式会话类型之间的关系和表达力差异尚不清晰,尤其命令式方法为何在后续工作中被函数式方法取代。
方法
构建命令式会话类型演算与线性函数式会话类型演算之间的翻译:正向翻译保类型且保语义;反向无类型翻译保语义,并通过限制函数式类型系统使反向翻译保类型。
评估
评估为理论证明而非实现实验:证明翻译的保类型性与保语义性,并据此精确比较两个演算的表达力,将命令式演算的不足主要归因于其类型系统限制。
原文摘要(Abstract)

Imperative session types provide an imperative interface to session-typed communication. In such an interface, channel references are first-class objects with operations that change the typestate of the channel. Compared to functional session type APIs, the program structure is simpler at the surface, but typestate is required to model the current state of communication throughout. Following an early work that explored the imperative approach, a significant body of work on session types has neglected the imperative approach and opts for a functional approach that uses linear types to manage channel references soundly. We demonstrate that the functional approach subsumes the early work on imperative session types by exhibiting a typing and semantics preserving translation into a system of linear functional session types. We further show that the untyped backwards translation from the functional to the imperative calculus is semantics preserving. We restrict the type system of the functional calculus such that the backwards translation becomes type preserving. Thus, we precisely capture the difference in expressiveness of the two calculi and conclude that the lack of expressiveness in the imperative calculus is largely due to restrictions imposed by its type system.

链接与引用

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

BibTeX
@article{paperbot1652,
  title = {Relating Functional and Imperative Session Types},
  author = {Hannes Saffrich and Peter Thiemann},
  journal = {Logical Methods in Computer Science},
  volume = {Volume 18, Issue 3},
  year = {2022},
  doi = {10.46298/lmcs-18(3:33)2022}
}