Abstract

Program synthesis, the task of automatically finding programs from the underlying programming language that satisfy user intent expressed in some form of constraints, has been regarded as one of the most central problems and hottest research fields in the theory of programming. On the other hand, the development of neural networks and deep learning in many fields has led researchers to consider the possibility of applying them to solve the program synthesis problems. In this paper, we took the probabilistic program synthesis realized by the neural network as the research subject and noticed that most of the current work borrows from the structure of encoding and decoding in natural language processing. We analyzed its two possible disadvantages, one is the performance degradation of the long-sequence structure, the other is that synthesized results without validation are too redundant. We took a probabilistic encoder-decoder neural model named BAYOU as an example to analyze the specific problem. We proposed a framework named PASS which contains several methods to solve those problems and improve the model performance. For the former problem, we showed how to adapt neural networks to increase the attention mechanism to address the problem of information forgetting and long sequences unmanageable. Then, we combined the program slicing in the field of program analysis to slice the generated program, thereby eliminated redundant code of result from methods without validation and had a more refined result. The experiment showed that the accuracy of neural program synthesis guided from our approach improved by a mean of 17%, up to a maximum of 22%. Besides, the slicing work of our approach succeeded in a mean about code refinement rate of 25.3% for those methods without result validation.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call