一句话:提出 NPA-PMA 框架,将牛顿法程序分析推广到含非确定性、非结构化控制流和递归的概率程序数据流分析。
概率程序的定量特性使组合式、高效的程序分析颇具挑战,许多分析依赖迭代近似。本文提出过程间数据流分析框架 NPA-PMA,面向含非结构化控制流、非确定性和一般递归的概率程序,设计(部分)非迭代分析。它基于牛顿法程序分析(NPA),将牛顿法推广到半环上的方程组求解。关键难点是需处理条件、概率、非确定性三种汇合,而半环仅支持单一汇合。作者引入 ω-连续 pre-Markov 代数(ωPMA)以抽取不同分析的公共结构,用正则无限树表达式编码程序,并提出线性化方法,使牛顿法适用于 ωPMA 上的正则无限树方程。框架允许分析为线性化方程提供非迭代求解策略。实验表明其有望优于 Kleene 迭代,并具有良好通用性。
Due to their quantitative nature, probabilistic programs pose non-trivial challenges for designing compositional and efficient program analyses. Many analyses for probabilistic programs rely on iterative approximation. This article presents an interprocedural dataflow-analysis framework, called NPA-PMA, for designing and implementing (partially) non-iterative program analyses of probabilistic programs with unstructured control-flow, nondeterminism, and general recursion. NPA-PMA is based on Newtonian Program Analysis (NPA), a generalization of Newton's method to solve equation systems over semirings. The key challenge for developing NPA-PMA is to handle multiple kinds of confluences in both the algebraic structures that specify analyses and the equation systems that encode control flow: semirings support a single confluence operation, whereas NPA-PMA involves three confluence operations (conditional, probabilistic, and nondeterministic). Our work introduces ω-continuous pre-Markov algebras (ωPMAs) to factor out common parts of different analyses; adopts regular infinite-tree expressions to encode probabilistic programs with unstructured control-flow; and presents a linearization method that makes Newton's method applicable to the setting of regular-infinite-tree equations over ωPMAs. NPA-PMA allows analyses to supply a non-iterative strategy to solve linearized equations. Our experimental evaluation demonstrates that (i) NPA-PMA holds considerable promise for outperforming Kleene iteration, and (ii) provides great generality for designing program analyses.