当前位置: X-MOL 学术arXiv.cs.LO › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Generating Concurrent Programs From Sequential Data Structure Knowledge
arXiv - CS - Logic in Computer Science Pub Date : 2020-11-08 , DOI: arxiv-2011.04045
Sarat Chandra Varanasi, Neeraj Mittal, Gopal Gupta

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.

中文翻译:

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

在本文中,我们解决了在给定顺序数据结构规范和有关并发行为的知识的情况下自动设计并发数据结构操作的问题。即使在最简单的情况下,设计并发代码也是一项重要的任务。人们通常通过将顺序版本转换为各自的并发版本来设计并发数据结构操作。这需要了解数据结构、其顺序行为、并发执行期间的线程交互和共享内存同步原语。我们使用自动常识推理来机械化这个设计过程。我们假设数据结构描述与其代数运算的顺序代码一起作为公理提供。此信息用于自动导出该数据结构的并发代码,例如链表和二叉搜索树的字典操作。在我们的案例中,知识是使用答案集编程 (ASP) 表达的,我们在所涉及的推理中使用演绎、归纳和溯因——就像人类所做的那样。ASP 允许对指针数据结构、运行时线程交互和共享内存同步的一阶理论进行简洁建模。我们的推理机可以系统地做出与人类推理机相同的判断,同时构建可证明安全的并发代码。我们提出了将顺序数据结构转换为其等效并发版本所涉及的几个推理挑战。所有的推理任务都在 ASP 中编码,我们的推理器可以做出合理的判断,将顺序代码转换为并发代码。据我们所知,我们的工作是第一个使用常识推理将顺序程序自动转换为并发代码的工作。
更新日期:2020-11-10
down
wechat
bug