祈使与MapReduce算法的关系等价性证明
Relational Equivalence Proofs Between Imperative and MapReduce Algorithms
摘要:
MapReduce框架被广泛用于实现分布式算法。然而,将命令式算法转换为这些框架需要对算法进行重大的结构更改。由于大规模运行错误算法的成本可能是严重的,因此非常希望验证翻译的正确性,即,证明MapReduce版本与命令式版本等价。我们提出了一种新的方法来证明命令式和MapReduce算法之间的等价性的基础上划分的等价性证明到一个序列的等价性证明之间的中间程序具有较小的差异。我们的方法是基于这样的见解,即需要两种子证明:(1)改变控制流结构的统一变换,这些变换大多独立于它们所应用的特定上下文;以及(2)上下文相关的变换,这些变换不是统一的,但保留了整体结构,并且可以使用耦合不变量证明是正确的。我们证明了我们的方法的可行性,通过评估它的两个原型算法通常用作MapReduce框架中的例子:k-means和PageRank。为了进行证明,我们使用交互式定理证明器Coq与部分证明自动化。结果表明,我们的方法及其基于Coq的原型实现,使非平凡算法的等价性证明,并可以在很大程度上自动化。
英文摘要:
MapReduce frameworks are widely used for the implementation of distributed algorithms. However, translating imperative algorithms into these frameworks requires significant structural changes to the algorithm. As the costs of running faulty algorithms at scale can be severe, it is highly desirable to verify the correctness of the translation, i.e., to prove that the MapReduce version is equivalent to the imperative original. We present a novel approach for proving equivalence between imperative and MapReduce algorithms based on partitioning the equivalence proof into a sequence of equivalence proofs between intermediate programs with smaller differences. Our approach is based on the insight that two kinds of sub-proofs are required: (1) uniform transformations changing the controlflow structure that are mostly independent of the particular context in which they are applied; and (2) context-dependent transformations that are not uniform but that preserve the overall structure and can be proved correct using coupling invariants. We demonstrate the feasibility of our approach by evaluating it on two prototypical algorithms commonly used as examples in MapReduce frameworks: k-means and PageRank. To carry out the proofs, we use the interactive theorem prover Coq with partial proof automation. The results show that our approach and its prototypical implementation based on Coq enables equivalence proofs of non-trivial algorithms and could be automated to a large degree.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。