Generating Concurrent Programs From Sequential Data Structure Knowledge

11/08/2020
by   Sarat Chandra Varanasi, et al.
0

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.

READ FULL TEXT
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

09/17/2021

Generating Concurrent Programs From Sequential Data Structure Knowledge Using Answer Set Programming

We tackle the problem of automatically designing concurrent data structu...
10/02/2020

Proving Highly-Concurrent Traversals Correct

Modern highly-concurrent search data structures, such as search trees, o...
04/27/2019

A Practical Analysis of Rust's Concurrency Story

Correct concurrent programs are difficult to write; when multiple thread...
05/10/2018

Order out of Chaos: Proving Linearizability Using Local Views

Proving the linearizability of highly concurrent data structures, such a...
06/22/2020

Scalable Range Locks for Scalable Address Spaces and Beyond

Range locks are a synchronization construct designed to provide concurre...
03/08/2021

A coordination-free, convergent, and safe replicated tree

The tree is an essential data structure in many applications. In a distr...
08/06/2018

The Internals of the Data Calculator

Data structures are critical in any data-driven scenario, but they are n...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.