Pith. sign in

REVIEW 2 cited by

Dafny as Verification-Aware Intermediate Language for Code Generation

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2501.06283 v1 pith:I3MSBXBA submitted 2025-01-10 cs.SE cs.AIcs.CLcs.LOcs.PL

Dafny as Verification-Aware Intermediate Language for Code Generation

classification cs.SE cs.AIcs.CLcs.LOcs.PL
keywords codelanguagedafnyusercorrectgenerategeneratedgeneration
verification ladder T0 review T1 audit T2 compute T3 formal T4 reserved
0 comments
Share X Bluesky LinkedIn Reddit HN
read the original abstract

Using large language models (LLMs) to generate source code from natural language prompts is a popular and promising idea with a wide range of applications. One of its limitations is that the generated code can be faulty at times, often in a subtle way, despite being presented to the user as correct. In this paper, we explore ways in which formal methods can assist with increasing the quality of code generated by an LLM. Instead of emitting code in a target language directly, we propose that the user guides the LLM to first generate an opaque intermediate representation, in the verification-aware language Dafny, that can be automatically validated for correctness against agreed on specifications. The correct Dafny program is then compiled to the target language and returned to the user. All user-system interactions throughout the procedure occur via natural language; Dafny code is never exposed. We describe our current prototype and report on its performance on the HumanEval Python code generation benchmarks.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 2 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. Why3-py: A Tool for Formal Verification of Hypothesis Testing and Meta-Analysis in Python

    cs.SE 2026-07 accept novelty 6.0

    Why3-py is a Python front-end to Why3 plus an extended StatWhy that verifies annotated hypothesis-testing and meta-analysis programs by discharging assumption and interpretation obligations.

  2. Copper: Unifying Correctness and Performance Specification in Code Generation

    cs.SE 2026-07 conditional novelty 5.0

    Copper raises LLM success at producing Dafny-verified, complexity-constrained code via short/detailed/formal prompts and repair loops, but is only demonstrated on binary search.