Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?
Madeline Endres, Sarah Fakhoury, Saikat Chakraborty, Shuvendu K., Lahiri

TL;DR
This paper explores using Large Language Models to convert informal natural language descriptions of code into formal postconditions, aiming to improve code verification and debugging.
Contribution
It introduces the nl2postcond problem, proposes metrics for evaluating LLM-generated postconditions, and demonstrates their practical usefulness in bug detection.
Findings
Generated postconditions are generally correct and discriminative.
nl2postcond can catch 64 real-world bugs from Defects4J.
Metrics effectively compare different nl2postcond approaches.
Abstract
Informal natural language that describes code functionality, such as code comments or function documentation, may contain substantial information about a programs intent. However, there is typically no guarantee that a programs implementation and natural language documentation are aligned. In the case of a conflict, leveraging information in code-adjacent natural language has the potential to enhance fault localization, debugging, and code trustworthiness. In practice, however, this information is often underutilized due to the inherent ambiguity of natural language which makes natural language intent challenging to check programmatically. The emergent abilities of Large Language Models (LLMs) have the potential to facilitate the translation of natural language intent to programmatically checkable assertions. However, it is unclear if LLMs can correctly translate informal natural…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software System Performance and Reliability · Software Reliability and Analysis Research
