P
3: Joint Program-and-Proof Planning for Verified Code Generation
P^3 is an LLM-based agentic workflow for verified code generation that jointly plans the program and its proof before elaborating both. This contrasts with the common sequential pipeline (program first, proof second), which often leads to brittle repair loops. Evaluated on Verina, AlgoVeri, and the new library-level benchmark Lean4Commit0, P^3 achieves the highest solve rate across all settings, improves solve rates by 4.6–11.2 percentage points, and reduces API cost by up to 40% and wall-clock time by up to 37% on difficult tasks.