We propose a symbolic execution method for programs that can draw random samples. In contrast to existing work, our method can verify randomized programs with unknown inputs and can prove probabilistic properties that universally quantify over all possible inputs. Our technique augments standard symbolic execution with a new class of \emph{probabilistic symbolic variables}, which represent the results of random draws, and computes symbolic expressions representing the probability of taking individual paths. We implement our method on top of the \textsc{KLEE} symbolic execution engine alongside multiple optimizations and use it to prove properties about probabilities and expected values for a range of challenging case studies written in C++, including Freivalds' algorithm, randomized quicksort, and a randomized property-testing algorithm for monotonicity. We evaluate our method against \textsc{Psi}, an exact probabilistic symbolic inference engine, and \textsc{Storm}, a probabilistic model checker, and show that our method significantly outperforms both tools.
翻译:我们为能够抽取随机样本的程序建议一种象征性执行方法。 与现有的工作相比, 我们的方法可以校验随机程序, 输入未知, 并且可以证明概率性能, 对所有可能的输入进行普遍量化。 我们的技术可以增加标准的象征性执行, 使用一个新的 \ emph{ 概率符号变量 类别, 代表随机抽取的结果, 并计算代表选择单个路径的概率的符号表达式。 我们用在 \ textsc{ KLEE} 符号执行引擎之上的方法, 并同时进行多重优化, 并用它来证明 C++ 中撰写的一系列具有挑战性的案例研究的概率和预期值的属性, 包括 Freivalds 的算法, 随机化快索尔特, 以及一个随机化的单一度属性测试算法。 我们对照 \ textsc{ Psi} 来评估我们的方法, 一种精确的概率性象征性的符号推断引擎, 和\ textsc{ Storm}, 一种概率模型检查器, 并显示我们的方法明显超过两种工具。