On the Effectiveness of Large Language Models in Writing Alloy Formulas
Yang Hong, Shan Jiang, Yulei Fu, Sarfraz Khurshid

TL;DR
This paper evaluates large language models' ability to generate, modify, and complete Alloy formulas from natural language descriptions, demonstrating their potential to improve specification writing in software development.
Contribution
It introduces a novel application of LLMs for writing and completing Alloy specifications, showing their effectiveness in this domain.
Findings
LLMs can generate complete Alloy formulas from natural language descriptions.
LLMs successfully create equivalent alternative formulas in Alloy.
LLMs effectively complete sketches of Alloy formulas based on natural language properties.
Abstract
Declarative specifications have a vital role to play in developing safe and dependable software systems. Writing specifications correctly, however, remains particularly challenging. This paper presents a controlled experiment on using large language models (LLMs) to write declarative formulas in the well-known language Alloy. Our use of LLMs is three-fold. One, we employ LLMs to write complete Alloy formulas from given natural language descriptions (in English). Two, we employ LLMs to create alternative but equivalent formulas in Alloy with respect to given Alloy formulas. Three, we employ LLMs to complete sketches of Alloy formulas and populate the holes in the sketches by synthesizing Alloy expressions and operators so that the completed formulas accurately represent the desired properties (that are given in natural language). We conduct the experimental evaluation using 11…
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.
