Neural Program Generation Modulo Static Analysis

10/26/2021
by   Rohan Mukherjee, et al.
0

State-of-the-art neural models of source code tend to be evaluated on the generation of individual expressions and lines of code, and commonly fail on long-horizon tasks such as the generation of entire method bodies. We propose to address this deficiency using weak supervision from a static program analyzer. Our neurosymbolic method allows a deep generative model to symbolically compute, using calls to a static-analysis tool, long-distance semantic relationships in the code that it has already generated. During training, the model observes these relationships and learns to generate programs conditioned on them. We apply our approach to the problem of generating entire Java methods given the remainder of the class that contains the method. Our experiments show that the approach substantially outperforms state-of-the-art transformers and a model that explicitly tries to learn program semantics on this task, both in terms of producing programs free of basic semantic errors and in terms of syntactically matching the ground truth.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/31/2020

On the Generalizability of Neural Program Analyzers with respect to Semantic-Preserving Program Transformations

With the prevalence of publicly available source code repositories to tr...
research
09/10/2020

JCoffee: Using Compiler Feedback to Make Partial Code Snippets Compilable

Static program analysis tools are often required to work with only a sma...
research
04/13/2022

Timeloops: Automatic System Call Policy Learning for Containerized Microservices

In this paper we introduce Timeloops a novel technique for automatically...
research
01/08/2020

Deep Static Modeling of invokedynamic

Java 7 introduced programmable dynamic linking in the form of the invoke...
research
09/28/2017

Thread-Modular Static Analysis for Relaxed Memory Models

We propose a memory-model-aware static program analysis method for accur...
research
09/18/2020

Out of Sight, Out of Place: Detecting and Assessing Swapped Arguments

Programmers often add meaningful information about program semantics whe...
research
05/13/2020

A Generating-Extension-Generator for Machine Code

The problem of "debloating" programs for security and performance purpos...

Please sign up or login with your details

Forgot password? Click here to reset