14 research outputs found

    Synthesizing Imperative Programs from Examples Guided by Static Analysis

    Full text link
    We present a novel algorithm that synthesizes imperative programs for introductory programming courses. Given a set of input-output examples and a partial program, our algorithm generates a complete program that is consistent with every example. Our key idea is to combine enumerative program synthesis and static analysis, which aggressively prunes out a large search space while guaranteeing to find, if any, a correct solution. We have implemented our algorithm in a tool, called SIMPL, and evaluated it on 30 problems used in introductory programming courses. The results show that SIMPL is able to solve the benchmark problems in 6.6 seconds on average.Comment: The paper is accepted in Static Analysis Symposium (SAS) '17. The submission version is somewhat different from the version in arxiv. The final version will be uploaded after the camera-ready version is read

    Learning Semantic Correspondences in Technical Documentation

    Full text link
    We consider the problem of translating high-level textual descriptions to formal representations in technical documentation as part of an effort to model the meaning of such documentation. We focus specifically on the problem of learning translational correspondences between text descriptions and grounded representations in the target documentation, such as formal representation of functions or code templates. Our approach exploits the parallel nature of such documentation, or the tight coupling between high-level text and the low-level representations we aim to learn. Data is collected by mining technical documents for such parallel text-representation pairs, which we use to train a simple semantic parsing model. We report new baseline results on sixteen novel datasets, including the standard library documentation for nine popular programming languages across seven natural languages, and a small collection of Unix utility manuals.Comment: accepted to ACL-201

    A Syntactic Neural Model for General-Purpose Code Generation

    Full text link
    We consider the problem of parsing natural language descriptions into source code written in a general-purpose programming language like Python. Existing data-driven methods treat this problem as a language generation task without considering the underlying syntax of the target programming language. Informed by previous work in semantic parsing, in this paper we propose a novel neural architecture powered by a grammar model to explicitly capture the target syntax as prior knowledge. Experiments find this an effective way to scale up to generation of complex programs from natural language descriptions, achieving state-of-the-art results that well outperform previous code generation and semantic parsing approaches.Comment: To appear in ACL 201

    Mapping Language to Code in Programmatic Context

    Full text link
    Source code is rarely written in isolation. It depends significantly on the programmatic context, such as the class that the code would reside in. To study this phenomenon, we introduce the task of generating class member functions given English documentation and the programmatic context provided by the rest of the class. This task is challenging because the desired code can vary greatly depending on the functionality the class provides (e.g., a sort function may or may not be available when we are asked to "return the smallest element" in a particular member variable list). We introduce CONCODE, a new large dataset with over 100,000 examples consisting of Java classes from online code repositories, and develop a new encoder-decoder architecture that models the interaction between the method documentation and the class environment. We also present a detailed error analysis suggesting that there is significant room for future work on this task.Comment: Accepted at EMNLP 201

    LSTM Based Source Code Generation for Turkish Pseudo Code of Algorithm

    Get PDF
    Algorithmic thinking and programming abilities of students is controversial and popular issue in technological education programs in schools and universities. Students that have not best mathematical and analytical background may have difficulties in learning computer programing. Moreover, learning programming is highly difficult for a single individual to establish connection between discrete pseudo code of algorithm and source code. Another problem is required time to write a piece of program code. In order to solve this problem, there are some tools that tutor students to get analyze and realize relation between pseudo code and source code. In this study, we propose a deep learning method that is Long Short Term-Memory (LSTM) based source code generator from Turkish pseudo codes. For this purpose, we used Introduction to programming course exams in vocational high school as dataset to train LSTM. When users query a Turkish pseudo code of algorithm, C# source code is generated. In order to measure success of proposed system, generated source code and instructor’s source code is analyzed with text similarity methods. Results show that proposed system is useful for students to learn fundamental programming skills

    Eine Architektur für Programmsynthese aus natürlicher Sprache

    Get PDF
    Die Arbeit entwirft ein domänenunabhängiges Vorgehen, das aus natürlichsprachlichen englischen Texten Programme ableitet. Eingabetexte werden mit computerlinguistischen Analysen bearbeitet und schließlich auf Quelltext abgebildet. Um die Analysen von der anzusteuernden API zu entkoppeln, wird diese als Modell in den Analyseprozess eingespeist. Eine Fallstudie zur Programmierung von 3D-Animationen und eine zur Heimautomation zeigen die Leistungsfähigkeit und Flexibilität des Verfahrens
    corecore