cs.PLNov 26, 2026

Assessing LLM Program Reasoning through Equivalence Proofs

Authors: Haozhi Wang, Anders Miltner, Jocelyn Qiaochu Chen

Organizations: University of Alberta, Canada · Simon Fraser University, Canada · Also with Alberta Machine Intelligence Institute (Amii).

Abstract

Language models increasingly optimize and migrate code, and trusting these rewrites requires independently checkable arguments that they preserve program behavior. We ask whether models can construct such arguments as equivalence proofs. We propose a lightweight textual proof format based on relational Hoare logic, with automatic checks of intermediate claims and their compositions. Models may leave claims underived as explicit assumptions, keeping partial proofs checkable while recording how much of each argument they derive. We evaluate five models on 200 equivalent program pairs in two imperative languages with unfamiliar syntax and guard semantics. In free-form reasoning, every model reaches the correct verdict on at least 66% of tasks, yet proof acceptance without feedback ranges from 36% to 94%. A verifier-assisted workflow uses the checks to guide proof refinement, raising overall acceptance from 56.4% to 80%, with the two strongest models exceeding 97%. Proof records also reveal what acceptance rates alone obscure: among accepted proofs, some models derive nearly every step, while others leave most of the argument as explicit assumptions. How these models fail to construct a valid proof gives a profile on their relative strengths and weaknesses.

Figures & tables

Appendix figures & tables3 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. ExVerus: Verus Proof Repair via Counterexample Reasoning

    Mar 26, 2026Jun Yang, Yuechun Sun, Yi Wu +5Formal Verification

  2. Improving LLM Code Reasoning via Semantic Equivalence Self-Play with Formal Verification

    Apr 18, 2026Antonio Valerio Miceli Barone, Poon Tsz NokAdversarial TrainingSelf-Play RL

  3. Learning to Prove, Not Just to Answer: Reinforcement Learning from Formal Verification for Natural-Language Logical Reasoning

    Sep 29, 2026Qili Zhang, Qianren Mao, Hanze Cai +11Logical ReasoningRL for Language Model Reasoning