arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1508.04856cs.PLcs.DC
收藏

基于Why3的并行程序演绎验证

Deductive Verification of Parallel Programs Using Why3

César Santos, Francisco Martins, Vasco Thudichum Vasconcelos

摘要:

消息传递接口规范(MPI)定义了一个用于并行计算机编程的可移植消息传递API。MPI程序在正确性方面存在许多挑战:通信中的发送值和期望值可能不匹配,导致不正确的计算,可能导致崩溃;程序可能会死锁,导致资源浪费。现有的工具是不完全令人满意的:模型检查不规模与过程的数量,测试技术浪费资源,并高度依赖于测试集的质量。作为一种替代方案,我们提出了一个原型的基于类型的方法来编程和验证MPI像程序对协议。协议是用依赖类型语言编写的,旨在捕获MPI中最常见的原语,此外还包含一种原语递归和集体选择的形式。然后将协议翻译成Why 3,一种演绎软件验证工具。而源代码则是用Why 3平台的语言WhyML编写的,并根据协议进行检查。保证通过验证的程序是通信安全的,没有死锁。我们使用我们的方法验证了教科书中的几个并行程序,并报告了结果。

英文摘要:

The Message Passing Interface specification (MPI) defines a portable message-passing API used to program parallel computers. MPI programs manifest a number of challenges on what concerns correctness: sent and expected values in communications may not match, resulting in incorrect computations possibly leading to crashes; and programs may deadlock resulting in wasted resources. Existing tools are not completely satisfactory: model-checking does not scale with the number of processes; testing techniques wastes resources and are highly dependent on the quality of the test set. As an alternative, we present a prototype for a type-based approach to programming and verifying MPI like programs against protocols. Protocols are written in a dependent type language designed so as to capture the most common primitives in MPI, incorporating, in addition, a form of primitive recursion and collective choice. Protocols are then translated into Why3, a deductive software verification tool. Source code, in turn, is written in WhyML, the language of the Why3 platform, and checked against the protocol. Programs that pass verification are guaranteed to be communication safe and free from deadlocks. We verified several parallel programs from textbooks using our approach, and report on the outcome.

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

↑