论文标题

从顺序数据结构知识中生成并发程序

Generating Concurrent Programs From Sequential Data Structure Knowledge

论文作者

Varanasi, Sarat Chandra, Mittal, Neeraj, Gupta, Gopal

论文摘要

在本文中,我们解决了鉴于连续数据结构规范和有关并发行为的知识,可以自动设计并发数据结构操作的问题。即使在最简单的情况下,设计并发代码也是一项非平凡的任务。人类通常通过将顺序版本转换为各自的并发版本来设计同时的数据结构操作。这需要了解数据结构,其顺序行为,并发执行期间的线程交互以及共享存储器同步原语。我们使用自动常识性推理对这个设计过程进行了调整。我们假设数据结构描述与代数操作的顺序代码一起提供为公理。此信息用于自动得出该数据结构的并发代码,例如用于链接列表和二进制搜索树的字典操作。我们案件中的知识是使用答案集编程(ASP)表达的,我们采用了推论,归纳和绑架 - 就像人类在所涉及的推理中一样。 ASP允许对指针数据结构的一阶理论,运行时线程交互和共享内存同步进行简洁的建模。我们的推理者可以系统地做出与人类推理者相同的判断,同时构建可证明安全的并发代码。我们提出了将顺序数据结构转换为等效并发版本的几个推理挑战。所有推理任务均在ASP中编码,我们的推理器可以做出合理的判断以将顺序代码转换为并发代码。据我们所知,我们的工作是第一个使用常识性推理自动将顺序程序转换为并发代码的工作。

In this paper we tackle the problem of automatically designing concurrent data structure operations given a sequential data structure specification and knowledge about concurrent behavior. Designing concurrent code is a non-trivial task even in simplest of cases. Humans often design concurrent data structure operations by transforming sequential versions into their respective concurrent versions. This requires an understanding of the data structure, its sequential behavior, thread interactions during concurrent execution and shared memory synchronization primitives. We mechanize this design process using automated commonsense reasoning. We assume that the data structure description is provided as axioms alongside the sequential code of its algebraic operations. This information is used to automatically derive concurrent code for that data structure, such as dictionary operations for linked lists and binary search trees. Knowledge in our case is expressed using Answer Set Programming (ASP), and we employ deduction, induction and abduction---just as humans do---in the reasoning involved. ASP allows for succinct modeling of first order theories of pointer data structures, run-time thread interactions and shared memory synchronization. Our reasoner can systematically make the same judgments as a human reasoner while constructing provably safe concurrent code. We present several reasoning challenges involved in transforming the sequential data structure into its equivalent concurrent version. All the reasoning tasks are encoded in ASP and our reasoner can make sound judgments to transform sequential code into concurrent code. To the best of our knowledge, our work is the first one to use commonsense reasoning to automatically transform sequential programs into concurrent code.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源