acceptodds
Published as a conference paper at NeurIPS 2026

P: Joint Program-and-Proof Planning for Verified Code Generation

Zenan Li, Ziran Yang, Peiyang Song, Zhaoyu Li, Kaiyu Yang

Abstract

Verified code generation asks a large language model (LLM) to generate both an executable program and a machine-checkable proof that the program meets a formal specification, promising software that is correct by construction. The de facto workflow decouples the two halves of the problem: first synthesize a program, then attempt to prove it correct. We observe that this sequential pipeline can be both ineffective and inefficient in practice. A program generated without anticipating its proof can be subtly incorrect or structurally difficult to verify, forcing the LLM into brittle repair loops that alternate between patching the code and patching the proof. Inspired by Dijkstra's view that a program and its correctness argument should be developed hand in hand, we propose , an LLM-based agentic workflow that first derives a unified program-and-proof plan from the specification, then elaborates the implementation and proof scaffold under this shared plan. To evaluate verified code generation in realistic settings, we further introduce Lean4Commit0, a project-level benchmark built by extracting core APIs from real-world software repositories and translating their requirements, including relational specifications across APIs, into Lean tasks. Using four frontier LLM backends, we evaluate on Verina, AlgoVeri, and our Lean4Commit0 benchmark, where it achieves the highest solve rate in every benchmark–model setting. Compared with the stronger baseline, it improves solve rates by 4.6–11.2 percentage points and reduces per-task API cost by up to roughly 40% and wall-clock time by up to roughly 37% on the difficult subset of each benchmark.

Keywords:
Sydney, Main Track

Reviews

Among:
Shape:
123456this paper, Bottom 49%
Figure 1. Mean review rating of the reviewed papers at NeurIPS 2026. This paper averages 4.33 over 3 reviews, above 49% of the others.
Reviewer_GpuCOpenReview ↗
Rating
4
Clarity
4
Confidence
4
Originality
3
Quality
3
Significance
3
Read review
Summary

This paper proposes a methodology for agentic verified code generation in Lean 4. Instead of the program-then-proof sequential pipeline adopted by most frameworks, it introduces a planning phase where coding agents are instructed to generate a sketch of decomposed program-generation / proof-elaboration tasks; then both program and proof are generated against the same plan. Additionally, the paper introduces a new set of benchmarks that include real-world programs. Experimental results show the methodology is effective compared to the sequential approach.

Strengths and weaknesses

Strengths:

  • Targets a relevant problem: how to orchestrate coding agents for verified code generation.
  • Good illustrating examples to motivate the coupling of program generation and proof elaboration.
  • Proposes real-world benchmarks.

Weaknesses:

  • The proposed method is relatively simple and the improvement compared to the baseline is modest, which limits the novelty of the contribution.
  • Missing hints on the reproducibility of the results.
Questions
  1. When prompting coding agents to produce a plan, what are the key technical/algorithmic insights for instructing the agent to construct a program/proof sketch? Could the authors give more detail on the first paragraph of Section 3.1?
  2. How many runs per benchmark entry were tried? Could the authors comment on the reproducibility of the results, especially for Table 2?
  3. I appreciate the case study on the red-black tree. Could the authors share an example from the newly proposed real-world benchmark that is not solvable by plain agent calls or the sequential method, but is solvable using the proposed method?
  4. Can the authors envision how the proposed method might adapt to languages with a less expressive type system but good deductive-verifier support? The paper mentions Rust and Verus — would the same methodology work in that setting?
Limitations

Yes. The paper discusses limitations (Appendix C), including disclosing that statistical significance testing was infeasible.

Paper formatting concerns

No

Reviewer_ANinOpenReview ↗
Rating
4
Clarity
3
Confidence
3
Originality
3
Quality
3
Significance
3
Read review
Summary

This paper consider verifiable code generation: given a formal specification, generate both code and a proof that the code meets the spec. Current approaches writes code first and then tries to prove it. However, a directly written program is often hard to verify, which pushes the model into heavy proof repair loops. The authors instead let the agent plan the program and proof together, by first presenting a shared sketch, then refinement, therefore the code and proof are improved jointly. They also introduce Lean4Commit0 benchmark built from real repositories. Across three benchmarks and four LLMs, the method (P3) gives the highest solve rate with cost and time savings.

Strengths and weaknesses

Strengths

  1. The research gap of code-then-proof methods is clearly stated. The proposed fix (planning code and proof jointly) is reasonable and well-motivated.
  2. The evaluation results show consistent solve-rate gains across all benchmark model combinations, as well as reductions in cost.

Weaknesses

  1. The comparison only includes the plain agent and the sequential (program-then-proof) baseline. Are there really no other relevant methods to compare against?
  2. The method assumes that the LLM can correctly predict proof burden without writing the full proof. Judging that "the rebuild route reduces to a list permutation, whereas structural deletion needs a long invariant chain" is itself a nontrivial intuition. On tasks with clean textbook structure the planner can get this right, but on genuinely unfamiliar specs the planner may pick the wrong plan. The approach depends heavily on this LLM capability. Is there any analysis or statistics on this?
  3. Lean-based verification is limited to small programs. It's unclear how well this transfers to real-world large-scale code.
Questions
  1. When the planner compares sketches and predicts proof burden, how often is it correct? Do you have any statistics?
  2. For the tasks P3 fails on, where does it break down? Bad plan, or correct plan but failed elaboration?
Limitations

yes

Paper formatting concerns

no

Final justification

For my questions, authors either explained to me or added new promising evaluation.

Reviewer_KMDXOpenReview ↗
Rating
5
Clarity
4
Confidence
3
Originality
3
Quality
3
Significance
3
Read review
Summary

This paper shows that program verification benefits from generating the program and the proof jointly.This paper also introduces a new benchmark for program verification that takes into account library functions that share post conditions.

Strengths and weaknesses

This paper was easy to follow and well-written. The experiments were thorough and well-thought out. The evaluation used relevant systems. While this is a very active area of research, I could not recall any other papers that focused on jointly generating the proof and program jointly. This work definitely makes a useful contribution to the area.

Questions

Could this benefit from an ablation study? Could you check if only adding planning helps? Namely Planning -> Program -> Proof as a baseline

Limitations

The paper does include limitations but they are restricted to the appendix. It would be nice if they were in the main section of the paper.

Paper formatting concerns

No issues

Comments on the paper

1 comment
Meta-review

This paper proposes P³, an agentic workflow for verified code generation that plans the program and its correctness proof jointly before elaborating either component. The shared plan is intended to avoid programs that are functionally plausible but unnecessarily difficult to verify. The paper also introduces Lean4Commit0, a benchmark derived from real repositories and including relational specifications across library APIs. Across Verina, AlgoVeri, and Lean4Commit0 with four LLM backends, P³ achieves the highest solve rate in every reported benchmark–model setting, improving over the stronger sequential baseline by 4.6–11.2 percentage points while reducing cost and runtime on difficult subsets.

Strengths:

The problem is important and clearly motivated: program synthesis and proof construction are tightly coupled, yet existing workflows typically handle them sequentially. The joint-planning formulation is simple but sensible and appears broadly applicable.

The evaluation is a notable strength. Results are consistent across three benchmarks and four models, and the improvements include both solve rate and computational efficiency. Lean4Commit0 is also a useful contribution because it moves evaluation toward repository-derived APIs and cross-functional specifications. The manuscript is reportedly clear and supported by informative examples.

Weaknesses:

The central weakness is that the evaluation does not fully isolate why P³ works. In particular, the paper lacks a planning-only baseline such as Planning → Program → Proof, making it unclear whether gains arise from joint program–proof reasoning or simply from adding a planning stage.

The method also assumes that the model can accurately estimate proof difficulty when selecting a plan, but no statistics are provided on plan quality, incorrect plan selection, or where failed runs break down. Baseline coverage is relatively limited, and details concerning repeated runs, variance, and reproducibility should be strengthened. Finally, the current experiments involve relatively small Lean tasks, leaving scalability to larger software systems uncertain.

Desired Results in the Author Rebuttal:

The response could materially strengthen the acceptance case by providing:

  1. A Planning → Program → Proof ablation under the same computational budget.

  2. Statistics on plan-selection accuracy and a failure decomposition separating poor plans from failed implementation or proof elaboration.

  3. Clarification of the number of runs, variance, reproducibility resources, and relevant omitted baselines.

  4. A representative Lean4Commit0 example solved only by P³, together with a clearer discussion of scalability.

Overall, the method is technically straightforward, but the consistent empirical gains and useful benchmark contribution outweigh the current evaluation. Hereby my initial assessment leans toward the acceptance (Poster).

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.