Deep Generation of Coq Lemma Names Using Elaborated Terms

04/16/2020
by   Pengyu Nie, et al.
0

Coding conventions for naming, spacing, and other essentially stylistic properties are necessary for developers to effectively understand, review, and modify source code in large software projects. Consistent conventions in verification projects based on proof assistants, such as Coq, increase in importance as projects grow in size and scope. While conventions can be documented and enforced manually at high cost, emerging approaches automatically learn and suggest idiomatic names in Java-like languages by applying statistical language models on large code corpora. However, due to its powerful language extension facilities and fusion of type checking and computation, Coq is a challenging target for automated learning techniques. We present novel generation models for learning and suggesting lemma names for Coq projects. Our models, based on multi-input neural networks, are the first to leverage syntactic and semantic information from Coq's lexer (tokens in lemma statements), parser (syntax trees), and kernel (elaborated terms) for naming; the key insight is that learning from elaborated terms can substantially boost model performance. We implemented our models in a toolchain, dubbed Roosterize, and applied it on a large corpus of code derived from the Mathematical Components family of projects, known for its stringent coding conventions. Our results show that Roosterize substantially outperforms baselines for suggesting lemma names, highlighting the importance of using multi-input models and elaborated terms.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/01/2021

Roosterize: Suggesting Lemma Names for Coq Verification Projects Using Deep Learning

Naming conventions are an important concern in large verification projec...
research
06/18/2020

Learning to Format Coq Code Using Language Models

Should the final right bracket in a record declaration be on a separate ...
research
09/19/2019

DIRE: A Neural Approach to Decompiled Identifier Naming

The decompiler is one of the most common tools for examining binaries wi...
research
07/10/2019

Identifying Algorithm Names in Code Comments

For recent machine-learning-based tasks like API sequence generation, co...
research
03/17/2020

Big Code != Big Vocabulary: Open-Vocabulary Models for Source Code

Statistical language modeling techniques have successfully been applied ...
research
12/09/2019

It Runs in the Family: Searching for Similar Names using Digitized Family Trees

Searching for a person's name is a common online activity. However, web ...
research
03/29/2022

Geographic Diversity in Public Code Contributions

We conduct an exploratory, large-scale, longitudinal study of 50 years o...

Please sign up or login with your details

Forgot password? Click here to reset