arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.09064cs.PL
收藏

概率程序的牛顿式程序分析

Newtonian Program Analysis of Probabilistic Programs

Di Wang, Thomas Reps

AI总结:

针对概率程序分析多依赖迭代近似的问题,提出基于牛顿式程序分析的NPA-PMA框架,通过引入ω-连续预马尔可夫代数、正则无限树表达式和线性化方法实现部分非迭代分析,实验证明其性能优于Kleene迭代且通用性强。

摘要:

由于其定量特性,概率程序给设计组合式且高效的程序分析带来了不小的挑战。许多针对概率程序的分析都依赖迭代近似。本文提出了一种名为NPA-PMA的过程间数据流分析框架,用于设计和实现针对具有非结构化控制流、非确定性和通用递归的概率程序的(部分)非迭代程序分析。NPA-PMA基于牛顿式程序分析(Newtonian Program Analysis,NPA),这是牛顿法的一种推广,用于求解半环上的方程组。开发NPA-PMA的核心挑战在于需要处理分析所基于的代数结构以及编码控制流的方程组中的多种汇合操作:半环仅支持单一汇合操作,而NPA-PMA涉及三种汇合操作(条件汇合、概率汇合和非确定性汇合)。\n 我们的工作引入了ω-连续预马尔可夫代数(ω-continuous pre-Markov algebras,ωPMAs)以提取不同分析的共有部分;采用正则无限树表达式来编码控制流超图中的程序执行路径;并提出了一种线性化方法,使牛顿法能够适用于ωPMAs上的正则无限树方程组场景。NPA-PMA允许分析提供非迭代策略来求解线性化后的方程组。我们的实验评估表明:(i)NPA-PMA在性能上有望显著优于Kleene迭代,且(ii)在设计程序分析方面具有很强的通用性。

英文摘要:

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 program-execution paths in control-flow hyper-graphs; 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑