arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1011.0551cs.LOcs.FL
收藏

异步程序的并行验证

Algorithmic Verification of Asynchronous Programs

Pierre Ganty, Rupak Majumdar

摘要:

异步编程是一种无处不在的系统编程习惯,用于管理与环境的并发交互。在这种风格中,程序员不是等待耗时的操作完成,而是对操作进行非阻塞调用,并将回调任务发布到任务缓冲区,该任务缓冲区稍后在耗时的操作完成时执行。协作调度器通过从任务缓冲区中挑选并执行回调任务来协调交互(这些回调可以发布更多的回调以供稍后执行)。编写正确的异步程序是困难的,因为回调的使用虽然有效,但模糊了程序控制流。我们提供了一个形式化的异步程序模型,并研究了这个模型的验证问题。我们证明了有限数据异步程序的安全验证问题是expspace完备的。我们证明了有限数据异步程序的活性验证是可判定的,并且多项式时间等价于Petri网的可达性。可判定性并不明显,因为即使数据是有限状态的,异步程序也构成了无限状态转换系统:挂起的异步调用的程序堆栈和任务缓冲区都可能是无限的。我们的主要技术结构是一个多项式时间的语义保持减少从异步程序的Petri网,反之亦然。这种简化允许在Petri网上使用算法技术来验证异步程序。我们还研究了几个扩展的异步程序的基本模型的灵感来自异步库的实现提供的额外功能,并分类这些扩展的验证问题的可判定性和不可判定性。

英文摘要:

Asynchronous programming is a ubiquitous systems programming idiom to manage concurrent interactions with the environment. In this style, instead of waiting for time-consuming operations to complete, the programmer makes a non-blocking call to the operation and posts a callback task to a task buffer that is executed later when the time-consuming operation completes. A co-operative scheduler mediates the interaction by picking and executing callback tasks from the task buffer to completion (and these callbacks can post further callbacks to be executed later). Writing correct asynchronous programs is hard because the use of callbacks, while efficient, obscures program control flow. We provide a formal model underlying asynchronous programs and study verification problems for this model. We show that the safety verification problem for finite-data asynchronous programs is expspace-complete. We show that liveness verification for finite-data asynchronous programs is decidable and polynomial-time equivalent to Petri Net reachability. Decidability is not obvious, since even if the data is finite-state, asynchronous programs constitute infinite-state transition systems: both the program stack and the task buffer of pending asynchronous calls can be potentially unbounded. Our main technical construction is a polynomial-time semantics-preserving reduction from asynchronous programs to Petri Nets and conversely. The reduction allows the use of algorithmic techniques on Petri Nets to the verification of asynchronous programs. We also study several extensions to the basic models of asynchronous programs that are inspired by additional capabilities provided by implementations of asynchronous libraries, and classify the decidability and undecidability of verification questions on these extensions.

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

↑