arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2011.04045cs.LO
收藏

利用顺序数据结构知识生成并发程序

Generating Concurrent Programs From Sequential Data Structure Knowledge

Sarat Chandra Varanasi, Neeraj Mittal, Gopal Gupta

摘要:

在本文中,我们解决的问题,自动设计并发数据结构操作给定的顺序数据结构规范和知识的并发行为。即使在最简单的情况下,设计并发代码也是一项重要的任务。人类通常通过将顺序版本转换为各自的并发版本来设计并发数据结构操作。这需要理解数据结构、其顺序行为、并发执行期间的线程交互以及共享内存同步原语。我们使用自动化的常识推理来机械化这个设计过程。我们假设数据结构描述作为公理与其代数运算的顺序代码一起提供。此信息用于自动导出该数据结构的并发代码,例如链表和二叉搜索树的字典操作。在我们的案例中,知识是用答案集编程(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.

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

↑