Deep Generation of Coq Lemma Names Using Elaborated Terms

Pengyu Nie, Karl Palmskog, Junyi Jessy Li, Milos Gligoric
4/16/2020
cs.PLcs.CLcs.SE

Official code: EngineeringSoftware/roosterize (22 stars, MIT, PyTorch, last commit 2022-09-06).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

PyTorchMIT

Tool for suggesting lemma names in Coq verification projects

225Shell, PythonApr 19, 20204 years agoMIT
coqdeep-learningmachine-learningmathcompname-generation+3 more

Similar Papers

Cite this paper

@article{nie2020deep,
  title  = {Deep Generation of Coq Lemma Names Using Elaborated Terms},
  author = {Pengyu Nie and Karl Palmskog and Junyi Jessy Li and Milos Gligoric},
  year   = {2020},
  eprint = {2004.07761},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2004.07761}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2004.07761.svg)](https://codeofpaper.com/paper/2004.07761)

Discussion