paperbot · PL 论文追踪

全部论文 待读 收藏

P1 A Theory of Slicing for Imperative Probabilistic Programs

命令式概率程序的切片理论
TOPLAS 42(2)2020匹配度 6/10 · 论文研究命令式概率程序的切片理论、语义正确性与最小切片算法,属于概率程序分析与形式化静态分析,和画像中的贝叶斯程序分析/概率程序分析方向有直接交集;但它不涉及 LLM/Agent、ML 系统或浮点程序分析,也没有工业落地与 benchmark 评估。引用 6 inbox
Torben Amtoft, Anindya Banerjee
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出命令式概率程序的切片理论,给出语法条件、语义正确性证明与最小切片算法。

本文提出命令式概率程序的切片理论,处理含随机赋值与 observe 条件语句的程序。作者将程序表示为概率控制流图(pCFG),其节点修改概率分布,从而把数据依赖、后支配、相关变量等标准切片机制推广到概率场景。论文分离切片规约与实现:先给出语法条件,要求存在另一不相交切片且两者变量概率独立;再证明满足条件的切片语义正确;最后给出计算最小切片的算法。利用某些循环(几乎)必然终止的知识可生成更小切片。可推广到 Hur 等人的结构化概率程序:切片与原程序具有相同“规范化”语义,其证明基于 pCFG 语义的充分性。

问题
如何为含随机赋值与 observe 条件语句的命令式概率程序定义切片,并保证其语义正确性和最小性。
方法
将程序表示为 pCFG,把数据依赖、后支配、相关变量等标准切片机制概率化;给出切片应满足的语法条件,证明其语义正确,并给出最小切片算法。
评估
以形式化证明为主要评估:证明满足语法条件的切片语义正确,给出最小切片算法,并证明结果可推广到结构化概率程序,依赖 pCFG 语义的充分性。
原文摘要(Abstract)

Dedicated to the memory of Sebastian Danicic. We present a theory for slicing imperative probabilistic programs containing random assignments and “observe” statements for conditioning. We represent such programs as probabilistic control-flow graphs (pCFGs) whose nodes modify probability distributions. This allows direct adaptation of standard machinery such as data dependence, postdominators, relevant variables, and so on, to the probabilistic setting. We separate the specification of slicing from its implementation: (1) first, we develop syntactic conditions that a slice must satisfy (they involve the existence of another disjoint slice such that the variables of the two slices are probabilistically independent of each other); (2) next, we prove that any such slice is semantically correct; (3) finally, we give an algorithm to compute the least slice. To generate smaller slices, we may in addition take advantage of knowledge that certain loops will terminate (almost) always. Our results carry over to the slicing of structured imperative probabilistic programs, as handled in recent work by Hur et al. For such a program, we can define its slice, which has the same “normalized” semantics as the original program; the proof of this property is based on a result proving the adequacy of the semantics of pCFGs w.r.t. the standard semantics of structured imperative probabilistic programs.

链接与引用

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

BibTeX
@article{AmtoftB20,
  title = {A Theory of Slicing for Imperative Probabilistic Programs},
  author = {Torben Amtoft and Anindya Banerjee},
  journal = {ACM Transactions on Programming Languages and Systems},
  volume = {42},
  number = {2},
  year = {2020},
  doi = {10.1145/3372895}
}